2013-12-09 40 views
0

我無法在Mac上的Emacs中使用拼寫檢查。我將我以前的Fedora上的.emacs文件複製到我的Macbook中的主文件夾中。了 「的.emacs」 具有線說法:在Mac上的Emacs中檢查拼寫

(global-set-key "\C-k" 'ispell) 

當I型在一個開放的emacs終端 「控制+ K」,我得到在迷你緩衝區以下錯誤消息:

Searching for program: permission denied,/Applications/Emacs.app/Contents/Resources/list/textmodes/ispell.elc 

當我尋找這個地址,我發現「/Applications/Emacs.app/Contents/Resources/」文件夾中沒有「list」文件夾。

當我做 「定位ispell.elc」,我得到如下結果:

/Applications/Emacs.app/Contents/Resources/lisp/textmodes/ispell.elc 
/usr/local/share/emacs/24.2/lisp/textmodes/ispell.elc 
/usr/share/emacs/22.1/lisp/textmodes/ispell.elc 

如何解決呢?

+0

您至少有兩個問題 - 首先,您的權限可能需要修復 - 其次您需要安裝'aspell'(或其他等同物)。或者,您可能需要「aspell」,而您只是將拼寫程序的位置配置錯誤 - 即「ispell.elc」不包含用於搜索字典的字典或可執行文件。你需要像這樣的東西(安裝'aspell'後):'(setq-default ispell-program-name「/Users/HOME/.0.data/.0.emacs/elpa/bin/aspell」)'和' (setq ispell-dictionary「english」)'和'(setq flyspell-default-dictionary「english」)' – lawlist

+1

正如你可能已經猜測的那樣,它是'lisp'而不是'list' - 所以你的'.emacs'文件可能有錯字。隨意右鍵單擊您的應用程序,並顯示打包的目錄並熟悉其中的各種目錄。另外,也許從一個經過驗證的真正獨立的Emacs構建(即* not * homebrew,* not * macports)開始 - http://emacsformacosx.com/您可以使用macports或homebrew來安裝'aspell',或者爲Mac安裝開發人員工具並構建'aspell',或者您可以在Google上找到另一個相當於打包拼寫實用程序的等效工具。 – lawlist

回答

0

我在我的emacs配置如下:

(defmacro WhenOSX (&rest body) 
    `(if (eq system-type 'darwin) 
     (progn ,@body) 
     nil 
    ) 
) 
(WhenOSX 
(setq ispell-program-name "/usr/local/bin/aspell") 
) 

我通過自制軟件安裝的aspell。上面的宏讓我可以在Linux,OSX和其他平臺上共享我的配置。

https://github.com/shaleh/dot-files/tree/master/emacs.d我的Emacs配置包含多年來我從網絡上收集的位。請享用。

+0

404無效鏈接 - 請更新。 – lawlist