From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: API for manipulating #+PROPERTY entries? Date: Tue, 5 Mar 2019 13:38:47 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a5e2de05835d2fe1" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Ey7-0002eL-R2 for emacs-orgmode@gnu.org; Tue, 05 Mar 2019 13:39:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1Ey6-0004Kv-Lv for emacs-orgmode@gnu.org; Tue, 05 Mar 2019 13:39:11 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:36148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1Ey4-0003eU-SA for emacs-orgmode@gnu.org; Tue, 05 Mar 2019 13:39:10 -0500 Received: by mail-wr1-x42c.google.com with SMTP id o17so10627554wrw.3 for ; Tue, 05 Mar 2019 10:38:59 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nik Clayton Cc: emacs-orgmode --000000000000a5e2de05835d2fe1 Content-Type: text/plain; charset="UTF-8" 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 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 > --000000000000a5e2de05835d2fe1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You might find a function like this one:= =C2=A0https://github.com/jkitchin/techela-emacs/blob/master/te= chela-grade.el#L149=C2=A0

helpful. There are some variations that do similar things.

John

-----------------------= ------------
Professor John Kitchin=C2=A0
Doherty Hall A207F
Depar= tment of Chemical Engineering
Carnegie Mellon University
Pittsburgh, = PA 15213
412-268-7803


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 fir= st headline of a file (i.e., not in a property drawer)?

I've got some properties that (a) make sense when set for the who= le 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&quo= t; error (when when the #+PROPERTY line already exists and I want to update= an existing entry).

N
--000000000000a5e2de05835d2fe1--