如何配置 Emacs 以在 Mac OS X 上使用“ispell”?

Ave*_*han 28 osx emacs

brew将 Emacs 和 ispell 用作我的包管理器。我两个都安装了。做一个快速的谷歌,我无法弄清楚如何告诉 Emacs ispell 在哪里并加载适当的词典。

现在当我做 a 时M-x ispell-check-version,Emacs 俏皮地回复:Searching for program: No such file or directory.

如何配置Emacs使用ispell

ckh*_*han 15

您正在寻找的变量是ispell-program-name. 把它塞进你的某个地方.emacs

(setq ispell-program-name "/path/to/ispell")
Run Code Online (Sandbox Code Playgroud)

或使用M-x set-variable等。

参考:

  • 从来源到 ispell.el

    (defcustom ispell-program-name
      (or (locate-file "aspell"   exec-path exec-suffixes 'file-executable-p)
          (locate-file "ispell"   exec-path exec-suffixes 'file-executable-p)
          (locate-file "hunspell" exec-path exec-suffixes 'file-executable-p)
          "ispell")
      "Program invoked by \\[ispell-word] and \\[ispell-region] commands."
      :type 'string
      :group 'ispell)
    
    Run Code Online (Sandbox Code Playgroud)
  • 另见:http : //emacswiki.org/emacs/InteractiveSpell

每当您找不到 Emacs 函数时,请记住C-h f(或变量:)C-h vispellDescribe function提示符下输入会告诉您ispell is an interactive compiled Lisp function in 'ispell.el'.,然后您通常可以从那里找到您要查找的内容。


小智 12

是什么帮助我在不.emacs使用绝对路径编辑我的情况下解决了这个问题(我不愿意这样做,因为我在不同的操作系统之间共享文件)是通过 brew 安装 ispell

brew install ispell --with-lang-en
Run Code Online (Sandbox Code Playgroud)

本答案(和我的评论)中所述。