aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-11-19 23:33:36 -0500
committerStefan Monnier2011-11-19 23:33:36 -0500
commitbac7ff225f427ac2db9465363abc5010750e2e2d (patch)
tree9a6c484e290ba75aa8236a251bbcba52d5b6ac63
parentcd1181dbece7f23a801ce9c56b985f9466cd6511 (diff)
downloademacs-bac7ff225f427ac2db9465363abc5010750e2e2d.tar.gz
emacs-bac7ff225f427ac2db9465363abc5010750e2e2d.zip
* lisp/emacs-lisp/bytecomp.el: Silence obsolete warnings more reliably.
(byte-compile-global-not-obsolete-vars): New var. (byte-compile-check-variable, byte-compile-make-obsolete-variable): Use it. (byte-compile-warn-obsolete): Align text with the one in *Help*.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/emacs-lisp/bytecomp.el11
2 files changed, 15 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8f9038ffede..e79af3ae2e8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/bytecomp.el: Silence obsolete warnings more reliably.
4 (byte-compile-global-not-obsolete-vars): New var.
5 (byte-compile-check-variable, byte-compile-make-obsolete-variable):
6 Use it.
7 (byte-compile-warn-obsolete): Align text with the one in *Help*.
8
12011-11-20 Juanma Barranquero <lekktu@gmail.com> 92011-11-20 Juanma Barranquero <lekktu@gmail.com>
2 10
3 * progmodes/cwarn.el (cwarn-is-enabled, cwarn-font-lock-keywords): 11 * progmodes/cwarn.el (cwarn-is-enabled, cwarn-font-lock-keywords):
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 2e05e93d569..3d593570c4e 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -359,10 +359,12 @@ else the global value will be modified."
359 "List of commands that are not meant to be called from Lisp.") 359 "List of commands that are not meant to be called from Lisp.")
360 360
361(defvar byte-compile-not-obsolete-vars nil 361(defvar byte-compile-not-obsolete-vars nil
362 "If non-nil, a list of variables that shouldn't be reported as obsolete.") 362 "List of variables that shouldn't be reported as obsolete.")
363(defvar byte-compile-global-not-obsolete-vars nil
364 "Global list of variables that shouldn't be reported as obsolete.")
363 365
364(defvar byte-compile-not-obsolete-funcs nil 366(defvar byte-compile-not-obsolete-funcs nil
365 "If non-nil, a list of functions that shouldn't be reported as obsolete.") 367 "List of functions that shouldn't be reported as obsolete.")
366 368
367(defcustom byte-compile-generate-call-tree nil 369(defcustom byte-compile-generate-call-tree nil
368 "Non-nil means collect call-graph information when compiling. 370 "Non-nil means collect call-graph information when compiling.
@@ -1113,7 +1115,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1113 (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs)) 1115 (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs))
1114 (byte-compile-warn "`%s' is an obsolete %s%s%s" symbol 1116 (byte-compile-warn "`%s' is an obsolete %s%s%s" symbol
1115 (if funcp "function" "variable") 1117 (if funcp "function" "variable")
1116 (if asof (concat " (as of Emacs " asof ")") "") 1118 (if asof (concat " (as of " asof ")") "")
1117 (cond ((stringp instead) 1119 (cond ((stringp instead)
1118 (concat "; " instead)) 1120 (concat "; " instead))
1119 (instead 1121 (instead
@@ -3030,6 +3032,7 @@ That command is designed for interactive use only" fn))
3030 ((let ((od (get var 'byte-obsolete-variable))) 3032 ((let ((od (get var 'byte-obsolete-variable)))
3031 (and od 3033 (and od
3032 (not (memq var byte-compile-not-obsolete-vars)) 3034 (not (memq var byte-compile-not-obsolete-vars))
3035 (not (memq var byte-compile-global-not-obsolete-vars))
3033 (or (case (nth 1 od) 3036 (or (case (nth 1 od)
3034 (set (not (eq access-type 'reference))) 3037 (set (not (eq access-type 'reference)))
3035 (get (eq access-type 'reference)) 3038 (get (eq access-type 'reference))
@@ -4116,7 +4119,7 @@ binding slots have been popped."
4116(byte-defop-compiler-1 make-obsolete-variable) 4119(byte-defop-compiler-1 make-obsolete-variable)
4117(defun byte-compile-make-obsolete-variable (form) 4120(defun byte-compile-make-obsolete-variable (form)
4118 (when (eq 'quote (car-safe (nth 1 form))) 4121 (when (eq 'quote (car-safe (nth 1 form)))
4119 (push (nth 1 (nth 1 form)) byte-compile-not-obsolete-vars)) 4122 (push (nth 1 (nth 1 form)) byte-compile-global-not-obsolete-vars))
4120 (byte-compile-normal-call form)) 4123 (byte-compile-normal-call form))
4121 4124
4122(defun byte-compile-defvar (form) 4125(defun byte-compile-defvar (form)