On 2025-10-13 Mon 00:02, Rudolf Adamkovič <[email protected]> wrote:
> Ihor Radchenko <[email protected]> writes:
>
>> We have a non-syntax convention that EMAIL: ... EMAIL+: ...
>> properties are concatenated (according to `org-property-separators')
>
> +1 Semantically, this is the standard way, supported directly by the Org
> APIs. It is what an Org user would expect to see used in the key-value
> context of Org properties. Put simply, KEY and KEY+ is the standard
> idiom, as seen everywhere in Org. BTW, I have been using this idiom for
> invoicing, now for many years, and it works great in user code as well.
Interesting, I wasn’t aware that this is a use case for the EMAIL+
syntax. The documentation says that it can be used to add values to
those inherited from ancester nodes [1], but that’s not the situation I
was talking about. However, I just tested it with the entry below and
it works as you say.
* Test
:PROPERTIES:
:N: Test
:PHONE: +12345 (WORK)
:PHONE+: +23456 (CELL)
:END:
`org-entry-properties' returns this alist:
(("CATEGORY" . "contacts")
("PHONE" . "+49 711 685-84873 (WORK) +49 160 97026843 (CELL)")
("N" . "Test")
("BLOCKED" . "")
("FILE" . "/home/.../contacts.org")
("PRIORITY" . "B")
("ITEM" . "Test"))
Not ideal because white space is an ambiguous separator, but I suppose
this can be configures via `org-property-separators'. We could argue
about whether this is the best solution for multiple-valued properties
(I have doubts), but this wouldn’t be productive.
However, I’d still argue that there is an issue because
`org-entry-properties' returns an arbitrary and undocumented subset of
the properties when a property has multiple instances. Given the syntax
above, this case should not arise, but I think it still be more
consistent and correct to simply return everything. Assoc and friends
will ignore the duplicates, it should therefore not cause harm (as
explained in my last message).
Plus, I think there is a documentation bug, since this particular use of
the PHONE+ syntax is not explained in the documentation. Let me know if
you want me to create a patch for that.
Titus
[1] https://orgmode.org/manual/Property-Syntax.html