emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Klein <kleinrob@mpip-mainz.mpg.de>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: derived exporter EXPORT_... options
Date: Tue, 26 Nov 2013 18:46:47 +0100	[thread overview]
Message-ID: <5294DE87.8070205@mpip-mainz.mpg.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

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 #2: hans.org --]
[-- Type: application/vnd.lotus-organizer, Size: 78 bytes --]

[-- Attachment #3: ox-hans.el --]
[-- Type: text/x-emacs-lisp, Size: 1475 bytes --]

;; 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	other threads:[~2013-11-26 17:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 17:46 Robert Klein [this message]
2013-11-26 19:49 ` derived exporter EXPORT_... options Nicolas Goaziou
2013-11-27 18:49   ` Robert Klein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5294DE87.8070205@mpip-mainz.mpg.de \
    --to=kleinrob@mpip-mainz.mpg.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).