emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/with-suppressed-warnings 397a1db 1/2: Enable suppr


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] scratch/with-suppressed-warnings 397a1db 1/2: Enable suppression of a number of warnings
Date: Sun, 9 Jun 2019 11:45:23 -0400 (EDT)

branch: scratch/with-suppressed-warnings
commit 397a1dbee5a557c5fe680de5c4ef82ff9b062246
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Enable suppression of a number of warnings
---
 lisp/emacs-lisp/bytecomp.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index b684c98..f9f9e6a 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -513,9 +513,9 @@ Return the compile-time value of FORM."
                                 expanded)))))
     (with-suppressed-warnings
         . (lambda (warnings &rest body)
-            (macroexpand-all `(internal--with-suppressed-warnings
-                               ',warnings ,@body)
-                             macroexpand-all-environment))))
+            `(internal--with-suppressed-warnings
+              ',warnings ,(macroexpand-all `(progn ,@body)
+                                           macroexpand-all-environment)))))
   "The default macro-environment passed to macroexpand by the compiler.
 Placing a macro here will cause a macro to have different semantics when
 expanded by the compiler as when expanded by the interpreter.")
@@ -1281,7 +1281,7 @@ function directly; use `byte-compile-warn' or
 
 (defun byte-compile-warn-obsolete (symbol)
   "Warn that SYMBOL (a variable or function) is obsolete."
-  (when (byte-compile-warning-enabled-p 'obsolete)
+  (when (byte-compile-warning-enabled-p 'obsolete symbol)
     (let* ((funcp (get symbol 'byte-obsolete-info))
            (msg (macroexp--obsolete-warning
                  symbol
@@ -2435,7 +2435,7 @@ list that represents a doc string reference.
 (defun byte-compile--declare-var (sym)
   (when (and (symbolp sym)
              (not (string-match "[-*/:$]" (symbol-name sym)))
-             (byte-compile-warning-enabled-p 'lexical))
+             (byte-compile-warning-enabled-p 'lexical sym))
     (byte-compile-warn "global/dynamic var `%s' lacks a prefix"
                        sym))
   (when (memq sym byte-compile-lexical-variables)
@@ -3223,8 +3223,8 @@ for symbols generated by the byte compiler itself."
         (byte-compile-discard))))
 
 (defun byte-compile-normal-call (form)
-  (when (and (byte-compile-warning-enabled-p 'callargs)
-             (symbolp (car form)))
+  (when (and (symbolp (car form))
+             (byte-compile-warning-enabled-p 'callargs (car form)))
     (if (memq (car form)
               '(custom-declare-group custom-declare-variable
                                      custom-declare-face))
@@ -3406,7 +3406,7 @@ for symbols generated by the byte compiler itself."
        ;; VAR is lexically bound
         (byte-compile-stack-ref (cdr lex-binding))
       ;; VAR is dynamically bound
-      (unless (or (not (byte-compile-warning-enabled-p 'free-vars))
+      (unless (or (not (byte-compile-warning-enabled-p 'free-vars var))
                  (boundp var)
                  (memq var byte-compile-bound-variables)
                  (memq var byte-compile-free-references))
@@ -4679,7 +4679,7 @@ binding slots have been popped."
   ;; This is not used for file-level defvar/consts.
   (when (and (symbolp (nth 1 form))
              (not (string-match "[-*/:$]" (symbol-name (nth 1 form))))
-             (byte-compile-warning-enabled-p 'lexical))
+             (byte-compile-warning-enabled-p 'lexical (nth 1 form)))
     (byte-compile-warn "global/dynamic var `%s' lacks a prefix"
                        (nth 1 form)))
   (let ((fun (nth 0 form))



reply via email to

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