Created
July 15, 2012 04:45
-
-
Save hamsolodev/3115030 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; use OSX's Quick Look to browse file:/// URLs | |
(defun osx-qlook (url &optional some-stuff) | |
(message "Launching Quick Look preview...") | |
(start-process | |
"qlmanage" | |
(get-buffer-create "*qlmanage*") | |
"/usr/bin/qlmanage" | |
"-p" | |
;; strip “file://” from URL | |
(substring url 7))) | |
(setq browse-url-browser-function (quote (("^file://." . osx-qlook) ("." . browse-url-default-macosx-browser)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
…adding
(interactive)
immediately after the(defun…
line would make the function interactive, allowing it to be bound to a key…