Hi,

I'm trying to user EXPORT_... options in subtree export in a derived
exporter.

Using attached ox-hans exporter and the org file hans.org,
I only get "Wurst" as :hans-option, never "Bratwurst", as given under
the heading "Two", using both options with subtree export (C-c C-e C-d j
h  and C-c C-e C-d j H.

Do I misunderstand subtree export?

Thanks for any help.

Best regards
Robert



-- 
Robert Klein
UNIX Operations, Max Planck-Institut für Polymerforschung
Ackermannweg 10
55218 Mainz

Attachment: hans.org
Description: Lotus Organizer

;; hans example derived exporter
(require 'ox-html)

(org-export-define-derived-backend
 'hans 'html
 :menu-entry
 '(?j "Export w/ HTML-derived hans exporter"
      ((?h "To temporary buffer (wurst)" org-hans-export-as-wurst)
       (?H "To temporary buffer (bratwurst)" org-hans-export-as-bratwurst)))
 :options-alist
 '((:hans-option "HANS_OPTION" nil nil t)))


(defun org-hans-export-as-wurst (&optional a subtreep v b ext-plist)
  (interactive)
  (let* ((doc-env (org-export-get-environment 'hans subtreep ext-plist)))
    (message "HANS-OPTION: %s"
             (org-element-interpret-data
              (plist-get doc-env :hans-option)))
    (message "EXPORT-HANS-OPTION: %s"
             (org-element-interpret-data
              (plist-get doc-env :export-hans-option)))))


(defun org-hans-export-as-bratwurst (&optional a subtreep v b ext-plist)
  (interactive)
  (save-excursion
    (save-restriction
      (when subtreep
        (org-narrow-to-subtree)
        (goto-char (point-min))
        (forward-line)
        (narrow-to-region (point) (point-max)))
        (let* ((doc-env (org-export-get-environment 'hans subtreep ext-plist)))
          (message "HANS-OPTION: %s"
                   (org-element-interpret-data
                    (plist-get doc-env :hans-option)))
          (message "EXPORT-HANS-OPTION: %s"
                   (org-element-interpret-data
                    (plist-get doc-env :export-hans-option)))))))

        

(provide 'ox-hans)

Reply via email to