我正在从Windows迁移到Mac,我花了整整一夜试图让emacs工作.
我已经安装了GNU emacs并简单地复制了我的Windows .emacs文件,除了拼写检查之外,这似乎没问题.我安装了cocoAspell并按照此设置说明添加路径并将ispell更改为aspell,但是当我运行拼写检查时,我得到了
Error: The file "/use/local/lib/aspell-0.60/english" can not be opened for reading.
Run Code Online (Sandbox Code Playgroud)
和FlySpell也不起作用.
好像它正在查看错误的目录,但我已经有了
(setq ispell-program-name "aspell"
ispell-dictionary "english"
ispell-dictionary-alist
(let ((default '("[A-Za-z]" "[^A-Za-z]" "[']" nil
("-B" "-d" "english" "--dict-dir"
"/Library/Application Support/cocoAspell/aspell6-en-6.0-0")
nil iso-8859-1)))
`((nil ,@default)
("english" ,@default))))
Run Code Online (Sandbox Code Playgroud)
它指向正确的字典目录"/ Library/Application Support/cocoAspell/aspell6-en-6.0-0".我无法弄清楚为什么我得到错误以及如何解决它.
更新:
现在我删除了我的GNU emacs和cocoAspell,并使用自制软件重新安装(和链接)emacs/aspell,如@katspaugh所建议的那样.我删除了上面显示的代码,只留下
(setq ispell-program-name "aspell")
Run Code Online (Sandbox Code Playgroud)
现在,当我进行拼写检查时,我得到了
Searching for program: No such file or directory, aspell
Run Code Online (Sandbox Code Playgroud)
我已经链接了aspell brew link aspell,为什么它仍然无法找到它?
在这个网页之后,我编辑了〜/ .emacs文件并添加了以下行:
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
Run Code Online (Sandbox Code Playgroud)
但是,flyspell不会以LaTeX文件开头.为什么会这样?
我只将Emacs用于\ LaTeX和python编程.有没有办法flyspell-mode在我处理.tex文件时自动打开,并flyspell-prog-mode在我处理.py文件时打开?我怎么能在我的.emacs文件中这样做?