瀏覽代碼

Turn off partial-completion-mode for special org completion

Report and patch by Levin Du.
Carsten Dominik 15 年之前
父節點
當前提交
e8e296128e
共有 2 個文件被更改,包括 22 次插入18 次删除
  1. 3 0
      lisp/ChangeLog
  2. 19 18
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-10-20  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-icompleting-read): Turn off partial completion mode
+	for the duration of this completion round.
+
 	* org-latex.el (org-export-latex-fontify-headline): Protect TeX
 	macros in author lines and similar stuff.
 

+ 19 - 18
lisp/org.el

@@ -7803,24 +7803,25 @@ from."
     (iswitchb-read-buffer prompt)))
 
 (defun org-icompleting-read (&rest args)
-  "Completing-read using `ido-mode' or `iswitchb' speedups if available"
-  (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 'ido-completing-read (concat (car args))
-	       (if (consp (car (nth 1 args)))
-		   (mapcar (lambda (x) (car x)) (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))
-	       (mapcar (lambda (x) (car x)) (nth 1 args))
-	       (cddr args))
-      (apply 'completing-read 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 'ido-completing-read (concat (car args))
+		(if (consp (car (nth 1 args)))
+		    (mapcar (lambda (x) (car x)) (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))
+		(mapcar (lambda (x) (car x)) (nth 1 args))
+		(cddr args))
+       (apply 'completing-read args)))))
 
 (defun org-extract-attributes (s)
   "Extract the attributes cookie from a string and set as text property."