summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-04-28 22:08:01 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-04-28 22:08:01 +0200
commit6ed60a797a844b204080daf4ee36f27811ee98ee (patch)
treed6e600239d742271713d795190aed2c2e66530b2
parentec615b192d703a0201ceefd46897e4636ff00a38 (diff)
parentc8c2d2b1f715158a1f55a7eaf4797c78562b4402 (diff)
downloadorg-mode-6ed60a797a844b204080daf4ee36f27811ee98ee.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el27
1 files changed, 19 insertions, 8 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 98521c3..b15603d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14952,16 +14952,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
- (or org-current-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
+ (or org-current-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)