From 9e05a6ac8ad54268159374486aa75d87c033ef75 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 18 Oct 2018 18:09:41 +0200 Subject: [PATCH] org-pcomplete: Small reorganization --- lisp/org-pcomplete.el | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lisp/org-pcomplete.el b/lisp/org-pcomplete.el index 1ef78ed9c..d245f6981 100644 --- a/lisp/org-pcomplete.el +++ b/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)