From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Mutually-exclusive Org tags still inherit each other Date: Mon, 04 Mar 2019 10:48:19 +0100 Message-ID: <87zhqbc6n0.fsf@nicolasgoaziou.fr> References: <874l9cdeki.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:46370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0kCy-0008OD-9X for emacs-orgmode@gnu.org; Mon, 04 Mar 2019 04:48:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0kCx-0000nX-D3 for emacs-orgmode@gnu.org; Mon, 04 Mar 2019 04:48:28 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:38859) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0kCv-0000i7-HR for emacs-orgmode@gnu.org; Mon, 04 Mar 2019 04:48:27 -0500 In-Reply-To: (Tina Russell's message of "Fri, 1 Mar 2019 13:47:44 -0800") 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: Tina Russell Cc: emacs-orgmode@gnu.org Hello, Tina Russell writes: > Well, I think it=E2=80=99s unreasonable to ask users to reinforce manuall= y and > continuously something they=E2=80=99ve already specified in their setting= s. > Besides, my example was intentionally trivial=E2=80=94imagine managing a = large > tree and having to remember which tags are mutually exclusive to what, > all the time. > > But, no matter! I have created a patch! It works great, even for edge > cases like when an entry has two tags that are set as mutually > exclusive to each other. Thank you for the patch. Unfortunately, I think we are miscommunicating, because we are thinking at different levels of abstraction. Le me clarify this. Org syntax supports colons-wrapped cookies at the end of a headline, called tags. That's about it. Of course, you can extend those cookies to support, e.g., inheritance, groups, mutual exclusion, and whatnot. But at the lowest level, there are only cookies at the end of a headline. The function `org-get-tags' was implemented to get those, possibly with inheritance. Most, if not all, of its callers in the code base do not care about groups, or mutual exclusion. Also, most, if not all, callers care about internal tags. Not that some internal tags are automatically inherited, hence support for this mechanism in `org-get-tags'. You apparently have a need for user-defined tags, with all bells and whistles. However, IIUC, you don't really need to list them, but ultimately do a tag search on them.=20 There are advanced functions for tag searches: `org-make-tags-matcher' and `org-scan-tags'. My point is that you should first check if they already do what you want, and patch them otherwise, instead of changing `org-get-tags', which has a clear scope. WDYT? Regards, --=20 Nicolas Goaziou