From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Kampas Subject: 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/)] Date: Mon, 12 Mar 2018 08:31:17 +0100 Message-ID: <16731993.gXpk8AjVC7@5th> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evHvY-0000NY-A8 for emacs-orgmode@gnu.org; Mon, 12 Mar 2018 03:31:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evHvV-0001nD-6n for emacs-orgmode@gnu.org; Mon, 12 Mar 2018 03:31:24 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:33026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evHvU-0001ly-Vm for emacs-orgmode@gnu.org; Mon, 12 Mar 2018 03:31:21 -0400 Received: by mail-wm0-x236.google.com with SMTP id s206so11968620wme.0 for ; Mon, 12 Mar 2018 00:31:20 -0700 (PDT) Received: from 5th.localnet (ip-4-23.hlucinnet.cz. [93.91.243.23]) by smtp.gmail.com with ESMTPSA id s78sm12865439wrc.93.2018.03.12.00.31.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Mar 2018 00:31:18 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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/)