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


Message #130 received at 77917 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77917 <at> debbugs.gnu.org,
 Ihor Radchenko <yantar92 <at> posteo.net>, prot <at> protesilaos.com
Subject: Re: bug#77917: 31.0.50; [PATCH] Stop using the "stop" sign for all
 warning levels
Date: Wed, 07 May 2025 20:22:24 +0300
>     >> I donʼt think we need the trailing space, but the rest looks good to
>     >> me.
>
>     Juri> I tried without the trailing space, but then an underline is added
>     Juri> at the end.  Very strange effect.  Maybe a bug?
>
> Some interaction between the `button' or `link' face from the
> `buttonize' with the :height spec?

Very interesting: 'display-warning' uses the function 'newline'
that basically does such a trick:

  (let ((last-command-event ?\n))
   (self-insert-command 1))

But the problem is that 'self-insert-command' inherits
the button text properties to the newline.  And with
these text properties the newline is displayed as
an underlined space character.

I don't know the reason why 'display-warning' uses 'newline',
but after replacing 'newline' with a plain "\n"
it is displayed correctly:

diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 6c77d57a6ba..9714abea213 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -216,7 +216,7 @@ warning-suppress-p
     some-match))
 
 (define-icon warnings-suppress button
-  `((emoji "⛔")
+  `((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))
@@ -333,7 +333,14 @@ 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"))
 	      (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.