emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [ANN] ASCII back-end for new export engine
Date: Fri, 27 Jan 2012 07:00:01 -1000	[thread overview]
Message-ID: <m1ipjxaxny.fsf@tsdye.com> (raw)
In-Reply-To: <87pqec4xua.fsf@gmail.com> (Nicolas Goaziou's message of "Sat, 21 Jan 2012 21:14:37 +0100")

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> I've commited an ASCII back-end for new export engine.
>
> Assuming contrib directory is in your load-path, you just need to
> (require 'org-export) to have both LaTeX and ASCII exporters ready to
> boot.
>
> You can then access to the dispatcher with M-x org-export-dispatch and
> test various configurations from there.
>
> As a reminder, you can ask for a table of contents, list of tables and
> list of listings with, respectively, "#+toc: headlines", "#+toc: tables"
> and "#+toc: listings". Also, drawers[1] are exported transparently by
> default.
>
> Feedback is welcome.
>
>
> Regards,
>
> [1] properties drawers excepted: those are different elements anyway.

Aloha Nicolas,

I haven't been able to export a listing yet.  The following source
exports with the old exporter, but fails with the experimental exporter.

* Listing heading

#+BEGIN_SRC python :results output
print "hello world"
#+END_SRC

With the old exporter I get:
\section{Listing heading}
\label{sec-6}



\begin{verbatim}
print "hello world"
\end{verbatim}

The backtrace with the experimental exporter follows.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  get-file-buffer(nil)
  (org-babel-expand-noweb-references info (get-file-buffer org-current-export-file))
  (if (org-babel-noweb-p (nth 2 info) :export) (org-babel-expand-noweb-references info (get-file-buffer org-current-export-file)) (nth 1 info))
  (setcar (nthcdr 1 info) (if (org-babel-noweb-p ... :export) (org-babel-expand-noweb-references info ...) (nth 1 info)))
  (setf (nth 1 info) (if (org-babel-noweb-p ... :export) (org-babel-expand-noweb-references info ...) (nth 1 info)))
  (progn (when (member ... ...) (org-babel-exp-in-export-file lang ...) (setf hash ...)) (setf (nth 1 info) (if ... ... ...)) (org-babel-exp-do-export info (quote block) hash))
  (if info (progn (when ... ... ...) (setf ... ...) (org-babel-exp-do-export info ... hash)))
  (when info (when (member ... ...) (org-babel-exp-in-export-file lang ...) (setf hash ...)) (setf (nth 1 info) (if ... ... ...)) (org-babel-exp-do-export info (quote block) hash))
  (let* ((info ...) (lang ...) (raw-params ...) hash) (when info (when ... ... ...) (setf ... ...) (org-babel-exp-do-export info ... hash)))
  (save-excursion (goto-char (match-beginning 0)) (let* (... ... ... hash) (when info ... ... ...)))
  org-babel-exp-src-block(#("print \"hello world\"\n" 0 1 (fontified t font-lock-fontified t font-lock-multiline t face py-builtins-face) 1 5 (fontified t font-lock-fontified t font-lock-multiline t face py-builtins-face) 5 6 (fontified t font-lock-fontified t font-lock-multiline t face nil) 6 7 (fontified t font-lock-fontified t font-lock-multiline t face font-lock-string-face) 7 19 (fontified t font-lock-fontified t font-lock-multiline t face font-lock-string-face) 19 20 (fontified t font-lock-fontified t font-lock-multiline t face font-lock-string-face)) #("python" 0 6 (font-lock-multiline t face org-block-begin-line font-lock-fontified t fontified t)) #(":results" 0 8 (font-lock-multiline t face org-block-begin-line font-lock-fontified t fontified t)) #("output" 0 6 (font-lock-multiline t face org-block-begin-line font-lock-fontified t fontified t)))
  apply(org-babel-exp-src-block #("print \"hello world\"\n" 0 1 (fontified t font-lock-fontified t font-lock-multiline t face py-builtins-face) 1 5 (fontified t font-lock-fontified t font-lock-multiline t face py-builtins-face) 5 6 (fontified t font-lock-fontified t font-lock-multiline t face nil) 6 7 (fontified t font-lock-fontified t font-lock-multiline t face font-lock-string-face) 7 19 (fontified t font-lock-fontified t font-lock-multiline t face font-lock-string-face) 19 20 (fontified t font-lock-fontified t font-lock-multiline t face font-lock-string-face)) (#("python" 0 6 (font-lock-multiline t face org-block-begin-line font-lock-fontified t fontified t)) #(":results" 0 8 (font-lock-multiline t face org-block-begin-line font-lock-fontified t fontified t)) #("output" 0 6 (font-lock-multiline t face org-block-begin-line font-lock-fontified t fontified t))))
  (if (memq type org-export-blocks-witheld) "" (apply func body headers))
  (progn (if (memq type org-export-blocks-witheld) "" (apply func body headers)))
  (unwind-protect (progn (if ... "" ...)) (set-match-data save-match-data-internal (quote evaporate)))
  (let ((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data-internal ...)))
  (save-match-data (if (memq type org-export-blocks-witheld) "" (apply func body headers)))
  (let ((replacement ...)) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent ...)))
  (progn (let (...) (when replacement ... ... ... ...)))
  (if (setq func (cadr ...)) (progn (let ... ...)))
  (when (setq func (cadr ...)) (let (...) (when replacement ... ... ... ...)))
  (let* ((match-start ...) (body-start ...) (indentation ...) (inner-re ...) (type ...) (headers ...) (balanced 1) (preserve-indent ...) match-end) (while (and ... ...) (if ... ... ...)) (when (not ...) (error "unbalanced begin/end_%s blocks with %S" type ...)) (setq match-end (copy-marker ...)) (unless preserve-indent (setq body ...)) (unless (memq type types) (setq types ...)) (save-match-data (interblock start match-start)) (when (setq func ...) (let ... ...)) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil))
  (while (re-search-forward beg-re nil t) (let* (... ... ... ... ... ... ... ... match-end) (while ... ...) (when ... ...) (setq match-end ...) (unless preserve-indent ...) (unless ... ...) (save-match-data ...) (when ... ...) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))
  (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[
\n]")) (while (re-search-forward beg-re nil t) (let* ... ... ... ... ... ... ... ... ... ... ...) (setq start ...)))
  (progn (fset (quote interblock) (function* ...)) (goto-char (point-min)) (setq start (point)) (let (...) (while ... ... ...)) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
  (unwind-protect (progn (fset ... ...) (goto-char ...) (setq start ...) (let ... ...) (interblock start ...) (run-hooks ...)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
  (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ... ... ... ... ...) (if --cl-letf-bound-- ... ...)))
  (letf ((... ...)) (goto-char (point-min)) (setq start (point)) (let (...) (while ... ... ...)) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
  (letf* ((... ...)) (goto-char (point-min)) (setq start (point)) (let (...) (while ... ... ...)) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
  (flet ((interblock ... ...)) (goto-char (point-min)) (setq start (point)) (let (...) (while ... ... ...)) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
  (let ((case-fold-search t) (types ...) matched indentation type func start end body headers preserve-indent progress-marker) (flet (...) (goto-char ...) (setq start ...) (let ... ...) (interblock start ...) (run-hooks ...)))
  (save-window-excursion (let (... ... matched indentation type func start end body headers preserve-indent progress-marker) (flet ... ... ... ... ... ...)))
  org-export-blocks-preprocess()
  (progn (org-export-blocks-preprocess) (org-element-parse-buffer nil visible-only))
  (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-regexp$\\)") (insert --buffer-string) (mapc (lambda ... ...) --overlays) (goto-char (point-min)) (progn (org-export-blocks-preprocess) (org-element-parse-buffer nil visible-only)))
  (progn (let (...) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-regexp$\\)") (insert --buffer-string) (mapc ... --overlays) (goto-char ...) (progn ... ...)))
  (unwind-protect (progn (let ... ... ... ... ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ...) (and ... ...)))
  (with-current-buffer temp-buffer (unwind-protect (progn ...) (and ... ...)))
  (let ((temp-buffer ...)) (with-current-buffer temp-buffer (unwind-protect ... ...)))
  (with-temp-buffer (let (...) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-regexp$\\)") (insert --buffer-string) (mapc ... --overlays) (goto-char ...) (progn ... ...)))
  (let ((--original-buffer #<buffer latex-export.org>) (--offset 0) (--buffer-string #("#+TITLE:     latex-export.org\n#+AUTHOR:    Thomas Dye\n#+EMAIL:     tsd@tsdye.com\n#+DATE:      2012-01-21 Sat\n#+DESCRIPTION:\n#+KEYWORDS:\n#+LANGUAGE:  en\n#+OPTIONS:   H:3 num:1 toc:nil \\n:nil @:t ::t |:t ^:t -:t f:t *:t <:t\n#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc\n#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js\n#+EXPORT_SELECT_TAGS: export\n#+EXPORT_EXCLUDE_TAGS: noexport\n#+LINK_UP:   \n#+LINK_HOME: \n#+XSLT:\n#+LaTeX_HEADER: \\usepackage{paralist}\n\n#+BEGIN_abstract\nThis is an abstract.\n#+END_abstract\n\n#+toc: headlines\n#+toc: tables\n#+toc: figures\n\n* First heading\n  :PROPERTIES:\n  :ID:       A0EF6F8D-DC06-4AA7-8090-401B90BDACF0\n  :END:\n\nNote the use of =#+toc: headlines= together with =#+OPTIONS: toc:nil=\nto produce a table of contents without a =\\vspace*= following.\n\nIn Section [[First heading]] we will set up Section [[Table heading]].\n\n** First sub heading\nThis is some text after the subheading.\n\n* Table heading\nThis is a test table.  Note that the new exporter faithfully\nreproduces the behavior of the old exporter.  Look into how it might\nbe modified to produce tables with the booktabs package. \n\n#+CAPTION: A test table\n#+LABEL: tab:test\n| One | Two |\n|-----+-----|\n| 1   | 2   |\n\n* Figure heading\n\nThis is an example of adding a figure.\n\n#+CAPTION[An example photograph]: An example photograph.\n#+NAME: fig:photo\n[[file:~/Public/projects/308/photo/IMG_0072_cropped.jpg]]\n\n* Reference heading\n\nThis is a reference \n\n* List heading\nThis is an in-paragraph enumerated list:\n  #+attr_latex: inparaenum (i)\n  - one;\n  - two; and\n  - three.\n\nThis should be a sentence in a new paragraph.\n* Listing heading\nThis is a listing.\n\n#+BEGIN_SRC python :results output\nprint \"hello world\"\n#+END_SRC\n\n#+RESULTS:\n: hello world\n\n" 0 8 ... 8 13 ... 13 29 ... 29 30 ... 30 39 ... 39 43 ... 43 53 ... 53 54 ... 54 62 ... 62 67 ... 67 80 ... 80 81 ... 81 88 ... 88 94 ... 94 108 ... 108 109 ... 109 123 ... 123 124 ... 124 135 ... 135 136 ... 136 151 ... 151 152 ... 152 221 ... 221 222 ... 222 294 ... 294 295 ... 295 364 ... 364 393 ... 393 394 ... 394 395 ... 395 423 ... 423 424 ... 424 455 ... 455 456 ... 456 469 ... 469 470 ... 470 483 ... 483 484 ... 484 491 ... 491 492 ... 492 529 ... 529 530 ... 530 531 ... 531 547 ... 547 548 ... 548 568 ... 568 569 ... 569 583 ... 583 584 ... 584 585 ... 585 601 ... 601 602 ... 602 615 ... 615 616 ... 616 630 ... 630 631 ... 631 632 ... 632 634 ... 634 647 ... 647 648 ... 648 662 ... 662 665 ... 665 669 ... 669 676 ... 676 712 ... 712 713 ... 713 720 ... 720 737 ... 737 738 ... 738 756 ... 756 757 ... 757 770 ... 770 771 ... 771 791 ... 791 832 ... 832 833 ... 833 843 ... 843 844 ... 844 867 ... 867 868 ... 868 869 ... 869 881 ... 881 882 ... 882 883 ... 883 884 ... 884 908 ... 908 909 ... 909 910 ... 910 922 ... 922 923 ... 923 924 ... 924 925 ... 925 928 ... 928 929 ... 929 931 ... 931 948 ... 948 990 ... 990 992 ... 992 1005 ... 1005 1067 ... 1067 1279 ... 1279 1280 ... 1280 1282 ... 1282 1296 ... 1296 1338 ... 1338 1394 ... 1394 1395 ... 1395 1412 ... 1412 1413 ... 1413 1414 ... 1414 1415 ... 1415 1467 ... 1467 1468 ... 1468 1469 ... 1469 1470 ... 1470 1472 ... 1472 1474 ... 1474 1491 ... 1491 1515 ... 1515 1517 ... 1517 1529 ... 1529 1530 ... 1530 1571 ... 1571 1601 ... 1601 1682 ... 1682 1684 ... 1684 1699 ... 1699 1700 ... 1700 1719 ... 1719 1720 ... 1720 1754 ... 1754 1755 ... 1755 1756 ... 1756 1760 ... 1760 1761 ... 1761 1762 ... 1762 1774 ... 1774 1775 ... 1775 1784 ... 1784 1785 ... 1785 1786 ... 1786 1796 ... 1796 1797 ... 1797 1799 ... 1799 1811 ... 1811 1812 ...)) (--overlays ...)) (with-temp-buffer (let ... ... ... ... ... ...)))
  (org-export-with-current-buffer-copy (org-export-blocks-preprocess) (org-element-parse-buffer nil visible-only))
  (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-export-with-current-buffer-copy (org-export-blocks-preprocess) (org-element-parse-buffer nil visible-only)) backend)
  (progn (when subtreep (let ... ...)) (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-export-with-current-buffer-copy ... ...) backend))
  (let* ((info ...) (raw-data ...)) (setq info (org-combine-plists info ...)) (let* (... ... ...) (when org-export-copy-to-kill-ring ...) output))
  (save-restriction (when (org-region-active-p) (narrow-to-region ... ...) (goto-char ...)) (when (and subtreep ...) (org-with-limited-levels ...)) (let* (... ...) (setq info ...) (let* ... ... output)))
  (save-excursion (save-restriction (when ... ... ...) (when ... ...) (let* ... ... ...)))
  org-export-as(e-latex nil nil nil nil)
  (let ((out ...) (buffer ...)) (with-current-buffer buffer (erase-buffer) (insert out) (goto-char ...)) buffer)
  org-export-to-buffer(e-latex "*Org E-LaTeX Export*" nil nil nil)
  (let ((outbuf ...)) (with-current-buffer outbuf (latex-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))
  (cond ((member* --cl-var-- ...) (let ... ... ...)) ((member* --cl-var-- ...) (org-e-ascii-export-to-ascii ... ... ... ...)) ((eql --cl-var-- ...) (let ... ... ...)) ((eql --cl-var-- ...) (org-e-latex-export-to-latex ... ... ...)) ((eql --cl-var-- ...) (org-e-latex-export-to-pdf ... ... ...)) ((eql --cl-var-- ...) (org-open-file ...)) (t (error "No command associated with key %s" ...)))
  (let ((--cl-var-- ...)) (cond (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (t ...)))
  (case (if (< raw-key 27) (+ raw-key 96) raw-key) ((65 78 85) (let ... ... ...)) ((97 110 117) (org-e-ascii-export-to-ascii ... ... ... ...)) (76 (let ... ... ...)) (108 (org-e-latex-export-to-latex ... ... ...)) (112 (org-e-latex-export-to-pdf ... ... ...)) (100 (org-open-file ...)) (t (error "No command associated with key %s" ...)))
  (let* ((input ...) (raw-key ...) (scope ...)) (case (if ... ... raw-key) (... ...) (... ...) (76 ...) (108 ...) (112 ...) (100 ...) (t ...)))
  org-export-dispatch()
  call-interactively(org-export-dispatch t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com

  parent reply	other threads:[~2012-01-27 17:00 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-21 20:14 [ANN] ASCII back-end for new export engine Nicolas Goaziou
2012-01-21 20:33 ` Samuel Wales
2012-01-21 20:36   ` Samuel Wales
2012-01-21 23:04   ` Nicolas Goaziou
2012-01-22  1:28     ` Samuel Wales
2012-01-22  9:43       ` Nicolas Goaziou
2012-01-22 16:36         ` Samuel Wales
2012-01-28 10:28           ` Samuel Wales
2012-01-28 13:55             ` Nicolas Goaziou
2012-01-28 20:50               ` Samuel Wales
2012-01-28 21:32                 ` Nicolas Goaziou
2012-01-28 22:15                   ` Samuel Wales
2012-01-28 23:58                     ` Nicolas Goaziou
2012-01-22 14:43 ` Martyn Jago
2012-01-22 15:45   ` Nicolas Goaziou
2012-01-22 16:43     ` Martyn Jago
2012-01-23 20:05     ` Eric Schulte
2012-01-23 20:49       ` Nicolas Goaziou
2012-01-22 16:35 ` Thomas S. Dye
2012-01-22 17:10   ` Nicolas Goaziou
2012-01-23  5:58     ` Thomas S. Dye
2012-01-25 17:41       ` Nicolas Goaziou
2012-01-26  6:49         ` Tweaking the export (was: Re: [ANN] ASCII back-end for new export engine) Christian Wittern
2012-01-27 13:06           ` Tweaking the export Nicolas Goaziou
2012-01-27 13:47             ` Jambunathan K
2012-01-27 14:03               ` Sebastien Vauban
2012-01-28  2:33                 ` Christian Wittern
2012-01-28  2:21               ` Christian Wittern
2012-01-28  4:03                 ` Eric Abrahamsen
2012-01-29  9:07                 ` Nicolas Goaziou
2012-02-04  6:21                   ` Christian Wittern
2012-02-17 20:06                     ` Nicolas Goaziou
2012-01-26  8:44         ` [ANN] ASCII back-end for new export engine Eric S Fraga
2012-01-26 13:59         ` Thomas S. Dye
2012-01-26 15:28           ` Nicolas Goaziou
2012-01-26 17:32             ` Thomas S. Dye
2012-01-26 18:31               ` Nicolas Goaziou
2012-01-26 19:00                 ` Achim Gratz
2012-01-27 12:58                   ` Nicolas Goaziou
2012-01-27 13:06                     ` Rick Frankel
2012-01-27 13:56                       ` Nicolas Goaziou
2012-01-27 16:31                         ` Achim Gratz
2012-02-01  6:44                         ` Achim Gratz
2012-01-26 20:10                 ` Thomas S. Dye
2012-02-01  8:36                 ` Jambunathan K
2012-01-27  8:10             ` Jambunathan K
2012-01-27 13:59               ` Nicolas Goaziou
2012-01-27 15:50                 ` Bastien
2012-01-27 16:29                 ` Thomas S. Dye
2012-01-27 17:04                 ` Jambunathan K
2012-01-27 18:13                   ` Thomas S. Dye
2012-01-27 18:31                     ` Jambunathan K
2012-01-27 19:21                       ` Achim Gratz
2012-01-27 19:48                         ` Thomas S. Dye
2012-01-27 20:10                           ` Nick Dokos
2012-01-27 20:11                       ` Thomas S. Dye
2012-01-23 21:33     ` Thomas S. Dye
2012-01-22 19:21 ` Thomas S. Dye
2012-01-22 20:50   ` Nicolas Goaziou
2012-01-23  6:14     ` Thomas S. Dye
2012-01-23  7:03       ` Nicolas Goaziou
2012-01-23 15:53         ` Thomas S. Dye
2012-01-23 18:18           ` Nicolas Goaziou
2012-01-23 21:27             ` Thomas S. Dye
2012-01-23 12:20     ` Andreas Leha
2012-01-27 17:00 ` Thomas S. Dye [this message]
2012-02-03 22:57   ` Nicolas Goaziou
2012-02-04 16:42     ` Thomas S. Dye
2012-02-05  2:19 ` Thomas S. Dye
2012-02-05  2:58 ` Thomas S. Dye
2012-02-05 14:09   ` Nicolas Goaziou
2012-02-06  1:34 ` Thomas S. Dye
2012-02-06 14:29   ` Nicolas Goaziou
2012-02-06 16:39     ` Thomas S. Dye
2012-02-06 17:05       ` Nicolas Goaziou
2012-02-06 18:46         ` Thomas S. Dye
2012-02-07  7:27           ` Nicolas Goaziou
2012-02-07  8:57             ` Document date and last updated date Sebastien Vauban
2012-02-07 17:45               ` Nicolas Goaziou
2012-02-07 22:29                 ` Sebastien Vauban
2012-02-07  6:22         ` [ANN] ASCII back-end for new export engine Thomas S. Dye
2012-02-07  7:07           ` Nicolas Goaziou
2012-02-07  9:00             ` Sebastien Vauban
2012-02-07 17:49               ` Nicolas Goaziou
2012-02-08  7:11                 ` Jambunathan K
2012-02-07 15:45             ` Thomas S. Dye

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=m1ipjxaxny.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /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).