From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: getting access to a self-invented option? Date: Wed, 7 Aug 2019 11:30:19 -0400 Message-ID: References: <875zne4y37.fsf@dell-desktop.WORKGROUP> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000198ba6058f889f5a" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54569) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvNta-0004Qu-4c for emacs-orgmode@gnu.org; Wed, 07 Aug 2019 11:30:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvNtY-0004Tw-U5 for emacs-orgmode@gnu.org; Wed, 07 Aug 2019 11:30:34 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:43459) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hvNtY-0004TL-Nz for emacs-orgmode@gnu.org; Wed, 07 Aug 2019 11:30:32 -0400 Received: by mail-pl1-x644.google.com with SMTP id 4so34348617pld.10 for ; Wed, 07 Aug 2019 08:30:32 -0700 (PDT) In-Reply-To: <875zne4y37.fsf@dell-desktop.WORKGROUP> 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: thibault.marin@gmx.com, Org Mode --000000000000198ba6058f889f5a Content-Type: text/plain; charset="UTF-8" On Sat, Aug 3, 2019 at 1:28 AM Thibault Marin 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... --000000000000198ba6058f889f5a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Aug 3, 2019 at 1:28 AM Thibau= lt Marin <thibault.marin@gmx.c= om> wrote: