emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 2b7dc7fef81: Fix Flymake lighter tool-tip from generating errors


From: Eli Zaretskii
Subject: master 2b7dc7fef81: Fix Flymake lighter tool-tip from generating errors
Date: Fri, 23 Feb 2024 10:47:22 -0500 (EST)

branch: master
commit 2b7dc7fef814753f1c6d4c352fe69bb6e167cd07
Author: Robert A. Burks <rburksdev@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix Flymake lighter tool-tip from generating errors
    
    Flymake tool-tip was generating errors on mouse over of
    mode-line lighter on inactive windows and on the minor mode
    indicator in the describe-mode Help page.
    * lisp/progmodes/flymake.el (flymake--mode-line-title):
    'help-echo' now uses buffer local state and makes null
    check.  (Bug#69248)
    
    Copyright-paperwork-exempt: yes
---
 lisp/progmodes/flymake.el | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 5974f076556..db00cc59c0e 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1569,13 +1569,19 @@ correctly.")
     ,flymake-mode-line-lighter
     mouse-face mode-line-highlight
     help-echo
-    ,(lambda (&rest _)
-       (concat
-        (format "%s known backends\n" (hash-table-count flymake--state))
-        (format "%s running\n" (length (flymake-running-backends)))
-        (format "%s disabled\n" (length (flymake-disabled-backends)))
-        "mouse-1: Display minor mode menu\n"
-        "mouse-2: Show help for minor mode"))
+    ,(lambda (w &rest _)
+       (with-current-buffer (window-buffer w)
+         ;; Mouse can activate tool-tip without window being active.
+         ;; `flymake--state' is buffer local and is null when line
+         ;; lighter appears in *Help* `describe-mode'.
+         (concat
+          (unless (null flymake--state)
+            (concat
+             (format "%s known backends\n"  (hash-table-count flymake--state))
+             (format "%s running\n" (length (flymake-running-backends)))
+             (format "%s disabled\n" (length (flymake-disabled-backends)))))
+          "mouse-1: Display minor mode menu\n"
+          "mouse-2: Show help for minor mode")))
     keymap
     ,(let ((map (make-sparse-keymap)))
        (define-key map [mode-line down-mouse-1]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]