aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-08-06 01:08:21 +0000
committerRichard M. Stallman2003-08-06 01:08:21 +0000
commit9e31e67b6f2286a3ce34cf4633875a2ec16664cf (patch)
treecd0b62ee91684f377623d69acc733e758eb74a4b
parentf0491f768e2163216ca93f980156d1f740e250d8 (diff)
downloademacs-9e31e67b6f2286a3ce34cf4633875a2ec16664cf.tar.gz
emacs-9e31e67b6f2286a3ce34cf4633875a2ec16664cf.zip
(byte-compile-not-obsolete-var): New var.
(byte-compile-variable-ref): Handle byte-compile-not-obsolete-var. (byte-compile-defvar): Bind byte-compile-not-obsolete-var to prevent warnings about defvar for an obsolete variable. (byte-compile-log-warning): warning-group-format renamed to warning-type-format.
-rw-r--r--lisp/emacs-lisp/bytecomp.el25
1 files changed, 15 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 43ce86921e8..c5be16908c0 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -10,7 +10,7 @@
10 10
11;;; This version incorporates changes up to version 2.10 of the 11;;; This version incorporates changes up to version 2.10 of the
12;;; Zawinski-Furuseth compiler. 12;;; Zawinski-Furuseth compiler.
13(defconst byte-compile-version "$Revision: 2.134 $") 13(defconst byte-compile-version "$Revision: 2.135 $")
14 14
15;; This file is part of GNU Emacs. 15;; This file is part of GNU Emacs.
16 16
@@ -351,6 +351,9 @@ Elements of the list may be be:
351 (const callargs) (const redefine) 351 (const callargs) (const redefine)
352 (const obsolete) (const noruntime) (const cl-functions)))) 352 (const obsolete) (const noruntime) (const cl-functions))))
353 353
354(defvar byte-compile-not-obsolete-var nil
355 "If non-nil, this is a variable that shouldn't be reported as obsolete.")
356
354(defcustom byte-compile-generate-call-tree nil 357(defcustom byte-compile-generate-call-tree nil
355 "*Non-nil means collect call-graph information when compiling. 358 "*Non-nil means collect call-graph information when compiling.
356This records functions were called and from where. 359This records functions were called and from where.
@@ -982,7 +985,7 @@ Each function's symbol gets marked with the `byte-compile-noruntime' property."
982;; Also log the current function and file if not already done. 985;; Also log the current function and file if not already done.
983(defun byte-compile-log-warning (string &optional fill level) 986(defun byte-compile-log-warning (string &optional fill level)
984 (let ((warning-prefix-function 'byte-compile-warning-prefix) 987 (let ((warning-prefix-function 'byte-compile-warning-prefix)
985 (warning-group-format "") 988 (warning-type-format "")
986 (warning-fill-prefix (if fill " "))) 989 (warning-fill-prefix (if fill " ")))
987 (display-warning 'bytecomp string level "*Compile-Log*"))) 990 (display-warning 'bytecomp string level "*Compile-Log*")))
988 991
@@ -2705,7 +2708,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
2705 (if (symbolp var) "constant" "nonvariable") 2708 (if (symbolp var) "constant" "nonvariable")
2706 (prin1-to-string var)) 2709 (prin1-to-string var))
2707 (if (and (get var 'byte-obsolete-variable) 2710 (if (and (get var 'byte-obsolete-variable)
2708 (memq 'obsolete byte-compile-warnings)) 2711 (memq 'obsolete byte-compile-warnings)
2712 (not (eq var byte-compile-not-obsolete-var)))
2709 (let* ((ob (get var 'byte-obsolete-variable)) 2713 (let* ((ob (get var 'byte-obsolete-variable))
2710 (when (cdr ob))) 2714 (when (cdr ob)))
2711 (byte-compile-warn "%s is an obsolete variable%s; %s" var 2715 (byte-compile-warn "%s is an obsolete variable%s; %s" var
@@ -3608,13 +3612,14 @@ If FORM is a lambda or a macro, byte-compile it as a function."
3608 fun var string)) 3612 fun var string))
3609 `(put ',var 'variable-documentation ,string)) 3613 `(put ',var 'variable-documentation ,string))
3610 (if (cddr form) ; `value' provided 3614 (if (cddr form) ; `value' provided
3611 (if (eq fun 'defconst) 3615 (let ((byte-compile-not-obsolete-var var))
3612 ;; `defconst' sets `var' unconditionally. 3616 (if (eq fun 'defconst)
3613 (let ((tmp (make-symbol "defconst-tmp-var"))) 3617 ;; `defconst' sets `var' unconditionally.
3614 `(funcall '(lambda (,tmp) (defconst ,var ,tmp)) 3618 (let ((tmp (make-symbol "defconst-tmp-var")))
3615 ,value)) 3619 `(funcall '(lambda (,tmp) (defconst ,var ,tmp))
3616 ;; `defvar' sets `var' only when unbound. 3620 ,value))
3617 `(if (not (default-boundp ',var)) (setq-default ,var ,value))) 3621 ;; `defvar' sets `var' only when unbound.
3622 `(if (not (default-boundp ',var)) (setq-default ,var ,value))))
3618 (when (eq fun 'defconst) 3623 (when (eq fun 'defconst)
3619 ;; This will signal an appropriate error at runtime. 3624 ;; This will signal an appropriate error at runtime.
3620 `(eval ',form))) 3625 `(eval ',form)))