summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-17 10:11:21 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-17 10:11:21 +0200
commit7ac8883394bc2979dee731c54ef65c0a9c135d0b (patch)
treed7c4b69d8b956b16e0b6405841b6a9f5e8951a27
parent45a1918efe8876ec33e7912a84f2fb8600466c1d (diff)
downloadorg-mode-7ac8883394bc2979dee731c54ef65c0a9c135d0b.tar.gz
Move `org-completing-read' into "org-macs.el"
* lisp/org-macs.el (org-completing-read): Moved here... * lisp/org.el: ... from there.
-rw-r--r--lisp/org-macs.el35
-rw-r--r--lisp/org.el10
2 files changed, 25 insertions, 20 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 1a2d8a4..196a2ce 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -168,6 +168,31 @@ point nowhere."
+;;; 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
(defsubst org-xor (a b)
@@ -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)
diff --git a/lisp/org.el b/lisp/org.el
index e3b4cce..99eba2d 100644
--- a/lisp/org.el
+++ b/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