emacs ispell 在 Latex 引号上中断

标签 emacs latex auctex hunspell ispell

我的 emacs“ispell”命令运行 hunspell,当它到达我的 emacs Latex 缓冲区中的引用部分时会中断(我使用的是 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 年 8 月 14 日的 GNU Emacs 24.3.1(x86_64-redhat-linux-gnu,GTK+ 版本 3.8.2)

最佳答案

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

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

它将一对引号替换为空格。需要空格以避免未对齐。

关于emacs ispell 在 Latex 引号上中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20611169/

相关文章:

emacs - 如何折叠我的 emacs org-mode 日志文件中超过 3 个月的所有条目?

Emacs define-key,Viper 模式键绑定(bind)

latex - 删除 Latex 标签(但不是其内容)的最简单方法?

templates - 如何使用 Emacs+AUCTeX 创建(自动插入)LaTeX 模板?

emacs - 使用 AUCTeX 在 LaTeX 模式下插入常规双引号

html - Emacs 组织模式 HTML 脚注

emacs - 防止 Emacs 滚动到缓冲区末尾

latex - 在LaTeX中添加类似MS-Word的注释

Ruby 创建方程图像 (LaTeX)

pdf - knit 1.5/patchDVI 1.9 似乎没有生成 evince + emacs 可接受的一致性