all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
To: Ihor Radchenko <yantar92@posteo.net>, Samuel Loury <konubinix@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property]
Date: Fri, 1 Sep 2023 18:48:32 +0200	[thread overview]
Message-ID: <2937cbf6-4ee7-0bdc-b585-d74c9d80883b@vodafonemail.de> (raw)
In-Reply-To: <874jklhqw2.fsf@localhost>

On 2023-08-27  09:43, Ihor Radchenko wrote:
> Samuel Loury <konubinix@gmail.com> writes:
> 
>> IMHO, "-tag&-todo=TODO" is totally ok. I even imagine we could say that
>> & and | are forbidden to say anything else than AND and OR and people
>> would be ok with that.
> 
> Actually, explicit & or | might be an easier way to not worry about
> escaping things. Except escaping & or | themselves.
> It might be the preferred way to put into the manual.
> 
>> IOW, I wonder of the time and effort to deal with optional & is worth
>> it. WDYT?
> 
> We cannot remove the optionality of &, because doing so will break
> existing user setups. But we can certainly change our recommendations in
> the manual.
> 
> Though pure tag matcher makes more sense with implicit &:
>  +tag1-tag2+tag3... vs +tag1&-tag2&+tag3
> Especially in the interactive agenda filters.

I feel it's a bit hard to reply to this message in the right places, so
I'll do a plain bottom post, sorry.

TL;DR:

- I think we cannot make "&" mandatory because of backward compatibility.

- Even if we made "&" mandatory, it would not really solve the quoting
  problem, since the parser is rather hacky and other quoting and
  context issues would still be there.

- But then I cannot see any real reason why we should recommend using
  "&" in the manual.

- Finally, we should hope for and work towards a "real parser", as Ihor
  has mentioned already in a previous post:

  (beginning of thread)
  https://list.orgmode.org/orgmode/9132e58f-d89e-f7df-bbe4-43d53a2367d2@vodafonemail.de/
  (mentioning of peg)
  https://list.orgmode.org/orgmode/87wmyendr7.fsf@localhost/

Details, as far as still required:

The whole tag/property query parser seems to have a long tradition.  For
example, there is still that TODO-state special case that allows for
queries like this (example ripped from the manual):

  work/WAITING
     Same as work+TODO​="WAITING"

So people *have* been worrying about a) query brevity and b) backward
compatibility, and I think we should do so as well.

Then the current parser is horribly ad-hoc-ish and, as a plain
regexp-based parser, context insensitive.  For example, a tag regexp
match

  {regexp}

is matched simply as

  {[^}]+}

that is, you have no chance whatsoever to quote the closing curly
parenthesis.  Likewise for double-quoted strings.

In other words, even if we make | or & mandatory, there will still
remain a lot of ambiguities stemming from the rest of the parser.  And
I'm too lazy to think about how we could quote & in that whole picture.
(| is sort of handled already, but again in a completely
context-insensitive way.)

This all calls for a proper parser, based on peg or bovine or whatever.
Hopefully that parser would still keep backward compatibility, but
that's probably wishful thinking.



  reply	other threads:[~2023-09-01 16:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  7:57 [BUG?] Matching tags: & operator no more implicit between tags and special property Samuel Loury
2023-08-23 10:21 ` Jens Schmidt
2023-08-23 10:37   ` Ihor Radchenko
2023-08-23 10:31 ` Ihor Radchenko
2023-08-23 10:38   ` Jens Schmidt
2023-08-23 14:00     ` [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property] Jens Schmidt
2023-08-23 15:55       ` Jens Schmidt
2023-08-24  7:30         ` Ihor Radchenko
2023-08-24  7:32       ` Ihor Radchenko
2023-08-24  8:52         ` Jens Schmidt
2023-08-25 18:46           ` Jens Schmidt
2023-08-26 10:16             ` Ihor Radchenko
2023-08-26 11:53               ` Jens Schmidt
2023-08-26 12:00                 ` Ihor Radchenko
2023-08-26 12:19                   ` Jens Schmidt
2023-08-26 12:22                     ` Ihor Radchenko
2023-08-26 12:54                       ` Jens Schmidt
2023-08-27  7:11                         ` Samuel Loury
2023-08-27  7:43                           ` Ihor Radchenko
2023-09-01 16:48                             ` Jens Schmidt [this message]
2023-09-01 23:59                               ` Tom Gillespie
2023-09-02  0:02                                 ` Tom Gillespie
2023-09-02  7:10                               ` Ihor Radchenko
2023-09-02 13:14                                 ` Redoing the current tag/property parser in a real grammar [was: Re: [RFC] Quoting property names in tag/property matches] Jens Schmidt
2023-09-03  7:04                                   ` Ihor Radchenko
2023-09-02 13:18                                 ` [RFC] Quoting property names in tag/property matches Jens Schmidt
2023-08-30 16:28                         ` [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property] Jens Schmidt
2023-08-31  8:08                           ` Ihor Radchenko
2023-08-31 10:24                             ` Jens Schmidt
2023-09-03  6:53                         ` Ihor Radchenko
2023-09-03  9:25                           ` Jens Schmidt

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2937cbf6-4ee7-0bdc-b585-d74c9d80883b@vodafonemail.de \
    --to=jschmidt4gnu@vodafonemail.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=konubinix@gmail.com \
    --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 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.