0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 18:36:26 +00:00
* org.el (org-icompleting-read): Correct bug introduced previously.
This commit is contained in:
Rasmus 2015-04-20 14:13:25 +02:00
parent e0567c9cac
commit 797023b84c

View file

@ -10498,27 +10498,33 @@ from."
(iswitchb-read-buffer prompt)))
(defun org-icompleting-read (&rest args)
"Completing-read using `ido-mode' or `iswitchb' speedups if available."
(org-without-partial-completion
(let ((ido-enter-matching-directory nil))
(apply
(cond ((and org-completion-use-ido
(fboundp 'ido-completing-read)
(boundp 'ido-mode) ido-mode
(listp (second args)))
'ido-completing-read)
((and org-completion-use-iswitchb
(boundp 'iswitchb-mode) iswitchb-mode
(listp (second args)))
'org-iswitchb-completing-read)
(t (or (and (boundp 'completing-read-function)
completing-read-function)
'completing-read)))
(concat (car args))
(if (consp (car (nth 1 args)))
(mapcar 'car (nth 1 args))
(nth 1 args))
(cddr args)))))
"Completing-read using `ido-mode' or `iswitchb' speedups if available.
Should be called like `completing-read'."
(let ((default-completion (or completing-read-function
completion-read)))
(org-without-partial-completion
(if (not (listp (second args)))
;; Ido only supports lists as the COLLECTION argument. Use
;; default completion function when second argument is not a
;; list.
(apply default-completion args)
(let ((ido-enter-matching-directory nil))
(apply (cond ((and org-completion-use-ido
(fboundp 'ido-completing-read)
(boundp 'ido-mode)
ido-mode)
'ido-completing-read)
((and org-completion-use-iswitchb
(boundp 'iswitchb-mode)
iswitchb-mode)
'org-iswitchb-completing-read)
(t default-completion))
(pop args)
(if (org-some 'consp (car args))
(mapcar 'car (pop args))
(pop args))
args))))))
(defun org-extract-attributes (s)
"Extract the attributes cookie from a string and set as text property."