GNU bug report logs -
#70063
[PATCH] fix warning-suppress for list type "warning type"
Previous Next
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
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (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)]
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.