0

I can get a property like this

:PROPERTIES:
:PRJ-DIR: ~/projects
:END:

#+begin_src shell :var x=(org-entry-get (point) "PRJ-DIR") :tangle no
echo Variable x has the value $x
#+end_src

, but can it be written to?;)

1 Answer 1

1

Yes, you can use org-entry-put to do that:

* foo
:PROPERTIES:
:PRJ-DIR:  /tmp
:END:

#+begin_src shell :var x=(org-entry-get (point) "PRJ-DIR") :tangle no
echo Variable x has the value $x
#+end_src

#+RESULTS:
: Variable x has the value ~/projects

#+begin_src elisp
(org-entry-put nil "PRJ-DIR" "/tmp")
#+end_src

#+RESULTS:

The value of PRJ-DIR is changed when you C-c C-c on the last source code block.

Note the similarities between org-entry-get and org-entry-put and do C-h f org-entry-put for more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.