emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 46b8746b38e: Fix warning-suppress for list type "warning type"


From: Eli Zaretskii
Subject: emacs-29 46b8746b38e: Fix warning-suppress for list type "warning type"
Date: Sun, 31 Mar 2024 05:10:14 -0400 (EDT)

branch: emacs-29
commit 46b8746b38e26ae3f216f57f231f5fc8aec22873
Author: Xuan Wang <code@wangxuan.name>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix warning-suppress for list type "warning type"
    
    Per the documentation 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 previous
    implementation could 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 (warnings-suppress): Fix saving
    warning types in 'warning-suppress-types'.  (Bug#70063)
    
    Copyright-paperwork-exempt: yes
---
 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 61aa0a2fe22..9bed714aa11 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -224,10 +224,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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]