Browse Source

More flyspell enhancements.

* org.el (org-options-keywords): New constant.
(org-additional-option-like-keywords): Remove duplicates with
keywords in the new constant.
(org-additional-option-like-keywords-for-flyspell): Use the
new constant.
(org-mode-flyspell-verify): Exclude keywords from the new
constant.

* org-pcomplete.el (pcomplete/org-mode/file-option): Use
`org-options-keywords'.
Bastien Guerry 12 years ago
parent
commit
64a30f6ecb
2 changed files with 20 additions and 15 deletions
  1. 2 8
      lisp/org-pcomplete.el
  2. 18 7
      lisp/org.el

+ 2 - 8
lisp/org-pcomplete.el

@@ -150,14 +150,8 @@ When completing for #+STARTUP, for example, this function returns
 	      (if (= ?: (aref x (1- (length x))))
 		  (concat x " ")
 		x))
-	    (delq nil
-		  (pcomplete-uniqify-list
-		   (append
-		    (mapcar (lambda (x)
-			      (if (string-match "^#\\+\\([A-Z_]+:?\\)" x)
-				  (match-string 1 x)))
-			    (org-split-string (org-get-current-options) "\n"))
-		    (copy-sequence org-additional-option-like-keywords))))))
+	    (append org-options-keywords
+		    org-additional-option-like-keywords)))
    (substring pcomplete-stub 2)))
 
 (defvar org-startup-options)

+ 18 - 7
lisp/org.el

@@ -11212,22 +11212,32 @@ This function can be used in a hook."
     "BEGIN_lstlisting" "END_lstlisting"
     "NAME:" "RESULTS:"
     "HEADER:" "HEADERS:"
-    "CATEGORY:" "COLUMNS:" "PROPERTY:"
+    "COLUMNS:" "PROPERTY:"
     "CAPTION:" "LABEL:"
     "SETUPFILE:"
-    "STARTUP:"
-    "OPTIONS:"
     "INCLUDE:"
     "BIND:"
     "MACRO:"))
 
+(defconst org-options-keywords
+  '("TITLE:" "AUTHOR:" "EMAIL:" "DATE:"
+    "DESCRIPTION:" "KEYWORDS:" "LANGUAGE:" "OPTIONS:"
+    "EXPORT_SELECT_TAGS:" "EXPORT_EXCLUDE_TAGS:"
+    "LINK_UP:" "LINK_HOME:" "LINK:"
+    "XSLT:" "CATEGORY:" "SEQ_TODO:" "TYP_TODO:"
+    "PRIORITIES:" "DRAWERS:" "STARTUP:" "TAGS:"
+    "FILETAGS:" "ARCHIVE:"))
+
 (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)))
+    (mapconcat (lambda(k)
+		 (replace-regexp-in-string
+		  "_\\|:" " "
+		  (concat k " " (downcase k) " " (upcase k))))
+	       (append org-options-keywords org-additional-option-like-keywords)
+	       " ")
+    " +" t)))
 
 (defcustom org-structure-template-alist
   '(
@@ -21873,6 +21883,7 @@ 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-options-keywords))
 	 (not (member word (mapcar 'car org-startup-options)))
 	 (not (member word org-additional-option-like-keywords-for-flyspell)))))