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 #136 received at 77917 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
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: Re: bug#77917: 31.0.50; [PATCH] Stop using the "stop" sign for all
 warning levels
Date: Wed, 7 May 2025 22:14:57 -0700

> On May 7, 2025, at 10:10 PM, Yuan Fu <casouri <at> gmail.com> wrote:
> 
> 
> 
>> On May 7, 2025, at 10:22 AM, Juri Linkov <juri <at> linkov.net> wrote:
>> 
>>>>> 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))
> 
> Using ⚠️ to mean “suppress” feels wrong. Maybe just display the ⚠️ or ⛔ in front of the warning, and append the suppress button at the end of the message? (But doesn’t the warning buffer only display warning?)

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.

And for the symbol we could use ⚠.

Yuan



This bug report was last modified 61 days ago.

Previous Next


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