Endless Parentheses

Concise ramblings on Emacs productivity.

Support on Gratipay
profile for Malabarba on Stack Exchange

Making Ispell work with org-mode

If you’ve every tried to do some spell-checking in org-mode you know how finicky that can be. Ispell is happy to check absolutely anything, even code blocks and property drawers! When you’re blogging about code-snippets from an org file this annoyance quickly turns into irritation. Here’s how you fix it.

(defun endless/org-ispell ()
"Configure `ispell-skip-region-alist' for `org-mode'."
(make-local-variable 'ispell-skip-region-alist)
(add-to-list 'ispell-skip-region-alist '(org-property-drawer-re))
(add-to-list 'ispell-skip-region-alist '("~" "~"))
(add-to-list 'ispell-skip-region-alist '("=" "="))
(add-to-list 'ispell-skip-region-alist '("^#\\+BEGIN_SRC" . "^#\\+END_SRC")))
(add-hook 'org-mode-hook #'endless/org-ispell)

Tags: keybind, init.el, emacs

Support on Gratipay
comments powered by Disqus