GNU bug report logs - #77917
31.0.50; [PATCH] Stop using the "stop" sign for all warning levels

Previous Next

Package: emacs;

Reported by: Protesilaos Stavrou <prot <at> protesilaos.com>

Date: Sat, 19 Apr 2025 07:25:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Robert Pluim <rpluim <at> gmail.com>, 77917 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, prot <at> protesilaos.com, Ihor Radchenko <yantar92 <at> posteo.net>
Subject: bug#77917: 31.0.50; [PATCH] Stop using the "stop" sign for all warning levels
Date: Thu, 08 May 2025 09:45:38 +0300
[Message part 1 (text/plain, inline)]
>>> (define-icon warnings-suppress button
>>> -  `((emoji "⛔")
>>> +  `((emoji "⚠️")
> [...]
> Re-reading your patch, I realized your patch does exactly what
> I described.  Maybe we should rename the icon so it doesn’t say
> suppress.

Unfortunately, renaming an icon is not so simple.
First we need to mark an old name as obsolete
because very likely many users already customized it
with 'M-x customize-icon RET warnings-suppress RET'
that adds to the custom file a setting like this:

  (custom-set-icons
    '(warnings-suppress ((emoji "⚠️") (symbol " ■ ") (text " stop "))))

And I even don't know how to make it obsolete.
For example, there is 'define-obsolete-face-alias',
but no something like 'define-obsolete-icon-alias'.

> And for the symbol we could use ⚠.

Thanks.  I tried to find a suitable character for the symbol,
but didn't realize this could be used for it.

Here is the patch that also updates the docstring:

[warnings-suppress.patch (text/x-diff, inline)]
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 6c77d57a6ba..54a35fee3a9 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -216,15 +216,15 @@ warning-suppress-p
     some-match))
 
 (define-icon warnings-suppress button
-  `((emoji "⛔")
-    ;; Many MS-Windows console fonts don't have good glyphs for U+25A0.
+  `((emoji "⚠️")
+    ;; Many MS-Windows console fonts don't have good glyphs for symbols.
     (symbol ,(if (and (eq system-type 'windows-nt)
                       (null window-system))
                  " » "
-               " ■ "))
-    (text " stop "))
-  "Suppress warnings."
-  :version "29.1"
+               " ⚠ "))
+    (text " warning "))
+  "Indicate and optionally suppress warnings."
+  :version "31.1"
   :help-echo "Click to suppress this warning type")
 
 (defun warnings-suppress (type)
@@ -333,7 +333,16 @@ display-warning
 	      (insert (format (nth 1 level-info)
 			      (format warning-type-format typename))
 		      message)
-              (funcall newline)
+              ;; Don't output the buttons when doing batch compilation
+              ;; and similar.
+              (unless (or noninteractive (eq type 'bytecomp))
+                (insert " " (buttonize (propertize
+                                        "[Suppress]" 'face
+                                        '(variable-pitch (:height 0.9)))
+                                       #'warnings-suppress type)
+                        "\n"))
+              (unless (bolp)
+		(funcall newline))
 	      (when (and warning-fill-prefix
                          (not (string-search "\n" message))
                          (not noninteractive))

This bug report was last modified 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.