annotate lisp/bytecomp/bytecomp-runtime.el @ 22:8fc7fe29b841 r19-15b94

Import from CVS: tag r19-15b94
author cvs
date Mon, 13 Aug 2007 08:50:29 +0200
parents 0293115a14e9
children ec9a17fef872
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; byte-run.el --- byte-compiler support for inlining
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1992 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Jamie Zawinski <jwz@lucid.com>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Hallvard Furuseth <hbf@ulrik.uio.no>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Keywords: internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; The code in this file should always be loaded, because it defines things
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; like "defsubst" which should work interpreted as well. The code in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; bytecomp.el and byte-optimize.el can be loaded as needed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
26 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
28 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; Synched up with: FSF 19.30.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;; interface to selectively inlining functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; This only happens when source-code optimization is turned on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; Redefined in byte-optimize.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; This is not documented--it's not clear that we should promote it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (fset 'inline 'progn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (put 'inline 'lisp-indent-hook 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;; Interface to inline functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; FSF comments the next two out, but I see no reason to do so. --ben
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defmacro proclaim-inline (&rest fns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Cause the named functions to be open-coded when called from compiled code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 They will only be compiled open-coded when byte-optimize is true."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (cons 'eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (apply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 'nconc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 '(lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (` ((or (memq (get '(, x) 'byte-optimizer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 '(nil byte-compile-inline-expand))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 "%s already has a byte-optimizer, can't make it inline"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 '(, x)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (put '(, x) 'byte-optimizer 'byte-compile-inline-expand))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 fns))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (defmacro proclaim-notinline (&rest fns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 "Cause the named functions to no longer be open-coded."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (cons 'eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (apply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 'nconc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 '(lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (` ((if (eq (get '(, x) 'byte-optimizer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 'byte-compile-inline-expand)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (put '(, x) 'byte-optimizer nil)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 fns))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;; This has a special byte-hunk-handler in bytecomp.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defmacro defsubst (name arglist &rest body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 "Define an inline function. The syntax is just like that of `defun'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (or (memq (get name 'byte-optimizer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 '(nil byte-compile-inline-expand))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (error "`%s' is a primitive" name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (list 'prog1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (cons 'defun (cons name (cons arglist body)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (list 'proclaim-inline name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ; Instead of the above line, FSF has this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ; (list 'eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ; (list 'put (list 'quote name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ; ''byte-optimizer ''byte-compile-inline-expand))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defun make-obsolete (fn new)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 "Make the byte-compiler warn that FUNCTION is obsolete.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 The warning will say that NEW should be used instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 If NEW is a string, that is the `use instead' message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (interactive "aMake function obsolete: \nxObsoletion replacement: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (let ((handler (get fn 'byte-compile)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (if (eq 'byte-compile-obsolete handler)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (setcar (get fn 'byte-obsolete-info) new)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (put fn 'byte-obsolete-info (cons new handler))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (put fn 'byte-compile 'byte-compile-obsolete)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 fn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (defun make-obsolete-variable (var new)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 "Make the byte-compiler warn that VARIABLE is obsolete,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 and NEW should be used instead. If NEW is a string, then that is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 `use instead' message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (let ((str (completing-read "Make variable obsolete: " obarray 'boundp t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (if (equal str "") (error ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (intern str))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (car (read-from-string (read-string "Obsoletion replacement: ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (put var 'byte-obsolete-variable new)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
116 ;; By overwhelming demand, we separate out truly obsolete symbols from
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
117 ;; those that are present for GNU Emacs compatibility.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
118 (defun make-compatible (fn new)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
119 "Make the byte-compiler know that FUNCTION is provided for compatibility.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
120 The warning will say that NEW should be used instead.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
121 If NEW is a string, that is the `use instead' message."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
122 (interactive "aMake function compatible: \nxCompatible replacement: ")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
123 (let ((handler (get fn 'byte-compile)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
124 (if (eq 'byte-compile-compatible handler)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
125 (setcar (get fn 'byte-compatible-info) new)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
126 (put fn 'byte-compatible-info (cons new handler))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
127 (put fn 'byte-compile 'byte-compile-compatible)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
128 fn)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
129
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
130 (defun make-compatible-variable (var new)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
131 "Make the byte-compiler know that VARIABLE is provided for compatibility.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
132 and NEW should be used instead. If NEW is a string, then that is the
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
133 `use instead' message."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
134 (interactive
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
135 (list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
136 (let ((str (completing-read "Make variable compatible: "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
137 obarray 'boundp t)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
138 (if (equal str "") (error ""))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
139 (intern str))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
140 (car (read-from-string (read-string "Compatible replacement: ")))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
141 (put var 'byte-compatible-variable new)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
142 var)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
143
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (put 'dont-compile 'lisp-indent-hook 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (defmacro dont-compile (&rest body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 "Like `progn', but the body always runs interpreted (not compiled).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 If you think you need this, you're probably making a mistake somewhere."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ;;; interface to evaluating things at compile time and/or load time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ;;; these macro must come after any uses of them in this file, as their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;;; definition in the file overrides the magic definitions on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;;; byte-compile-macro-environment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (put 'eval-when-compile 'lisp-indent-hook 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (defmacro eval-when-compile (&rest body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 "Like `progn', but evaluates the body at compile time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 The result of the body appears to the compiler as a quoted constant."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ;; Not necessary because we have it in b-c-initial-macro-environment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ;; (list 'quote (eval (cons 'progn body)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (cons 'progn body))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (put 'eval-and-compile 'lisp-indent-hook 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (defmacro eval-and-compile (&rest body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 "Like `progn', but evaluates the body at compile time and at load time."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ;; Remember, it's magic.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (cons 'progn body))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ;;; Interface to file-local byte-compiler parameters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ;;; Redefined in bytecomp.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ;;; The great RMS speaketh:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ;;;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
176 ;;; I nuked this because it's not a good idea for users to think of
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
177 ;;; using it. These options are a matter of installation preference,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
178 ;;; and have nothing to do with particular source files; it's a
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
179 ;;; mistake to suggest to users that they should associate these with
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
180 ;;; particular source files. There is hardly any reason to change
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
181 ;;; these parameters, anyway. --rms.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;;; But I'll leave this stuff alone. --ben
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (put 'byte-compiler-options 'lisp-indent-hook 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (defmacro byte-compiler-options (&rest args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 "Set some compilation-parameters for this file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 This will affect only the file in which it appears; this does nothing when
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
189 evaluated, or when loaded from a .el file.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 Each argument to this macro must be a list of a key and a value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 Keys: Values: Corresponding variable:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 verbose t, nil byte-compile-verbose
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 optimize t, nil, source, byte byte-optimize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 warnings list of warnings byte-compile-warnings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 file-format emacs18, emacs19 byte-compile-emacs18-compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 The value specificed with the `warnings' option must be a list, containing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 some subset of the following flags:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 free-vars references to variables not in the current lexical scope.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 unused-vars references to non-global variables bound but not referenced.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 unresolved calls to unknown functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 callargs lambda calls with args that don't match the definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 redefine function cell redefined from a macro to a lambda or vice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 versa, or redefined to take a different number of arguments.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 If the first element if the list is `+' or `-' then the specified elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 are added to or removed from the current set of warnings, instead of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 entire set of warnings being overwritten.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 For example, something like this might appear at the top of a source file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (byte-compiler-options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (optimize t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (warnings (- callargs)) ; Don't warn about arglist mismatch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (warnings (+ unused-vars)) ; Do warn about unused bindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (file-format emacs19))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 ;;; bytecomp-runtime.el ends here