emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r103630: * lisp/emacs-lisp/bytecomp.e


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103630: * lisp/emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable):
Date: Fri, 11 Mar 2011 21:59:24 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103630
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2011-03-11 21:59:24 -0500
message:
  * lisp/emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable):
  Disable obsolescence warnings in the file that declares it.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/bytecomp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-03-11 18:46:12 +0000
+++ b/lisp/ChangeLog    2011-03-12 02:59:24 +0000
@@ -1,3 +1,8 @@
+2011-03-12  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable):
+       Disable obsolescence warnings in the file that declares it.
+
 2011-03-11  Ken Manheimer  <address@hidden>
 
        * allout-widgets.el (allout-widgets-tally) Initialize

=== modified file 'lisp/emacs-lisp/bytecomp.el'
--- a/lisp/emacs-lisp/bytecomp.el       2011-02-23 15:22:28 +0000
+++ b/lisp/emacs-lisp/bytecomp.el       2011-03-12 02:59:24 +0000
@@ -3840,6 +3840,17 @@
        ,@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))


reply via email to

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