From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: creating new #+KEYWORD: variables Date: Fri, 9 Nov 2018 10:29:47 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b51db9057a37fe9e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL373-0006mv-U5 for emacs-orgmode@gnu.org; Fri, 09 Nov 2018 04:30:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL372-0004ki-Le for emacs-orgmode@gnu.org; Fri, 09 Nov 2018 04:30:01 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:42347) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gL372-0004i4-8U for emacs-orgmode@gnu.org; Fri, 09 Nov 2018 04:30:00 -0500 Received: by mail-ed1-x529.google.com with SMTP id h21-v6so1192076edq.9 for ; Fri, 09 Nov 2018 01:29: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: moptop99@gmail.com Cc: Org-mode --000000000000b51db9057a37fe9e Content-Type: text/plain; charset="UTF-8" Hi Matt, I found a solution for this, which I am using with my (still in development) setup for exporting from org-mode to LeanPub. I found a function for extracting document global properties at https://emacs.stackexchange.com/a/21715, which you could use to support your first example. After defining =org-global-prop-value=, you could call it like this: (org-global-prop-value "ORG_LMS_COURSE") You can see my setup, including the two functions, here: https://github.com/zzamboni/dot-emacs/blob/master/init.org#publishing-to-leanpub Hope this helps! --Diego On Fri, Nov 9, 2018 at 4:33 AM Matt Price wrote: > I am writing this interface to my university's learning management system: > https://github.com/titaniumbones/Org-Marking-Mode/tree/use-structured-course-def. > I am only using hte exporting system tangentially and I have not defined a > new exporter. However, I would really like to be able to set some variable > values in the header section of hte document, e.g.: > > #+ORG_LMS_COURSE: becomingmodern > > or > > #+PROPERTY: org-lms-course hackinghistory > > I thought the latter might work but (org-entry-get-with-inheritance > "org-lms-course) and (org-entry-get-with-inheritance "ORG_LMS_COURSE") both > return nil. The former is in any case somewhat cleaner-looking but I am > not finding in the manual an instructions on how to add my own keywords. > Is it possible to do this? I can of course always set a buffer-local > variable in a src block, e.g.: > #+begin_src emacs-lisp > (setq org-lms-course 'becomingmodern) > #+end_src. > > but I would like to be able to avoid that where possible. > > Thanks for the help as usual! > > > --000000000000b51db9057a37fe9e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <= /div>
On Fri, Nov 9, 2018 at= 4:33 AM Matt Price <moptop99@gmai= l.com> wrote:
I am writing this interface to my university's lear= ning management system: https://github.= com/titaniumbones/Org-Marking-Mode/tree/use-structured-course-def. I am= only using hte exporting system tangentially and I have not defined a new = exporter. However, I would really like to be able to set some variable valu= es in the header section of hte document, e.g.:

<= /div>
#+ORG_LMS_COURSE: becomingmodern

or
=

#+PROPERTY: org-lms-course hackinghistory

I thought the latter might work but (org-entry-get-with-i= nheritance "org-lms-course) and (org-entry-get-with-inheritance "= ORG_LMS_COURSE") both return nil.=C2=A0 The former is in any case some= what cleaner-looking but I am not finding in the manual an instructions on = how to add my own keywords.=C2=A0 Is it possible to do this? I can of cours= e always set a buffer-local variable in a src block, e.g.:
#+begi= n_src emacs-lisp
(setq org-lms-course 'becomingmodern)
<= div>#+end_src.

but I would like to be able to avo= id that where possible.

Thanks for the help a= s usual!


--000000000000b51db9057a37fe9e--