* Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
@ 2011-12-16 14:28 Christoph LANGE
2011-12-26 14:16 ` Bastien
0 siblings, 1 reply; 8+ messages in thread
From: Christoph LANGE @ 2011-12-16 14:28 UTC (permalink / raw)
To: Orgmode Mailing List
Dear all,
noticing the new feature "Property names ending in + accumulate" (as
described on
http://orgmode.org/Changes.html#accumulating-property-keywords – BTW,
this exposes another issue with the fixed head bar on the new homepage,
as the actual link target is hidden by the head bar), I thought I could
use it in the property drawers of the entries of my org-contacts file,
and noticed the following problems:
1. font lock (aka syntax highlighting) does not yet recognize :PROPERTY+:
2. accumulation doesn't work within the same entry; details follow:
For some of my contacts I'd like to record multiple phone numbers or
e-mail addresses. So far I have been doing that in an ad hoc manner, e.g.
* Contact Name
:PROPERTIES:
:EMAIL: foo@bar.org, bar@baz.org
:END:
While I have not yet automated my usage of org-contacts, I thought it
would be more scalable and more accessible to future scripting if
multi-valued properties had a clear multi-value representation. (So the
feature is not yet mission-critical for me.) I thought that the new
accumulation feature might be suitable for that. (Or did I
misunderstand the feature?)
So when I changed the above contact entry to
* Contact Name
:PROPERTIES:
:EMAIL: foo@bar.org
:EMAIL+: bar@baz.org
:END:
I would have expected (org-entry-get (point) "EMAIL" t) to evaluate to,
well, at least "foo@bar.org bar@baz.org" (and in some later version of
org-mode maybe to a two-item list, for even easier automated
processing). But I got the following unexpected results, which indicate
that accumulation is not yet supported in this context (well, if it was
ever _intended_…):
(org-entry-get (point) "EMAIL" t) → "foo@bar.org"
(org-entry-get (point) "EMAIL+" t) → "bar@baz.org"
Cheers, and thanks for any help,
Christoph
PS: org-contacts may not be the best tool to use anyway. I like it so
far, but if you know a better alternative that satisfies my
requirements, I'd appreciate hints. My requirements so far are:
* easily capturing information about contacts (addresses, birthdays, but
also arbitrary other information)
* grouping contacts (e.g. by tagging them)
* linking to contacts from other org files
* for easy display and editing (e.g. like org columns)
--
Christoph Lange, http://www.facebook.com/ch.lange, Skype duke4701
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
2011-12-16 14:28 Bugs/features of accumulating property values when used with entries (concretely: in org-contacts) Christoph LANGE
@ 2011-12-26 14:16 ` Bastien
2011-12-26 14:50 ` Sebastien Vauban
0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2011-12-26 14:16 UTC (permalink / raw)
To: Christoph LANGE; +Cc: Orgmode Mailing List
Hi Christoph,
Christoph LANGE <ch.lange@jacobs-university.de> writes:
> noticing the new feature "Property names ending in + accumulate" (as
> described on http://orgmode.org/Changes.html#accumulating-property-keywords
> – BTW, this exposes another issue with the fixed head bar on the new
> homepage, as the actual link target is hidden by the head bar),
This has been fixed.
> I thought I
> could use it in the property drawers of the entries of my org-contacts
> file, and noticed the following problems:
>
> 1. font lock (aka syntax highlighting) does not yet
> recognize :PROPERTY+:
I just fixed this, thanks.
> 2. accumulation doesn't work within the same entry; details follow:
I let Eric answer this -- I'm not familiar enough with accumulating
properties.
Best,
--
Bastien
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
2011-12-26 14:16 ` Bastien
@ 2011-12-26 14:50 ` Sebastien Vauban
2011-12-28 18:17 ` Christoph LANGE
2012-01-21 5:48 ` Samuel Wales
0 siblings, 2 replies; 8+ messages in thread
From: Sebastien Vauban @ 2011-12-26 14:50 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Bastien, Christoph and Eric,
Bastien wrote:
> Christoph LANGE <ch.lange-shsDHVVYhWkzrYMiTdX2twxv4HzkJkzx@public.gmane.org> writes:
>
>> 1. font lock (aka syntax highlighting) does not yet
>> recognize :PROPERTY+:
>
> I just fixed this, thanks.
>
>> 2. accumulation doesn't work within the same entry; details follow:
>>
>> So when I changed the above contact entry to
>>
>> * Contact Name
>> :PROPERTIES:
>> :EMAIL: foo-8kAbNik00GA@public.gmane.org
>> :EMAIL+: bar-mlkRCKUPihU@public.gmane.org
>> :END:
>>
>> I would have expected (org-entry-get (point) "EMAIL" t) to evaluate to, well,
>> at least "foo-8kAbNik00GA@public.gmane.org bar-mlkRCKUPihU@public.gmane.org" (and in some later version of org-mode
>> maybe to a two-item list, for even easier automated processing). But I got
>> the following unexpected results, which indicate that accumulation is not yet
>> supported in this context (well, if it was ever _intended_…):
>
> I let Eric answer this -- I'm not familiar enough with accumulating
> properties.
I'll try to answer that one, under the supervision of the guru...
Well, the following works:
:PROPERTIES:
:var: foo=7
:var+: baz=3
:END:
so your syntax looks correct, but AFAIK the `+' is only supported at this
stage for the `var' property: you can't take any property and add a `+' to
transform it in an accumulative property.
Whether this should be restricted by default or open by default, I have no
opinion at this stage.
I know, however, multivalued properties are sort of already well supported.
See http://orgmode.org/manual/Using-the-property-API.html for more info.
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
2011-12-26 14:50 ` Sebastien Vauban
@ 2011-12-28 18:17 ` Christoph LANGE
2011-12-28 18:47 ` Eric Schulte
2011-12-28 18:54 ` Thomas S. Dye
2012-01-21 5:48 ` Samuel Wales
1 sibling, 2 replies; 8+ messages in thread
From: Christoph LANGE @ 2011-12-28 18:17 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
Hi Seb,
thanks for your help!
2011-12-26 15:50 Sebastien Vauban:
>> Christoph LANGE<ch.lange@jacobs-university.de> writes:
>>> 2. accumulation doesn't work within the same entry; details follow:
>>>
>>> So when I changed the above contact entry to
>>>
>>> * Contact Name
>>> :PROPERTIES:
>>> :EMAIL: foo@bar.org
>>> :EMAIL+: bar@baz.org
>>> :END:
>>>
>>> I would have expected (org-entry-get (point) "EMAIL" t) to evaluate to, well,
>>>
>>> at least "foo@bar.org bar@baz.org" (and in some later version of org-mode
>>>
>>> maybe to a two-item list, for even easier automated processing). But I got
>>>
>>> the following unexpected results, which indicate that accumulation is not yet
>>>
>>> supported in this context (well, if it was ever _intended_…):
>
> … AFAIK the `+' is only supported at this
> stage for the `var' property: you can't take any property and add a `+' to
>
> transform it in an accumulative property.
>
> Whether this should be restricted by default or open by default, I have no
>
> opinion at this stage.
If it is intended to be limited to the "var" property, then at least the
documentation ("Property syntax") needs fixing, as it states generally:
> If you want to add to the value of an existing property, append a
> `+' to the property name.
But thanks a lot for pointing this out:
> I know, however, multivalued properties are sort of already well supported.
>
> See http://orgmode.org/manual/Using-the-property-API.html for more info.
Cheers,
Christoph
--
Christoph Lange, http://www.facebook.com/ch.lange, Skype duke4701
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
2011-12-28 18:17 ` Christoph LANGE
@ 2011-12-28 18:47 ` Eric Schulte
2011-12-29 8:03 ` Sebastien Vauban
2011-12-28 18:54 ` Thomas S. Dye
1 sibling, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2011-12-28 18:47 UTC (permalink / raw)
To: Christoph LANGE; +Cc: Sebastien Vauban, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
Christoph LANGE <ch.lange@jacobs-university.de> writes:
> Hi Seb,
>
> thanks for your help!
>
> 2011-12-26 15:50 Sebastien Vauban:
>>> Christoph LANGE<ch.lange@jacobs-university.de> writes:
>>>> 2. accumulation doesn't work within the same entry; details follow:
>>>>
>>>> So when I changed the above contact entry to
>>>>
>>>> * Contact Name
>>>> :PROPERTIES:
>>>> :EMAIL: foo@bar.org
>>>> :EMAIL+: bar@baz.org
>>>> :END:
>>>>
>>>> I would have expected (org-entry-get (point) "EMAIL" t) to evaluate to, well,
>>>>
>>>> at least "foo@bar.org bar@baz.org" (and in some later version of org-mode
>>>>
>>>> maybe to a two-item list, for even easier automated processing). But I got
>>>>
>>>> the following unexpected results, which indicate that accumulation is not yet
>>>>
>>>> supported in this context (well, if it was ever _intended_…):
See the attached file for an example of working property inheritance.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: acumulate.org --]
[-- Type: text/x-org, Size: 373 bytes --]
#+Property: EMAIL foo@bar.org
* Contact Name
:PROPERTIES:
:EMAIL+: bar@baz.org
:END:
#+begin_src emacs-lisp
(org-entry-get (point) "email" 'inherit)
#+end_src
#+results:
: foo@bar.org bar@baz.org
* Contact Name
:PROPERTIES:
:FOO: 1
:FOO+: 2
:END:
#+begin_src emacs-lisp
(org-entry-get (point) "FOO" 'inherit)
#+end_src
#+results:
: 1
[-- Attachment #3: Type: text/plain, Size: 668 bytes --]
While it is not possible to accumulate two properties from within the
same block, property accumulation does successfully add to the inherited
values of variables.
I don't know if it should be possible to accumulate properties within
the same property block. I would imagine so, in which case the behavior
should be considered a bug.
>>
>> … AFAIK the `+' is only supported at this stage for the `var'
>>property: you can't take any property and add a `+' to
>>
FALSE, the "var" property is in no way special when it comes to property
inheritance. All properties are treated equally.
Best,
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
2011-12-28 18:17 ` Christoph LANGE
2011-12-28 18:47 ` Eric Schulte
@ 2011-12-28 18:54 ` Thomas S. Dye
1 sibling, 0 replies; 8+ messages in thread
From: Thomas S. Dye @ 2011-12-28 18:54 UTC (permalink / raw)
To: Christoph LANGE; +Cc: Sebastien Vauban, emacs-orgmode
Christoph LANGE <ch.lange@jacobs-university.de> writes:
> Hi Seb,
>
> thanks for your help!
>
> 2011-12-26 15:50 Sebastien Vauban:
>>> Christoph LANGE<ch.lange@jacobs-university.de> writes:
>>>> 2. accumulation doesn't work within the same entry; details follow:
>>>>
>>>> So when I changed the above contact entry to
>>>>
>>>> * Contact Name
>>>> :PROPERTIES:
>>>> :EMAIL: foo@bar.org
>>>> :EMAIL+: bar@baz.org
>>>> :END:
>>>>
>>>> I would have expected (org-entry-get (point) "EMAIL" t) to evaluate to, well,
>>>>
>>>> at least "foo@bar.org bar@baz.org" (and in some later version of org-mode
>>>>
>>>> maybe to a two-item list, for even easier automated processing). But I got
>>>>
>>>> the following unexpected results, which indicate that accumulation is not yet
>>>>
>>>> supported in this context (well, if it was ever _intended_…):
>>
>> … AFAIK the `+' is only supported at this
>> stage for the `var' property: you can't take any property and add a `+' to
>>
>> transform it in an accumulative property.
>>
>> Whether this should be restricted by default or open by default, I have no
>>
>> opinion at this stage.
>
> If it is intended to be limited to the "var" property, then at least the
> documentation ("Property syntax") needs fixing, as it states generally:
>
>> If you want to add to the value of an existing property, append a
>> `+' to the property name.
>
> But thanks a lot for pointing this out:
>
>> I know, however, multivalued properties are sort of already well supported.
>>
>> See http://orgmode.org/manual/Using-the-property-API.html for more info.
>
> Cheers,
>
> Christoph
Aloha Christoph and Seb,
The following example shows that the accumulative property isn't
restricted to var/var+.
* Accumulative properties syntax
#+property: not-var 0
:PROPERTIES:
:not-var+: 3
:END:
#+begin_src emacs-lisp
(org-entry-get (point) "not-var" t)
#+end_src
#+results:
: 0 3
To run the example, you'll need to refresh the local setup by C-c
C-c on the #+property: not-var 0 line, then execute the emacs-lisp
source block.
I didn't follow this thread closely, so I don't know if my experience is
useful, but when I briefly studied the accumulative property syntax I
tripped up on two things: 1) I often forgot to renew the local setup so
that changes in #+property: lines would take effect; and 2) I tried to
add more than one instance of a property in a drawer, which isn't
allowed.
hth,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
2011-12-28 18:47 ` Eric Schulte
@ 2011-12-29 8:03 ` Sebastien Vauban
0 siblings, 0 replies; 8+ messages in thread
From: Sebastien Vauban @ 2011-12-29 8:03 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Christophe, Eric and Thomas,
Eric Schulte wrote:
> Christoph LANGE <ch.lange-shsDHVVYhWkzrYMiTdX2twxv4HzkJkzx@public.gmane.org> writes:
>> 2011-12-26 15:50 Sebastien Vauban:
>>>> Christoph LANGE<ch.lange-shsDHVVYhWkzrYMiTdX2twxv4HzkJkzx@public.gmane.org> writes:
>>>>> 2. accumulation doesn't work within the same entry; details follow:
>>>>>
>>>>> So when I changed the above contact entry to
>>>>>
>>>>> * Contact Name
>>>>> :PROPERTIES:
>>>>> :EMAIL: foo-8kAbNik00GA@public.gmane.org
>>>>> :EMAIL+: bar-mlkRCKUPihU@public.gmane.org
>>>>> :END:
>>>>>
>>>>> I would have expected (org-entry-get (point) "EMAIL" t) to evaluate to, well,
>>>>>
>>>>> at least "foo-8kAbNik00GA@public.gmane.org bar-mlkRCKUPihU@public.gmane.org" (and in some later version of org-mode
>>>>>
>>>>> maybe to a two-item list, for even easier automated processing). But I got
>>>>>
>>>>> the following unexpected results, which indicate that accumulation is not yet
>>>>>
>>>>> supported in this context (well, if it was ever _intended_…):
>
> See the attached file for an example of working property inheritance.
> [...]
>
> * Contact Name
> :PROPERTIES:
> :FOO: 1
> :FOO+: 2
> :END:
>
> #+begin_src emacs-lisp
> (org-entry-get (point) "FOO" 'inherit)
> #+end_src
>
> #+results:
> : 1
>
> While it is not possible to accumulate two properties from within the
> same block, property accumulation does successfully add to the inherited
> values of variables.
>
> I don't know if it should be possible to accumulate properties within
> the same property block. I would imagine so, in which case the behavior
> should be considered a bug.
I would say so (that it's a bug), as doing it on a file-basis (within the
"same property block") is well supported:
#+PROPERTY: FOO 1
#+PROPERTY: FOO+ 2
* Contact Name
#+begin_src emacs-lisp
(org-entry-get (point) "FOO" 'inherit)
#+end_src
#+results:
: 1 2
>>> … AFAIK the `+' is only supported at this stage for the `var'
>>> property: you can't take any property and add a `+' to
>
> FALSE, the "var" property is in no way special when it comes to property
> inheritance. All properties are treated equally.
Sorry for insinuating it otherwise. And thanks for the correction!
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
2011-12-26 14:50 ` Sebastien Vauban
2011-12-28 18:17 ` Christoph LANGE
@ 2012-01-21 5:48 ` Samuel Wales
1 sibling, 0 replies; 8+ messages in thread
From: Samuel Wales @ 2012-01-21 5:48 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
FWIW:
It might be the case that we will want to consider the multi-value
property idea and the multi-line property idea together at some point.
(With or without serialization for the latter.)
I think multi-line properties will eventually be needed (in some form)
in any case for things like org-contacts and they provide a simple way
of allowing more data without imposing semantics. In other words,
they are usable even if we don't standardize multi-value semantics.
However, Babel and OP both need multi-value properties.
What should a multi-value property be semantically? Effectively a
vector? Effectively an alist? Both are possibilities.
Outside of Babel and OP's case, do we need a layer of semantics on
properties? Do we want one? Should we set Babel's interpretation of
multi-value properties in stone for the rest of Org?
Also, should there be an interface to multi-value properties other
than accumulation? Give me the 3rd value of property? Give me the
value that matches this string? Set the 3rd value? Set (and replace)
the value that matches?
Is accumulation a substitute for multi-line properties? Or do we want
something nicer for that purpose so that editing and reading are
easier, so that there is no order-dependence of property fields, and
so on?
Just philosophical/design questions.
Samuel
--
The Kafka Pandemic: http://thekafkapandemic.blogspot.com
===
Bigotry against people with serious diseases is still bigotry.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-01-21 5:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16 14:28 Bugs/features of accumulating property values when used with entries (concretely: in org-contacts) Christoph LANGE
2011-12-26 14:16 ` Bastien
2011-12-26 14:50 ` Sebastien Vauban
2011-12-28 18:17 ` Christoph LANGE
2011-12-28 18:47 ` Eric Schulte
2011-12-29 8:03 ` Sebastien Vauban
2011-12-28 18:54 ` Thomas S. Dye
2012-01-21 5:48 ` Samuel Wales
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).