]> code.delx.au - gnu-emacs/commitdiff
* lisp/emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable):
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 12 Mar 2011 02:59:24 +0000 (21:59 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 12 Mar 2011 02:59:24 +0000 (21:59 -0500)
Disable obsolescence warnings in the file that declares it.

lisp/ChangeLog
lisp/emacs-lisp/bytecomp.el

index 9456644a7a84537a726bed624e3270936c65ac29..087c5b0acbba29f351964389ef5d570a1d9c4472 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable):
+       Disable obsolescence warnings in the file that declares it.
+
 2011-03-11  Ken Manheimer  <ken.manheimer@gmail.com>
 
        * allout-widgets.el (allout-widgets-tally) Initialize
index 2f113dfb4795c518556ace470dd928823264ac1e..5e24b80ac5a1e8364590e93ee8362444d5737a91 100644 (file)
@@ -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))