소스 검색

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'.
Oleh Krehel 10 년 전
부모
커밋
acf7f47ecd
1개의 변경된 파일19개의 추가작업 그리고 15개의 파일을 삭제
  1. 19 15
      lisp/org.el

+ 19 - 15
lisp/org.el

@@ -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)