From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Re: Subtree export problems Date: Sat, 06 Feb 2016 13:03:09 -1000 Message-ID: References: <87pow93oua.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSBt4-0005Cj-Nx for emacs-orgmode@gnu.org; Sat, 06 Feb 2016 18:03:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSBt1-0007J1-Ec for emacs-orgmode@gnu.org; Sat, 06 Feb 2016 18:03:30 -0500 Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:36903) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1aSBt1-0007Hy-7o for emacs-orgmode@gnu.org; Sat, 06 Feb 2016 18:03:27 -0500 In-reply-to: <87pow93oua.fsf@gmx.us> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: aaronecay@gmail.com, emacs-orgmode@gnu.org Aloha Rasmus, Thanks for your help. Rasmus writes: >> However, when I attempt to export the Second Level Headline >> subtree, I get this pertinent part: >> >> ,------------------------ | \setmarginnotefont{nil} >> `------------------------ > > How could it do anything else? Try to narrow to the subtree and > run your code (see also org-export-as and how subtree export > works; it narrows). You will see that your code returns nil. Interesting, thanks, that makes sense. So, IIUC narrowing puts the "keywords" at the top of the buffer out of scope. I fiddled around a bit and came up with this, which seems to work: ,----------------------------------------- | ** Second Level Headline | :PROPERTIES: | :MARGIN-NOTE-FONT: \itshape\footnotesize | :END: `----------------------------------------- > You are using a hack to use something that you think looks like a > Org keyword, but which is not (in particular it’s unknown to ox > backends). I think you can check org-export-get-environment and > org-export-define-backend to appreciate this. Am I right that what John Kitchin's code (jk-org-kwd) refers to as "keyword" should be called "property" instead? This makes more sense to me in light of the above. Also, I don't understand what you mean by "hack". Should I be wary of using John's functions? I find them handy to mark bits of information that the user (usually me) might want to change. They save the need to rummage around a long document to find where the information is actually used. Should I use other functions instead? > In any case, you can fix the second case by redefining your > function to never return nil. > > (defun jk-org-kwd (KEYWORD) > "get the value of a KEYWORD in the form of #+KEYWORD: value" > (or (cdr (assoc KEYWORD (jk-org-kwds))) "")) This didn't work for me. Subtree export of this one still fails: ,--------------------------------------------------------------- | ** Second Level Headline | #+header: :var marginnote-font=(jk-org-kwd "MARGIN-NOTE-FONT") | #+header: :results raw :exports results | #+begin_src emacs-lisp | (format "\\setmarginnotefont{%s}" marginnote-font) | #+end_src `--------------------------------------------------------------- But subtree export of this one succeeds, albeit with an empty argument to \setmarginnotefont{} because the MARGIN-NOTE-FONT property wasn't in the scope of the subtree: ,--------------------------------------------------------------- | ** Second Level Headline | | #+header: :var marginnote-font=(jk-org-kwd "MARGIN-NOTE-FONT") | #+header: :results raw :exports results | #+begin_src emacs-lisp | (format "\\setmarginnotefont{%s}" marginnote-font) | #+end_src `--------------------------------------------------------------- I couldn't make sense of the backtrace triggered by toggle-debug-on-quit, except to note that it reports org-babel functions. All the best, Tom -- Thomas S. Dye http://www.tsdye.com