emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bugs/features of accumulating property values when used with ent


From: Thomas S. Dye
Subject: Re: [O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)
Date: Wed, 28 Dec 2011 08:54:23 -1000

Christoph LANGE <address@hidden> writes:

> Hi Seb,
>
> thanks for your help!
>
> 2011-12-26 15:50 Sebastien Vauban:
>>> Christoph LANGE<address@hidden>  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:    address@hidden
>>>>    :EMAIL+:   address@hidden
>>>>    :END:
>>>>
>>>> I would have expected (org-entry-get (point) "EMAIL" t) to evaluate to, 
>>>> well,
>>>>
>>>> at least "address@hidden address@hidden" (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]