Ispell and Apostrophes11 May 2015, by Artur Malabarba.
Typography post series
If you’ve been following our journey of typography, you must now have pretty apostrophes all over your org documents. But if that’s the case, you probably also noticed a drawback. Ispell doesn’t like them very much. Now how are we supposed to use our amazing auto-correct?
Don’t despair, dear reader, I have the solution. It wasn’t trivial to come up with, but it’s quite simple to understand.
- Tell Ispell that apostrophes are just like hard-quotes, where it comes to constituting a word.
- Convert all ’ to ' as they’re being sent to the Aspell subprocess.
- Convert them back when reading the subprocess output. We even take care to
only do that in
org-mode, so that it won’t get in the way of your LaTeX buffers.
The following code uses the new advice system in Emacs 24.4. It can certainly be
made to work on older Emacs by changing it to use
This is, admittedly, a hacky solution. But it’s been working well for me for the last few weeks. Feel free to shout and scream at me if you run into issues.
Fixed the third regexp.