【问题标题】:Emacs ispell error when accepting words for local file dictionary接受本地文件字典的单词时,Emacs ispell 错误
【发布时间】:2013-06-04 20:35:06
【问题描述】:

在每个.tex 文件中,当我键入A (shift a) 来接受一个新单词时,我在迷你缓冲区或消息缓冲区中收到错误消息Wrong type argument: sequencep, 1

ispell-add-per-file-word-list: Wrong type argument: sequencep, 1

如果我在文件底部添加类似于以下内容的行:

% LocalWords:  hello

我可以(A)接受有限数量的单词,大体上最多 50 个字符的新单词,直到行尾。然后我再次得到同样的错误。如果我像前面一样添加另一行,因此:

% LocalWords:  hello <words added by ispell ...>
% LocalWords:  again 

我可以再继续下去,直到行尾。此后错误再次显示。

至于我的 init 文件,我有这些看似无辜的行:

(setenv "DICPATH" (concat exec-directory "../hunspell/dict"))
(setq-default ispell-program-name
  (concat exec-directory "../hunspell/hunspell.exe"))
(setq ispell-extra-args '("-t"))
(setq ispell-local-dictionary-alist
      '(
        (nil       "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-d" "en_US") nil utf-8)
        ("english" "[A-Za-z]" "[^A-Za-z]" "['.]"    nil ("-d" "en_GB") nil utf-8)

        ("italian"
"[A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
 "[^A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
        "[-.]" nil ("-d" "it_IT") nil iso-8859-1)

        ))

总而言之,每当需要开始本地文件字典的新行时,ispell-add-per-file-word-list 就会遇到麻烦。

【问题讨论】:

  • 试试 Aspell 看看是否能减少问题? (setq-default ispell-program-name "c:/Program Files/Aspell/bin/aspell.exe") -- aspell.net/win32 -- 基本应用程序是Aspell-0-50-3-3-Setup.exe,英语词典是Aspell-en-0.50-2-3.exe,意大利语词典是aspell-it-0.50-2-3.exe
  • 这里是我用来即时更改 Aspell 词典的示例函数的链接:stackoverflow.com/a/22190123/2112489

标签: emacs spelling ispell


【解决方案1】:

This suggested workaround 为我解决了这个问题。在这里摘录它以供后代使用,解决方法是将以下内容添加到您的 Emacs 启动代码中:

(add-hook 'TeX-mode-hook #'(lambda ()
                             (setq-local comment-padding " ")))

根本原因是has subsequently been fixed 的 Emacs 错误。所以这个问题应该在 Emacs 24.4 及更高版本中完全消失。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-17
    • 1970-01-01
    • 1970-01-01
    • 2017-08-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多