4

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

WorldsEndless
  • 1,493
  • 1
  • 15
  • 27

1 Answers1

1

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.

elemakil
  • 3,681
  • 28
  • 53
Tobias
  • 5,038
  • 1
  • 18
  • 39
  • Brilliant! I must know, how did you come up with that solution? Where does such knowledge come from, and how can I get it? ;) – WorldsEndless Dec 22 '13 at 13:36
  • I already did some research before for http://stackoverflow.com/questions/20609172/replacing-i-with-i-using-emacs-ispell/20671547#20671547. I am using emacs at work to analyze automatically generated program output. Therefore, I wrote quite a bit of special elisp code. This way it is unavoidable to become more familiar with elisp. You learn a lot if you look at problems of others and investigate them with the help of the emacs elisp info manual and the source code of packages. In some occasions I wrote some code as answer and now I am using it for myself. // Merry christmas and Happy New Year! – Tobias Dec 23 '13 at 12:44
  • @WorldsEndless Don't forget to accept this solution as correct if it solves your problem. – Thomas Dec 24 '13 at 06:48
  • @Thomas got it; I had some severe troubles recalling how I had logged in to this site. – WorldsEndless Dec 24 '13 at 19:45