forked from mirrors/org-mode
org-pcomplete: Small reorganization
This commit is contained in:
parent
102ab1a245
commit
9e05a6ac8a
|
@ -68,7 +68,8 @@
|
||||||
(defvar org-todo-keywords-1)
|
(defvar org-todo-keywords-1)
|
||||||
(defvar org-todo-line-regexp)
|
(defvar org-todo-line-regexp)
|
||||||
|
|
||||||
;;;; Customization variables
|
|
||||||
|
;;; Internal Functions
|
||||||
|
|
||||||
(defun org-thing-at-point ()
|
(defun org-thing-at-point ()
|
||||||
"Examine the thing at point and let the caller know what it is.
|
"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)))))))
|
(cons "drawer" nil)))))))
|
||||||
(t 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 ()
|
(defun org-command-at-point ()
|
||||||
"Return the qualified name of the Org completion entity at point.
|
"Return the qualified name of the Org completion entity at point.
|
||||||
When completing for #+STARTUP, for example, this function returns
|
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)))
|
(car (org-thing-at-point)))
|
||||||
pcomplete-default-completion-function))))
|
pcomplete-default-completion-function))))
|
||||||
|
|
||||||
|
|
||||||
|
;;; Completion functions
|
||||||
|
|
||||||
(defun pcomplete/org-mode/file-option ()
|
(defun pcomplete/org-mode/file-option ()
|
||||||
"Complete against all valid file options."
|
"Complete against all valid file options."
|
||||||
(require 'org-element)
|
(require 'org-element)
|
||||||
|
@ -416,14 +430,8 @@ switches."
|
||||||
":tcolumns" ":level" ":compact" ":timestamp"
|
":tcolumns" ":level" ":compact" ":timestamp"
|
||||||
":formula" ":formatter" ":wstart" ":mstart"))))
|
":formula" ":formatter" ":wstart" ":mstart"))))
|
||||||
|
|
||||||
(defun org-pcomplete-case-double (list)
|
|
||||||
"Return list with both upcase and downcase version of all strings in LIST."
|
;;; Finish up
|
||||||
(let (e res)
|
|
||||||
(while (setq e (pop list))
|
|
||||||
(setq res (cons (downcase e) (cons (upcase e) res))))
|
|
||||||
(nreverse res)))
|
|
||||||
|
|
||||||
;;;; Finish up
|
|
||||||
|
|
||||||
(provide 'org-pcomplete)
|
(provide 'org-pcomplete)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue