4

This is more of a Mac question, than emacs. I think, this is relevant to this site.

I have emacs (Spacemacs) installed via brew, and I can invoke it from a terminal. However, I wish to invoke emacs --daemon and emacsclient -nc from the spotlight of Mac, that I often use to launch programs.

Does anyone do it? How do you accomplish this?

2

I'm not sure about invoking an emacsclient from Spotlight, but I installed Emacs for OS X via homebrew using brew cask install emacs and it installs a proper .app file so you can launch Emacs from Spotlight.

Prior to discovering Emacs for OS X, I created an Automator application that runs a shell script to launch Emacs. I named the Automator application Emacs.app so that Spotlight could find it. You might be able to use that for invoking emacsclient.

2
  • Thanks! I think, Automator might be a way for me. Do you have Automator recipe to open a command line application. I tried few things for 10 minutes and couldn't get to anywhere. Jun 16 '17 at 3:59
  • I used something like Automator Application > Run Shell Script then set open /path/to/emacs.app/Contents/MacOS/Emacs as the script. This blog post has an example of using emacsclient so might be closer to what you want. Jun 16 '17 at 5:21
2
  1. Open Automator.
  2. Create new file as an Application.
  3. Add a Run Shell Script step.
  4. Paste the following as the content of the shell script:
    /Applications/Emacs.app/Contents/MacOS/bin/emacsclient \
      --no-wait \
      --quiet \
      --suppress-output \
      --create-frame \
      .
    
  5. Save the file as Emacsclient.app under the /Applications folder.

Thanks to luke-francl for the hint!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.