From 3836d34a10218cfe6a84d9479cbb587a2797a271 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Thu, 16 Apr 2015 17:15:16 +0200 Subject: [PATCH] org.el: Small refactor * org.el (org-icompleting-read): Support completing-read-default. --- lisp/org.el | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 659536d..fbd5ca7 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -10502,29 +10502,25 @@ from." (defun org-icompleting-read (&rest args) "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))) - (let ((ido-enter-matching-directory nil)) - (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)) - (apply 'completing-read args))))) + (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))))) (defun org-extract-attributes (s) "Extract the attributes cookie from a string and set as text property." -- 2.3.5