Use `completing-read-function' for completion

lisp/org.el (org-icompleting-read): When `completing-read-function' is
the default one, use `ido', otherwise, use `completing-read-function'.
This commit is contained in:
Oleh Krehel 2015-04-16 16:22:11 +02:00
parent cf7d64f1e4
commit acf7f47ecd
1 changed files with 19 additions and 15 deletions

View File

@ -10503,23 +10503,27 @@ from."
"Completing-read using `ido-mode' or `iswitchb' speedups if available."
(org-without-partial-completion
(if (and org-completion-use-ido
(fboundp 'ido-completing-read)
(boundp 'ido-mode) ido-mode
(listp (second args)))
(fboundp 'ido-completing-read)
(boundp 'ido-mode) ido-mode
(listp (second args)))
(let ((ido-enter-matching-directory nil))
(apply 'ido-completing-read (concat (car args))
(if (consp (car (nth 1 args)))
(mapcar 'car (nth 1 args))
(nth 1 args))
(cddr args)))
(apply (if (eq completing-read-function
'completing-read-default)
'ido-completing-read
completing-read-function)
(concat (car args))
(if (consp (car (nth 1 args)))
(mapcar 'car (nth 1 args))
(nth 1 args))
(cddr args)))
(if (and org-completion-use-iswitchb
(boundp 'iswitchb-mode) iswitchb-mode
(listp (second args)))
(apply 'org-iswitchb-completing-read (concat (car args))
(if (consp (car (nth 1 args)))
(mapcar 'car (nth 1 args))
(nth 1 args))
(cddr args))
(boundp 'iswitchb-mode) iswitchb-mode
(listp (second args)))
(apply 'org-iswitchb-completing-read (concat (car args))
(if (consp (car (nth 1 args)))
(mapcar 'car (nth 1 args))
(nth 1 args))
(cddr args))
(apply 'completing-read args)))))
(defun org-extract-attributes (s)