diff options
author | Bastien <bzg@gnu.org> | 2018-03-20 17:23:18 +0100 |
---|---|---|
committer | Bastien <bzg@gnu.org> | 2018-03-20 17:23:18 +0100 |
commit | b0cca9656da861592c6342e03a3572fd07adb635 (patch) | |
tree | 24f99a20e80aca83616ace20532e7776d693df91 | |
parent | b7f350f7ef9a1aa9437730ca7b330a0a07c4fe39 (diff) | |
download | org-mode-b0cca9656da861592c6342e03a3572fd07adb635.tar.gz |
org.el: Fix bug when adding persistent tags
* lisp/org.el (org-tag-add-to-alist): New function.
(org-set-regexps-and-options): Use the new function to only
append persistent tags if they are not already in the tags
alist.
-rw-r--r-- | lisp/org.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el index f791df8..af2e546 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4903,6 +4903,12 @@ Support for group tags is controlled by the option (message "Groups tags support has been turned %s" (if org-group-tags "on" "off"))) +(defun org-tag-add-to-alist (alist1 alist2) + "Append ALIST1 elements to ALIST2 if they are not there yet." + (let (to-add) + (dolist (i alist1) (unless (member i alist2) (push i to-add))) + (append to-add alist2))) + (defun org-set-regexps-and-options (&optional tags-only) "Precompute regular expressions used in the current buffer. When optional argument TAGS-ONLY is non-nil, only compute tags @@ -4931,10 +4937,11 @@ related expressions." (mapcar #'org-add-prop-inherited (cdr (assq 'filetags alist)))) (setq org-current-tag-alist - (append org-tag-persistent-alist - (let ((tags (cdr (assq 'tags alist)))) - (if tags (org-tag-string-to-alist tags) - org-tag-alist)))) + (org-tag-add-to-alist + org-tag-persistent-alist + (let ((tags (cdr (assq 'tags alist)))) + (if tags (org-tag-string-to-alist tags) + org-tag-alist)))) (setq org-tag-groups-alist (org-tag-alist-to-groups org-current-tag-alist)) (unless tags-only |