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:
parent
e818699113
commit
c8c2d2b1f7
16
lisp/org.el
16
lisp/org.el
|
@ -15016,17 +15016,27 @@ When JUST-ALIGN is non-nil, only align tags."
|
||||||
(if just-align current
|
(if just-align current
|
||||||
;; Get a new set of tags from the user.
|
;; Get a new set of tags from the user.
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let* ((table
|
(let* ((seen)
|
||||||
|
(table
|
||||||
(setq
|
(setq
|
||||||
org-last-tags-completion-table
|
org-last-tags-completion-table
|
||||||
(delete-dups
|
;; 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
|
(append
|
||||||
org-tag-persistent-alist
|
org-tag-persistent-alist
|
||||||
(or org-tag-alist (org-get-buffer-tags))
|
(or org-tag-alist (org-get-buffer-tags))
|
||||||
(and
|
(and
|
||||||
org-complete-tags-always-offer-all-agenda-tags
|
org-complete-tags-always-offer-all-agenda-tags
|
||||||
(org-global-tags-completion-table
|
(org-global-tags-completion-table
|
||||||
(org-agenda-files)))))))
|
(org-agenda-files))))))))
|
||||||
(current-tags (org-split-string current ":"))
|
(current-tags (org-split-string current ":"))
|
||||||
(inherited-tags
|
(inherited-tags
|
||||||
(nreverse (nthcdr (length current-tags)
|
(nreverse (nthcdr (length current-tags)
|
||||||
|
|
Loading…
Reference in New Issue