emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Function to look-up a certain property
@ 2014-11-02 17:04 Alexander Baier
  2014-11-02 17:08 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Baier @ 2014-11-02 17:04 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I am looking for a function that starts at point and walks up the
outline-tree searching for property P. If P is defined the function
returns P's value, otherwise nil. If The top level headline does not
have a property P, the function looks for #+P between the first headline
and bob.

Is there something in org's code base that does this?

Regards,
-- 
Alexander Baier

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

* Re: Function to look-up a certain property
  2014-11-02 17:04 Function to look-up a certain property Alexander Baier
@ 2014-11-02 17:08 ` Nicolas Goaziou
  2014-11-02 19:50   ` Alexander Baier
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2014-11-02 17:08 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Alexander Baier <alexander.baier@mailbox.org> writes:

> I am looking for a function that starts at point and walks up the
> outline-tree searching for property P. If P is defined the function
> returns P's value, otherwise nil. If The top level headline does not
> have a property P, the function looks for #+P between the first headline
> and bob.
>
> Is there something in org's code base that does this?

  (org-entry-get (point) "P" t)

However, it will look for "#+PROPERTY: P val" instead, and it isn't
limited to data before first headline.


Regards,

-- 
Nicolas Goaziou

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

* Re: Function to look-up a certain property
  2014-11-02 17:08 ` Nicolas Goaziou
@ 2014-11-02 19:50   ` Alexander Baier
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Baier @ 2014-11-02 19:50 UTC (permalink / raw)
  To: emacs-orgmode

On 2014-11-02 18:08 Nicolas Goaziou wrote:
> Hello,
>
> Alexander Baier <alexander.baier@mailbox.org> writes:
>
>> I am looking for a function that starts at point and walks up the
>> outline-tree searching for property P. If P is defined the function
>> returns P's value, otherwise nil. If The top level headline does not
>> have a property P, the function looks for #+P between the first headline
>> and bob.
>>
>> Is there something in org's code base that does this?
>
>   (org-entry-get (point) "P" t)
>
> However, it will look for "#+PROPERTY: P val" instead, and it isn't
> limited to data before first headline.

This is perfect, thank you!

Regards,
-- 
Alexander Baier

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

end of thread, other threads:[~2014-11-02 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-02 17:04 Function to look-up a certain property Alexander Baier
2014-11-02 17:08 ` Nicolas Goaziou
2014-11-02 19:50   ` Alexander Baier

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).