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: Tue, 1 Aug 2023 20:50:43 +0200	[thread overview]
Message-ID: <3ac83971-2805-cfde-28a3-891814b95c25@vodafonemail.de> (raw)
In-Reply-To: <87o7jsinoo.fsf@localhost>

On 2023-07-31  08:45, Ihor Radchenko wrote:

> If you are up to a job of adding this to `org-make-tags-matcher' and
> not breaking things, you can try.

Depends a bit on the required collateral changes: Updating ORG-NEWS and
doc/org-guide.org should be no problem.  Doing a naive grep-based search
I haven't found tests on `org-tags-view' or `org-make-tags-matcher', so
I hopefully wouldn't need to add anything new in that direction.

Finally, the first step probably would be to make that humongous regexp
in `org-make-tags-matcher' a bit more readable.  What would you prefer?
`rx' or sth long the following lines (not checked for equality yet):

   (re (concat
        ;; AND operator (OR is done by global splitting)
        "^&?"
        ;; 1: exclusion and inclusion (the latter being
        ;; implicit)
        "\\([-+:]\\)?"
        ;; 2: query expression
        "\\("
	   ;; regular expression matching tag
	   "{[^}]+}\\|"
	   ;; LEVEL special property match (3: op, 4: level
	   ;; value)
	   "LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|"
	   ;; property match
	   "\\(?:"
	       ;; 5: property name (with backslash escaping minus)
	       "\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)"
	       ;; 6: property operator
	       "\\([<>=]\\{1,2\\}\\)"
	       ;; 7: property value/operand
	       "\\("
		   ;; regular expression
		   "{[^}]+}\\|"
		   ;; string
		   "\"[^\"]*\"\\|"
		   ;; number
		   "-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?"
	       "\\)"
	   "\\)\\|"
	   ;; tag match
	   org-tag-re
        "\\)"))

 > But we should really provide more
 > readable match syntax, similar to org-ql; sooner or later.

Agreed on that if the new syntax will allow for equally succinct
queries.  Plus a very cursory, doc-only review of org-ql hasn't
revealed to me how I'd do numeric property comparisons with it.


  reply	other threads:[~2023-08-01 18:52 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 [this message]
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
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=3ac83971-2805-cfde-28a3-891814b95c25@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).