emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Duplicate characters in help string when filtering by tag
@ 2018-08-11  2:51 Matt Lundin
  0 siblings, 0 replies; only message in thread
From: Matt Lundin @ 2018-08-11  2:51 UTC (permalink / raw)
  To: Org Mode

I'm finding that when I call org-agenda-filter-by-tag, the string of
character hints is long, with lots of duplicates. E.g.,

Filter by tag [hpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcw ]:tag-char, [TAB]:tag, [/]:off, [+/-]:filter/exclude, [q]:quit [3 times]

A git bisect reveals that this bug began with commit
2056b60aae528d0ba663d8b3804dc69e98993f1c. After a bit of investigating,
I've found the cause: org--tag-add-to-alist no longer removes duplicate
tags if they belong in a tag group. 

Let me provide a minimal example to illustrate. Take the following
setting:

(setq org-tag-alist
      '((:startgroup)
        ("home" . ?h)
	("phone" . ?p)
	("computer" . ?c)
	("work" . ?w)
        (:endgroup)))

If one has 10 agenda files (none of which has a local #+TAGS
declaration), org-tag-alist-for-agenda will end up containing those tags
multiple times:

--8<---------------cut here---------------start------------->8---
org-tag-alist-for-agenda is a variable defined in ‘org.el’.
Its value is
(#1=(:startgroup)
    #2=("home" . 104)
    #3=("phone" . 112)
    #4=("computer" . 99)
    #5=("work" . 119)
    #6=(:endgroup)
    #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6#)
--8<---------------cut here---------------end--------------->8---

As a result, the help prompt for org-filter-tags-for-agenda looks like
this (notice the duplicate characters):

Filter by tag [hpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcw ]:tag-char, [TAB]:tag, [/]:off, [+/-]:filter/exclude, [q]:quit [3 times]

Best,
Matt

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-11  2:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-11  2:51 [BUG] Duplicate characters in help string when filtering by tag Matt Lundin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).