0

In org mode I do C-c C-e t u 1) with or 2) without the title. 2) works fine. For 1), this is what I get in the minibuffer (echo area):

apply: Wrong type argument: listp, #("XYZ" 0 5 (:parent (#0)))

What's wrong with it?

#+TITLE: XYZ    
#+EXPORT_FILE_NAME: ~/Documents/Outbox/test
#+OPTIONS: ^:nil

* Food
    This is the body,
    which says something about the topic of food.

** Delicious Food
    This is the body of the second-level header.

** Distasteful Food
    This could have
    a body too, with
    several lines.

*** Dormitory Food

* Shelter
    Another first-level topic with its header line.

Relevant help page:

https://www.gnu.org/software/emacs/manual/html_node/org/Export-settings.html

Excerpt

UPDATE #1:

Syntax highlighting:

UPDATE #2:

GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)

UPDATE #3 on 11/26

C-u M-x org-reload M-x toggle-debug-on-error

Backtrace:

Debugger entered--Lisp error: (wrong-type-argument listp #("XYZ" 0 3 (:parent (#0))))
  org-element-set-contents(#("XYZ" 0 3 (:parent (#0))))
  apply(org-element-set-contents #("XYZ" 0 3 (:parent (#0))) nil)
  #f(compiled-function (s) #<bytecode 0x141eba1>)(#("XYZ" 0 3 (:parent (#0))))
  #f(compiled-function (--data) #<bytecode 0x13f4f9d>)(#("XYZ" 0 3 (:parent (#0))))
  mapc(#f(compiled-function (--data) #<bytecode 0x13f4f9d>) (#("XYZ" 0 3 (:parent (#0)))))
  #f(compiled-function (--data) #<bytecode 0x13f4f9d>)((#("XYZ" 0 3 (:parent (#0)))))
  org-element-map((#("XYZ" 0 3 (:parent (#0)))) plain-text #f(compiled-function (s) #<bytecode 0x141eba1>))
  org-export--get-inbuffer-options(#s(org-export-backend :name latex :parent nil :transcoders ((bold . org-latex-bold) (center-block . org-latex-center-block) (clock . org-latex-clock) (code . org-latex-code) (drawer . org-latex-drawer) (dynamic-block . org-latex-dynamic-block) (entity . org-latex-entity) (example-block . org-latex-example-block) (export-block . org-latex-export-block) (export-snippet . org-latex-export-snippet) (fixed-width . org-latex-fixed-width) (footnote-definition . org-latex-footnote-definition) (footnote-reference . org-latex-footnote-reference) (headline . org-latex-headline) (horizontal-rule . org-latex-horizontal-rule) (inline-src-block . org-latex-inline-src-block) (inlinetask . org-latex-inlinetask) (italic . org-latex-italic) (item . org-latex-item) (keyword . org-latex-keyword) (latex-environment . org-latex-latex-environment) (latex-fragment . org-latex-latex-fragment) (line-break . org-latex-line-break) (link . org-latex-link) (node-property . org-latex-node-property) (paragraph . org-latex-paragraph) (plain-list . org-latex-plain-list) (plain-text . org-latex-plain-text) (planning . org-latex-planning) (property-drawer . org-latex-property-drawer) (quote-block . org-latex-quote-block) (radio-target . org-latex-radio-target) (section . org-latex-section) (special-block . org-latex-special-block) (src-block . org-latex-src-block) (statistics-cookie . org-latex-statistics-cookie) (strike-through . org-latex-strike-through) (subscript . org-latex-subscript) (superscript . org-latex-superscript) (table . org-latex-table) (table-cell . org-latex-table-cell) (table-row . org-latex-table-row) (target . org-latex-target) (template . org-latex-template) (timestamp . org-latex-timestamp) (underline . org-latex-underline) (verbatim . org-latex-verbatim) (verse-block . org-latex-verse-block) (latex-math-block . org-latex-math-block) (latex-matrices . org-latex-matrices)) :options ((:latex-class "LATEX_CLASS" nil org-latex-default-class t) (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t) (:latex-header "LATEX_HEADER" nil nil newline) (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline) (:description "DESCRIPTION" nil nil parse) (:keywords "KEYWORDS" nil nil parse) (:subtitle "SUBTITLE" nil nil parse) (:latex-active-timestamp-format nil nil org-latex-active-timestamp-format) (:latex-caption-above nil nil org-latex-caption-above) (:latex-classes nil nil org-latex-classes) (:latex-default-figure-position nil nil org-latex-default-figure-position) (:latex-default-table-environment nil nil org-latex-default-table-environment) (:latex-default-table-mode nil nil org-latex-default-table-mode) (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format) (:latex-footnote-defined-format nil nil org-latex-footnote-defined-format) (:latex-footnote-separator nil nil org-latex-footnote-separator) (:latex-format-drawer-function nil nil org-latex-format-drawer-function) (:latex-format-headline-function nil nil org-latex-format-headline-function) (:latex-format-inlinetask-function nil nil org-latex-format-inlinetask-function) (:latex-hyperref-template nil nil org-latex-hyperref-template t) (:latex-image-default-height nil nil org-latex-image-default-height) (:latex-image-default-option nil nil org-latex-image-default-option) (:latex-image-default-width nil nil org-latex-image-default-width) (:latex-images-centered nil nil org-latex-images-centered) (:latex-inactive-timestamp-format nil nil org-latex-inactive-timestamp-format) (:latex-inline-image-rules nil nil org-latex-inline-image-rules) (:latex-link-with-unknown-path-format nil nil org-latex-link-with-unknown-path-format) (:latex-listings nil nil org-latex-listings) (:latex-listings-langs nil nil org-latex-listings-langs) (:latex-listings-options nil nil org-latex-listings-options) (:latex-minted-langs nil nil org-latex-minted-langs) (:latex-minted-options nil nil org-latex-minted-options) (:latex-prefer-user-labels nil nil org-latex-prefer-user-labels) (:latex-subtitle-format nil nil org-latex-subtitle-format) (:latex-subtitle-separate nil nil org-latex-subtitle-separate) (:latex-table-scientific-notation nil nil org-latex-table-scientific-notation) (:latex-tables-booktabs nil nil org-latex-tables-booktabs) (:latex-tables-centered nil nil org-latex-tables-centered) (:latex-text-markup-alist nil nil org-latex-text-markup-alist) (:latex-title-command nil nil org-latex-title-command) (:latex-toc-command nil nil org-latex-toc-command) (:latex-compiler "LATEX_COMPILER" nil org-latex-compiler) (:date "DATE" nil "\\today" parse)) :filters ((:filter-options . org-latex-math-block-options-filter) (:filter-paragraph . org-latex-clean-invalid-line-breaks) (:filter-parse-tree org-latex-math-block-tree-filter org-latex-matrices-tree-filter org-latex-image-link-filter) (:filter-verse-block . org-latex-clean-invalid-line-breaks)) :blocks nil :menu (108 "Export to LaTeX" ((76 "As LaTeX buffer" org-latex-export-as-latex) (108 "As LaTeX file" org-latex-export-to-latex) (112 "As PDF file" org-latex-export-to-pdf) (111 "As PDF file and open" (lambda (a s v b) (if a (org-latex-export-to-pdf t s v b) (org-open-file ...))))))))
  org-export-get-environment(#s(org-export-backend :name latex :parent nil :transcoders ((bold . org-latex-bold) (center-block . org-latex-center-block) (clock . org-latex-clock) (code . org-latex-code) (drawer . org-latex-drawer) (dynamic-block . org-latex-dynamic-block) (entity . org-latex-entity) (example-block . org-latex-example-block) (export-block . org-latex-export-block) (export-snippet . org-latex-export-snippet) (fixed-width . org-latex-fixed-width) (footnote-definition . org-latex-footnote-definition) (footnote-reference . org-latex-footnote-reference) (headline . org-latex-headline) (horizontal-rule . org-latex-horizontal-rule) (inline-src-block . org-latex-inline-src-block) (inlinetask . org-latex-inlinetask) (italic . org-latex-italic) (item . org-latex-item) (keyword . org-latex-keyword) (latex-environment . org-latex-latex-environment) (latex-fragment . org-latex-latex-fragment) (line-break . org-latex-line-break) (link . org-latex-link) (node-property . org-latex-node-property) (paragraph . org-latex-paragraph) (plain-list . org-latex-plain-list) (plain-text . org-latex-plain-text) (planning . org-latex-planning) (property-drawer . org-latex-property-drawer) (quote-block . org-latex-quote-block) (radio-target . org-latex-radio-target) (section . org-latex-section) (special-block . org-latex-special-block) (src-block . org-latex-src-block) (statistics-cookie . org-latex-statistics-cookie) (strike-through . org-latex-strike-through) (subscript . org-latex-subscript) (superscript . org-latex-superscript) (table . org-latex-table) (table-cell . org-latex-table-cell) (table-row . org-latex-table-row) (target . org-latex-target) (template . org-latex-template) (timestamp . org-latex-timestamp) (underline . org-latex-underline) (verbatim . org-latex-verbatim) (verse-block . org-latex-verse-block) (latex-math-block . org-latex-math-block) (latex-matrices . org-latex-matrices)) :options ((:latex-class "LATEX_CLASS" nil org-latex-default-class t) (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t) (:latex-header "LATEX_HEADER" nil nil newline) (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline) (:description "DESCRIPTION" nil nil parse) (:keywords "KEYWORDS" nil nil parse) (:subtitle "SUBTITLE" nil nil parse) (:latex-active-timestamp-format nil nil org-latex-active-timestamp-format) (:latex-caption-above nil nil org-latex-caption-above) (:latex-classes nil nil org-latex-classes) (:latex-default-figure-position nil nil org-latex-default-figure-position) (:latex-default-table-environment nil nil org-latex-default-table-environment) (:latex-default-table-mode nil nil org-latex-default-table-mode) (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format) (:latex-footnote-defined-format nil nil org-latex-footnote-defined-format) (:latex-footnote-separator nil nil org-latex-footnote-separator) (:latex-format-drawer-function nil nil org-latex-format-drawer-function) (:latex-format-headline-function nil nil org-latex-format-headline-function) (:latex-format-inlinetask-function nil nil org-latex-format-inlinetask-function) (:latex-hyperref-template nil nil org-latex-hyperref-template t) (:latex-image-default-height nil nil org-latex-image-default-height) (:latex-image-default-option nil nil org-latex-image-default-option) (:latex-image-default-width nil nil org-latex-image-default-width) (:latex-images-centered nil nil org-latex-images-centered) (:latex-inactive-timestamp-format nil nil org-latex-inactive-timestamp-format) (:latex-inline-image-rules nil nil org-latex-inline-image-rules) (:latex-link-with-unknown-path-format nil nil org-latex-link-with-unknown-path-format) (:latex-listings nil nil org-latex-listings) (:latex-listings-langs nil nil org-latex-listings-langs) (:latex-listings-options nil nil org-latex-listings-options) (:latex-minted-langs nil nil org-latex-minted-langs) (:latex-minted-options nil nil org-latex-minted-options) (:latex-prefer-user-labels nil nil org-latex-prefer-user-labels) (:latex-subtitle-format nil nil org-latex-subtitle-format) (:latex-subtitle-separate nil nil org-latex-subtitle-separate) (:latex-table-scientific-notation nil nil org-latex-table-scientific-notation) (:latex-tables-booktabs nil nil org-latex-tables-booktabs) (:latex-tables-centered nil nil org-latex-tables-centered) (:latex-text-markup-alist nil nil org-latex-text-markup-alist) (:latex-title-command nil nil org-latex-title-command) (:latex-toc-command nil nil org-latex-toc-command) (:latex-compiler "LATEX_COMPILER" nil org-latex-compiler) (:date "DATE" nil "\\today" parse)) :filters ((:filter-options . org-latex-math-block-options-filter) (:filter-paragraph . org-latex-clean-invalid-line-breaks) (:filter-parse-tree org-latex-math-block-tree-filter org-latex-matrices-tree-filter org-latex-image-link-filter) (:filter-verse-block . org-latex-clean-invalid-line-breaks)) :blocks nil :menu (108 "Export to LaTeX" ((76 "As LaTeX buffer" org-latex-export-as-latex) (108 "As LaTeX file" org-latex-export-to-latex) (112 "As PDF file" org-latex-export-to-pdf) (111 "As PDF file and open" (lambda (a s v b) (if a (org-latex-export-to-pdf t s v b) (org-open-file ...))))))) nil (:output-file "debug_title.tex"))
  org-export-as(latex nil nil nil (:output-file "debug_title.tex"))
  org-export-to-file(latex "debug_title.tex" nil nil nil nil nil)
  (let ((outfile (org-export-output-file-name ".tex" subtreep))) (org-export-to-file (quote latex) outfile async subtreep visible-only body-only ext-plist))
  org-latex-export-to-latex(nil nil nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)
  • Make org-mode export with ```C-c C-e t u``` instead ```C-x C-e t u```. Also note the ```TITLE``` by itself is a keyword, so no need to repeat it in first line and ```C-x C-e``` enters debug mode. – Ian Nov 16 '19 at 13:26
  • @Ian `C-x` was a typo, I corrected it. TITLE may have been a poor example, but the error remains if I change it to xyz. Syntax highlighting shows there is [something wrong with that line](https://postimg.cc/B8xCZbf6). –  Nov 17 '19 at 00:21
  • FWIW, I don't see the problem (but the setting of EXPORT_FILE_NAME caused me problems, so I changed it - see below). The PDF is produced fine. The syntax highlighting does look different, but that's fine: the TITLE face is `org-document-info-keyword ` whereas for the other two, it is `org-meta-line` - which makes sense. For the EXPORT_FILE_NAME setting a) I could not use `~`: that's a shell abbreviation that I guess is not acceptable in this context, b) but even when I replaced it with an absolute pathname, I still had problems because ... – NickD Nov 17 '19 at 00:49
  • ... the various tools I use (latex, pygments, texi2dvi) expected everything in the same directory. So I specified the directory where the org file was and everything worked. Note that depending on your tool chain, you might or might not have the same problem. I would suggest that you shut down your emacs and restart it, then try again: it may be that your session is curdled somehow. – NickD Nov 17 '19 at 00:50
  • The problem I am reporting is reproducible after a shut down of Emacs, and on any `*.org` file. What would be the steps to troubleshoot? `#+EXPORT_FILE_NAME:` works fine in standalone. In the unlikely case `~` in its argument interferes, I replaced it by the value of `$HOME`. –  Nov 17 '19 at 04:01
  • @Erwann - Now you posted a picture, I remember I had once such behaviour - what I did I made a hex-dump ```hexdump -c filename.org > filename-dump.txt``` and noticed the first three characters were unusual, starting with ```.```. So if this is your case, either delete the first line and re-insert it, or just start a new .org file and copy just the content of your original one (I presumed I made a wrong typing, so I do not remember exactly how I solved). Maybe it will be useful to report it as bug. Depending on your system, the command may by ```dump``` (linux) - I do not use Win. – Ian Nov 17 '19 at 09:29
  • @Ian here's the [dump](https://pastebin.com/raw/RKc2WxXi). It don't see leading unusual characters. –  Nov 17 '19 at 13:54
  • I see. That was my case. However does not hurt to delete the first line and type it again. – Ian Nov 17 '19 at 13:57
  • @Ian how was it your case after your said "3 characters unusual"?! On the first line `C-k #+TITLE: XYZ` turns from green to purple starting from `:`. `C-c C-e t u` returns a similar error: "Wrong type argument: listp, #("XYZ" 0 3 (:parent (#0)))". Reproducible on a new file as well. –  Nov 17 '19 at 14:12
  • @Erwann, in my case after deleting them the syntax highlighting was the correct one - I did not dully noted that behaviour, not recorded the characters. Note you may try the hexdump with ```-C``` flag to see if you have same result. Try also changing the theme. – Ian Nov 17 '19 at 15:26
  • @Erwann Exporting with the file content from above works here without producing any error. Maybe recompile org (once had a strange error until I recompiled it), in my case: `(byte-recompile-directory "~/.emacs/elpa/org-plus-contrib-20191111" nil t)` – Hubisan Nov 19 '19 at 14:13
  • @Erwann and of course to get more context about the error (backtrace) use `M-x toggle-debug-on-error` and export again. Then you will see which function causes the error (only works if it signals an error, not if it is just a warning). Would be good to add this to the question. – Hubisan Nov 19 '19 at 18:22
  • same error reported here, no answer unfortunately: https://stackoverflow.com/q/43730192/1365754 – Hubisan Nov 19 '19 at 18:31
  • More with same error: conclusion > reinstall org packages or recompile (to try out do `C-u M-x org-reload`). 1. https://github.com/syl20bnr/spacemacs/issues/3246#issuecomment-214707023. 2. https://emacs.stackexchange.com/questions/32747/export-from-org-mode-to-latex-doesnt-accept-the-option-title 3. https://www.reddit.com/r/emacs/comments/6jeu74/getting_error_exporting_org_doc_because_it_has/ – Hubisan Nov 19 '19 at 18:41

1 Answers1

0

org wasn't up to date as of today. That solved the problem: M-x list-package RET U x. enter image description here enter image description here