From d41a1cda91081bc07e79e609af65a1446074e38b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 7 May 2008 07:24:48 +0200 Subject: [PATCH] Allow spaces when entering property values. Because entering property value wit the command `org-set-property' offers completion on existing values of the property, space was treated as a completion command in the minibuffer. This is now fixed. Also, completion is now case-insensitive here. --- ChangeLog | 7 +++++++ lisp/org.el | 21 +++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7010d169f..500c6cf56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-07 Carsten Dominik + + * lisp/org.el (org-delete-property-globally) + (org-delete-property, org-set-property): Ignore case during + completion. + (org-set-property): Use `org-completing-read' instead of + `completing-read'. 2008-05-06 Bastien Guerry diff --git a/lisp/org.el b/lisp/org.el index f6fdc81cd..cb59c0c82 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9809,14 +9809,21 @@ for a value, offering competion either on allowed values (via an inherited xxx_ALL property) or on existing values in other instances of this property in the current file." (interactive - (let* ((prop (completing-read - "Property: " (mapcar 'list (org-buffer-property-keys nil t t)))) + (let* ((completion-ignore-case t) + (keys (org-buffer-property-keys nil t t)) + (prop0 (completing-read "Property: " (mapcar 'list keys))) + (prop (if (member prop0 keys) + prop0 + (or (cdr (assoc (downcase prop0) + (mapcar (lambda (x) (cons (downcase x) x)) + keys))) + prop0))) (cur (org-entry-get nil prop)) (allowed (org-property-get-allowed-values nil prop 'table)) (existing (mapcar 'list (org-property-values prop))) (val (if allowed - (completing-read "Value: " allowed nil 'req-match) - (completing-read + (org-completing-read "Value: " allowed nil 'req-match) + (org-completing-read (concat "Value" (if (and cur (string-match "\\S-" cur)) (concat "[" cur "]") "") ": ") @@ -9828,7 +9835,8 @@ in the current file." (defun org-delete-property (property) "In the current entry, delete PROPERTY." (interactive - (let* ((prop (completing-read + (let* ((completion-ignore-case t) + (prop (completing-read "Property: " (org-entry-properties nil 'standard)))) (list prop))) (message "Property %s %s" property @@ -9839,7 +9847,8 @@ in the current file." (defun org-delete-property-globally (property) "Remove PROPERTY globally, from all entries." (interactive - (let* ((prop (completing-read + (let* ((completion-ignore-case t) + (prop (completing-read "Globally remove property: " (mapcar 'list (org-buffer-property-keys))))) (list prop))) -- 2.11.4.GIT