From: Matt Price <moptop99@gmail.com>
To: thibault.marin@gmx.com, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: getting access to a self-invented option?
Date: Wed, 7 Aug 2019 11:30:19 -0400 [thread overview]
Message-ID: <CAN_Dec9U8gQ37nH14xWaVayhZ6aH5y9aGDVA51mVeHPDth063Q@mail.gmail.com> (raw)
In-Reply-To: <875zne4y37.fsf@dell-desktop.WORKGROUP>
[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]
On Sat, Aug 3, 2019 at 1:28 AM Thibault Marin <thibault.marin@gmx.com>
wrote:
> Hi,
>
> I am not sure where you are trying to get to the value (in the
> publishing function?), but I use something like the following to handle
> custom keywords:
>
> ,----
> | #+MWP_EXPORT_TYPE: slides
> |
> | #+name: elt
> | #+begin_src emacs-lisp :results silent :exports none
> | (let ((tree (org-element-parse-buffer)))
> | (org-element-map
> | tree 'keyword
> | (lambda (r)
> | (let ((key (org-element-property :key r))
> | (value (org-element-property :value r)))
> | (when (string= key "MWP_EXPORT_TYPE")
> | value))) ;; Return the keyword value
> | nil t))
> | #+end_src
> `----
>
> If you have access to the parsed tree or the buffer filename, you may be
> able to use this or something similar (maybe wrapped in a function).
>
> Hope it helps.
>
>
I think this is a pretty good option -- I would use this in an interactive
function that is called from the org buffer, so I should be able to parse
it. I keep all my lectures in a single file, and same for all my other
course materials, so I guess I will have to do some testing and see how
long the parse operation takes...
[-- Attachment #2: Type: text/html, Size: 1705 bytes --]
next prev parent reply other threads:[~2019-08-07 15:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 16:10 getting access to a self-invented option? Matt Price
2019-08-02 20:00 ` Tim Cross
2019-08-07 15:39 ` Matt Price
2019-08-03 5:28 ` Thibault Marin
2019-08-07 15:30 ` Matt Price [this message]
2019-08-03 17:42 ` Berry, Charles
2019-08-07 15:36 ` Matt Price
2019-08-07 16:58 ` Berry, Charles
2019-08-07 17:21 ` Berry, Charles
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=CAN_Dec9U8gQ37nH14xWaVayhZ6aH5y9aGDVA51mVeHPDth063Q@mail.gmail.com \
--to=moptop99@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=thibault.marin@gmx.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).