From 3c121459b4c76f7cf0620d453f00676e2920a102 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 20 Feb 2009 08:12:47 +0100 Subject: [PATCH] Completion: Allow spaces in some fields Org has a number of places where the value read by completing-read may contains spaces. For these occasions, the space character needs to be a normal character. The recent support for ido.el invalidated these special cases because ido has its own way of dealing with spaces. This commit now makes sure that ido is off for the critical cases where completion must allow spaces. --- lisp/ChangeLog | 7 +++++++ lisp/org-remember.el | 4 ++-- lisp/org.el | 17 +++++++++++------ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 38c79c300..b782669d0 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2009-02-20 Carsten Dominik + * org-remember.el (org-remember-apply-template): Use + `org-completing-read-no-ido'. + + * org.el (org-completing-read-no-ido): New function. + (org-make-tags-matcher, org-set-property): Use + `org-completing-read-no-ido'. + * org-export-latex.el (org-export-latex-import-inbuffer-stuff): New option. (org-export-as-latex): Import in-buffer settings as TeX macros. diff --git a/lisp/org-remember.el b/lisp/org-remember.el index 457e1adf8..c90099198 100644 --- a/lisp/org-remember.el +++ b/lisp/org-remember.el @@ -538,7 +538,7 @@ to be run from that hook to function properly." propprompt (mapcar 'list (org-split-string allowed "[ \t]+")) nil 'req-match) - (org-completing-read propprompt existing nil nil + (org-completing-read-no-ido propprompt existing nil nil "" nil "")))) (org-set-property prop val))) (char @@ -551,7 +551,7 @@ to be run from that hook to function properly." nil nil (list org-end-time-was-given))) (t (let (org-completion-use-ido) - (insert (org-completing-read + (insert (org-completing-read-no-ido (concat (if prompt prompt "Enter string") (if default (concat " [" default "]")) ": ") diff --git a/lisp/org.el b/lisp/org.el index 27362d82d..2dd328814 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7043,6 +7043,10 @@ used as the link location instead of reading one interactively." (org-defkey minibuffer-local-completion-map "?" 'self-insert-command) (apply 'org-ido-completing-read args))) +(defun org-completing-read-no-ido (&rest args) + (let (org-completion-use-ido) + (apply 'org-completing-read args))) + (defun org-ido-completing-read (&rest args) "Completing-read using `ido-mode' speedups if available" (if (and org-completion-use-ido @@ -9838,7 +9842,7 @@ also TODO lines." ;; Get a new match request, with completion (let ((org-last-tags-completion-table (org-global-tags-completion-table))) - (setq match (org-completing-read + (setq match (org-completing-read-no-ido "Match: " 'org-tags-completion-function nil nil nil 'org-tags-history)))) @@ -11082,11 +11086,12 @@ in the current file." (existing (mapcar 'list (org-property-values prop))) (val (if allowed (org-completing-read "Value: " allowed nil 'req-match) - (org-completing-read - (concat "Value" (if (and cur (string-match "\\S-" cur)) - (concat "[" cur "]") "") - ": ") - existing nil nil "" nil cur)))) + (let (org-completion-use-ido) + (org-completing-read + (concat "Value" (if (and cur (string-match "\\S-" cur)) + (concat "[" cur "]") "") + ": ") + existing nil nil "" nil cur))))) (list prop (if (equal val "") cur val)))) (unless (equal (org-entry-get nil property) value) (org-entry-put nil property value))) -- 2.11.4.GIT