* Help with org-map-entries and property searches
@ 2008-12-17 14:55 Ben Alexander
2008-12-17 15:46 ` Bernt Hansen
0 siblings, 1 reply; 3+ messages in thread
From: Ben Alexander @ 2008-12-17 14:55 UTC (permalink / raw)
To: emacs-orgmode Org-Mode
Hi,
I'm trying to code lisp, and it's slow going for me. I was hoping
someone with a few spare cycles could explain why this doesn't work
the way I expect. I typed the following code into an org file and hit
C-x C-e (eval-last-sexp):
(length (org-map-entries t "+LEDGER=\"entry\""))
=> 1
(length (org-map-entries t "+LEDGER=\"transaction\""))
=> 2
This looks good: I do have two headlines with a property called LEDGER
where the value is "transaction" (no quotes)
However, all of the following attempts to search for both kinds of (or
all) values fail (no error, just the wrong value). What am I doing
wrong?
(length (org-map-entries t "+LEDGER={\"transaction\"\|\"entry\"}"))
=> 0
(length (org-map-entries t "+LEDGER={transaction\|entry}"))
=> 0
(length (org-map-entries t "+LEDGER=entry"))
=> 0
(length (org-map-entries t "+LEDGER"))
=> 0
I was inspired by this example of a property search from the org info
page (section 7.3)
+work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
+With={Sarah\|Denny}+SCHEDULED>="<2008-10-11>"
I've tried this in
GNU Emacs 22.3.2 (i386-apple-darwin9.5.0, Carbon Version 1.6.0) of
2008-09-21 on plume.sr.unh.edu - Aquamacs Distribution 1.5
and
GNU Emacs 22.3.1 (i386-apple-darwin9.5.1, Carbon Version 1.6.0) of
2008-11-07 on Xander.local (compiled via MacPorts)
Org-mode version 6.15a in both.
I also got the same results when I did it after a 'start-vanilla-
aquamacs' (thanks to William Henney for the tip!)
Thanks,
Ben
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help with org-map-entries and property searches
2008-12-17 14:55 Help with org-map-entries and property searches Ben Alexander
@ 2008-12-17 15:46 ` Bernt Hansen
2008-12-17 15:51 ` Ben Alexander
0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2008-12-17 15:46 UTC (permalink / raw)
To: Ben Alexander; +Cc: emacs-orgmode Org-Mode
Ben Alexander <bva@alexanderonline.org> writes:
> However, all of the following attempts to search for both kinds of (or
> all) values fail (no error, just the wrong value). What am I doing
> wrong?
>
> (length (org-map-entries t "+LEDGER={\"transaction\"\|\"entry\"}"))
> => 0
> (length (org-map-entries t "+LEDGER={transaction\|entry}"))
> => 0
> (length (org-map-entries t "+LEDGER=entry"))
> => 0
> (length (org-map-entries t "+LEDGER"))
> => 0
>
Try this: (add 2 more \ characters before the |)
(length (org-map-entries t "+LEDGER={transaction\\\|entry}"))
=> 3
HTH,
Bernt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help with org-map-entries and property searches
2008-12-17 15:46 ` Bernt Hansen
@ 2008-12-17 15:51 ` Ben Alexander
0 siblings, 0 replies; 3+ messages in thread
From: Ben Alexander @ 2008-12-17 15:51 UTC (permalink / raw)
To: Bernt Hansen; +Cc: emacs-orgmode Org-Mode
Genius!
Thanks!
On 2008-Dec-17, at 15:46, Bernt Hansen wrote:
> Ben Alexander <bva@alexanderonline.org> writes:
>
>> However, all of the following attempts to search for both kinds of
>> (or
>> all) values fail (no error, just the wrong value). What am I doing
>> wrong?
>>
>
> Try this: (add 2 more \ characters before the |)
>
> (length (org-map-entries t "+LEDGER={transaction\\\|entry}"))
> => 3
>
> HTH,
>
> Bernt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-17 15:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-17 14:55 Help with org-map-entries and property searches Ben Alexander
2008-12-17 15:46 ` Bernt Hansen
2008-12-17 15:51 ` Ben Alexander
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.