From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" Subject: Re: getting access to a self-invented option? Date: Wed, 7 Aug 2019 16:58:41 +0000 Message-ID: <9EDE113B-CF70-4246-BF76-BAD8248E6EC3@ucsd.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:49639) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvPHJ-0002ou-Cb for emacs-orgmode@gnu.org; Wed, 07 Aug 2019 12:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvPHI-0007Hg-1F for emacs-orgmode@gnu.org; Wed, 07 Aug 2019 12:59:09 -0400 Received: from mx0b-00395d01.pphosted.com ([148.163.137.170]:63528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hvPHH-00079l-HK for emacs-orgmode@gnu.org; Wed, 07 Aug 2019 12:59:07 -0400 In-Reply-To: Content-Language: en-US Content-ID: <23FF2A18A4FE1F4AA6FB8AD81C892E65@AD.UCSD.EDU> 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: Matt Price Cc: Org Mode Matt, See inline. > On Aug 7, 2019, at 8:36 AM, Matt Price wrote >=20 >=20 > On Sat, Aug 3, 2019 at 1:42 PM Berry, Charles wrote: > Matt, >=20 > This seems like a good use case for a `derived-backend'. >=20 > You can use `org-export-define-derived-backend' with 'hugo as the parent= , define a :menu-entry to add an export action for your custom export to th= e hugo menu using '?m' (say) as the key. >=20 > Then=20 >=20 > C-c C-e H m >=20 > will export using your custom variant of hugo. >=20 > :-) I'm trying to use the variable to determine whether I export with hug= o or with my hugo-reveal franken-backend: https://github.com/titaniumbones/= ox-huveal . So my preference is to evaluate the variable BEFORE export begi= ns.=20 But `org-export-as' doesn't execute until the dispatcher has run and the ch= oice of hugo or hugo-reveal has been made.=20 However, if this determination is permanently set for a particular file (yo= u only export in one manner according to the variable and never alter the v= ariable), then see below. >=20 > I guess another option is to just set a buffer-local variable in the file= , or use #+FILETAGS: and hack htings that way. I'm not sure what the most s= ustainable & org-like method relaly is...=20 >=20 The obvious choice for a local file setting is an OPTION. Since your 'huvea= l backend already has an :options-alist, you can just add another option fo= r `:mwp-export-type' there. If you want access to the value before `org-exp= ort-as' runs, try something like=20 (plist-get (org-export-get-environment) :mwp-export-type)=20 HTH, Chuck=