【问题标题】:emacs ispell breaks on latex quotation marksemacs ispell 在乳胶引号上打断
【发布时间】:2014-01-03 20:36:10
【问题描述】:

我的运行 hunspell 的 emacs “ispell” 命令在遇到我的 emacs 乳胶缓冲区中的引用部分时中断(我正在使用 AucTEX)。在我以前的 emacs/Linux 发行版中,它没有这个问题。示例:

as you like to say, vbfs ``You won't know what to do with yourself.''

运行 M-x ispell 正确标记 vbfs。不过,

as you like to say, ``You won't know what to do with yourself.'' vbfs

不记录任何错误。此外,一旦命中引用的文本部分,似乎会跳过文档的其余部分。什么可能导致这种情况?供参考,这是我的ispell-tex-skip-alists var:

((("\\\\addcontentsline" ispell-tex-arg-end 2)
  ("\\\\add\\(tocontents\\|vspace\\)" ispell-tex-arg-end)
  ("\\\\\\([aA]lph\\|arabic\\)" ispell-tex-arg-end)
  ("\\\\bibliographystyle" ispell-tex-arg-end)
  ("\\\\makebox" ispell-tex-arg-end 0)
  ("\\\\e?psfig" ispell-tex-arg-end)
  ("\\\\document\\(class\\|style\\)" . "\\\\begin[  \n]*{[  \n]*document[   \n]*}"))
 (("\\(figure\\|table\\)\\*?" ispell-tex-arg-end 0)
  ("list" ispell-tex-arg-end 2)
  ("program" . "\\\\end[    \n]*{[  \n]*program[    \n]*}")
  ("verbatim\\*?" . "\\\\end[   \n]*{[  \n]*verbatim\\*?[   \n]*}")))

在 buildvm-15.phx2.fedoraproject.org 上运行 2013-08-14 的 GNU Emacs 24.3.1(x86_64-redhat-linux-gnu,GTK+ 版本 3.8.2)

【问题讨论】:

    标签: emacs latex auctex hunspell ispell


    【解决方案1】:

    Ispell 将这对引号传递给不处理它的 hunspell。 我们可以通过以下建议来避免这种情况:

    (defadvice ispell-send-string (before kill-quotes activate)
      (setq string (replace-regexp-in-string "''" "  " string)))
    

    它用空格替换引号对。需要空格以避免错位。

    【讨论】:

    • 太棒了!我必须知道,你是怎么想出这个解决方案的?这些知识从何而来,如何获得? ;)
    • 我之前已经为 stackoverflow.com/questions/20609172/… 做过一些研究。我在工作中使用 emacs 来分析自动生成的程序输出。因此,我写了很多特殊的 elisp 代码。这样就不可避免地会更加熟悉 elisp。如果您查看其他人的问题并在 emacs elisp 信息手册和软件包源代码的帮助下进行调查,您会学到很多东西。在某些情况下,我写了一些代码作为答案,现在我自己使用它。 // 圣诞快乐,新年快乐!
    • @WorldsEndless 如果它解决了您的问题,请不要忘记接受此解决方案是正确的。
    • @Thomas 明白了;回想起我是如何登录到这个网站的时,我遇到了一些严重的麻烦。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-14
    • 1970-01-01
    • 2023-04-09
    • 1970-01-01
    相关资源
    最近更新 更多