diff options
| author | Stefan Monnier | 2001-11-17 00:54:36 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-11-17 00:54:36 +0000 |
| commit | fef3407e0a974d248ad3eceabcc8436dc57a268b (patch) | |
| tree | 25009fad13d78b732d91e735eb48b00061954517 | |
| parent | 0b936a1e08fa024a88a1cad194ae6d11fc6a4546 (diff) | |
| download | emacs-fef3407e0a974d248ad3eceabcc8436dc57a268b.tar.gz emacs-fef3407e0a974d248ad3eceabcc8436dc57a268b.zip | |
(byte-compile-call-tree, byte-code-vector)
(byte-stack+-info, byte-compile-last-warned-form)
(byte-compile-last-logged-file): Don't defconst a variable.
(no-byte-compile): Declare.
(byte-compile-file): Don't boundp-check no-byte-compile any more.
(byte-compile-defvar): Leave defconst as is.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 9e5007bfeaa..5504f5448e3 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.91 $") | 13 | (defconst byte-compile-version "$Revision: 2.92 $") |
| 14 | 14 | ||
| 15 | ;; This file is part of GNU Emacs. | 15 | ;; This file is part of GNU Emacs. |
| 16 | 16 | ||
| @@ -363,7 +363,7 @@ invoked interactively are excluded from this list." | |||
| 363 | :type '(choice (const :tag "Yes" t) (const :tag "No" nil) | 363 | :type '(choice (const :tag "Yes" t) (const :tag "No" nil) |
| 364 | (other :tag "Ask" lambda))) | 364 | (other :tag "Ask" lambda))) |
| 365 | 365 | ||
| 366 | (defconst byte-compile-call-tree nil "Alist of functions and their call tree. | 366 | (defvar byte-compile-call-tree nil "Alist of functions and their call tree. |
| 367 | Each element looks like | 367 | Each element looks like |
| 368 | 368 | ||
| 369 | \(FUNCTION CALLERS CALLS\) | 369 | \(FUNCTION CALLERS CALLS\) |
| @@ -441,10 +441,10 @@ Each element is (INDEX . VALUE)") | |||
| 441 | 441 | ||
| 442 | ;;; The byte codes; this information is duplicated in bytecomp.c | 442 | ;;; The byte codes; this information is duplicated in bytecomp.c |
| 443 | 443 | ||
| 444 | (defconst byte-code-vector nil | 444 | (defvar byte-code-vector nil |
| 445 | "An array containing byte-code names indexed by byte-code values.") | 445 | "An array containing byte-code names indexed by byte-code values.") |
| 446 | 446 | ||
| 447 | (defconst byte-stack+-info nil | 447 | (defvar byte-stack+-info nil |
| 448 | "An array with the stack adjustment for each byte-code.") | 448 | "An array with the stack adjustment for each byte-code.") |
| 449 | 449 | ||
| 450 | (defmacro byte-defop (opcode stack-adjust opname &optional docstring) | 450 | (defmacro byte-defop (opcode stack-adjust opname &optional docstring) |
| @@ -810,8 +810,8 @@ Each function's symbol gets marked with the `byte-compile-noruntime' property." | |||
| 810 | (if (symbolp x) (list 'prin1-to-string x) x)) | 810 | (if (symbolp x) (list 'prin1-to-string x) x)) |
| 811 | args))))))) | 811 | args))))))) |
| 812 | 812 | ||
| 813 | (defconst byte-compile-last-warned-form nil) | 813 | (defvar byte-compile-last-warned-form nil) |
| 814 | (defconst byte-compile-last-logged-file nil) | 814 | (defvar byte-compile-last-logged-file nil) |
| 815 | 815 | ||
| 816 | (defvar byte-compile-last-line nil | 816 | (defvar byte-compile-last-line nil |
| 817 | "Last known line number in the input.") | 817 | "Last known line number in the input.") |
| @@ -1322,6 +1322,12 @@ recompile every `.el' file that already has a `.elc' file." | |||
| 1322 | (if (> skip-count 0) (format ", %d skipped" skip-count) "") | 1322 | (if (> skip-count 0) (format ", %d skipped" skip-count) "") |
| 1323 | (if (> dir-count 1) (format " in %d directories" dir-count) "")))) | 1323 | (if (> dir-count 1) (format " in %d directories" dir-count) "")))) |
| 1324 | 1324 | ||
| 1325 | (defvar no-byte-compile nil | ||
| 1326 | "Non-nil to prevent byte-compiling of emacs-lisp code. | ||
| 1327 | This is normally set in local file variables at the end of the elisp file: | ||
| 1328 | |||
| 1329 | ;; Local Variables:\n;; no-byte-compile: t\n;; End: ") | ||
| 1330 | |||
| 1325 | ;;;###autoload | 1331 | ;;;###autoload |
| 1326 | (defun byte-compile-file (filename &optional load) | 1332 | (defun byte-compile-file (filename &optional load) |
| 1327 | "Compile a file of Lisp code named FILENAME into a file of byte code. | 1333 | "Compile a file of Lisp code named FILENAME into a file of byte code. |
| @@ -1388,8 +1394,7 @@ The value is non-nil if there were no errors, nil if errors." | |||
| 1388 | (setq default-directory (file-name-directory filename))) | 1394 | (setq default-directory (file-name-directory filename))) |
| 1389 | ;; Check if the file's local variables explicitly specify not to | 1395 | ;; Check if the file's local variables explicitly specify not to |
| 1390 | ;; compile this file. | 1396 | ;; compile this file. |
| 1391 | (if (with-current-buffer input-buffer | 1397 | (if (with-current-buffer input-buffer no-byte-compile) |
| 1392 | (and (boundp 'no-byte-compile) no-byte-compile)) | ||
| 1393 | (progn | 1398 | (progn |
| 1394 | (message "%s not compiled because of `no-byte-compile: %s'" | 1399 | (message "%s not compiled because of `no-byte-compile: %s'" |
| 1395 | (file-relative-name filename) | 1400 | (file-relative-name filename) |
| @@ -3296,10 +3301,12 @@ If FORM is a lambda or a macro, byte-compile it as a function." | |||
| 3296 | (byte-compile-warn "third arg to %s %s is not a string: %s" | 3301 | (byte-compile-warn "third arg to %s %s is not a string: %s" |
| 3297 | fun var string)) | 3302 | fun var string)) |
| 3298 | `(put ',var 'variable-documentation ,string)) | 3303 | `(put ',var 'variable-documentation ,string)) |
| 3299 | (if (cdr (cdr form)) ; `value' provided | 3304 | (if (cddr form) ; `value' provided |
| 3300 | (if (eq fun 'defconst) | 3305 | (if (eq fun 'defconst) |
| 3301 | ;; `defconst' sets `var' unconditionally. | 3306 | ;; `defconst' sets `var' unconditionally. |
| 3302 | `(setq ,var ,value) | 3307 | (let ((tmp (make-symbol "defconst-tmp-var"))) |
| 3308 | `(let ((,tmp ,value)) | ||
| 3309 | (eval '(defconst ,var ,tmp)))) | ||
| 3303 | ;; `defvar' sets `var' only when unbound. | 3310 | ;; `defvar' sets `var' only when unbound. |
| 3304 | `(if (not (boundp ',var)) (setq ,var ,value)))) | 3311 | `(if (not (boundp ',var)) (setq ,var ,value)))) |
| 3305 | `',var)))) | 3312 | `',var)))) |