emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: org-agenda queries for absent properties
Date: Sun, 6 Aug 2023 11:19:54 +0200	[thread overview]
Message-ID: <b142a63b-4c7f-49b8-c271-7d10c34ffb9d@vodafonemail.de> (raw)
In-Reply-To: <87r0ogip0d.fsf@localhost>

On 2023-08-06  09:55, Ihor Radchenko wrote:

>> But from here it gets more intersting:
>>
>> - The code uses subre "\\\\-" in property names to (supposedly) allow
>>     for inclusion of minus characters in property names, which (probably)
>>     could be confused with term negation.
> 
> Not probably. It is known to be confused.
> https://orgmode.org/list/87jzv67k3p.fsf@localhost

Right.  But the issue back then appeared because the subre for property
names does not match minus characters, just alnums and underscores:

   \\([[:alnum:]_]+\\)

What I'm trying to convey is: If we match plain minus characters in
above subre, these will be greedily goobled up including any following
operator, which makes the whole thing uniquely an operator term.  If
there is no following operator, but something else, the whole regexp
backtracks and (hopefully) matches a following negative term.

>> - Even more, IMO one could do away completely with the minus-quoting and
>>     unquoting, since the overall regexp should allow for unambiguously
>>     matching minus characters both
>>
>>     + in {tag regexps} (because of "{[^}]+}" gobbling them) and
>>
>>     + in property names (because a property name must always be followed
>>       by some operator)
>>
>>     *without* them getting confused with term negation.
>>
>>     Or do I miss something here?  A cursory test with sth like
>>
>>       +foo-bar="xxx"-patchday=202302
>>
>>     seems to work fine.
> 
> Agree.

Ah, OK.  I thought you wouldn't.  Let me redo this thing as I think it
is correct (including let-binding common subres as you suggested).  I
will also add tests for matching property names having minuses and then
we can see how it goes.



  reply	other threads:[~2023-08-06  9:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-30 17:13 org-agenda queries for absent properties Jens Schmidt
2023-07-31  6:45 ` Ihor Radchenko
2023-08-01 18:50   ` Jens Schmidt
2023-08-02  6:45     ` Ihor Radchenko
2023-08-05 10:56       ` Jens Schmidt
2023-08-06  7:55         ` Ihor Radchenko
2023-08-06  9:19           ` Jens Schmidt [this message]
2023-08-06 14:42             ` Jens Schmidt
2023-08-07 11:53               ` Ihor Radchenko
2023-08-07 20:20                 ` Jens Schmidt
2023-08-08  7:04                   ` Ihor Radchenko

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=b142a63b-4c7f-49b8-c271-7d10c34ffb9d@vodafonemail.de \
    --to=jschmidt4gnu@vodafonemail.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).