From: "Valentin Wüstholz" <wuestholz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] Export to ascii fails
Date: Fri, 14 Jan 2011 13:36:10 +0100 [thread overview]
Message-ID: <AANLkTinQHbcE3_qBFJaUcyr+p250FBSDBfcs3FBLy4B5@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 771 bytes --]
Hi,
I ran into a bug with the ascii export. Exporting the attached org
file to ascii fails (see the attached backtrace). The failure seems to
be related to the 'H:10' option.
I had a look at the code and the following patch seemed to alleviate the issue:
------------------------------ lisp/org-ascii.el ------------------------------
index 99facb1..25cdf12 100644
@@ -637 +637 @@ publishing directory."
- (let (char (n (- level umax 1)) (ind 0))
+ (let (char (n (- level 1)) (ind 0))
@@ -655 +655 @@ publishing directory."
- (setq char (nth (- umax level) (reverse org-export-ascii-underline)))
+ (setq char (nth n (reverse org-export-ascii-underline)))
This will however still fail, if (length org-export-ascii-underline) <= n.
Best regards,
Valentin
[-- Attachment #2: bug.org --]
[-- Type: application/octet-stream, Size: 46 bytes --]
#+OPTIONS: H:10
Title
* A
* B
[-- Attachment #3: backtrace --]
[-- Type: application/octet-stream, Size: 5474 bytes --]
Debugger entered--Lisp error: (wrong-type-argument integerp nil)
make-string(4 nil)
(insert title "\n" (make-string (string-width title) char) "\n")
(if (> level umax) (progn (insert ... ... " " title "\n") (catch ... ...) (setq org-ascii-current-indentation ...)) (if (or ... ...) (insert "\n")) (setq char (nth ... ...)) (unless org-export-with-tags (if ... ...)) (if org-export-with-section-numbers (setq title ...)) (insert title "\n" (make-string ... char) "\n") (setq org-ascii-current-indentation (quote ...)))
(let (char (n ...) (ind 0)) (if (> level umax) (progn ... ... ...) (if ... ...) (setq char ...) (unless org-export-with-tags ...) (if org-export-with-section-numbers ...) (insert title "\n" ... "\n") (setq org-ascii-current-indentation ...)))
org-ascii-level-start(1 #("A " 0 1 (target "sec-1" fontified t)) 10 ("" #("* B " 0 1 (fontified t target "sec-2") 3 4 (fontified t target "sec-2")) ""))
(cond ((string-match "^\\(\\*+\\)[ ]+\\(.*\\)" line) (setq first-heading-pos ...) (setq level ... txt ...) (org-ascii-level-start level txt umax lines)) ((and org-export-with-tables ...) (if ... ...) (setq table-buffer ...) (when ... ... ...)) (t (if ... ...) (setq line ...) (if ... ...) (if ... ... ...) (insert line "\n")))
(while (setq line (pop lines)) (when (and link-buffer ...) (org-export-ascii-push-links ...) (setq link-buffer nil)) (setq wrap nil) (setq line (org-html-expand-for-ascii line)) (while (string-match org-bracket-link-analytic-regexp++ line) (setq path ... link ... type ... desc0 ... desc ...) (if ... ... ... ... ...)) (when custom-times (setq line ...)) (cond (... ... ... ...) (... ... ... ...) (t ... ... ... ... ...)))
(let* ((opt-plist ...) (region-p ...) (rbeg ...) (rend ...) (subtree-p ...) (level-offset ...) (opt-plist ...) (org-current-export-dir ...) (org-current-export-file buffer-file-name) (custom-times org-display-custom-times) (org-ascii-current-indentation ...) (level 0) line txt (umax nil) (umax-toc nil) (case-fold-search nil) (bfname ...) (filename ...) (filename ...) (buffer ...) (org-levels-open ...) (odd org-odd-levels-only) (date ...) (author ...) (title ...) (email ...) (language ...) (quote-re0 ...) (todo nil) (lang-words nil) (region ...) (lines ...) thetoc have-headings first-heading-pos table-open table-buffer link-buffer link type path desc desc0 rpl wrap fnc) (let (...) (org-unmodified ...)) (setq org-min-level (org-get-min-level lines level-offset)) (setq org-last-level org-min-level) (org-init-section-numbers) (setq lang-words (or ... ...)) (set-buffer buffer) (erase-buffer) (fundamental-mode) (org-install-letbind) (mapc (lambda ... ...) org-export-plist-vars) (org-set-local (quote org-odd-levels-only) odd) (setq umax (if arg ... org-export-headline-levels)) (setq umax-toc (if ... ... umax)) (unless body-only (when ... ... ...) (if ... ...) (cond ... ... ...) (if ... ...) (unless ... ...)) (if (and org-export-with-toc ...) (progn ... ... ... ...)) (org-init-section-numbers) (while (setq line ...) (when ... ... ...) (setq wrap nil) (setq line ...) (while ... ... ...) (when custom-times ...) (cond ... ... ...)) (org-export-ascii-push-links (nreverse link-buffer)) (normal-mode) (when thetoc (goto-char ...) (if ... ... ...) (mapc ... thetoc) (or ... ...)) (goto-char (point-min)) (let (beg end) (while ... ... ... ... ...)) (let (beg end) (goto-char ...) (while ... ... ... ... ...) (goto-char ...) (while ... ... ... ...)) (run-hooks (quote org-export-ascii-final-hook)) (or to-buffer (save-buffer)) (goto-char (point-min)) (or (org-export-push-to-kill-ring "ASCII") (message "Exporting... done")) (if (eq to-buffer ...) (prog1 ... ...) (current-buffer)))
org-export-as-ascii(nil)
call-interactively(org-export-as-ascii)
(if (and bg (nth 2 ass) (not ...) (not ...)) (let (...) (set-process-sentinel p ...) (message "Background process \"%s\": started" p)) (if subtree-p (progn ... ...)) (call-interactively (nth 1 ass)) (when (and bpos ...) (let ... ... ... ... ...)))
(let* ((bg ...) subtree-p (help "[t] insert the export option template\n[v] limit export to visible part of outline tree\n[1] only export the current subtree\n[SPC] publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME prop)\n\n[a/n/u] export as ASCII/Latin-1/UTF-8 [A/N/U] to temporary buffer\n\n[h] export as HTML [H] to temporary buffer [R] export region\n[b] export as HTML and open in browser\n\n[l] export as LaTeX [L] to temporary buffer\n[p] export as LaTeX and process to PDF [d] ... and open PDF file\n\n[D] export as DocBook [V] export as DocBook, process to PDF, and open\n\n[j] export as TaskJuggler [J] ... and open\n\n[m] export as Freemind mind map\n[x] export as XOXO\n[g] export using Wes Hardaker's generic exporter\n\n[i] export current file as iCalendar file\n[I] export all agenda files as iCalendar files [c] ...as one combined file\n\n[F] publish current file [P] publish current project\n[X] publish a project... [E] publish every projects") (cmds ...) r1 r2 ass (cpos ...) (cbuf ...) bpos) (save-excursion (save-window-excursion ... ... ... ... ... ... ...)) (and bpos (goto-char bpos)) (setq r2 (if ... ... r1)) (unless (setq ass ...) (error "No command associated with key %c" r1)) (if (and bg ... ... ...) (let ... ... ...) (if subtree-p ...) (call-interactively ...) (when ... ...)))
org-export(nil)
call-interactively(org-export nil nil)
[-- Attachment #4: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next reply other threads:[~2011-01-14 12:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 12:36 Valentin Wüstholz [this message]
2011-01-19 9:57 ` [BUG] Export to ascii fails Carsten Dominik
2011-01-19 12:02 ` Valentin Wüstholz
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=AANLkTinQHbcE3_qBFJaUcyr+p250FBSDBfcs3FBLy4B5@mail.gmail.com \
--to=wuestholz@gmail.com \
--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).