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.
This commit is contained in:
Bastien Guerry 2012-07-30 13:02:48 +02:00
parent 9f66ab1d84
commit 4c2c6dba7b
1 changed files with 14 additions and 1 deletions

View File

@ -11195,20 +11195,32 @@ This function can be used in a hook."
"BEGIN:" "END:" "BEGIN:" "END:"
"ORGTBL" "TBLFM:" "TBLNAME:" "ORGTBL" "TBLFM:" "TBLNAME:"
"BEGIN_EXAMPLE" "END_EXAMPLE" "BEGIN_EXAMPLE" "END_EXAMPLE"
"BEGIN_VERBATIM" "END_VERBATIM"
"BEGIN_QUOTE" "END_QUOTE" "BEGIN_QUOTE" "END_QUOTE"
"BEGIN_VERSE" "END_VERSE" "BEGIN_VERSE" "END_VERSE"
"BEGIN_CENTER" "END_CENTER" "BEGIN_CENTER" "END_CENTER"
"BEGIN_SRC" "END_SRC" "BEGIN_SRC" "END_SRC"
"BEGIN_RESULT" "END_RESULT" "BEGIN_RESULT" "END_RESULT"
"BEGIN_lstlisting" "END_lstlisting"
"NAME:" "RESULTS:" "NAME:" "RESULTS:"
"HEADER:" "HEADERS:" "HEADER:" "HEADERS:"
"CATEGORY:" "COLUMNS:" "PROPERTY:" "CATEGORY:" "COLUMNS:" "PROPERTY:"
"CAPTION:" "LABEL:" "CAPTION:" "LABEL:"
"SETUPFILE:" "SETUPFILE:"
"STARTUP:"
"OPTIONS:"
"INCLUDE:" "INCLUDE:"
"BIND:" "BIND:"
"MACRO:")) "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 (defcustom org-structure-template-alist
'( '(
("s" "#+BEGIN_SRC ?\n\n#+END_SRC" ("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 (get-text-property pos 'org-no-flyspell))
(not (member word org-todo-keywords-1)) (not (member word org-todo-keywords-1))
(not (member word org-all-time-keywords)) (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) (defun org-remove-flyspell-overlays-in (beg end)
"Remove flyspell overlays in region." "Remove flyspell overlays in region."