我在Windows 8上使用Emacs 24.3。我希望能夠右鍵單擊文件並選擇「使用Emacs編輯」並在現有emacs框架中打開該文件。下面列出了我迄今爲止所做的所有步驟。大部分是從Emacs documentation page for Windows採取的方向。在現有emacs框架中打開文件(Windows)
以下是我用來「使用Emacs編輯」添加到我的上下文菜單中的註冊表項:
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\openwemacs]
@="&Edit with Emacs"
[HKEY_CLASSES_ROOT\*\shell\openwemacs\command]
@="C:\\Portable Software\\emacs-24.3\\bin\\emacsclientw.exe -n \"%1\""
[HKEY_CLASSES_ROOT\Directory\shell\openwemacs]
@="Edit &with Emacs"
[HKEY_CLASSES_ROOT\Directory\shell\openwemacs\command]
@="C:\\Portable Software\\emacs-24.3\\bin\\emacsclientw.exe --alternate-editor=\"C:\\Portable Software\\emacs-24.3\\bin\\runemacs.exe\" -n \"%1\""
我還設置了ALTERNATE_EDITOR
環境變量C:\\path\\to\\runemacs.exe
在我的.emacs
開始我已按照this answer添加了以下代碼。
(require 'server)
(or (server-running-p)
(server-start))
添加時,打開第二個文件時擺脫了「服務器已在運行」錯誤,但它仍然在新框架中打開。
那麼我錯過了什麼讓emacs在現有的框架中打開新文件?
任何想法我需要解鎖? – Ryan 2013-03-25 13:20:27
這取決於防火牆軟件,但大多數防火牆會阻止Emacs創建偵聽套接字,因此您需要將Emacs添加到白名單(或將其從第一次被阻止時放置的黑名單中刪除)。有些人也可能阻止emacsclient作爲客戶端進行連接。 – JSON 2013-03-26 01:29:28
我剛剛爲Windows防火牆創建了一個防火牆規則,允許連接到runemacs.exe。開放行爲沒有變化。 – Ryan 2013-03-27 17:02:13