emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Diego Zamboni <diego@zzamboni.org>
To: moptop99@gmail.com
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: creating new #+KEYWORD: variables
Date: Fri, 9 Nov 2018 10:29:47 +0100	[thread overview]
Message-ID: <CAGY83EftBP2k8J4HSZVQS=ODb-EDQXO8Rxz80ZAbz9=UVLgBKw@mail.gmail.com> (raw)
In-Reply-To: <CAN_Dec-69vG61NK9Jh6zYJNxA4OwYE6oD0d11Rh8+K9T4LPZQA@mail.gmail.com>

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

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 <moptop99@gmail.com> 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!
>
>
>

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

  reply	other threads:[~2018-11-09  9:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09  3:32 creating new #+KEYWORD: variables Matt Price
2018-11-09  9:29 ` Diego Zamboni [this message]
2018-11-10  2:24   ` Matt Price
2018-11-10  7:22 ` Nicolas Goaziou
2018-11-10 16:17   ` Matt Price
2018-11-10 17:11     ` John Kitchin
2018-11-10 18:58       ` Nicolas Goaziou
2018-11-15 12:15         ` Matt Price
2018-11-15 19:51           ` John Kitchin
2018-11-12  9:11   ` Diego Zamboni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGY83EftBP2k8J4HSZVQS=ODb-EDQXO8Rxz80ZAbz9=UVLgBKw@mail.gmail.com' \
    --to=diego@zzamboni.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).