Sfoglia il codice sorgente

org-pcomplete: Small reorganization

Nicolas Goaziou 6 anni fa
parent
commit
9e05a6ac8a
1 ha cambiato i file con 17 aggiunte e 9 eliminazioni
  1. 17 9
      lisp/org-pcomplete.el

+ 17 - 9
lisp/org-pcomplete.el

@@ -68,7 +68,8 @@
 (defvar org-todo-keywords-1)
 (defvar org-todo-line-regexp)
 
-;;;; Customization variables
+
+;;; Internal Functions
 
 (defun org-thing-at-point ()
   "Examine the thing at point and let the caller know what it is.
@@ -138,6 +139,16 @@ The return value is a string naming the thing at point."
 		(cons "drawer" nil)))))))
      (t nil))))
 
+(defun org-pcomplete-case-double (list)
+  "Return list with both upcase and downcase version of all strings in LIST."
+  (let (e res)
+    (while (setq e (pop list))
+      (setq res (cons (downcase e) (cons (upcase e) res))))
+    (nreverse res)))
+
+
+;;; Completion API
+
 (defun org-command-at-point ()
   "Return the qualified name of the Org completion entity at point.
 When completing for #+STARTUP, for example, this function returns
@@ -176,6 +187,9 @@ When completing for #+STARTUP, for example, this function returns
 		 (car (org-thing-at-point)))
 		pcomplete-default-completion-function))))
 
+
+;;; Completion functions
+
 (defun pcomplete/org-mode/file-option ()
   "Complete against all valid file options."
   (require 'org-element)
@@ -416,14 +430,8 @@ switches."
 			   ":tcolumns" ":level" ":compact" ":timestamp"
 			   ":formula" ":formatter" ":wstart" ":mstart"))))
 
-(defun org-pcomplete-case-double (list)
-  "Return list with both upcase and downcase version of all strings in LIST."
-  (let (e res)
-    (while (setq e (pop list))
-      (setq res (cons (downcase e) (cons (upcase e) res))))
-    (nreverse res)))
-
-;;;; Finish up
+
+;;; Finish up
 
 (provide 'org-pcomplete)