From 1a7364177046b8a57ade0aeb9f52bacfc0b8b088 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 1 Jun 2015 18:20:46 +0200 Subject: [PATCH] Fix `org-olpath-completing-read' * lisp/org.el (org-olpath-completing-read): Feed `org-icompleting-read' with COLLECTION argument too. --- lisp/org.el | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 271022fb2..259421715 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 -- 2.11.4.GIT