emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [BUG] Duplicate characters in help string when filtering by tag
Date: Fri, 10 Aug 2018 21:51:24 -0500	[thread overview]
Message-ID: <87a7pt39ar.fsf@fastmail.fm> (raw)

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

                 reply	other threads:[~2018-08-11  2:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7pt39ar.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).