John Kitchin <[email protected]> writes:
> Where did you add that?
>
> John
>
> -----------------------------------
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
> On Fri, May 6, 2022 at 11:40 AM Tyler Grinn <[email protected]>
> wrote:
>
> Thanks for the advice. I've added the caret symbol
> (:EXPORT_FILE_NAME^:
> assignment-1) to mean 'concatenate' as opposed to + for 'joining'.
> If
> this is something the community would want I will clean it up and
> send
> in a patch.
I modified 'org--property-local-values' to return a cons list with the
car being the value of the property and the cdr being either 'concat or
'join.
;; Find additional values.
(let* ((property-extension (org-re-property
(concat (regexp-quote property)
"[+^]")
t t)))
(while (re-search-forward property-extension end t)
(push (cons (match-string-no-properties 3)
(if (string-match-p "\\^\\'"
(match-string-no-properties 2))
'concat
'join))
value)))
I used a single re-search in order to maintain the ordering of
properties, ie:
:PROP: he
:PROP^: llo
:PROP+: world
produces 'hello world'
I then updated both 'org-entry-get' and
'org-entry-get-with-inheritance' to 'cl-reduce' the cons list into the
final string value.