Subject: bug#69248: closed (Re: bug#69248: [PATCH] Fix flymake lighter tool-tip from generating errors)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 23 Feb 2024 15:49:02 +0000

Your bug report

#69248: [PATCH] Fix flymake lighter tool-tip from generating errors

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
69248: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69248
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#69248: [PATCH] Fix flymake lighter tool-tip from generating errors
From: Eli Zaretskii <[email-masked]>
To: Spencer Baugh <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Fri, 23 Feb 2024 17:48:04 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Spencer Baugh <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked],  Robert Burks
>   <[email-masked]>
> Date: Fri, 23 Feb 2024 10:40:41 -0500
> 
> João Távora <[email-masked]> writes:
> >> João, could you please review the patch?
> >
> > No, but I'm copying Spencer Baugh, who has expressed interest in becoming
> > Flymake maintainer (and has my full endorsement, though I haven't worked
> > out the bureaucracy, if there is any)
> >
> > João
> 
> The patch seems correct, if someone with commit access could please
> apply it.

Thanks, installed, and closing the bug.

Subject: [PATCH] Fix flymake lighter tool-tip from generating errors
From: Robert Burks <[email-masked]>
To: [email-masked]
Date: Fri, 16 Feb 2024 19:07:12 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

With a non-flymake window selected, hovering over the flymake line lighter
of an inactive window generates errors.  This also occurs where the
indicators are shown in describe mode help.

The attached patch corrects this issue.

Robert A. Burks
From 7d9baf7a782b3f569c51c3533798df6cc00b1acd Mon Sep 17 00:00:00 2001
From: "Robert A. Burks" <[email-masked]>
Date: Fri, 16 Feb 2024 18:17:52 -0500
Subject: [PATCH] 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.
---
 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 bb062753d39..23c6d9cf85d 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1401,13 +1401,19 @@ flymake--mode-line-title
     ,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]
-- 
2.34.1