emacs-devel
[Top][All Lists]
Advanced

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

Re: Towards a cleaner build


From: Lars Ingebrigtsen
Subject: Re: Towards a cleaner build
Date: Fri, 17 May 2019 14:39:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

That should be:

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index e76baf5ed0..9502a139d1 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -337,12 +337,19 @@ byte-compile-warnings
        (or (symbolp v)
            (null (delq nil (mapcar (lambda (x) (not (symbolp x))) v))))))
 
-(defun byte-compile-warning-enabled-p (warning)
+(defun byte-compile-warning-enabled-p (warning &optional symbol)
   "Return non-nil if WARNING is enabled, according to `byte-compile-warnings'."
-  (or (eq byte-compile-warnings t)
-      (if (eq (car byte-compile-warnings) 'not)
-          (not (memq warning byte-compile-warnings))
-        (memq warning byte-compile-warnings))))
+  ;; Don't issue a warning for SYMBOL being obsolete if called from
+  ;; within an obsolete function.
+  (and (not (and symbol
+                 (eq warning 'obsolete)
+                 byte-compile-current-form
+                 (get byte-compile-current-form 'byte-obsolete-info)
+                 (not (memq symbol byte-compile-not-obsolete-funcs))))
+       (or (eq byte-compile-warnings t)
+           (if (eq (car byte-compile-warnings) 'not)
+               (not (memq warning byte-compile-warnings))
+             (memq warning byte-compile-warnings)))))
 
 ;;;###autoload
 (defun byte-compile-disable-warning (warning)
@@ -1268,7 +1275,7 @@ byte-compile-warn
 
 (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

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




reply via email to

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