From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Williams Subject: Re: LaTeX export crashes Date: Mon, 17 Oct 2011 16:22:15 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFudX-0005cp-T7 for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 17:22:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFudV-0006iS-C8 for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 17:22:19 -0400 Received: from mail-yx0-f172.google.com ([209.85.213.172]:36455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFudV-0006iG-7a for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 17:22:17 -0400 Received: by yxj19 with SMTP id 19so4210805yxj.31 for ; Mon, 17 Oct 2011 14:22:15 -0700 (PDT) In-Reply-To: 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: emacs-orgmode@gnu.org On Thu, Oct 13, 2011 at 4:48 PM, Ken Williams wrote: > Hi, the following document makes a LaTeX export (C-c C-e d) crash with > "Args out of range: "", -1, 0".=A0 After that, exporting (to any format) > dies with the same error. > [snip] Then Sebastien Vauban wrote: > Works for me, with Org-mode version 7.7 (release_7.7.381.ge8629.dirty). Here's a full stack trace, does this make it any more evident what's going = on? -Ken Debugger entered--Lisp error: (args-out-of-range "" -1 0) substring("" -1) (string=3D "\n" (substring body sub-length)) (if (string=3D "\n" (substring body sub-length)) (substring body 0 sub-length) body) (let* ((body ...) (sub-length ...)) (if (string=3D "\n" ...) (substring body 0 sub-length) body)) (org-babel-clean-text-properties (let* (... ...) (if ... ... body))) (let* ((block-indentation ...) (lang ...) (lang-headers ...) (switches ...) (body ...) (preserve-indentation ...)) (list lang (with-temp-buffer ...) (org-babel-merge-params org-babel-default-header-args ... ... ... ...) switches block-indentation)) org-babel-parse-src-block-match() (setq info (org-babel-parse-src-block-match)) (save-excursion (goto-char head) (setq info (org-babel-parse-src-block-match)) (setq indent (car ...)) (setq info (butlast info)) (while (and ... ...) (setf ... ...)) (when (looking-at org-babel-src-name-w-name-regexp) (setq name ...) (when ... ...))) (if (setq head (org-babel-where-is-src-block-head)) (save-excursion (goto-char head) (setq info ...) (setq indent ...) (setq info ...) (while ... ...) (when ... ... ...)) (when (save-excursion ... ...) (setq info ...))) (let ((case-fold-search t) head info name indent) (if (setq head ...) (save-excursion ... ... ... ... ... ...) (when ... ...)) (when (and info ...) (setf ... ...)) (when info (append info ...))) org-babel-get-src-block-info(light) (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("" #("R" 0 1 (font-lock-fontified t fontified nil= ))) apply(org-babel-exp-src-block "" #("R" 0 1 (font-lock-fontified t fontified nil))) (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 (match-end 0)) (unless preserve-indent (setq body ...)) (unless (memq type types) (setq types ...)) (save-match-data (interblock start match-start)) (when (setq func ...) (let ... ...))) (while (re-search-forward beg-re nil t) (let* (... ... ... ... ... ... ... ... match-end) (while ... ...) (when ... ...) (setq match-end ...) (unless preserve-indent ...) (unless ... ...) (save-match-data ...) (when ... ...)) (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 (erase-buffer) (insert string) (setq case-fold-search t) (let (...) (remove-text-properties ... ... ...)) (org-export-kill-licensed-text) (let (...) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char ...) (when ... ... ... ...)) (when (plist-get parameters :add-text) (goto-char ...) (insert ... "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ... ...) (org-export-kill-licensed-text) (let ... ...) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks ...) (untabify ... ...) (org-export-handle-include-files-recurse) (run-hooks ...) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags ... ...) (run-hooks ...) (org-export-remove-tasks ...) (when ... ...) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks ...) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist ...) (run-hooks ...) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers ...) (when ... ... ...) (when ... ... ...) (org-export-remove-headline-metadata parameters) (setq target-alist ...) (run-hooks ...) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks ...) (unless ... ...) (setq target-alist ...) (org-export-mark-radio-links) (run-hooks ...) (org-export-concatenate-multiline-links) (run-hooks ...) (org-export-normalize-links) ...) (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 (erase-buffer) (insert string) (setq case-fold-search t) (let (...) (remove-text-properties ... ... ...)) (org-export-kill-licensed-text) (let (...) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char ...) (when ... ... ... ...)) (when (plist-get parameters :add-text) (goto-char ...) (insert ... "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (let* ((org-export-current-backend ...) (archived-trees ...) (inhibit-read-only t) (drawers org-drawers) (source-buffer ...) target-alist rtn) (setq org-export-target-aliases nil org-export-preferred-target-alist nil org-export-id-target-alist nil org-export-code-refs nil) (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ... ...) (org-export-kill-licensed-text) (let ... ...) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks ...) (untabify ... ...) (org-export-handle-include-files-recurse) (run-hooks ...) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags ... ...) (run-hooks ...) (org-export-remove-tasks ...) (when ... ...) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks ...) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist ...) (run-hooks ...) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers ...) (when ... ... ...) (when ... ... ...) (org-export-remove-headline-metadata parameters) (setq target-alist ...) (run-hooks ...) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks ...) (unless ... ...) (setq target-alist ...) (org-export-mark-radio-links) (run-hooks ...) (org-export-concatenate-multiline-links) (run-hooks ...) (org-export-normalize-links) ...) rtn) org-export-preprocess-string(#("#+TITLE: Test doc\n#+AUTHOR: Ken Williams\n\nSome stuff.\n\n#+begin_src R\n5+5\n#+end_src\n" 0 8 (fontified nil font-lock-fontified t) 8 9 (fontified nil) 9 17 (fontified nil font-lock-fontified t) 17 18 (fontified nil) 18 27 (fontified nil font-lock-fontified t) 27 28 (fontified nil) 28 40 (fontified nil font-lock-fontified t) 40 41 (fontified nil) 41 55 (fontified nil :org-license-to-kill t) 55 68 (fontified nil font-lock-fontified t) 68 69 (fontified nil font-lock-fontified t) 69 72 (fontified nil font-lock-fontified t :org-license-to-kill t) 72 73 (fontified nil font-lock-fontified t :org-license-to-kill t) 73 82 (fontified nil font-lock-fontified t) 82 83 (fontified nil)) :emph-multiline t :for-backend latex :comments nil :tags not-in-toc :priority nil :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil) org-export-as-latex(nil nil nil nil nil nil) org-export-as-pdf(nil) org-export-as-pdf-and-open(nil) call-interactively(org-export-as-pdf-and-open) (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] switch buffer/subtree export\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[o] export as OpenDocumentText [O] ... 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 ... ... ... ... ... ...)) (redisplay) (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)