0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 16:32:51 +00:00

Fix multiple groups of mutually exclusive tags

* lisp/org.el (org-set-tags): Use a subtler mechansim to remove
  duplicate tags.  This fixes a bug introduced in 77b4fad.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106763>
This commit is contained in:
Nicolas Goaziou 2016-04-28 22:04:49 +02:00
parent e818699113
commit c8c2d2b1f7

View file

@ -15016,17 +15016,27 @@ When JUST-ALIGN is non-nil, only align tags."
(if just-align current
;; Get a new set of tags from the user.
(save-excursion
(let* ((table
(let* ((seen)
(table
(setq
org-last-tags-completion-table
(delete-dups
(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)))))))
;; Uniquify tags in alists, yet preserve
;; structure (i.e., keywords).
(delq nil
(mapcar
(lambda (pair)
(let ((head (car pair)))
(cond ((symbolp head) pair)
((member head seen) nil)
(t (push head seen)
pair))))
(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))))))))
(current-tags (org-split-string current ":"))
(inherited-tags
(nreverse (nthcdr (length current-tags)