Question

My emacs "ispell" command, which runs hunspell, breaks when it hits quoted sections in my emacs latex buffer (I am using AucTEX). With my previous emacs/Linux distro it didn't have this problem. Example:

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

Running M-x ispell correctly flags vbfs. However,

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

Does not register any errors. Further, once it's hit that quoted portion of text, is seems to skip the remainder of the document. What could cause this? For reference, here is my 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]*}")))

Running GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.8.2) of 2013-08-14 on buildvm-15.phx2.fedoraproject.org

Was it helpful?

Solution

Ispell passes the pair of quotation marks to hunspell which does not cope with it. We can avoid that with the following advice:

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

It replaces the pair of quotation marks with spaces. The spaces are required to avoid miss-align.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top