emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* bug: wrong-type-argument when trying export to pdf.
@ 2022-10-11 19:08 Justin Silverman
  2022-10-12  4:08 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Justin Silverman @ 2022-10-11 19:08 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 4332 bytes --]

I am having a problem and getting a wrong-type-argument error when trying to run `org-beamer-export-to-pdf' on the attached file `debug.org' (see backtrace below). The problem also occurs when running `org-latex-export-to-pdf'. 

The bug can be reproduced using `emacs -Q' with the configuration provided in `simple-config.el'.

Note that the problem can be solved by commenting out the lines:
    (org-babel-do-load-languages
     'org-babel-load-languages
     '((R . t)
       (emacs-lisp . t)
       (latex . t)))

yet doing this then makes it not possible to run C-c C-c on the R src block (without those lines you get an error about not being able to find ESS).

Am I just setting up org-babel incorrectly or is this a bug?

Best,
Justin 


Backtrace:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  jit-lock--run-functions(1218 1284)
  jit-lock-fontify-now(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
  #<subr font-lock-ensure>(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
  polymode-inhibit-during-initialization(#<subr font-lock-ensure> 1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
  apply(polymode-inhibit-during-initialization #<subr font-lock-ensure> (1218 #<marker at 1284 in L4-6_CoDA.org<2>>))
  font-lock-ensure(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
  org-table-align()
  org-babel-insert-result(((0.333333333333333) (0.333333333333333) (0.333333333333333)) ("value" "replace") ("R" "w1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum(..." ((:colname-names) (:rowname-names) (:result-params "value" "replace") (:result-type . value) (:results . "value replace") (:exports . "both") (:cache . "no") (:hlines . "no") (:noweb . "no") (:session . "*R*") (:tangle . "no")) "" nil 1072 "(ref:%s)") nil "R" (0 0 257283 648000))
  org-babel-execute-src-block(nil ("R" "w1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum(..." ((:colname-names) (:rowname-names) (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:exports . "both") (:tangle . "no") (:session . "*R*") (:noweb . "no") (:hlines . "no") (:cache . "no")) "" nil 1072 "(ref:%s)"))
  org-babel-exp-results(("R" "w1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum(..." ((:cache . "no") (:colname-names) (:exports . "both") (:hlines . "no") (:noweb . "no") (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:rowname-names) (:session . "*R*") (:tangle . "no")) "" nil 1072 "(ref:%s)") block nil "2da1507400b1866895fab4840062db146ee4de1e")
  org-babel-exp-do-export(("R" "w1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum(..." ((:cache . "no") (:colname-names) (:exports . "both") (:hlines . "no") (:noweb . "no") (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:rowname-names) (:session . "*R*") (:tangle . "no")) "" nil 1072 "(ref:%s)") block "2da1507400b1866895fab4840062db146ee4de1e")
  org-babel-exp-src-block((src-block (:language "R" :switches nil :parameters ":exports both :results value :session \"*R*\"" :begin 1072 :end 1207 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value "  w1 <- c(1, 1, 1) \n  w2 <- c(1, 1, 5) \n\n  x1 <- w..." :post-blank 1 :post-affiliated 1072 :mode planning :granularity element :cached nil :parent (section (:begin 1072 :end 1207 :contents-begin 1072 :contents-end 1206 :robust-begin 1072 :robust-end 1204 :post-blank 1 :post-affiliated 1072 :mode section :granularity element :cached nil :parent (headline (:raw-value "Spurious Conclusions" :begin 1047 :end 1285 :pre-blank 1 :contents-begin 1072 :contents-end 1284 :robust-begin 1074 :robust-end 1282 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1047 :title (...) :parent (org-data ...) :cached t :org-element--cache-sync-key (0 . 1047))) :org-element--cache-sync-key (0 . 1071))) :org-element--cache-sync-key (0 . 1072))))
  org-babel-exp-process-buffer()
  org-export-as(beamer nil nil nil (:output-file "L4-6_CoDA.tex"))
  org-export-to-file(beamer "L4-6_CoDA.tex" nil nil nil nil nil org-latex-compile)
  org-beamer-export-to-pdf()
  funcall-interactively(org-beamer-export-to-pdf)
  command-execute(org-beamer-export-to-pdf)

[-- Attachment #1.2: Type: text/html, Size: 7110 bytes --]

[-- Attachment #2: simple-config.el --]
[-- Type: text/plain, Size: 1405 bytes --]

;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.


;; Install Straight -- per straight documentation
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

;; Install use-package through straight 
;; Now use-package will use straight.el to automatically install
;; missing packages if you provide :straight t:
(straight-use-package 'use-package)

; This is only needed once, near the top of the file
(eval-when-compile
  ;; Following line is not needed if use-package.el is in ~/.emacs.d
  ;; (add-to-list 'load-path "<path where use-package is installed>")
  (require 'use-package))


(straight-use-package 'org)
(straight-use-package '(org-contrib :type git :host github :repo "emacsmirror/org-contrib"))

(use-package 'org
	     :config
    (org-babel-do-load-languages
     'org-babel-load-languages
     '((R . t)
       (emacs-lisp . t)
       (latex . t)))
)
	     

[-- Attachment #3: debug.org --]
[-- Type: application/vnd.lotus-organizer, Size: 1144 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug: wrong-type-argument when trying export to pdf.
  2022-10-11 19:08 bug: wrong-type-argument when trying export to pdf Justin Silverman
@ 2022-10-12  4:08 ` Ihor Radchenko
  2022-10-12 14:19   ` Justin Silverman
  2022-10-12 15:11   ` Justin Silverman
  0 siblings, 2 replies; 4+ messages in thread
From: Ihor Radchenko @ 2022-10-12  4:08 UTC (permalink / raw)
  To: Justin Silverman; +Cc: emacs-orgmode

Justin Silverman <jsilve24@gmail.com> writes:

> I am having a problem and getting a wrong-type-argument error when
> trying to run `org-beamer-export-to-pdf' on the attached file
> `debug.org' (see backtrace below). The problem also occurs when
> running `org-latex-export-to-pdf'.
> ...
> Backtrace:
>
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>   jit-lock--run-functions(1218 1284)
>   jit-lock-fontify-now(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
>   #<subr font-lock-ensure>(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
>   polymode-inhibit-during-initialization(#<subr font-lock-ensure> 1218 #<marker at 1284 in L4-6_CoDA.org<2>>)

The backtrace shows that you are using polymode. Does the problem
persist without polymode?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug: wrong-type-argument when trying export to pdf.
  2022-10-12  4:08 ` Ihor Radchenko
@ 2022-10-12 14:19   ` Justin Silverman
  2022-10-12 15:11   ` Justin Silverman
  1 sibling, 0 replies; 4+ messages in thread
From: Justin Silverman @ 2022-10-12 14:19 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 4670 bytes --]

Sorry that was my bad, the backtrace was from my own config not the simple-config.el that I provided. Here is the backtrace from the simple-config.el that shows that the problem persists even without polymode.

(still, thanks for pointing out that I had polymode activated, that was a mistake that I will fix in my personal config)

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  jit-lock--run-functions(1157 1223)
  jit-lock-fontify-now(1157 #<marker at 1223 in debug.org<2>>)
  font-lock-ensure(1157 #<marker at 1223 in debug.org<2>>)
  org-table-align()
  org-babel-insert-result(((0.333333333333333) (0.333333333333333) (0.333333333333333)) ("value" "replace") ("R" "w1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum(..." ((:colname-names) (:rowname-names) (:result-params "value" "replace") (:result-type . value) (:results . "value replace") (:exports . "both") (:cache . "no") (:hlines . "no") (:noweb . "no") (:session . "*R*") (:tangle . "no")) "" nil 1011 "(ref:%s)") nil "R" (0 0 258514 765000))
  org-babel-execute-src-block(nil ("R" "w1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum(..." ((:colname-names) (:rowname-names) (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:exports . "both") (:tangle . "no") (:session . "*R*") (:noweb . "no") (:hlines . "no") (:cache . "no")) "" nil 1011 "(ref:%s)"))
  org-babel-exp-results(("R" "w1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum(..." ((:cache . "no") (:colname-names) (:exports . "both") (:hlines . "no") (:noweb . "no") (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:rowname-names) (:session . "*R*") (:tangle . "no")) "" nil 1011 "(ref:%s)") block nil "2da1507400b1866895fab4840062db146ee4de1e")
  org-babel-exp-do-export(("R" "w1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum(..." ((:cache . "no") (:colname-names) (:exports . "both") (:hlines . "no") (:noweb . "no") (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:rowname-names) (:session . "*R*") (:tangle . "no")) "" nil 1011 "(ref:%s)") block "2da1507400b1866895fab4840062db146ee4de1e")
  org-babel-exp-src-block((src-block (:language "R" :switches nil :parameters ":exports both :results value :session \"*R*\"" :begin 1011 :end 1146 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value "  w1 <- c(1, 1, 1) \n  w2 <- c(1, 1, 5) \n\n  x1 <- w..." :post-blank 1 :post-affiliated 1011 :mode planning :granularity element :cached nil :parent (section (:begin 1011 :end 1223 :contents-begin 1011 :contents-end 1223 :robust-begin 1011 :robust-end 1221 :post-blank 0 :post-affiliated 1011 :mode section :granularity element :cached nil :parent (headline (:raw-value "Spurious Conclusions" :begin 986 :end 1223 :pre-blank 1 :contents-begin 1011 :contents-end 1223 :robust-begin 1013 :robust-end 1221 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 986 :title (...) :parent (org-data ...) :cached t :org-element--cache-sync-key (0 . 986))) :org-element--cache-sync-key (0 . 1010))) :org-element--cache-sync-key (0 . 1011))))
  org-babel-exp-process-buffer()
  org-export-as(beamer nil nil nil nil)
  org-export-to-buffer(beamer "*Org BEAMER Export*" nil nil nil nil nil #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_16>)
  org-beamer-export-as-latex()
  funcall-interactively(org-beamer-export-as-latex)
  command-execute(org-beamer-export-as-latex record)
  execute-extended-command(nil "org-beamer-export-as-latex" nil)
  funcall-interactively(execute-extended-command nil "org-beamer-export-as-latex" nil)
  command-execute(execute-extended-command)



Ihor Radchenko <yantar92@gmail.com> writes:

> Justin Silverman <jsilve24@gmail.com> writes:
>
>> I am having a problem and getting a wrong-type-argument error when
>> trying to run `org-beamer-export-to-pdf' on the attached file
>> `debug.org' (see backtrace below). The problem also occurs when
>> running `org-latex-export-to-pdf'.
>> ...
>> Backtrace:
>>
>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>>   jit-lock--run-functions(1218 1284)
>>   jit-lock-fontify-now(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
>>   #<subr font-lock-ensure>(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
>>   polymode-inhibit-during-initialization(#<subr font-lock-ensure> 1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
>
> The backtrace shows that you are using polymode. Does the problem
> persist without polymode?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug: wrong-type-argument when trying export to pdf.
  2022-10-12  4:08 ` Ihor Radchenko
  2022-10-12 14:19   ` Justin Silverman
@ 2022-10-12 15:11   ` Justin Silverman
  1 sibling, 0 replies; 4+ messages in thread
From: Justin Silverman @ 2022-10-12 15:11 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1195 bytes --]

Well, rm -rf .emacs.d/straight/ followed by repulling and rebuilding seemed to fix things.

I am surprised that I still saw the same problem with emacs -Q but my simple-config.el did use straight. Perhaps straight in simple-config.el just ended up using the same build files that were corrupted...

Anyways I guess mark this one frustrating but solved.

Justin 

Ihor Radchenko <yantar92@gmail.com> writes:

> Justin Silverman <jsilve24@gmail.com> writes:
>
>> I am having a problem and getting a wrong-type-argument error when
>> trying to run `org-beamer-export-to-pdf' on the attached file
>> `debug.org' (see backtrace below). The problem also occurs when
>> running `org-latex-export-to-pdf'.
>> ...
>> Backtrace:
>>
>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>>   jit-lock--run-functions(1218 1284)
>>   jit-lock-fontify-now(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
>>   #<subr font-lock-ensure>(1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
>>   polymode-inhibit-during-initialization(#<subr font-lock-ensure> 1218 #<marker at 1284 in L4-6_CoDA.org<2>>)
>
> The backtrace shows that you are using polymode. Does the problem
> persist without polymode?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-12 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 19:08 bug: wrong-type-argument when trying export to pdf Justin Silverman
2022-10-12  4:08 ` Ihor Radchenko
2022-10-12 14:19   ` Justin Silverman
2022-10-12 15:11   ` Justin Silverman

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).