emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* API for manipulating #+PROPERTY entries?
@ 2019-03-05  6:51 Nik Clayton
  2019-03-05  7:47 ` Nicolas Goaziou
  2019-03-05 18:38 ` John Kitchin
  0 siblings, 2 replies; 3+ messages in thread
From: Nik Clayton @ 2019-03-05  6:51 UTC (permalink / raw)
  To: emacs-orgmode

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

Hoi,

Is there an API for manipulating properties that are set in #+PROPERTY
lines before the first headline of a file (i.e., not in a property drawer)?

I've got some properties that (a) make sense when set for the whole file,
and (b) the file contains multiple first level headings (which isn't going
to change).

Using org-entry-put when point is before the first headline throws a
"Before first headline" error (when when the #+PROPERTY line already exists
and I want to update an existing entry).

N

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

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

* Re: API for manipulating #+PROPERTY entries?
  2019-03-05  6:51 API for manipulating #+PROPERTY entries? Nik Clayton
@ 2019-03-05  7:47 ` Nicolas Goaziou
  2019-03-05 18:38 ` John Kitchin
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2019-03-05  7:47 UTC (permalink / raw)
  To: Nik Clayton; +Cc: emacs-orgmode

Hello,

Nik Clayton <nik@ngo.org.uk> writes:

> Is there an API for manipulating properties that are set in #+PROPERTY
> lines before the first headline of a file (i.e., not in a property
> drawer)?

There is no API for keywords.

> Using org-entry-put when point is before the first headline throws a
> "Before first headline" error (when when the #+PROPERTY line already exists
> and I want to update an existing entry).

`org-entry-put' is for node properties. Those do not necessary have
a keyword equivalent. Reciprocally, some keywords cannot be translated
into node properties.

Regards,

-- 
Nicolas Goaziou

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

* Re: API for manipulating #+PROPERTY entries?
  2019-03-05  6:51 API for manipulating #+PROPERTY entries? Nik Clayton
  2019-03-05  7:47 ` Nicolas Goaziou
@ 2019-03-05 18:38 ` John Kitchin
  1 sibling, 0 replies; 3+ messages in thread
From: John Kitchin @ 2019-03-05 18:38 UTC (permalink / raw)
  To: Nik Clayton; +Cc: emacs-orgmode

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

You might find a function like this one:
https://github.com/jkitchin/techela-emacs/blob/master/techela-grade.el#L149

helpful. There are some variations that do similar things.

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, Mar 5, 2019 at 1:51 AM Nik Clayton <nik@ngo.org.uk> wrote:

> Hoi,
>
> Is there an API for manipulating properties that are set in #+PROPERTY
> lines before the first headline of a file (i.e., not in a property drawer)?
>
> I've got some properties that (a) make sense when set for the whole file,
> and (b) the file contains multiple first level headings (which isn't going
> to change).
>
> Using org-entry-put when point is before the first headline throws a
> "Before first headline" error (when when the #+PROPERTY line already exists
> and I want to update an existing entry).
>
> N
>

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

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

end of thread, other threads:[~2019-03-05 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-05  6:51 API for manipulating #+PROPERTY entries? Nik Clayton
2019-03-05  7:47 ` Nicolas Goaziou
2019-03-05 18:38 ` John Kitchin

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