Subject: bug#77917: closed (Re: bug#77917: 31.0.50; [PATCH] Stop using the "stop" sign for all warning levels)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 03 May 2025 08:18:02 +0000

Your bug report

#77917: 31.0.50; [PATCH] Stop using the "stop" sign for all warning levels

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].

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

Subject: Re: bug#77917: 31.0.50; [PATCH] Stop using the "stop" sign for all warning levels
From: Eli Zaretskii <[email-masked]>
To: Protesilaos Stavrou <[email-masked]>
Cc: [email-masked]
Date: Sat, 03 May 2025 11:17:31 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Sat, 19 Apr 2025 11:55:22 +0300
> From: Protesilaos Stavrou <[email-masked]>
> Cc: [email-masked]
> 
> On 2025-04-19 11:29, Eli Zaretskii wrote:
> >> Date: Sat, 19 Apr 2025 08:14:00 +0300
> >> From: Protesilaos Stavrou <[email-masked]>
> >> 
> >> The *Warnings* buffer uses the same "stop" sign for "warning" and
> >> "error" level warnings. This makes it hard to quickly scan the buffer
> >> for actual errors.
> > 
> > The sign is not for Warning or Error, it's for _disabling_ the
> > message.  That's why it's the same sign.
> > 
> > Why can't one search by using the text, not the sign?
> > 
> >> I attach a patch that uses a different icon for "warning" than for
> >> "error" or "emergency".
> > 
> > That's wrong, IMO, see above.
> 
> I see, thank you!

No further comments, so I'm now closing this bug.

Subject: 31.0.50; [PATCH] Stop using the "stop" sign for all warning levels
From: Protesilaos Stavrou <[email-masked]>
To: [email-masked]
Date: Sat, 19 Apr 2025 08:14:00 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Dear maintainers,

The *Warnings* buffer uses the same "stop" sign for "warning" and
"error" level warnings. This makes it hard to quickly scan the buffer
for actual errors.

I attach a patch that uses a different icon for "warning" than for
"error" or "emergency".

All the best,
Protesilaos (or simply "Prot")

From 5544f882c01ba7caa966e16f3074a9a2017e3802 Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
From: Protesilaos Stavrou <[email-masked]>
Date: Sat, 19 Apr 2025 08:06:30 +0300
Subject: [PATCH] Stop using the stop sign for all warning levels

* lisp/emacs-lisp/warnings.el (warnings-suppress): Define distinct icons
for "stop" and "warn".
(warnings-get-icon): Define function to return the appropriate icon.
(display-warning): Use 'warnings-get-icon'.
---
 lisp/emacs-lisp/warnings.el | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 6c77d57a6ba..626f0bccf2f 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -215,7 +215,7 @@ (defun warning-suppress-p (type suppress-list)
     ;; we return t.
     some-match))
 
-(define-icon warnings-suppress button
+(define-icon warnings-suppress-stop button
   `((emoji "⛔")
     ;; Many MS-Windows console fonts don't have good glyphs for U+25A0.
     (symbol ,(if (and (eq system-type 'windows-nt)
@@ -223,8 +223,20 @@ (define-icon warnings-suppress button
                  " » "
                " ■ "))
     (text " stop "))
+  "Suppress errors."
+  :version "31.1"
+  :help-echo "Click to suppress this warning type")
+
+(define-icon warnings-suppress-warn button
+  `((emoji "⚠️")
+    ;; Many MS-Windows console fonts don't have good glyphs for U+25A0.
+    (symbol ,(if (and (eq system-type 'windows-nt)
+                      (null window-system))
+                 " ! "
+               " ⏸ "))
+    (text " warn "))
   "Suppress warnings."
-  :version "29.1"
+  :version "31.1"
   :help-echo "Click to suppress this warning type")
 
 (defun warnings-suppress (type)
@@ -246,6 +258,13 @@ (defun warnings-suppress (type)
                                 (cons (list type) warning-suppress-types))))
     (_ (message "Exiting"))))
 
+(defun warnings-get-icon (level)
+  "Return appropriate icon for LEVEL of warning."
+  (icon-string
+   (if (memq level '(emergency :emergency error :error))
+       'warnings-suppress-stop
+     'warnings-suppress-warn)))
+
 ;;;###autoload
 (defun display-warning (type message &optional level buffer-name)
   "Display a warning message, MESSAGE.
@@ -324,7 +343,7 @@ (defun display-warning (type message &optional level buffer-name)
               ;; Don't output the button when doing batch compilation
               ;; and similar.
               (unless (or noninteractive (eq type 'bytecomp))
-                (insert (buttonize (icon-string 'warnings-suppress)
+                (insert (buttonize (warnings-get-icon level)
                                    #'warnings-suppress type)
                         " "))
 	      (if warning-prefix-function
-- 
2.39.5