
我最近改用 emacs 作為 OS X 上的守護程式~/Library/LaunchAgents
。
<?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>gnu.emacs.daemon</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Emacs.app/Contents/MacOS/Emacs</string>
<string>--daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Gnu Emacs Daemon</string>
<key>UserName</key>
<string>grant</string>
</dict>
</plist>
除了透過開啟新的 emacsclient 視窗後開啟檔案時的一個小問題外,一切都運作良好emacsclient -c -n
。當我點擊 時C-x C-f,它從檔案系統根目錄而不是我的主目錄開始,而啟動 Emacs.appC-x C-f則從我的主目錄開始。有沒有辦法將行為切換為從我的主目錄而不是檔案系統根目錄啟動?