diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2011-05-24 08:18:16 +0000 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2011-06-01 13:51:31 +0200 |
commit | 1afcef30077b588ea0b8ec23b33f3680348cb46f (patch) | |
tree | 3b6aef2dfc19e2d3a8d82dcc9900714c6182816e | |
parent | e05aa5552d7bc29f00efeb3211f7567643ec4212 (diff) | |
download | org-mode-1afcef30077b588ea0b8ec23b33f3680348cb46f.tar.gz |
Do not run flyspell-checks on {todo,all-time,additional-option-like}-keywords
* org.el (org-mode-flyspell-verify): This is useful when using
flyspell with a non-English dictionary, or if some of your
keywords are in another language.
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r-- | lisp/org.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el index c2b18c6..66466ee 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -20208,9 +20208,15 @@ To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]." ;; Make flyspell not check words in links, to not mess up our keymap (defun org-mode-flyspell-verify () - "Don't let flyspell put overlays at active buttons." - (and (not (get-text-property (max (1- (point)) (point-min)) 'keymap)) - (not (get-text-property (max (1- (point)) (point-min)) 'org-no-flyspell)))) + "Don't let flyspell put overlays at active buttons, or on + {todo,all-time,additional-option-like}-keywords." + (let ((pos (max (1- (point)) (point-min))) + (word (thing-at-point 'word))) + (and (not (get-text-property pos 'keymap)) + (not (get-text-property pos 'org-no-flyspell)) + (not (member word org-todo-keywords-1)) + (not (member word org-all-time-keywords)) + (not (member word org-additional-option-like-keywords))))) (defun org-remove-flyspell-overlays-in (beg end) "Remove flyspell overlays in region." |