comparison lisp/bytecomp/bytecomp.el @ 96:dbb370e3c29e r20-0final

Import from CVS: tag r20-0final
author cvs
date Mon, 13 Aug 2007 09:12:40 +0200
parents 131b0175ea99
children 0d2f883870bc
comparison
equal deleted inserted replaced
95:e8c07a565f9c 96:dbb370e3c29e
1 ;;; bytecomp.el --- compilation of Lisp code into byte code. 1 ;;; bytecomp.el --- compilation of Lisp code into byte code.
2 2
3 ;;; Copyright (C) 1985-1987, 1991-1994 Free Software Foundation, Inc. 3 ;;; Copyright (C) 1985-1987, 1991-1994 Free Software Foundation, Inc.
4 ;;; Copyright (C) 1996 Ben Wing. 4 ;;; Copyright (C) 1996 Ben Wing.
5 5
6 ;; Author: Jamie Zawinski <jwz@lucid.com> 6 ;; Author: Jamie Zawinski <jwz@netscape.com>
7 ;; Hallvard Furuseth <hbf@ulrik.uio.no> 7 ;; Hallvard Furuseth <hbf@ulrik.uio.no>
8 ;; Keywords: internal 8 ;; Keywords: internal
9 9
10 ;; Subsequently modified by RMS and others. 10 ;; Subsequently modified by RMS and others.
11 11
1222 ;; that is, variables from the lexical scope that is now 1222 ;; that is, variables from the lexical scope that is now
1223 ;; terminating. (Think nested lets.) 1223 ;; terminating. (Think nested lets.)
1224 (not (eq (car rest) 'new-scope))) 1224 (not (eq (car rest) 'new-scope)))
1225 (setq cell (car rest)) 1225 (setq cell (car rest))
1226 (if (and (= 0 (logand byte-compile-referenced-bit (cdr cell))) 1226 (if (and (= 0 (logand byte-compile-referenced-bit (cdr cell)))
1227 ;; Don't warn about declared-but-unused arguments, for two 1227 ;; Don't warn about declared-but-unused arguments,
1228 ;; reasons: first, the arglist structure might be imposed by 1228 ;; for two reasons: first, the arglist structure
1229 ;; external forces, and we don't have (declare (ignore x)) yet; 1229 ;; might be imposed by external forces, and we don't
1230 ;; and second, inline expansion produces forms like 1230 ;; have (declare (ignore x)) yet; and second, inline
1231 ;; expansion produces forms like
1231 ;; ((lambda (arg) (byte-code "..." [arg])) x) 1232 ;; ((lambda (arg) (byte-code "..." [arg])) x)
1232 ;; which we can't (ok, well, don't) recognise as containing a 1233 ;; which we can't (ok, well, don't) recognise as
1233 ;; reference to arg, so every inline expansion would generate 1234 ;; containing a reference to arg, so every inline
1234 ;; a warning. (If we had `ignore' then inline expansion could 1235 ;; expansion would generate a warning. (If we had
1235 ;; emit an ignore declaration.) 1236 ;; `ignore' then inline expansion could emit an
1237 ;; ignore declaration.)
1236 (= 0 (logand byte-compile-arglist-bit (cdr cell))) 1238 (= 0 (logand byte-compile-arglist-bit (cdr cell)))
1237 ;; Don't warn about defvars because this is a legitimate special 1239 ;; Don't warn about defvars because this is a
1238 ;; binding. 1240 ;; legitimate special binding.
1239 (not (byte-compile-defvar-p (car cell)))) 1241 (not (byte-compile-defvar-p (car cell))))
1240 (setq unreferenced (cons (car cell) unreferenced))) 1242 (setq unreferenced (cons (car cell) unreferenced)))
1241 (setq rest (cdr rest))) 1243 (setq rest (cdr rest)))
1242 (setq unreferenced (nreverse unreferenced)) 1244 (setq unreferenced (nreverse unreferenced))
1243 (while unreferenced 1245 (while unreferenced
1703 ;; Have to check if emacs-version is bound so that this works 1705 ;; Have to check if emacs-version is bound so that this works
1704 ;; in files loaded early in loadup.el. 1706 ;; in files loaded early in loadup.el.
1705 "\n(if (and (boundp 'emacs-version)\n" 1707 "\n(if (and (boundp 'emacs-version)\n"
1706 "\t (or (and (boundp 'epoch::version) epoch::version)\n" 1708 "\t (or (and (boundp 'epoch::version) epoch::version)\n"
1707 "\t (and (not (string-match \"XEmacs\" emacs-version))\n" 1709 "\t (and (not (string-match \"XEmacs\" emacs-version))\n"
1708 "\t (string-lessp emacs-version \"19.29\"))n" 1710 "\t (string-lessp emacs-version \"19.29\"))\n"
1709 "\t (string-lessp emacs-version \"19.14\")))\n" 1711 "\t (string-lessp emacs-version \"19.14\")))\n"
1710 " (error \"`" 1712 " (error \"`"
1711 ;; prin1-to-string is used to quote backslashes. 1713 ;; prin1-to-string is used to quote backslashes.
1712 (substring (prin1-to-string (file-name-nondirectory filename)) 1714 (substring (prin1-to-string (file-name-nondirectory filename))
1713 1 -1) 1715 1 -1)