emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Cassio Koshikumo <ckoshikumo@gmail.com>
To: Daniel Fleischer <danflscr@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Creating sparse tree with regexp property matches
Date: Wed, 25 Aug 2021 19:30:30 -0300	[thread overview]
Message-ID: <CAJP-4jN7gsnHf97fF=2+LMttUuSQMu=2C+NZsctN+NOcUrdZeQ@mail.gmail.com> (raw)
In-Reply-To: <m2ilzt6xqn.fsf@gmail.com>

Ah! Can't believe I didn't try that. Well, at least the docs can
benefit from my confusion.

Thanks,

On Wed, Aug 25, 2021 at 6:05 PM Daniel Fleischer <danflscr@gmail.com> wrote:
>
> On Wed, Aug 25 2021, Cassio Koshikumo wrote:
> > 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 Sat>"
> >
> > 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,
>
> Hi, the solution is that it's elisp based regex, so OR is indicated with
> \| instead of just |. It might be good idea to correct the example.
>
> Best,
>
> *Daniel Fleischer*



-- 
Cassio Koshikumo


  reply	other threads:[~2021-08-25 22:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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='CAJP-4jN7gsnHf97fF=2+LMttUuSQMu=2C+NZsctN+NOcUrdZeQ@mail.gmail.com' \
    --to=ckoshikumo@gmail.com \
    --cc=danflscr@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).