From mboxrd@z Thu Jan 1 00:00:00 1970 From: Levin Du Subject: org-olpath-completing-read is not friendly with partial-completion-mode Date: Fri, 16 Oct 2009 14:52:19 +0800 Message-ID: <9649271a0910152352sc186a71qdd94c8e4b1829f8@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mygfv-0007uB-GQ for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 02:52:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mygfr-0007tr-TN for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 02:52:31 -0400 Received: from [199.232.76.173] (port=34814 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mygfr-0007tg-Qu for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 02:52:27 -0400 Received: from mx20.gnu.org ([199.232.41.8]:51828) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mygfr-0000xD-Au for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 02:52:27 -0400 Received: from mail-ew0-f228.google.com ([209.85.219.228]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mygfp-00058x-K7 for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 02:52:25 -0400 Received: by ewy28 with SMTP id 28so1715314ewy.42 for ; Thu, 15 Oct 2009 23:52:20 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode Mode Try this: (partial-completion-mode t) (funcall 'org-olpath-completing-read "? " '("todo1.org/tasks/" "todo1.org/tasks/normal/" "todo1.org/tasks/urgent/" "note.org/") nil t nil nil) todo It stays on todo1.org/ (Sole completion) my raw patch: diff --git a/vendor/org/org.el b/vendor/org/org.el index d3d886f..f3a02cf 100644 --- a/vendor/org/org.el +++ b/vendor/org/org.el @@ -7780,23 +7780,29 @@ from." (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)))) + (let ((saved-pc-mode partial-completion-mode)) + (when saved-pc-mode + (partial-completion-mode 0)) + (unwind-protect + (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))) + (when saved-pc-mode + (partial-completion-mode 1))))) (defun org-extract-attributes (s) "Extract the attributes cookie from a string and set as text property." @@ -8890,7 +8896,6 @@ See also `org-refile-use-outline-path' and `org-completion-use-ido'" (unless org-refile-target-table (error "No refile targets")) (let* ((cbuf (current-buffer)) - (partial-completion-mode nil) (cfn (buffer-file-name (buffer-base-buffer cbuf))) (cfunc (if (and org-refile-use-outline-path org-outline-path-complete-in-steps) Hope it helps. Regards, Levin