GNU bug report logs - #70063
[PATCH] fix warning-suppress for list type "warning type"

Previous Next

Package: emacs;

Reported by: Xuan Wang <code <at> wangxuan.name>

Date: Fri, 29 Mar 2024 04:08:03 UTC

Severity: normal

Tags: patch

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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#70063: closed ([PATCH] fix warning-suppress for list type
 "warning type")
Date: Sun, 31 Mar 2024 09:12:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 31 Mar 2024 12:10:50 +0300
with message-id <86edbqbwbp.fsf <at> gnu.org>
and subject line Re: bug#70063: [PATCH] fix warning-suppress for list type "warning type"
has caused the debbugs.gnu.org bug report #70063,
regarding [PATCH] fix warning-suppress for list type "warning type"
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
70063: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70063
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Xuan Wang <code <at> wangxuan.name>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] fix warning-suppress for list type "warning type"
Date: Thu, 28 Mar 2024 21:07:34 -0400
[Message part 3 (text/plain, inline)]
Tags: patch


Bug report:

In warnings.el, the function warning-suppress is supposed to save the
user's choice into variable warning-suppress-types or
warning-suppress-log-types.

The type of a warning can be a simple symbol, or a list of symbols in
the format of '(warning-type subtype subsubtype).

The change introduced by commit d5ee49c25c8f59ab17c40eebdf38a769c2f5588b
fixes the problem in situations where the warning type is a simple
symbol, but this commit's code saves wrong data if the warning type is a
list.

old behavior:
type              warning-suppress-types
pkg           ->    '((pkg))                  Correct
(pkg subtype) ->    '(((pkg subtype)))        Incorrect

Refer to the implementation of warning-suppress-p, an element in
warning-suppress-types must be a list of symbols, must not be a simple
symbol, and must not be a list of lists (if this is the case, nothing is
going to be matched).

How to reproduce the bug:

Use any script that can emit a warning type that is a list. Press the
button on the warning buffer to suppress the warning. Run the script and
emit the warning again; you will see the warning buffer pop up, so the
warning is not suppressed.

How this patch fix the bug:

Check if the "warning type" is a list using "consp" first. If the
warning type is a list, add it directly to warning-suppress-types.
Otherwise, use the old behavior, wrap it in a list, then add it to
warning-suppress-types.

new behavior:
type              warning-suppress-types
pkg           ->    '((pkg))                Correct
(pkg subtype) ->    '((pkg subtype))        Correct

[0001-fix-warning-suppress-for-list-type-warning-type.patch (text/patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Xuan Wang <code <at> wangxuan.name>
Cc: 70063-done <at> debbugs.gnu.org
Subject: Re: bug#70063: [PATCH] fix warning-suppress for list type "warning
 type"
Date: Sun, 31 Mar 2024 12:10:50 +0300
> From: Xuan Wang <code <at> wangxuan.name>
> Date: Thu, 28 Mar 2024 21:07:34 -0400
> 
> Bug report:
> 
> In warnings.el, the function warning-suppress is supposed to save the
> user's choice into variable warning-suppress-types or
> warning-suppress-log-types.
> 
> The type of a warning can be a simple symbol, or a list of symbols in
> the format of '(warning-type subtype subsubtype).
> 
> The change introduced by commit d5ee49c25c8f59ab17c40eebdf38a769c2f5588b
> fixes the problem in situations where the warning type is a simple
> symbol, but this commit's code saves wrong data if the warning type is a
> list.

Thanks, installed on the emacs-29 branch, and closing the bug.


This bug report was last modified 1 year and 110 days ago.

Previous Next


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