emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-agenda queries for absent properties


From: Jens Schmidt
Subject: Re: org-agenda queries for absent properties
Date: Tue, 1 Aug 2023 20:50:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]