Re: [O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)

2012-01-20 Thread Samuel Wales
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.



Re: [O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)

2011-12-29 Thread Sebastien Vauban
Hi Christophe, Eric and Thomas,

Eric Schulte wrote:
 Christoph LANGE ch.la...@jacobs-university.de writes:
 2011-12-26 15:50 Sebastien Vauban:
 Christoph LANGEch.la...@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:f...@bar.org
:EMAIL+:   b...@baz.org
:END:

 I would have expected (org-entry-get (point) EMAIL t) to evaluate to, 
 well,

 at least f...@bar.org b...@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.
 [...]

 * 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




Re: [O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)

2011-12-28 Thread Christoph LANGE

Hi Seb,

thanks for your help!

2011-12-26 15:50 Sebastien Vauban:

Christoph LANGEch.la...@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:f...@bar.org
   :EMAIL+:   b...@baz.org
   :END:

I would have expected (org-entry-get (point) EMAIL t) to evaluate to, well,

at least f...@bar.org b...@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



Re: [O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)

2011-12-28 Thread Eric Schulte
Christoph LANGE ch.la...@jacobs-university.de writes:

 Hi Seb,

 thanks for your help!

 2011-12-26 15:50 Sebastien Vauban:
 Christoph LANGEch.la...@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:f...@bar.org
:EMAIL+:   b...@baz.org
:END:

 I would have expected (org-entry-get (point) EMAIL t) to evaluate to, 
 well,

 at least f...@bar.org b...@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.
#+Property: EMAIL f...@bar.org

* Contact Name
   :PROPERTIES:
   :EMAIL+:   b...@baz.org
   :END:

#+begin_src emacs-lisp
  (org-entry-get (point) email 'inherit)
#+end_src

#+results:
: f...@bar.org b...@baz.org

* 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.


 … 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/


Re: [O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)

2011-12-28 Thread Thomas S. Dye
Christoph LANGE ch.la...@jacobs-university.de writes:

 Hi Seb,

 thanks for your help!

 2011-12-26 15:50 Sebastien Vauban:
 Christoph LANGEch.la...@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:f...@bar.org
:EMAIL+:   b...@baz.org
:END:

 I would have expected (org-entry-get (point) EMAIL t) to evaluate to, 
 well,

 at least f...@bar.org b...@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



Re: [O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)

2011-12-26 Thread Bastien
Hi Christoph,

Christoph LANGE ch.la...@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



Re: [O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)

2011-12-26 Thread Sebastien Vauban
Hi Bastien, Christoph and Eric,

Bastien wrote:
 Christoph LANGE ch.la...@jacobs-university.de 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:f...@bar.org
   :EMAIL+:   b...@baz.org
   :END:

 I would have expected (org-entry-get (point) EMAIL t) to evaluate to, well,
 at least f...@bar.org b...@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_…):

 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




[O] Bugs/features of accumulating property values when used with entries (concretely: in org-contacts)

2011-12-16 Thread Christoph LANGE

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:f...@bar.org, b...@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:f...@bar.org
  :EMAIL+:   b...@baz.org
  :END:

I would have expected (org-entry-get (point) EMAIL t) to evaluate to, 
well, at least f...@bar.org b...@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)  → f...@bar.org
(org-entry-get (point) EMAIL+ t) → b...@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