org.el (org-set-regexps-and-options-for-tags): Fix the setting of tag groups when relying on `org-tag-alist'
* org.el (org-set-regexps-and-options-for-tags): Fix the setting of tag groups when relying on `org-tag-alist', not on tags directly set in the buffer with the #+TAGS option. Thanks to Maurice for reporting this.
This commit is contained in:
parent
0aa0fdd971
commit
4269178827
74
lisp/org.el
74
lisp/org.el
|
@ -4834,41 +4834,49 @@ Support for group tags is controlled by the option
|
||||||
(mapcar 'org-add-prop-inherited ftags)))
|
(mapcar 'org-add-prop-inherited ftags)))
|
||||||
(org-set-local 'org-tag-groups-alist nil)
|
(org-set-local 'org-tag-groups-alist nil)
|
||||||
;; Process the tags.
|
;; Process the tags.
|
||||||
;; FIXME
|
(when (and (not tags) org-tag-alist)
|
||||||
(when tags
|
(setq tags
|
||||||
(let (e tgs g)
|
(mapcar
|
||||||
(while (setq e (pop tags))
|
(lambda (tg) (cond ((eq (car tg) :startgroup) "{")
|
||||||
(cond
|
((eq (car tg) :endgroup) "}")
|
||||||
((equal e "{")
|
((eq (car tg) :grouptags) ":")
|
||||||
(progn (push '(:startgroup) tgs)
|
(t (concat (car tg)
|
||||||
(when (equal (nth 1 tags) ":")
|
(if (characterp (cdr tg))
|
||||||
(push (list (replace-regexp-in-string
|
(format "(%s)" (char-to-string (cdr tg))) "")))))
|
||||||
"(.+)$" "" (nth 0 tags)))
|
org-tag-alist)))
|
||||||
org-tag-groups-alist)
|
(let (e tgs g)
|
||||||
(setq g 0))))
|
(while (setq e (pop tags))
|
||||||
((equal e ":") (push '(:grouptags) tgs))
|
(cond
|
||||||
((equal e "}") (push '(:endgroup) tgs) (if g (setq g nil)))
|
((equal e "{")
|
||||||
((equal e "\\n") (push '(:newline) tgs))
|
(progn (push '(:startgroup) tgs)
|
||||||
((string-match (org-re "^\\([[:alnum:]_@#%]+\\)(\\(.\\))$") e)
|
(when (equal (nth 1 tags) ":")
|
||||||
(push (cons (match-string 1 e)
|
(push (list (replace-regexp-in-string
|
||||||
(string-to-char (match-string 2 e))) tgs)
|
"(.+)$" "" (nth 0 tags)))
|
||||||
|
org-tag-groups-alist)
|
||||||
|
(setq g 0))))
|
||||||
|
((equal e ":") (push '(:grouptags) tgs))
|
||||||
|
((equal e "}") (push '(:endgroup) tgs) (if g (setq g nil)))
|
||||||
|
((equal e "\\n") (push '(:newline) tgs))
|
||||||
|
((string-match (org-re "^\\([[:alnum:]_@#%]+\\)(\\(.\\))$") e)
|
||||||
|
(push (cons (match-string 1 e)
|
||||||
|
(string-to-char (match-string 2 e))) tgs)
|
||||||
|
(if (and g (> g 0))
|
||||||
|
(setcar org-tag-groups-alist
|
||||||
|
(append (car org-tag-groups-alist)
|
||||||
|
(list (match-string 1 e)))))
|
||||||
|
(if g (setq g (1+ g))))
|
||||||
|
(t (push (list e) tgs)
|
||||||
(if (and g (> g 0))
|
(if (and g (> g 0))
|
||||||
(setcar org-tag-groups-alist
|
(setcar org-tag-groups-alist
|
||||||
(append (car org-tag-groups-alist)
|
(append (car org-tag-groups-alist) (list e))))
|
||||||
(list (match-string 1 e)))))
|
(if g (setq g (1+ g))))))
|
||||||
(if g (setq g (1+ g))))
|
(org-set-local 'org-tag-alist nil)
|
||||||
(t (push (list e) tgs)
|
(while (setq e (pop tgs))
|
||||||
(if (and g (> g 0))
|
(or (and (stringp (car e))
|
||||||
(setcar org-tag-groups-alist
|
(assoc (car e) org-tag-alist))
|
||||||
(append (car org-tag-groups-alist) (list e))))
|
(push e org-tag-alist)))
|
||||||
(if g (setq g (1+ g))))))
|
;; Return a list with tag variables
|
||||||
(org-set-local 'org-tag-alist nil)
|
(list org-file-tags org-tag-alist org-tag-groups-alist)))))
|
||||||
(while (setq e (pop tgs))
|
|
||||||
(or (and (stringp (car e))
|
|
||||||
(assoc (car e) org-tag-alist))
|
|
||||||
(push e org-tag-alist)))
|
|
||||||
;; Return a list with tag variables
|
|
||||||
(list org-file-tags org-tag-alist org-tag-groups-alist))))))
|
|
||||||
|
|
||||||
(defvar org-ota nil)
|
(defvar org-ota nil)
|
||||||
(defun org-set-regexps-and-options ()
|
(defun org-set-regexps-and-options ()
|
||||||
|
|
Loading…
Reference in New Issue