From 4c2c6dba7bacfcf3b08c3b990663352d8b7a2e70 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Mon, 30 Jul 2012 13:02:48 +0200 Subject: [PATCH] Enhance flyspelling. * org.el (org-additional-option-like-keywords): Add keywords. (org-additional-option-like-keywords-for-flyspell): New constant to use with flyspell. (org-mode-flyspell-verify): Use the dedicated constant and don't check `org-startup-options'. Thanks to Bjarte Johansen for bringing this up. --- lisp/org.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index fd15f7959..a564291df 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11195,20 +11195,32 @@ This function can be used in a hook." "BEGIN:" "END:" "ORGTBL" "TBLFM:" "TBLNAME:" "BEGIN_EXAMPLE" "END_EXAMPLE" + "BEGIN_VERBATIM" "END_VERBATIM" "BEGIN_QUOTE" "END_QUOTE" "BEGIN_VERSE" "END_VERSE" "BEGIN_CENTER" "END_CENTER" "BEGIN_SRC" "END_SRC" "BEGIN_RESULT" "END_RESULT" + "BEGIN_lstlisting" "END_lstlisting" "NAME:" "RESULTS:" "HEADER:" "HEADERS:" "CATEGORY:" "COLUMNS:" "PROPERTY:" "CAPTION:" "LABEL:" "SETUPFILE:" + "STARTUP:" + "OPTIONS:" "INCLUDE:" "BIND:" "MACRO:")) +(defconst org-additional-option-like-keywords-for-flyspell + (delete-dups + (split-string + (mapconcat (lambda(k) (replace-regexp-in-string + "_\\|:" " " + (concat k " " (downcase k) " " (upcase k)))) + org-additional-option-like-keywords " ") " +" t))) + (defcustom org-structure-template-alist '( ("s" "#+BEGIN_SRC ?\n\n#+END_SRC" @@ -21796,7 +21808,8 @@ To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]." (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))))) + (not (member word (mapcar 'car org-startup-options))) + (not (member word org-additional-option-like-keywords-for-flyspell))))) (defun org-remove-flyspell-overlays-in (beg end) "Remove flyspell overlays in region."