org-latex-preview: Fix preview help-echo property

* lisp/org-latex-preview.el (org-latex-preview--update-overlay):
Add LaTeX compilation errors to the help-echo property when the
cursor is inside the fragment that is being previewed.  This
primarily affects the use of `org-latex-preview-auto-mode`.
This commit is contained in:
Karthik Chikmagalur 2024-01-05 18:58:10 -08:00 committed by TEC
parent 79336cef3d
commit b2adb517f4
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 9 additions and 9 deletions

View File

@ -496,16 +496,16 @@ overlay face is set to `org-latex-preview-processing-face'."
`(left-fringe exclamation-mark error)))))
(when org-latex-preview-processing-indicator
(org-latex-preview--indicate-processing ov))
;; This is a temporary measure until a more sophisticated
;; interface for errors is available in Org.
(when errors
(overlay-put
ov 'help-echo
(if (bound-and-true-p tooltip-mode)
errors
(concat (propertize "! " 'face '(bold error))
(substring (replace-regexp-in-string "[\n\r\t ]+" " " errors) 2)))))
(unless (overlay-get ov 'view-text) ;Live previewing this element, update in background
;; This is a temporary measure until a more sophisticated
;; interface for errors is available in Org.
(when errors
(overlay-put
ov 'help-echo
(if (bound-and-true-p tooltip-mode)
errors
(concat (propertize "! " 'face '(bold error))
(substring (replace-regexp-in-string "[\n\r\t ]+" " " errors) 2)))))
(when image-display (overlay-put ov 'display image-display))
(overlay-put ov 'face (overlay-get ov 'hidden-face)))
(run-hook-with-args 'org-latex-preview-update-overlay-functions ov)))