summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-03-13 10:28:15 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-03-13 10:28:15 -0700
commit3eca4629203c3038f04db312999ca32d8e292e50 (patch)
tree7dab20a2f6de3e300fd266f51b71efd1d9f52188 /lisp/emacs-lisp/bytecomp.el
parent01e0b5adf4e35c2b00705c212b853936fe218cac (diff)
parentd32df629a23d0e04eb70df9c6e60e821d905c822 (diff)
downloademacs-3eca4629203c3038f04db312999ca32d8e292e50.tar.gz
emacs-3eca4629203c3038f04db312999ca32d8e292e50.tar.bz2
emacs-3eca4629203c3038f04db312999ca32d8e292e50.zip
Merge from mainline.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el11
1 files changed, 11 insertions, 0 deletions
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))