I’ve been writing lately several snippets to improve the communication of Emacs with OS X. One of them is this quick and dirty mdfind mode that provides access, within an Emacs buffer, to the results of
mdfind commands (the CLI to OS X’s Spotlight). Just put the above file somewhere in your load path,
(require 'mdfind) in your init file and invoke
M-x mdfind. You’ll be asked for a directory and a search string to perform in that directory. Under the rug, this shell command gets executed:
mdfind -onlyin directory query
The results (a file list) are collected in a special buffer in a new major mode (creatively dubbed
mdfind-mode) that inherits from
org-mode (this is Emacs 22; if you haven’t yet, take a look at org-mode: it is simply awesome), and that displays the files nicely fontified as links. See the comments at the beginning of
mdfind.el for a list of available shortcuts that you can use to navigate and open (using OS X’s default handlers) the files in the list.
The functionality offered is right now limited and there’re many venues for improvement, so i guess i’ll keep adding features as i need them. But you’re encouraged to take this quick hack as an starting point to get the functionality that you deem important (and maybe share the results 🙂 ). Or, alternatively, to leave your suggestions in the comments section.