all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Burks <rburksdev@gmail.com>
To: 69248@debbugs.gnu.org
Subject: bug#69248: [PATCH] Fix flymake lighter tool-tip from generating errors
Date: Fri, 16 Feb 2024 19:07:12 -0500	[thread overview]
Message-ID: <CAHvcHq7TY9iyg-0c9tYWUfmCx5NDC2tQu+tnGw2PUF6S+Y5zxg@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 245 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 335 bytes --]

[-- Attachment #2: 0001-Fix-flymake-lighter-tool-tip-from-generating-errors.patch --]
[-- Type: text/x-patch, Size: 2045 bytes --]

From 7d9baf7a782b3f569c51c3533798df6cc00b1acd Mon Sep 17 00:00:00 2001
From: "Robert A. Burks" <rburksdev@gmail.com>
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


             reply	other threads:[~2024-02-17  0:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17  0:07 Robert Burks [this message]
2024-02-22 13:24 ` bug#69248: [PATCH] Fix flymake lighter tool-tip from generating errors Eli Zaretskii
2024-02-22 14:04   ` João Távora
2024-02-23 15:40     ` Spencer Baugh
2024-02-23 15:48       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHvcHq7TY9iyg-0c9tYWUfmCx5NDC2tQu+tnGw2PUF6S+Y5zxg@mail.gmail.com \
    --to=rburksdev@gmail.com \
    --cc=69248@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.