From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Subtree export problems Date: Fri, 05 Feb 2016 14:34:15 -1000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRqph-0006S8-4j for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 19:34:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRqpW-0004vf-82 for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 19:34:37 -0500 Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:56304) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1aRqpW-0004us-05 for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 19:34:26 -0500 Received: from [168.105.253.53] (port=65460 helo=cpe-98-155-32-100) by box472.bluehost.com with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1aRqpO-0000Zv-EY for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 17:34:18 -0700 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: Org Mode Aloha all, The following ECM gives me two problems. 1) When I export the full file, all is well, I get this pertinent part: ,------------------------------------------ | \section{Top Level Headline} | \label{sec:orgheadline2} | \setmarginnotefont{\itshape\footnotesize} | | \subsection{Second Level Headline} | \label{sec:orgheadline1} | | \setmarginnotefont{\itshape\footnotesize} `------------------------------------------ However, when I attempt to export the Second Level Headline subtree, I get this pertinent part: ,------------------------ | \setmarginnotefont{nil} `------------------------ 2) Subtree export doesn't work when the Second Level Headline is followed on the next line by the #+header: line (with no empty line or some text between them). I'm left in the *Org Export Dispatcher*, where I can get out with C-g. Org-mode version 8.3.3 (release_8.3.3-449-gd85ff3 @ /Users/dk/.emacs.d/src/org-mode/lisp/) Here is the ECM: #+MARGIN-NOTE-FONT: \itshape\footnotesize #+SELECT_TAGS: export #+EXCLUDE_TAGS: noexport * Top 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 ** 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 * Access keyword values :noexport: #+name: jk-keywords #+header: :results silent #+begin_src emacs-lisp (defun jk-org-kwds () "parse the buffer and return a cons list of (property . value) from lines like: #+PROPERTY: value" (org-element-map (org-element-parse-buffer 'element) '(keyword node-property) (lambda (keyword) (cons (org-element-property :key keyword) (org-element-property :value keyword))))) (defun jk-org-kwd (KEYWORD) "get the value of a KEYWORD in the form of #+KEYWORD: value" (cdr (assoc KEYWORD (jk-org-kwds)))) #+end_src -- Thomas S. Dye http://www.tsdye.com