summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-10-05 09:51:15 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-10-05 09:56:32 +0200
commit02357b0c2a88077b95e182ba19c3e457774c0ff8 (patch)
tree1fe04fc7131f74e49adac9fe15761d52b35930fd
parent093e8cf58e8ceda1d4558f9dc438663939e70c24 (diff)
downloadorg-mode-02357b0c2a88077b95e182ba19c3e457774c0ff8.tar.gz
Allow comma as a separator when specifying tags
* lisp/org.el (org-set-tags): Allow comma as a separator when specifying tags at the completion interface. (org-tags-completion-function): Allow comma as a separator when specifying tags at the completion interface. Patch by Richard Riley, extended by Carsten
-rw-r--r--lisp/org.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 642d106..f4c7a3e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12769,8 +12769,10 @@ With prefix ARG, realign all tags in headings in the current buffer."
(save-excursion
(setq table (append org-tag-persistent-alist
(or org-tag-alist (org-get-buffer-tags))
- (and org-complete-tags-always-offer-all-agenda-tags
- (org-global-tags-completion-table (org-agenda-files))))
+ (and
+ org-complete-tags-always-offer-all-agenda-tags
+ (org-global-tags-completion-table
+ (org-agenda-files))))
org-last-tags-completion-table table
current-tags (org-split-string current ":")
inherited-tags (nreverse
@@ -12782,19 +12784,24 @@ With prefix ARG, realign all tags in headings in the current buffer."
(delq nil (mapcar 'cdr table))))
(org-fast-tag-selection
current-tags inherited-tags table
- (if org-fast-tag-selection-include-todo org-todo-key-alist))
+ (if org-fast-tag-selection-include-todo
+ org-todo-key-alist))
(let ((org-add-colon-after-tag-completion t))
(org-trim
(org-without-partial-completion
- (org-icompleting-read "Tags: " 'org-tags-completion-function
+ (org-icompleting-read "Tags: "
+ 'org-tags-completion-function
nil nil current 'org-tags-history)))))))
(while (string-match "[-+&]+" tags)
;; No boolean logic, just a list
(setq tags (replace-match ":" t t tags))))
+ (setq tags (replace-regexp-in-string "[ ,]" ":" tags))
+
(if org-tags-sort-function
(setq tags (mapconcat 'identity
- (sort (org-split-string tags (org-re "[^[:alnum:]_@#%]+"))
+ (sort (org-split-string
+ tags (org-re "[^[:alnum:]_@#%]+"))
org-tags-sort-function) ":")))
(if (string-match "\\`[\t ]*\\'" tags)
@@ -12874,7 +12881,7 @@ This works in the agenda, and also in an org-mode buffer."
(defun org-tags-completion-function (string predicate &optional flag)
(let (s1 s2 rtn (ctable org-last-tags-completion-table)
(confirm (lambda (x) (stringp (car x)))))
- (if (string-match "^\\(.*[-+:&|]\\)\\([^-+:&|]*\\)$" string)
+ (if (string-match "^\\(.*[-+:&,|]\\)\\([^-+:&,|]*\\)$" string)
(setq s1 (match-string 1 string)
s2 (match-string 2 string))
(setq s1 "" s2 string))