From 557275af545374292134f94ff6f24ded988c7c28 Mon Sep 17 00:00:00 2001 From: TEC Date: Fri, 5 Jan 2024 16:27:20 +0800 Subject: [PATCH] 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. --- lisp/org-latex-preview.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/org-latex-preview.el b/lisp/org-latex-preview.el index 1c4271f61..109934a38 100644 --- a/lisp/org-latex-preview.el +++ b/lisp/org-latex-preview.el @@ -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)))