Using OSX Spotlight from within Emacs

Emacs comes with a ‘locate’ command that uses the locate system command to find files within your system.

On OS X, it is easier to use Spotlight, which is trivial to enable in Emacs.

In your .emacs file, add the following code:

(setq locate-command "mdfind")
Now try: 
M-x locate <enter your search here>

Your search results will be displayed in a new Window.


One Comment on “Using OSX Spotlight from within Emacs”

  1. […] This post was mentioned on Twitter by KANEUCHI Tetsuya, takashi yamamiya. takashi yamamiya said: これは便利。RT @kaniza: Mac の Emacs では、locate-command を mdfind に指定することで簡単に Spotlight が使える。 […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s