org-latex-preview: Add error reporting via tooltip

* lisp/org-latex-preview.el (org-latex-preview--update-overlay): Add a
rudimentary interface for viewing compile errors (via tooltip).
This commit is contained in:
Karthik Chikmagalur 2023-01-07 01:24:05 -08:00 committed by TEC
parent 90cb3e9507
commit c40c287d07
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 5 additions and 0 deletions

View File

@ -371,6 +371,7 @@ indeed LaTeX fragments/environments.")
(let* ((zoom (or (plist-get org-latex-preview-options :zoom) 1.0))
(height (plist-get (cdr path-info) :height))
(depth (plist-get (cdr path-info) :depth))
(errors (plist-get (cdr path-info) :errors))
(image-display
(and (car path-info)
(list 'image
@ -393,6 +394,10 @@ indeed LaTeX fragments/environments.")
(round (* 100 (- 1 (/ (max 0.0 (- depth 0.02))
height))))
'center)))))
;; This is a temporary measure until a more sophisticated
;; interface for errors is available in Org.
(when (and errors tooltip-mode)
(overlay-put ov 'help-echo errors))
(when image-display
(overlay-put ov 'display image-display)
(overlay-put ov 'preview-image image-display))