emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Creating sparse tree with regexp property matches
@ 2021-08-25 20:12 Cassio Koshikumo
  2021-08-25 21:03 ` Daniel Fleischer
  0 siblings, 1 reply; 14+ messages in thread
From: Cassio Koshikumo @ 2021-08-25 20:12 UTC (permalink / raw)
  To: emacs-orgmode

Hello all,

I think there's a bug with `org-make-tags-matcher' when creating a sparse tree
using property matching with regular expressions and "or" terms. Take the
example given in the manual:

  +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2
       +With={Sarah|Denny}+SCHEDULED>="<2008-10-11>"

If we isolate just this part:

  +With={Sarah|Denny}

The resulting sparse tree does not match the right
headings. The function generates the following `tagsmatcher':

(progn
  (setq org-cached-props nil)
  (or
   (and
    (member
     #("Denny" 0 5
       (regexp t))
     tags-list))
   (and
    (member "With" tags-list))))

There're checks for "Denny" (as a regexp) and "With" (as a string) --- this is
supposed to be the property name, not a search term. They are both checked for
in `tags-list'. And, finally, "Sarah" is nowhere to be seen.

The problem, as far as I can tell, is that splitting the input at `|' to get the
`orterms' does not work with the regular expression the function uses to find
the constituent parts of each term. In this example, splitting the input at `|'
makes one side get the opening brace and the other the closing brace, while the
regexp expects both being present. Since the regexp doesn't fully match, the
terms are all parsed wrong. (The function doesn't recognize "With" as property
name, for instance.) I'm still messing with it but, for now, don't really know
how to fix the problem. I don't 100% understand the function yet...

Regards,

-- 
Cassio


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-09-17 11:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 20:12 [BUG] Creating sparse tree with regexp property matches Cassio Koshikumo
2021-08-25 21:03 ` Daniel Fleischer
2021-08-25 22:30   ` Cassio Koshikumo
2021-08-31 11:27     ` Timothy
2021-08-31 12:28       ` Daniel Fleischer
2021-08-31 12:41         ` Cassio Koshikumo
2021-08-31 12:56         ` Timothy
2021-08-31 20:31           ` Daniel Fleischer
2021-09-01 10:28             ` Timothy
2021-09-01 11:32               ` Daniel Fleischer
2021-09-02  6:35                 ` [PATCH] " Daniel Fleischer
2021-09-16 15:01                   ` Daniel Fleischer
2021-09-17 10:17                     ` Timothy
2021-09-17 11:15                       ` Daniel Fleischer

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).