【问题标题】:spell check not working in emacs text editor拼写检查在 emacs 文本编辑器中不起作用
【发布时间】:2015-04-02 06:23:50
【问题描述】:

我最近在我的新系统中安装了 fedora 21,然后是 emacs 24 文本编辑器。当我尝试进行拼写检查时,我在底部收到以下消息:

ispell-phaf:nil 没有匹配的条目。

我知道这与与 ispell 拼写检查工具链接的字典有关,但无法准确找出问题所在。请朋友们帮帮我....

【问题讨论】:

  • 错误来自ispell-parse-hunspell-affix-file -- M-x describe-function RET ispell-parse-hunspell-affix-file RET -- 也许这将帮助您找出可能出现的问题,例如,hunspell 的外部实用程序可能没有安装/配置属性?

标签: emacs


【解决方案1】:

就像@lawlist 提到的,错误来自函数ispell-parse-hunspell-affix-file。 ispell 试图做的是从ispell-dictionaryispell-local-dictionary 中提取您的集合字典,然后将该值传递给上述函数。然后该函数提取在ispell-local-dictionary-alist 中定义的 alist,然后将其传递给 hunspell。

所以你需要特别做的是向ispell-local-dictionary-alist 添加一个条目,类似这样(示例取自here

(setq ispell-local-dictionary-alist '(
("american"
       "[[:alpha:]]"
       "[^[:alpha:]]"
       "[']"
       t
       ("-d" "en_US" "-p" "D:\\hunspell\\share\\hunspell\\personal.en")
       nil
       iso-8859-1))

您需要确保在哪里显示“美国”,您的字典名称与您输入到 ispell-dictionaryispell-local-dictionary 的值完全匹配,并确保您传递了您指定的参数想通过这一行进入 hunspell:(“-d”“en_US”“-p”“D:\hunspell\share\hunspell\personal.en”)。您可以查看 hunspell 将使用哪些命令 here。希望这至少可以为您提供更有意义的错误消息,以便您知道还有什么问题。

【讨论】:

    【解决方案2】:

    这最终对我有用(详细信息在以下博客中)...

    http://blog.binchen.org/posts/what-s-the-best-spell-check-set-up-in-emacs.html

    我在上面的博客中选择了“非程序员的建议”...

    感谢大家的支持...@lawlist @Allan Zhang @Lucas @Rob Spanton

    【讨论】:

      【解决方案3】:

      我在迁移到新操作系统时也遇到了类似的问题。迁移还将我的 emacs 从 24.3 升级到 24.4(现在我在 24.5 上)。

      我通过安装以下解决了这个问题:

      rw-language-and-country-codes
      rw-ispell
      rw-hunspell
      

      然后重启 emacs。我被困了很长时间,因为我忘记重新启动 emacs - 所以不要忘记! wiki 也可能有帮助:http://www.emacswiki.org/emacs/InteractiveSpell

      【讨论】:

      • 如何安装上面的?是否使用'yum install'?我试过并得到“没有可用的软件包 rw-language-and-country-codes。” rw-ispell 和 rw-hunspell 也类似
      • 使用 emacs 包管理器 - 查找 ELPA、MELPA 和 marmalade 以获得良好的介绍。具体的包在上面的wiki中也有进一步的解释
      【解决方案4】:

      我在安装 Fedora 22 后遇到了类似的问题。我通过安装 Fedora 存储库中的 hunspell-en-GB 软件包解决了这个问题。

      【讨论】:

        【解决方案5】:

        即使错误与 Hunspell 函数有关,但当 Emacs 找不到 aspell 时会弹出此错误。即使系统上存在 Hunspell(据我所知),默认情况下也不使用 Hunspell。确保它和一些字典已安装:

        sudo yum install aspell aspell-en

        或其他语言的其他词典。

        您可能对 Fedora 软件包搜索感兴趣:

        https://apps.fedoraproject.org/packages/aspell

        【讨论】:

        • 为什么会这样?为什么它会尝试在hunspell-en-US 已经存在的地方找到aspell-en
        猜你喜欢
        • 2011-07-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-11-16
        • 2012-05-02
        • 2018-02-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多