tecosaur / org-latex-preview-todos

A tracker for the Org LaTeX Preview effort on https://git.tecosaur.net/tec/org-mode
5 stars 0 forks source link

Previews sometimes fail in indirect buffers (org-element related) #41

Open karthink opened 2 months ago

karthink commented 2 months ago

Due to some issues with org-element or org-element caching that I'm having trouble reproducing, latex previews sometimes fail in indirect Org buffers. I'm keeping an eye for a deterministic, reproducible test case while I work, but it would be good to identify the cause before we merge.

I didn't record the org-element-cache error, but will update this when it next happens.

karthink commented 2 months ago

I encountered it just minutes after I opened this topic. The error occurred when I pasted a LaTeX environment into an indirect Org buffer and org-latex-preview-auto-mode was turned on, so it tried to produce a preview. Unfortunately no backtrace was generated for org-element-cache:

⛔ Warning (org-element): org-element--cache: Org parser error in periodic_pdes.org::TODO Solving the wave equation::69236. Resetting.
 The error was: (error "org-element: Parsing aborted by user.  Cache has been cleared.
If you observe Emacs hangs frequently, please report this to Org mode mailing list (M-x org-submit-bug-report)")
 Backtrace:
nil
 Please report this to Org mode mailing list (M-x org-submit-bug-report).

Emacs locked up so I had to quit (C-g) multiple times.

yantar92 commented 2 months ago

karthink @.***> writes:

I encountered it just minutes after I opened this topic. The error occurred when I pasted a LaTeX environment into an indirect Org buffer. Unfortunately no backtrace was generated for org-element-cache:


⛔ Warning (org-element): org-element--cache: Org parser error in periodic_pdes.org::TODO Solving the wave equation::69236. Resetting.
 The error was: (error "org-element: Parsing aborted by user.  Cache has been cleared.

(setq org-element--cache-self-verify 'backtrace)

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

karthink commented 2 months ago

(setq org-element--cache-self-verify 'backtrace)

Thanks. I remember that these backtraces are very large. Do I need to do something else to make the backtrace readable and not full of calls to inscrutable compiled functions, for instance?

yantar92 commented 2 months ago

karthink @.***> writes:

(setq org-element--cache-self-verify 'backtrace)

Thanks. I remember that these backtraces are very large. Do I need to do something else to make the backtrace readable and not full of calls to inscrutable compiled functions, for instance?

That backtrace is not Elisp backtrace. It simply enabled org-element's internal logging mechanisms that will record all the cache updates. Then, the log might contain clues about what went wrong.

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