all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug: Matching tags: results incomplete when mixing group tags and their ancestors [9.1.7 (9.1.7-12-g74f6ed-elpaplus @ /home/martin/.emacs.d/elpa/org-plus-contrib-20180305/)]
@ 2018-03-12  7:31 Martin Kampas
  2018-03-15 14:44 ` Martin Kampas
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Kampas @ 2018-03-12  7:31 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Here is an example Org file:

------------
#+TAGS: [ tag1 : tag2 ] [ tag2 : tag3 ] [ tag3 : tag4 ]
* Tag1           :tag1:
* Tag2           :tag2:
* Tag3           :tag3:
* Tag4           :tag4:
------------

Searching headlines by tags works well unless you combine a group tag together with some of its ancestor tags in the query.

1) GOOD - Searching for "tag1" marks all four headlines.
2) GOOD - Searching for "tag3" marks headlines "Tag3" and "Tag4".
3) BAD - Searching for "tag1+tag3" marks just headline "Tag3" providing an incomplete result. Expected result: headlines "Tag3" and "Tag4" are marked.

With more complex tag set it may happen quite easily that such a search is done.

The bug seems to be in org-tags-expand.

(org-tags-expand "tag1")
#("{\\<\\(?:tag[1-4]\\)\\>}" 0 20 (grouptag t))
(org-tags-expand "tag3")
#("{\\<\\(?:tag[34]\\)\\>}" 0 19 (grouptag t))
(org-tags-expand "tag1+tag3")
#("{\\<\\(?:tag[1-4]\\)\\>}+tag3" 0 20 (grouptag t))

In the third invocation "tag3" was left unexpanded.

Best regards,
Martin


Emacs  : GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2018-02-09
Package: Org mode version 9.1.7 (9.1.7-12-g74f6ed-elpaplus @ /home/martin/.emacs.d/elpa/org-plus-contrib-20180305/)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-22  8:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-12  7:31 Bug: Matching tags: results incomplete when mixing group tags and their ancestors [9.1.7 (9.1.7-12-g74f6ed-elpaplus @ /home/martin/.emacs.d/elpa/org-plus-contrib-20180305/)] Martin Kampas
2018-03-15 14:44 ` Martin Kampas
2018-03-16 22:05   ` Nicolas Goaziou
2018-03-21  1:14   ` Bastien
2018-03-22  5:32     ` Martin Kampas
2018-03-22  8:22       ` Bastien Guerry

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.