From unknown Sun Jun 22 00:12:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70063: [PATCH] fix warning-suppress for list type "warning type" Resent-From: Xuan Wang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Mar 2024 04:08:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70063 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 70063@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1711685259945 (code B ref -1); Fri, 29 Mar 2024 04:08:03 +0000 Received: (at submit) by debbugs.gnu.org; 29 Mar 2024 04:07:39 +0000 Received: from localhost ([127.0.0.1]:41393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq3Wl-0000F6-1H for submit@debbugs.gnu.org; Fri, 29 Mar 2024 00:07:39 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq0il-0007YZ-Kn for submit@debbugs.gnu.org; Thu, 28 Mar 2024 21:07:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq0ie-0007Xv-R6 for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 21:07:44 -0400 Received: from mail-ot1-f46.google.com ([209.85.210.46]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq0ic-0004FL-Q2 for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 21:07:44 -0400 Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6e67d42422aso983104a34.0 for ; Thu, 28 Mar 2024 18:07:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711674460; x=1712279260; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=D+LB4EpXGxaDerNphIwn1MLNQsYR0HYR0y1RqfawQ3U=; b=dCk1iIsvODeWEz9AaP4fn3TGpFPeENinCvq6wKYEtla0Il4wsgsEDx0O55f7nnzUvi Y7IGP3h2ZUVUfCTi5ww6ZTLLMnEGTpK7sormbaHRb8ZT3a9yGqTbJfKem5EN7xzaCan1 HeUcMP4TupOlRNFr4IpHjVsVKN6+Lkc78SN4+lAyDPs5PeHKnm2C5XA7VM/Cs7CLcR2C tqrnjhbgG2fRtVzmLApDAsx6AJTUBz4dOT2Uh8LrJ/CMOyvWOh+uIx5q0GebHXYjoIY+ D7LGXYeeQ/cN+LJOiZJgpI+bdYRpiRtv8Kw+gxOYAQDq+rGmJjfdAQSTBg2pQKcK/iNk Wq5g== X-Gm-Message-State: AOJu0YxG81Aq4vyaU2QOsNRQQwZKp039vlZRrjQL3Bl+cQgGlO3AaPnO drhcMgmf1pjaenPPEgZLBL2LH/5T8phPQg1P3lbBNBUD8Pd9Sf81fYDXXjnc X-Google-Smtp-Source: AGHT+IFllylQhpczpwsimCFaG3/x68GRYemgF/srgrVZrodGivxGqs+HblYdMPxdG3JgydB15cKesg== X-Received: by 2002:a9d:7a9a:0:b0:6e7:b67c:1940 with SMTP id l26-20020a9d7a9a000000b006e7b67c1940mr557460otn.23.1711674460187; Thu, 28 Mar 2024 18:07:40 -0700 (PDT) Received: from WX-Desktop (074-065-109-118.res.spectrum.com. [74.65.109.118]) by smtp.gmail.com with ESMTPSA id z4-20020ae9f444000000b00787fd080d28sm992932qkl.74.2024.03.28.18.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 18:07:39 -0700 (PDT) From: Xuan Wang Date: Thu, 28 Mar 2024 21:07:34 -0400 Message-ID: <87zfuhu9pl.fsf@WX-Desktop.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=209.85.210.46; envelope-from=xuan.public@gmail.com; helo=mail-ot1-f46.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (xuan.public[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-Mailman-Approved-At: Fri, 29 Mar 2024 00:07:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-fix-warning-suppress-for-list-type-warning-type.patch >From 57084c8de073c8ca1e74b98ca67e08b88813c42e Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Thu, 28 Mar 2024 20:34:23 -0400 Subject: [PATCH] fix warning-suppress for list type "warning type" Per the document of warning-suppress-types and the implementation of warning-suppress-p, a warning type can be either a symbol or a list of symbols. The old implementation can generate wrong warning-suppress-types. old behavior: type warning-suppress-types pkg -> '((pkg)) Correct (pkg subtype) -> '(((pkg subtype))) Incorrect Now we check whether type is a cons cell first. (Should not use listp here as listp returns t for nil) new behavior: type warning-suppress-types pkg -> '((pkg)) Correct (pkg subtype) -> '((pkg subtype)) Correct --- lisp/emacs-lisp/warnings.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 6c62a56e99c..8b43c6a8726 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -225,10 +225,14 @@ SUPPRESS-LIST is the list of kinds of warnings to suppress." (?q "quit and do nothing")))) (?y (customize-save-variable 'warning-suppress-log-types - (cons (list type) warning-suppress-log-types))) + (if (consp type) + (cons type warning-suppress-log-types) + (cons (list type) warning-suppress-log-types)))) (?n (customize-save-variable 'warning-suppress-types - (cons (list type) warning-suppress-types))) + (if (consp type) + (cons type warning-suppress-types) + (cons (list type) warning-suppress-types)))) (_ (message "Exiting")))) ;;;###autoload -- 2.34.1 --=-=-=-- From unknown Sun Jun 22 00:12:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Xuan Wang Subject: bug#70063: closed (Re: bug#70063: [PATCH] fix warning-suppress for list type "warning type") Message-ID: References: <86edbqbwbp.fsf@gnu.org> <87zfuhu9pl.fsf@WX-Desktop.mail-host-address-is-not-set> X-Gnu-PR-Message: they-closed 70063 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 70063@debbugs.gnu.org Date: Sun, 31 Mar 2024 09:12:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1711876322-27406-1" This is a multi-part message in MIME format... ------------=_1711876322-27406-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #70063: [PATCH] fix warning-suppress for list type "warning type" which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 70063@debbugs.gnu.org. --=20 70063: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D70063 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1711876322-27406-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 70063-done) by debbugs.gnu.org; 31 Mar 2024 09:11:05 +0000 Received: from localhost ([127.0.0.1]:46607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqrDU-00073m-GN for submit@debbugs.gnu.org; Sun, 31 Mar 2024 05:11:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqrDR-00072l-M6 for 70063-done@debbugs.gnu.org; Sun, 31 Mar 2024 05:11:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqrDJ-0004Gr-DT; Sun, 31 Mar 2024 05:10:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CBCvezEyaxn6TxvMX/1WnXBvpViCtoOcRSG6be7oD+A=; b=YBv2Wyk2iqHG 5thWTLYBzljEu3WZBslvrTP8YVU13HhcB49lSZ/QM4t0MDLnVVvZ4rKQuOPqxCSfNgJliUY01Rwoa ASEcFAU33Y+Wvraq3+g9Pa38x6B99d8W7ptBfLH+/aEeSfxqOR2WU4fYMcqewrDqM1Hu+mMcdwNq+ Mmx43d9tFbOHC5As6bIEokNot+20viyKzwjPKjy2gvlNkWOwGddCvlMbe8HCF4+x9vXtpb8OgYTjX MbXG8il7saL1b//AaLJBFAvYog56jwp7aYg1PDOdRlYmg2hmwlyj3St6UTLqHkbXUiq7GVO2EpGYy kkFAn/2sBqXudBA5sdppog==; Date: Sun, 31 Mar 2024 12:10:50 +0300 Message-Id: <86edbqbwbp.fsf@gnu.org> From: Eli Zaretskii To: Xuan Wang In-Reply-To: <87zfuhu9pl.fsf@WX-Desktop.mail-host-address-is-not-set> (message from Xuan Wang on Thu, 28 Mar 2024 21:07:34 -0400) Subject: Re: bug#70063: [PATCH] fix warning-suppress for list type "warning type" References: <87zfuhu9pl.fsf@WX-Desktop.mail-host-address-is-not-set> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70063-done Cc: 70063-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Xuan Wang > 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. ------------=_1711876322-27406-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 Mar 2024 04:07:39 +0000 Received: from localhost ([127.0.0.1]:41393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq3Wl-0000F6-1H for submit@debbugs.gnu.org; Fri, 29 Mar 2024 00:07:39 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq0il-0007YZ-Kn for submit@debbugs.gnu.org; Thu, 28 Mar 2024 21:07:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq0ie-0007Xv-R6 for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 21:07:44 -0400 Received: from mail-ot1-f46.google.com ([209.85.210.46]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq0ic-0004FL-Q2 for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 21:07:44 -0400 Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6e67d42422aso983104a34.0 for ; Thu, 28 Mar 2024 18:07:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711674460; x=1712279260; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=D+LB4EpXGxaDerNphIwn1MLNQsYR0HYR0y1RqfawQ3U=; b=dCk1iIsvODeWEz9AaP4fn3TGpFPeENinCvq6wKYEtla0Il4wsgsEDx0O55f7nnzUvi Y7IGP3h2ZUVUfCTi5ww6ZTLLMnEGTpK7sormbaHRb8ZT3a9yGqTbJfKem5EN7xzaCan1 HeUcMP4TupOlRNFr4IpHjVsVKN6+Lkc78SN4+lAyDPs5PeHKnm2C5XA7VM/Cs7CLcR2C tqrnjhbgG2fRtVzmLApDAsx6AJTUBz4dOT2Uh8LrJ/CMOyvWOh+uIx5q0GebHXYjoIY+ D7LGXYeeQ/cN+LJOiZJgpI+bdYRpiRtv8Kw+gxOYAQDq+rGmJjfdAQSTBg2pQKcK/iNk Wq5g== X-Gm-Message-State: AOJu0YxG81Aq4vyaU2QOsNRQQwZKp039vlZRrjQL3Bl+cQgGlO3AaPnO drhcMgmf1pjaenPPEgZLBL2LH/5T8phPQg1P3lbBNBUD8Pd9Sf81fYDXXjnc X-Google-Smtp-Source: AGHT+IFllylQhpczpwsimCFaG3/x68GRYemgF/srgrVZrodGivxGqs+HblYdMPxdG3JgydB15cKesg== X-Received: by 2002:a9d:7a9a:0:b0:6e7:b67c:1940 with SMTP id l26-20020a9d7a9a000000b006e7b67c1940mr557460otn.23.1711674460187; Thu, 28 Mar 2024 18:07:40 -0700 (PDT) Received: from WX-Desktop (074-065-109-118.res.spectrum.com. [74.65.109.118]) by smtp.gmail.com with ESMTPSA id z4-20020ae9f444000000b00787fd080d28sm992932qkl.74.2024.03.28.18.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 18:07:39 -0700 (PDT) From: Xuan Wang To: bug-gnu-emacs@gnu.org Subject: [PATCH] fix warning-suppress for list type "warning type" Date: Thu, 28 Mar 2024 21:07:34 -0400 Message-ID: <87zfuhu9pl.fsf@WX-Desktop.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=209.85.210.46; envelope-from=xuan.public@gmail.com; helo=mail-ot1-f46.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (xuan.public[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 29 Mar 2024 00:07:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-fix-warning-suppress-for-list-type-warning-type.patch >From 57084c8de073c8ca1e74b98ca67e08b88813c42e Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Thu, 28 Mar 2024 20:34:23 -0400 Subject: [PATCH] fix warning-suppress for list type "warning type" Per the document of warning-suppress-types and the implementation of warning-suppress-p, a warning type can be either a symbol or a list of symbols. The old implementation can generate wrong warning-suppress-types. old behavior: type warning-suppress-types pkg -> '((pkg)) Correct (pkg subtype) -> '(((pkg subtype))) Incorrect Now we check whether type is a cons cell first. (Should not use listp here as listp returns t for nil) new behavior: type warning-suppress-types pkg -> '((pkg)) Correct (pkg subtype) -> '((pkg subtype)) Correct --- lisp/emacs-lisp/warnings.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 6c62a56e99c..8b43c6a8726 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -225,10 +225,14 @@ SUPPRESS-LIST is the list of kinds of warnings to suppress." (?q "quit and do nothing")))) (?y (customize-save-variable 'warning-suppress-log-types - (cons (list type) warning-suppress-log-types))) + (if (consp type) + (cons type warning-suppress-log-types) + (cons (list type) warning-suppress-log-types)))) (?n (customize-save-variable 'warning-suppress-types - (cons (list type) warning-suppress-types))) + (if (consp type) + (cons type warning-suppress-types) + (cons (list type) warning-suppress-types)))) (_ (message "Exiting")))) ;;;###autoload -- 2.34.1 --=-=-=-- ------------=_1711876322-27406-1--