org-latex-preview: Still show errs with no tooltip

* lisp/org-latex-preview.el (org-latex-preview--update-overlay): When
`tooltip-mode' is not active, still show the error, just remove multiple
spaces to be economic with the horizontal room available.  This isn't
good as showing the tooltip, but it's better than not showing anything.
This commit is contained in:
TEC 2024-01-05 16:27:20 +08:00
parent 90e7813dd7
commit 557275af54
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 7 additions and 2 deletions

View File

@ -499,8 +499,13 @@ overlay face is set to `org-latex-preview-processing-face'."
(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 (and errors tooltip-mode)
(overlay-put ov 'help-echo errors))
(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)))