Skip to content

Instantly share code, notes, and snippets.

@magnars
Created December 21, 2011 11:12
Show Gist options
  • Save magnars/1505658 to your computer and use it in GitHub Desktop.
Save magnars/1505658 to your computer and use it in GitHub Desktop.
Using PeepOpen with Cocoa Emacs
on open these_items
set this_item to item 1 of these_items
set file_path to (the POSIX path of this_item)
tell application "Terminal"
do shell script "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n " & file_path & ""
end tell
end open
;; Replace the old shell-command-to-string function call in peepopen.el
;; or eproject-peepopen.el with this, so that PeepOpen uses EmacsClient.app
;; to open the selected file.
(shell-command-to-string
(format "open 'peepopen://%s?editor=%s'"
(expand-file-name root)
"EmacsClient"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment