From: Matt Lundin <mdl@imapmail.org>
To: David Maus <dmaus@ictsoc.de>
Cc: Chao LU <loochao@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: How to do Properties search by define an agenda command
Date: Sat, 13 Nov 2010 10:31:17 -0500 [thread overview]
Message-ID: <87bp5tb5q2.fsf@fastmail.fm> (raw)
In-Reply-To: 87oc9tkb4l.wl%dmaus@ictsoc.de
David Maus <dmaus@ictsoc.de> writes:
> At Thu, 11 Nov 2010 20:51:58 -0500,
> Matt Lundin wrote:
>> > Looks like to use the intended functionality someone has to patch Org
>> > mode's tag search to handle multivalue properties.
AFAICT, the OP was not inquiring about a multivalue search, but rather
simply asking how to match an entire property value string (i.e., the
title of a book). The problems was caused not by unescaped spaces in
property values, but rather by how the custom agenda search was
constructed (e.g., incorrect property key, unescaped quote marks, etc.).
>> I don't believe the space in property values is meant to indicate
>> multiple values (i.e., in the same way that ":" separates tags). Here's
>> an example from the manual:
>
> This is a misunderstanding: Yes, you can use space characters in
> single value properties and use regexps to simulate multivalue
> properties.
>
> But you can't use Org's multivalue properties (C-h f
> org-entry-put-multivalued-property RET).
Good to know. I wasn't aware of multivalued properties.
I think my comment still stands: currently, for normal tags/property
searches, single spaces are not intended to indicate multiple values.
The function org-tags-view invokes only the single value property
mechanism (i.e., org-cached-entry-get).
AFAICT, multivalued properties were introduced to accommodate org-attach
but they have not (yet) been used elsewhere in Org-mode. See the
following commit:
--8<---------------cut here---------------start------------->8---
commit d043e31182595983df3d191e80ca941ee171c400
Author: Carsten Dominik <carsten.dominik@gmail.com>
Date: Wed Oct 1 09:25:18 2008 +0200
Integrate John Wiegley's org-attach.el.
--8<---------------cut here---------------end--------------->8---
> Looks like an inconsistency or a glitch: Org supports putting multiple
> values in a property but has no reserved separator for multiple
> values. So there is no way for a function recognize multivalue
> properties -- what makes it hard to perform a search for properties
> with multiple values w/o having the user enter a regular expression.
Currently, the only way to extract multivalue properties is to use the
API functions:
(info "(org) Using the property API")
I believe single value properties should be the default behavior for
searches (that is how the manual presents properties). I would certainly
*not* want to have to escape spaces in property drawers when, say,
entering AUTHOR and TITLE property values.
Currently, the search logic of is relatively straightforward:
1. to force an exact property match, use TITLE="Quantum Mechanics"
2. to allow partial matches, use a regexp: TITLE={Quantum}
Perhaps a patch could introduce an user option to use the multivalued
API in property searches. This could be a nice option for custom
commands. But I would recommend that the single value remain the
default.
Best,
Matt
next prev parent reply other threads:[~2010-11-13 15:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-10 7:59 How to do Properties search by define an agenda command Chao LU
2010-11-10 18:30 ` David Maus
2010-11-12 1:51 ` Matt Lundin
2010-11-13 6:09 ` David Maus
2010-11-13 15:31 ` Matt Lundin [this message]
2010-11-12 1:39 ` Matt Lundin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bp5tb5q2.fsf@fastmail.fm \
--to=mdl@imapmail.org \
--cc=dmaus@ictsoc.de \
--cc=emacs-orgmode@gnu.org \
--cc=loochao@gmail.com \
/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 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.