emacs: add launchd plist for server daemon.

Since emacs version 23.1 the emacs executable accepts a --daemon flag
which will start emacs as a server daemon. You can then connect to the
server using emacsclient (reducing startup time etc).
See http://www.emacswiki.org/emacs/EmacsAsDaemon#toc7
master
Sascha Vincent Kurowski 2014-10-22 00:07:20 +02:00 committed by Mike McQuaid
parent ef4b9c52f9
commit 351c585389
1 changed files with 19 additions and 0 deletions

View File

@ -114,6 +114,25 @@ class Emacs < Formula
end end
end end
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/emacs</string>
<string>--daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do test do
assert_equal "4", shell_output("#{bin}/emacs --batch --eval=\"(print (+ 2 2))\"").strip assert_equal "4", shell_output("#{bin}/emacs --batch --eval=\"(print (+ 2 2))\"").strip
end end