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

1 Answer 1

2
+50

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.

4
  • Brilliant! I must know, how did you come up with that solution? Where does such knowledge come from, and how can I get it? ;) Dec 22, 2013 at 13:36
  • I already did some research before for stackoverflow.com/questions/20609172/…. 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, 2013 at 12:44
  • @WorldsEndless Don't forget to accept this solution as correct if it solves your problem.
    – Thomas
    Dec 24, 2013 at 6:48
  • @Thomas got it; I had some severe troubles recalling how I had logged in to this site. Dec 24, 2013 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.