Browse Source

Move `org-completing-read' into "org-macs.el"

* lisp/org-macs.el (org-completing-read): Moved here...
* lisp/org.el: ... from there.
Nicolas Goaziou 7 years ago
parent
commit
7ac8883394
2 changed files with 25 additions and 20 deletions
  1. 25 10
      lisp/org-macs.el
  2. 0 10
      lisp/org.el

+ 25 - 10
lisp/org-macs.el

@@ -167,6 +167,31 @@ point nowhere."
   `(load ,file 'noerror nil nil 'mustsuffix))
 
 
+
+;;; Input
+
+(defun org-read-function (prompt &optional allow-empty?)
+  "Prompt for a function.
+If ALLOW-EMPTY? is non-nil, return nil rather than raising an
+error when the user input is empty."
+  (let ((func (completing-read prompt obarray #'fboundp t)))
+    (cond ((not (string= func ""))
+	   (intern func))
+	  (allow-empty? nil)
+	  (t (user-error "Empty input is not valid")))))
+
+(defun org-completing-read (&rest args)
+  "Completing-read with SPACE being a normal character."
+  (let ((enable-recursive-minibuffers t)
+	(minibuffer-local-completion-map
+	 (copy-keymap minibuffer-local-completion-map)))
+    (org-defkey minibuffer-local-completion-map " " 'self-insert-command)
+    (org-defkey minibuffer-local-completion-map "?" 'self-insert-command)
+    (org-defkey minibuffer-local-completion-map (kbd "C-c !")
+		'org-time-stamp-inactive)
+    (apply #'completing-read args)))
+
+
 
 ;;; Logic
 
@@ -469,16 +494,6 @@ The number of levels is controlled by `org-inlinetask-min-level'"
 			  limit-level)))
 	   (format "\\*\\{1,%d\\} " nstars)))))
 
-(defun org-read-function (prompt &optional allow-empty?)
-  "Prompt for a function.
-If ALLOW-EMPTY? is non-nil, return nil rather than raising an
-error when the user input is empty."
-  (let ((func (completing-read prompt obarray #'fboundp t)))
-    (cond ((not (string= func ""))
-	   (intern func))
-	  (allow-empty? nil)
-	  (t (user-error "Empty input is not valid")))))
-
 
 (provide 'org-macs)
 

+ 0 - 10
lisp/org.el

@@ -10322,16 +10322,6 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 		   (match-string 1 (expand-file-name file))))
 	  (t (concat "file:" file)))))
 
-(defun org-completing-read (&rest args)
-  "Completing-read with SPACE being a normal character."
-  (let ((enable-recursive-minibuffers t)
-	(minibuffer-local-completion-map
-	 (copy-keymap minibuffer-local-completion-map)))
-    (org-defkey minibuffer-local-completion-map " " 'self-insert-command)
-    (org-defkey minibuffer-local-completion-map "?" 'self-insert-command)
-    (org-defkey minibuffer-local-completion-map (kbd "C-c !")
-		'org-time-stamp-inactive)
-    (apply #'completing-read args)))
 
 ;;; Opening/following a link