From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OKntA8A55mTGhAEASxT56A (envelope-from ) for ; Wed, 23 Aug 2023 18:54:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0MoMA8A55mSpLwEAG6o9tA (envelope-from ) for ; Wed, 23 Aug 2023 18:54:24 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 97D9C51BB9 for ; Wed, 23 Aug 2023 18:54:23 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=vodafonemail.de header.s=vfde-mb-mr2-21dec header.b=FBSl5aDl; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=vodafonemail.de ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692809663; a=rsa-sha256; cv=none; b=am//zvTRbZ6WBgm8XUza5pD4qbi7EaMExaI8a2I0IikzlRwNmQn3scpM5MSGzdShNcJQLp GCi0Z9zdzRTeQFgYaJHdS5JpMEWiVF3SBijDU6g3eRDvI8jv5tqVsAPoVTa3jlBC5vNu8s ACkXrp5Kns6ey+30/eScRvD9rdrU8HNVw7LppmL5g/HEaAdkYoErvIZFPqEatFU7j5IIAm KJXnruImg261WNcvIue0AO9a/KQIJB0QtOQIPrmzFeyBii2B+M/SPSYh/Hi8Gq3iSFO7cM EbTI2qO4PDz32zqH5Mhgf4nLHfwPCJ8A2Z76lauo5OR0jP1xJNuMT7SECkB+FQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=vodafonemail.de header.s=vfde-mb-mr2-21dec header.b=FBSl5aDl; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=vodafonemail.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692809663; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=x0BD3nE2QXvlGnkYHR9/mjAQ3F3PQzUCkWpz4Ou3CAU=; b=D26jrFnP7Vm+x7F6fBn12Jo8ojg0Fx/CGa+yFoFyyZ3iFgFroeeblnN2AY+f326NLcWTtM jYBxumOL9qm4QIGDTYNctyxcxVCjzTKQinIhd/Z46CG/iy6YbWGKIqQb+SKmT4SzhGrM4E 1yKuAy9yh83n7t9P1w72OLjPjv6DlmzMJADXLS72tmMLr5GvU6zBdYAFB7HLiIfGukfm+4 g5bA44lztVhlVV0AhpH/1xGHQxCeUP6i297gPy/NzVRNFY21h21U3hz2s85jbH39UDaHmV QmEilLbpaYqMRR2QyG9q6GV1dWnONautsuoEV7yHN7kZgGyn7ggg7MFOM0VSjA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYr3a-0007iO-MV; Wed, 23 Aug 2023 12:50:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYoPQ-00024t-Q4 for emacs-orgmode@gnu.org; Wed, 23 Aug 2023 10:00:32 -0400 Received: from mr5.vodafonemail.de ([145.253.228.165]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYoPO-0005aH-0m for emacs-orgmode@gnu.org; Wed, 23 Aug 2023 10:00:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-21dec; t=1692799227; bh=x0BD3nE2QXvlGnkYHR9/mjAQ3F3PQzUCkWpz4Ou3CAU=; h=Message-ID:Date:User-Agent:Subject:Content-Language:From:To: References:In-Reply-To:Content-Type:From; b=FBSl5aDlWlxQe9aWW2DAzP1jKUrLUR3FEhU0uc2yflqTVdqOoE4m/Afr11KI1/VqJ F6jEEm4zvZ0L/axM/VF6E9/9zxCppdXQyfMWOA/acIw3TjBSr5JeQmmRLxmslhh27b UvzXdDPjRZ8y8yHZGrY8Ig/Gz3KXI5XToqieSHwQ= Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr5.vodafonemail.de (Postfix) with ESMTPS id 4RW7CH6LW5z1y4J; Wed, 23 Aug 2023 14:00:27 +0000 (UTC) Received: from [192.168.0.138] (unknown [86.33.74.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4RW7C46R10z9sPj; Wed, 23 Aug 2023 14:00:13 +0000 (UTC) Message-ID: <748acab1-eaf4-fdd3-13a6-26e6229de613@vodafonemail.de> Date: Wed, 23 Aug 2023 16:00:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property] Content-Language: de-DE-frami, en-US From: Jens Schmidt To: Ihor Radchenko , Samuel Loury Cc: emacs-orgmode@gnu.org References: <87h6oq2nu1.fsf@gmail.com> <877cpm6oe3.fsf@localhost> <811c9bda-cea4-c0d6-30b4-53ebdb432ab6@vodafonemail.de> In-Reply-To: <811c9bda-cea4-c0d6-30b4-53ebdb432ab6@vodafonemail.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-type: clean X-purgate: clean X-purgate-size: 2689 X-purgate-ID: 155817::1692799223-DD7F97FF-97AFAA79/0/0 Received-SPF: pass client-ip=145.253.228.165; envelope-from=jschmidt4gnu@vodafonemail.de; helo=mr5.vodafonemail.de X-Spam_score_int: -54 X-Spam_score: -5.5 X-Spam_bar: ----- X-Spam_report: (-5.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.684, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Spam-Score: -9.50 X-Migadu-Queue-Id: 97D9C51BB9 X-Migadu-Spam-Score: -9.50 X-TUID: MJRh+ZE4lKco > On 2023-08-23 12:31, Ihor Radchenko wrote: > >> Jens, we got an edge case with "-", after all. >> >> What is happening here is that the new parser >> (https://orgmode.org/list/9132e58f-d89e-f7df-bbe4-43d53a2367d2@vodafonemail.de) >> treats the above match string as >> >> property "tag-TODO" not equal "TODO" >> >> instead of >> >> not tag equal "tag" and not TODO equal "TODO" Right. And you already provided in the other branch of this discussion a direction how to resolve that: > [...] In case of ambiguity TAG1-TAG2-TAG3-PROP="" like we see here, we > should prefer multiple shorter conditions: TAG1 && -TAG2 && -TAG3 && PROP="" > > When "TAG1-TAG2" is an actual tag name with dash, we may allow escaping. But I'd like to clarify that. From the Org syntax https://orgmode.org/worg/org-syntax.html#Headings I understood that tag names cannot contain minus characters, and `org-tag-re' does not match any, either. So we are talking about property names only, right? At least I'll do so in the following ... Then the question is what quoting scheme to use for property names. The previous one used before my commit f689eb4 (A) "\\-" => "-" never has been documented and never has been working properly, since the *matching* of these was done on *prop* names, but the *unescaping* on *tag* names. So we are basically free to come up with something new. Some obvious choice would be a simpler single backslash (B) "\-" => "-" And when I have been "fixing" the parser, I also thought that (C) ":...:" => "..." would give a nice and somewhat logical quoting scheme. That is, if a property name contains "special" characters, it could be surrounded by colons to quote these. So we have so far quoting schemes A, B, C, with my preference being C. Any other proposals? I'll focus on C, where there is one big cave-at: The main regexp in `org-make-tags-matcher' also allows for (undocumented) colons as inclusive search term separator: ;; exclusion and inclusion (the latter being implicit) "\\(?1:[-+:]\\)?" ^ Which collides with the colons used by quoting scheme C. I'd rather sacrifice that use of colon as search term separator, TBH. Given the property name syntax in https://orgmode.org/worg/org-syntax.html#Node_Properties the subre in `org-make-tags-matcher' to match property names should then look similar to "\\(?5:[[:alnum:]_]+\\|:[^[:space:]]+?:\\)" , right (colons being stripped off later)? I'm really asking about the trailing plus signs here, but these do not seem to make sense in property queries. What do you think?