From 3aaaa6f1c9ebd44db3a293e6fd4c08193caf2275 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 11 Mar 2011 21:59:24 -0500 Subject: [PATCH] * lisp/emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable): Disable obsolescence warnings in the file that declares it. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/bytecomp.el | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9456644a7a8..087c5b0acbb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-03-12 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable): + Disable obsolescence warnings in the file that declares it. + 2011-03-11 Ken Manheimer * allout-widgets.el (allout-widgets-tally) Initialize diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 2f113dfb479..5e24b80ac5a 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3840,6 +3840,17 @@ that suppresses all warnings during execution of BODY." ,@decls ',(nth 1 form))))) +;; If foo.el declares `toto' as obsolete, it is likely that foo.el will +;; actually use `toto' in order for this obsolete variable to still work +;; correctly, so paradoxically, while byte-compiling foo.el, the presence +;; of a make-obsolete-variable call for `toto' is an indication that `toto' +;; should not trigger obsolete-warnings in foo.el. +(byte-defop-compiler-1 make-obsolete-variable) +(defun byte-compile-make-obsolete-variable (form) + (when (eq 'quote (car-safe (nth 1 form))) + (push (nth 1 (nth 1 form)) byte-compile-not-obsolete-vars)) + (byte-compile-normal-call form)) + (defun byte-compile-defvar (form) ;; This is not used for file-level defvar/consts with doc strings. (when (and (symbolp (nth 1 form)) -- 2.39.5