summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2008-05-07 07:24:48 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2008-05-07 07:24:48 +0200
commitd41a1cda91081bc07e79e609af65a1446074e38b (patch)
tree1d848ab08eb9d6e567856071e302f565396540c7
parentb928ce51f8f92fcfe7c87ef0e50d8c125d5853e5 (diff)
downloadorg-mode-d41a1cda91081bc07e79e609af65a1446074e38b.tar.gz
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.
-rw-r--r--ChangeLog7
-rw-r--r--lisp/org.el21
2 files changed, 22 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7010d16..500c6cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-07 Carsten Dominik <dominik@science.uva.nl>
+
+ * 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 <bzg@altern.org>
diff --git a/lisp/org.el b/lisp/org.el
index f6fdc81..cb59c0c 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)))