Created
November 19, 2011 21:34
-
-
Save uskanda/1379387 to your computer and use it in GitHub Desktop.
[Emacs]anything source of spotlight (open binary files by associated mac application)
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
(defcustom anything-c-source-mac-spotlight2-open-file-extensions | |
'("pdf" "jpg" "gif" "psd" "ai" "png" "mpg" "avi" "mov") | |
"List of file extensions to open by Mac OS X application." | |
:type 'list | |
:group 'anything-c-source-mac-spotlight2) | |
(defvar anything-c-source-mac-spotlight2 | |
'((name . "mdfind") | |
(candidates | |
. (lambda () (start-process "mdfind-process" nil "mdfind" anything-pattern))) | |
(type . file) | |
(requires-pattern . 3) | |
(action . (lambda (candidate) | |
(progn | |
(if (member (file-name-extension candidate) anything-c-source-mac-spotlight2-open-file-extensions) | |
(shell-command (concat "open " candidate)) | |
(anything-c-find-file-or-marked candidate))))) | |
(delayed)) | |
"Source for retrieving files via Spotlight's command line | |
utility mdfind.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment