emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Get the "closest" property value
@ 2022-10-08 22:57 George Mauer
  2022-10-12  9:30 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: George Mauer @ 2022-10-08 22:57 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

If I have a document what looks like the following. What code could I run
for the ??? to get the property value for "workspace-directory" that is
closest in the outline to the location running the code?

* Top Level
  :PROPERTIES:
  :workspace-directory: /tmp
  :END:

   #+begin_src emacs-lisp
     (???) ; /tmp
   #+end_src

** L2 Heading
   :PROPERTIES:
   :workspace-directory: ~/whatever
   :END:

   #+begin_src emacs-lisp
     (???) ; "~/whatever"
   #+end_src

** Another L2 Heading

   #+begin_src emacs-lisp
     (???) ; /tmp
   #+end_src

[-- Attachment #2: Type: text/html, Size: 740 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Get the "closest" property value
  2022-10-08 22:57 Get the "closest" property value George Mauer
@ 2022-10-12  9:30 ` Ihor Radchenko
  2022-10-12 13:31   ` George Mauer
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2022-10-12  9:30 UTC (permalink / raw)
  To: gmauer; +Cc: emacs-orgmode

George Mauer <gmauer@gmail.com> writes:

> If I have a document what looks like the following. What code could I run
> for the ??? to get the property value for "workspace-directory" that is
> closest in the outline to the location running the code?
>
> * Top Level
>   :PROPERTIES:
>   :workspace-directory: /tmp
>   :END:
>
>    #+begin_src emacs-lisp
>      (???) ; /tmp
>    #+end_src

#+begin_src emacs-lisp :var prop-value=(org-entry-get (point) "workspace-directory")
prop-value
#+end_src

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Get the "closest" property value
  2022-10-12  9:30 ` Ihor Radchenko
@ 2022-10-12 13:31   ` George Mauer
  0 siblings, 0 replies; 3+ messages in thread
From: George Mauer @ 2022-10-12 13:31 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

Thanks a lot Ihor, while that doesn't seem to "cascade" upwards, it was
enough of a clue to get me there. What i'm looking for is (org-entry-get
(point) "workspace-directory" 't) with the third "inherit" parameter set

Thanks again! That's going to open up a few new workflows for me.

On Wed, Oct 12, 2022 at 4:29 AM Ihor Radchenko <yantar92@gmail.com> wrote:

> George Mauer <gmauer@gmail.com> writes:
>
> > If I have a document what looks like the following. What code could I run
> > for the ??? to get the property value for "workspace-directory" that is
> > closest in the outline to the location running the code?
> >
> > * Top Level
> >   :PROPERTIES:
> >   :workspace-directory: /tmp
> >   :END:
> >
> >    #+begin_src emacs-lisp
> >      (???) ; /tmp
> >    #+end_src
>
> #+begin_src emacs-lisp :var prop-value=(org-entry-get (point)
> "workspace-directory")
> prop-value
> #+end_src
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 1927 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-12 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08 22:57 Get the "closest" property value George Mauer
2022-10-12  9:30 ` Ihor Radchenko
2022-10-12 13:31   ` George Mauer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).