jkitchin / ox-ipynb

org-mode exporter to Jupyter notebooks
175 stars 40 forks source link

wrong-type-argument listp when exporting example file #5

Closed andreas-h closed 7 years ago

andreas-h commented 7 years ago

I'm trying to get this to work, but am running into issues with the example file.

I have this in my init.el:

(load-file "~/.emacs.d/external/ox-ipynb/ox-ipynb.el")
(require 'ox-ipynb)

Now, when I open the example.org file and press C-c C-e n b, I get the following error:

Debugger entered--Lisp error: (wrong-type-argument listp #("John Kitchin" 0 12 (:parent (#1))))
  org-element-set-contents(#("John Kitchin" 0 12 (:parent (#0))))
  apply(org-element-set-contents #("John Kitchin" 0 12 (:parent (#0))) nil)
  #[257 "\211\305\306\307#\310\311\211:\204\312\202\"\n@9\203!\nAA\202\"\n)\"\210\313\314 \211:\2043\312\202@\n@9\203?\nAA\202@\n)#\210\315\211    \n;\203V\316\317\n#\202\\\320\nA@\"*\211;\203n\321\n\312\f$\202z\nA\322\nA@\f#\240\210\n+\210  AA@\240\210    @\240*\207" [new old element property value replace-regexp-in-string "\n" " " mapc #[(blob) "\305 \211;\203\306\f\307\n$\202 \fA\310\fA@\n#\240\210\f+\207" [blob old value property element :parent org-add-props nil plist-put] 6] nil apply org-element-set-contents :parent get-text-property 0 plist-get org-add-props plist-put] 7 "\n\n(fn S)"](#("John Kitchin" 0 12 (:parent (#0))))
  #[257 "\211\211:\204\211;\205\311\262\202\211@9\205\211@\262?\206\301\203-\312\301\313\">\206\211\2049\314\310\242\"\202\211\315=\203]\314\310\242\211:\204N\316\262\202Y\211@9\203Y\211AA\262\"\202\211\304>\203~\300!\211\203}\302\203v\317\320\"\210\202}\307\307\242B\240\210\210\306\321=\203\271;\204\271\211\236A\211\203\270\211@\310\242\211;\203\247\322\323#\266\202\202\257\312A@\"\266\202!\210A\266\202\202\216\210\303\203\377\306\321=\203\377\316\211:\204\326\211;\205\336\311\262\202\340\211@9\205\336\211@\262\206\375\324\211;\203\365\322\323#\266\202\202\375\312A@\"\266\202>\203\325\202r>\203\326\202r\315=\203\326\202r\311=\203'\325\202r\204/\325\202r\211\2047\326\202r\211\211:\204H\211;\205P\311\262\202R\211@9\205P\211@\262\211\204Z\325\202p\211>\203e\325\202p\327!\203o\325\202p\326\262\266\204\326=\203\377\211\203\376\211@\211@A\211;\203\225\322\323#\266\202\202\235\312A@\"\266\202\211\203\365 \235\203\336!\235\203\317\330!\211\203\313\211@\310\242A!\210\310\242@!\210A\266\202\202\262\210\202\365\310\242A!\210\310\242@!\210\202\365!\235\203\360\314\310\242\330!\"\210\202\365\310\242!\210\266A\266\202\202{\210\211\305>\206\211:\204\316\262\202\211@9\203\211AA\262?\206\306\331=\203.\211\">?\206\306\332=\203\352\316\211:\204G\211;\205O\311\262\202Q\211@9\205O\211@\262\206n\324\211;\203f\322\323#\266\202\202n\312A@\"\266\202>\203y\325\202\343>\203\204\326\202\343\315=\203\216\326\202\343\311=\203\230\325\202\343\204\240\325\202\343\211\204\250\326\202\343\211\211:\204\271\211;\205\301\311\262\202\303\211@9\205\301\211@\262\211\204\313\325\202\341\211>\203\326\325\202\341\327!\203\340\325\202\341\326\262\266\204\325=\206\314\310\242\211:\204\371\316\262\202\211@9\203\211AA\262\"\207" [#[257 "\211\305\306\307#\310\311\211:\204\312\202\"\n@9\203!\nAA\202\"\n)\"\210\313\314 \211:\2043\312\202@\n@9\203?\nAA\202@\n)#\210\315\211    \n;\203V\316\317\n#\202\\\320\nA@\"*\211;\203n\321\n\312\f$\202z\nA\322\nA@\f#\240\210\n+\210  AA@\240\210    @\240*\207" [new old element property value replace-regexp-in-string "\n" " " mapc #[(blob) "\305 \211;\203\306\f\307\n$\202 \fA\310\fA@\n#\240\210\f+\207" [blob old value property element :parent org-add-props nil plist-put] 6] nil apply org-element-set-contents :parent get-text-property 0 plist-get org-add-props plist-put] 7 "\n\n(fn S)"] nil nil nil (plain-text) nil objects (nil) (#0) plain-text plist-get :ignore-list mapc org-data nil throw :--map-first-match objects get-text-property 0 :parent object element org-element-secondary-p reverse greater-elements elements org-element-secondary-value-alist org-element-all-objects org-element-all-elements org-element-object-containers org-element--parsed-properties-alist org-element-dual-keywords org-element-multiple-keywords org-element-greater-elements] 11 "\n\n(fn --DATA)"](#("John Kitchin" 0 12 (:parent (#0))))
  mapc(#[257 "\211\211:\204\211;\205\311\262\202\211@9\205\211@\262?\206\301\203-\312\301\313\">\206\211\2049\314\310\242\"\202\211\315=\203]\314\310\242\211:\204N\316\262\202Y\211@9\203Y\211AA\262\"\202\211\304>\203~\300!\211\203}\302\203v\317\320\"\210\202}\307\307\242B\240\210\210\306\321=\203\271;\204\271\211\236A\211\203\270\211@\310\242\211;\203\247\322\323#\266\202\202\257\312A@\"\266\202!\210A\266\202\202\216\210\303\203\377\306\321=\203\377\316\211:\204\326\211;\205\336\311\262\202\340\211@9\205\336\211@\262\206\375\324\211;\203\365\322\323#\266\202\202\375\312A@\"\266\202>\203\325\202r>\203\326\202r\315=\203\326\202r\311=\203'\325\202r\204/\325\202r\211\2047\326\202r\211\211:\204H\211;\205P\311\262\202R\211@9\205P\211@\262\211\204Z\325\202p\211>\203e\325\202p\327!\203o\325\202p\326\262\266\204\326=\203\377\211\203\376\211@\211@A\211;\203\225\322\323#\266\202\202\235\312A@\"\266\202\211\203\365 \235\203\336!\235\203\317\330!\211\203\313\211@\310\242A!\210\310\242@!\210A\266\202\202\262\210\202\365\310\242A!\210\310\242@!\210\202\365!\235\203\360\314\310\242\330!\"\210\202\365\310\242!\210\266A\266\202\202{\210\211\305>\206\211:\204\316\262\202\211@9\203\211AA\262?\206\306\331=\203.\211\">?\206\306\332=\203\352\316\211:\204G\211;\205O\311\262\202Q\211@9\205O\211@\262\206n\324\211;\203f\322\323#\266\202\202n\312A@\"\266\202>\203y\325\202\343>\203\204\326\202\343\315=\203\216\326\202\343\311=\203\230\325\202\343\204\240\325\202\343\211\204\250\326\202\343\211\211:\204\271\211;\205\301\311\262\202\303\211@9\205\301\211@\262\211\204\313\325\202\341\211>\203\326\325\202\341\327!\203\340\325\202\341\326\262\266\204\325=\206\314\310\242\211:\204\371\316\262\202\211@9\203\211AA\262\"\207" [#[257 "\211\305\306\307#\310\311\211:\204\312\202\"\n@9\203!\nAA\202\"\n)\"\210\313\314    \211:\2043\312\202@\n@9\203?\nAA\202@\n)#\210\315\211    \n;\203V\316\317\n#\202\\\320\nA@\"*\211;\203n\321\n\312\f$\202z\nA\322\nA@\f#\240\210\n+\210  AA@\240\210    @\240*\207" [new old element property value replace-regexp-in-string "\n" " " mapc #[(blob) "\305 \211;\203\306\f\307\n$\202 \fA\310\fA@\n#\240\210\f+\207" [blob old value property element :parent org-add-props nil plist-put] 6] nil apply org-element-set-contents :parent get-text-property 0 plist-get org-add-props plist-put] 7 "\n\n(fn S)"] nil nil nil (plain-text) nil objects (nil) (#0) plain-text plist-get :ignore-list mapc org-data nil throw :--map-first-match objects get-text-property 0 :parent object element org-element-secondary-p reverse greater-elements elements org-element-secondary-value-alist org-element-all-objects org-element-all-elements org-element-object-containers org-element--parsed-properties-alist org-element-dual-keywords org-element-multiple-keywords org-element-greater-elements] 11 "\n\n(fn --DATA)"] (#("John Kitchin" 0 12 (:parent #0))))
  #[257 "\211\211:\204\211;\205\311\262\202\211@9\205\211@\262?\206\301\203-\312\301\313\">\206\211\2049\314\310\242\"\202\211\315=\203]\314\310\242\211:\204N\316\262\202Y\211@9\203Y\211AA\262\"\202\211\304>\203~\300!\211\203}\302\203v\317\320\"\210\202}\307\307\242B\240\210\210\306\321=\203\271;\204\271\211\236A\211\203\270\211@\310\242\211;\203\247\322\323#\266\202\202\257\312A@\"\266\202!\210A\266\202\202\216\210\303\203\377\306\321=\203\377\316\211:\204\326\211;\205\336\311\262\202\340\211@9\205\336\211@\262\206\375\324\211;\203\365\322\323#\266\202\202\375\312A@\"\266\202>\203\325\202r>\203\326\202r\315=\203\326\202r\311=\203'\325\202r\204/\325\202r\211\2047\326\202r\211\211:\204H\211;\205P\311\262\202R\211@9\205P\211@\262\211\204Z\325\202p\211>\203e\325\202p\327!\203o\325\202p\326\262\266\204\326=\203\377\211\203\376\211@\211@A\211;\203\225\322\323#\266\202\202\235\312A@\"\266\202\211\203\365 \235\203\336!\235\203\317\330!\211\203\313\211@\310\242A!\210\310\242@!\210A\266\202\202\262\210\202\365\310\242A!\210\310\242@!\210\202\365!\235\203\360\314\310\242\330!\"\210\202\365\310\242!\210\266A\266\202\202{\210\211\305>\206\211:\204\316\262\202\211@9\203\211AA\262?\206\306\331=\203.\211\">?\206\306\332=\203\352\316\211:\204G\211;\205O\311\262\202Q\211@9\205O\211@\262\206n\324\211;\203f\322\323#\266\202\202n\312A@\"\266\202>\203y\325\202\343>\203\204\326\202\343\315=\203\216\326\202\343\311=\203\230\325\202\343\204\240\325\202\343\211\204\250\326\202\343\211\211:\204\271\211;\205\301\311\262\202\303\211@9\205\301\211@\262\211\204\313\325\202\341\211>\203\326\325\202\341\327!\203\340\325\202\341\326\262\266\204\325=\206\314\310\242\211:\204\371\316\262\202\211@9\203\211AA\262\"\207" [#[257 "\211\305\306\307#\310\311\211:\204\312\202\"\n@9\203!\nAA\202\"\n)\"\210\313\314 \211:\2043\312\202@\n@9\203?\nAA\202@\n)#\210\315\211    \n;\203V\316\317\n#\202\\\320\nA@\"*\211;\203n\321\n\312\f$\202z\nA\322\nA@\f#\240\210\n+\210  AA@\240\210    @\240*\207" [new old element property value replace-regexp-in-string "\n" " " mapc #[(blob) "\305 \211;\203\306\f\307\n$\202 \fA\310\fA@\n#\240\210\f+\207" [blob old value property element :parent org-add-props nil plist-put] 6] nil apply org-element-set-contents :parent get-text-property 0 plist-get org-add-props plist-put] 7 "\n\n(fn S)"] nil nil nil (plain-text) nil objects (nil) (#0) plain-text plist-get :ignore-list mapc org-data nil throw :--map-first-match objects get-text-property 0 :parent object element org-element-secondary-p reverse greater-elements elements org-element-secondary-value-alist org-element-all-objects org-element-all-elements org-element-object-containers org-element--parsed-properties-alist org-element-dual-keywords org-element-multiple-keywords org-element-greater-elements] 11 "\n\n(fn --DATA)"]((#("John Kitchin" 0 12 (:parent #0))))
  org-element-map((#("John Kitchin" 0 12 (:parent #0))) plain-text #[257 "\211\305\306\307#\310\311\211:\204\312\202\"\n@9\203!\nAA\202\"\n)\"\210\313\314    \211:\2043\312\202@\n@9\203?\nAA\202@\n)#\210\315\211    \n;\203V\316\317\n#\202\\\320\nA@\"*\211;\203n\321\n\312\f$\202z\nA\322\nA@\f#\240\210\n+\210  AA@\240\210    @\240*\207" [new old element property value replace-regexp-in-string "\n" " " mapc #[(blob) "\305 \211;\203\306\f\307\n$\202 \fA\310\fA@\n#\240\210\f+\207" [blob old value property element :parent org-add-props nil plist-put] 6] nil apply org-element-set-contents :parent get-text-property 0 plist-get org-add-props plist-put] 7 "\n\n(fn S)"])
  org-export--get-inbuffer-options([cl-struct-org-export-backend org nil ((babel-call . org-org-identity) (bold . org-org-identity) (center-block . org-org-identity) (clock . org-org-identity) (code . org-org-identity) (diary-sexp . org-org-identity) (drawer . org-org-identity) (dynamic-block . org-org-identity) (entity . org-org-identity) (example-block . org-org-identity) (export-block . org-org-export-block) (fixed-width . org-org-identity) (footnote-definition . ignore) (footnote-reference . org-org-identity) (headline . org-org-headline) (horizontal-rule . org-org-identity) (inline-babel-call . org-org-identity) (inline-src-block . org-org-identity) (inlinetask . org-org-identity) (italic . org-org-identity) (item . org-org-identity) (keyword . org-org-keyword) (latex-environment . org-org-identity) (latex-fragment . org-org-identity) (line-break . org-org-identity) (link . org-org-link) (node-property . org-org-identity) (template . org-org-template) (paragraph . org-org-identity) (plain-list . org-org-identity) (planning . org-org-identity) (property-drawer . org-org-identity) (quote-block . org-org-identity) (radio-target . org-org-identity) (section . org-org-section) (special-block . org-org-identity) (src-block . org-org-identity) (statistics-cookie . org-org-identity) (strike-through . org-org-identity) (subscript . org-org-identity) (superscript . org-org-identity) (table . org-org-identity) (table-cell . org-org-identity) (table-row . org-org-identity) (target . org-org-identity) (timestamp . org-org-identity) (underline . org-org-identity) (verbatim . org-org-identity) (verse-block . org-org-identity)) nil ((:filter-parse-tree . org-org--add-missing-sections)) nil (79 "Export to Org" ((79 "As Org buffer" org-org-export-as-org) (111 "As Org file" org-org-export-to-org) (118 "As Org file and open" (lambda (a s v b) (if a (org-org-export-to-org t s v b) (org-open-file (org-org-export-to-org nil s v b)))))))])
  org-export-get-environment([cl-struct-org-export-backend org nil ((babel-call . org-org-identity) (bold . org-org-identity) (center-block . org-org-identity) (clock . org-org-identity) (code . org-org-identity) (diary-sexp . org-org-identity) (drawer . org-org-identity) (dynamic-block . org-org-identity) (entity . org-org-identity) (example-block . org-org-identity) (export-block . org-org-export-block) (fixed-width . org-org-identity) (footnote-definition . ignore) (footnote-reference . org-org-identity) (headline . org-org-headline) (horizontal-rule . org-org-identity) (inline-babel-call . org-org-identity) (inline-src-block . org-org-identity) (inlinetask . org-org-identity) (italic . org-org-identity) (item . org-org-identity) (keyword . org-org-keyword) (latex-environment . org-org-identity) (latex-fragment . org-org-identity) (line-break . org-org-identity) (link . org-org-link) (node-property . org-org-identity) (template . org-org-template) (paragraph . org-org-identity) (plain-list . org-org-identity) (planning . org-org-identity) (property-drawer . org-org-identity) (quote-block . org-org-identity) (radio-target . org-org-identity) (section . org-org-section) (special-block . org-org-identity) (src-block . org-org-identity) (statistics-cookie . org-org-identity) (strike-through . org-org-identity) (subscript . org-org-identity) (superscript . org-org-identity) (table . org-org-identity) (table-cell . org-org-identity) (table-row . org-org-identity) (target . org-org-identity) (timestamp . org-org-identity) (underline . org-org-identity) (verbatim . org-org-identity) (verse-block . org-org-identity)) nil ((:filter-parse-tree . org-org--add-missing-sections)) nil (79 "Export to Org" ((79 "As Org buffer" org-org-export-as-org) (111 "As Org file" org-org-export-to-org) (118 "As Org file and open" (lambda (a s v b) (if a (org-org-export-to-org t s v b) (org-open-file (org-org-export-to-org nil s v b)))))))] nil nil)
  org-export-as(org nil nil nil nil)
  org-export-to-buffer(org "*Org ORG Export*" nil nil nil nil nil (closure ((ext-plist) (body-only) (visible-only) (subtreep) (async) htmlize-output-type t) nil (org-mode)))
  org-org-export-as-org(nil nil nil nil nil)
  (let ((ipynb (or (if (boundp (quote export-file-name)) (progn export-file-name)) (concat (file-name-base (buffer-file-name)) ".ipynb"))) buf) (org-org-export-as-org async subtreep visible-only body-only info) (save-current-buffer (set-buffer "*Org ORG Export*") (set (make-local-variable (quote export-file-name)) ipynb) (setq buf (ox-ipynb-export-to-buffer)) (save-current-buffer (set-buffer buf) (set (make-local-variable (quote export-file-name)) ipynb)) (prog1 buf (kill-buffer "*Org ORG Export*"))))
  ox-ipynb-export-to-ipynb-buffer(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)

Using org-plus-contrib-20171004 with Emacs 25.2.2 on Debian Linux.

I would appreciate any idea how to resolve this.

andreas-h commented 7 years ago

PS: The same is true when I initialize with

(add-to-list 'load-path "~/.emacs.d/external/ox-ipynb/")
(require 'ox-ipynb)

instead.

andreas-h commented 7 years ago

Never mind, that was a problem with my org install (mixed versions builtin org and org-plus-contrib from org elpa, because I accidentally had a call to some org function in my init file before package-initialize).