summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-06-01 18:20:46 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-06-01 18:20:46 +0200
commit1a7364177046b8a57ade0aeb9f52bacfc0b8b088 (patch)
tree6cd5332dc9db4d030d337af48ddc903eec7e0399
parent458bde5243d759b5b8cad1d7f61cfe5fa638ba54 (diff)
downloadorg-mode-1a7364177046b8a57ade0aeb9f52bacfc0b8b088.tar.gz
Fix `org-olpath-completing-read'
* lisp/org.el (org-olpath-completing-read): Feed `org-icompleting-read' with COLLECTION argument too.
-rwxr-xr-xlisp/org.el45
1 files changed, 20 insertions, 25 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 271022f..2594217 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12124,31 +12124,26 @@ this is used for the GOTO interface."
(let ((thetable collection)
(org-completion-use-ido nil) ; does not work with ido.
(org-completion-use-iswitchb nil)) ; or iswitchb
- (apply
- 'org-icompleting-read prompt
- (lambda (string predicate &optional flag)
- (let (rtn r f (l (length string)))
- (cond
- ((eq flag nil)
- ;; try completion
- (try-completion string thetable))
- ((eq flag t)
- ;; all-completions
- (setq rtn (all-completions string thetable predicate))
- (mapcar
- (lambda (x)
- (setq r (substring x l))
- (if (string-match " ([^)]*)$" x)
- (setq f (match-string 0 x))
- (setq f ""))
- (if (string-match "/" r)
- (concat string (substring r 0 (match-end 0)) f)
- x))
- rtn))
- ((eq flag 'lambda)
- ;; exact match?
- (assoc string thetable)))))
- args)))
+ (apply #'org-icompleting-read
+ prompt
+ collection
+ (lambda (string predicate &optional flag)
+ (cond
+ ((eq flag nil) (try-completion string thetable))
+ ((eq flag t)
+ (let ((l (length string)))
+ (mapcar (lambda (x)
+ (let ((r (substring x l))
+ (f (if (string-match " ([^)]*)$" x)
+ (match-string 0 x)
+ "")))
+ (if (string-match "/" r)
+ (concat string (substring r 0 (match-end 0)) f)
+ x)))
+ (all-completions string thetable predicate))))
+ ;; Exact match?
+ ((eq flag 'lambda) (assoc string thetable))))
+ args)))
;;;; Dynamic blocks