diff options
author | Bastien Guerry <bzg@altern.org> | 2013-03-25 15:53:21 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-03-25 15:53:21 +0100 |
commit | dd3fbd246ecac770a2428cd10a589df758010abf (patch) | |
tree | e74967cbcfb2385316b5e629a211ac65659b1ce5 | |
parent | 9ae225f48aee2dafa8a053a752a188d40d678213 (diff) | |
download | org-mode-dd3fbd246ecac770a2428cd10a589df758010abf.tar.gz |
Fix commit a9880a
* org.el (org-toggle-tags-groups): Correctly highlight group
tags.
(org-tags-expand): Expand tags as words, with characters ?@
and ?_ being considered words constituents.
-rw-r--r-- | lisp/org.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/org.el b/lisp/org.el index ae112fa..04a0f20 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4753,12 +4753,11 @@ Support for group tags is controlled by the option `org-group-tags', which is non-nil by default." (interactive) (setq org-group-tags (not org-group-tags)) - (if (and (derived-mode-p 'org-agenda-mode) - org-group-tags) - (org-agenda-redo)) - (when (derived-mode-p 'org-mode) - (org-set-regexps-and-options-for-tags) - (org-set-regexps-and-options)) + (cond ((and (derived-mode-p 'org-agenda-mode) + org-group-tags) + (org-agenda-redo)) + ((derived-mode-p 'org-mode) + (let ((org-inhibit-startup t)) (org-mode)))) (message "Groups tags support has been turned %s" (if org-group-tags "on" "off"))) @@ -14049,13 +14048,17 @@ the list of tags in this group. When DOWNCASE is non-nil, expand downcased TAGS." (if org-group-tags (let* ((case-fold-search t) + (stable org-mode-syntax-table) (tal (or org-tag-groups-alist-for-agenda org-tag-groups-alist)) (tal (if downcased (mapcar (lambda(tg) (mapcar 'downcase tg)) tal) tal)) (tml (mapcar 'car tal)) (rtnmatch match) rpl) + ;; @ and _ are allowed as word-components in tags + (modify-syntax-entry ?@ "w" stable) + (modify-syntax-entry ?_ "w" stable) (while (and tml (string-match - (concat "\\(?1:[+-]?\\)\\(?2:" (regexp-opt tml) "\\)") + (concat "\\(?1:[+-]?\\)\\(?2:\\<" (regexp-opt tml) "\\>\\)") rtnmatch)) (let* ((dir (match-string 1 rtnmatch)) (tag (match-string 2 rtnmatch)) |