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?;)
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityYes, 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.