Mercurial > emacs
comparison lispref/compile.texi @ 22138:d4ac295a98b3
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 19 May 1998 03:45:57 +0000 |
parents | 90da2489c498 |
children | 05a836654c88 |
comparison
equal
deleted
inserted
replaced
22137:2b0e6a1e7fb9 | 22138:d4ac295a98b3 |
---|---|
1 @c -*-texinfo-*- | 1 @c -*-texinfo-*- |
2 @c This is part of the GNU Emacs Lisp Reference Manual. | 2 @c This is part of the GNU Emacs Lisp Reference Manual. |
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
4 @c See the file elisp.texi for copying conditions. | 4 @c See the file elisp.texi for copying conditions. |
5 @setfilename ../info/compile | 5 @setfilename ../info/compile |
6 @node Byte Compilation, Advising, Loading, Top | 6 @node Byte Compilation, Advising Functions, Loading, Top |
7 @chapter Byte Compilation | 7 @chapter Byte Compilation |
8 @cindex byte-code | 8 @cindex byte-code |
9 @cindex compilation | 9 @cindex compilation |
10 | 10 |
11 Emacs Lisp has a @dfn{compiler} that translates functions written | 11 Emacs Lisp has a @dfn{compiler} that translates functions written |
17 Because the byte-compiled code is evaluated by the byte-code | 17 Because the byte-compiled code is evaluated by the byte-code |
18 interpreter, instead of being executed directly by the machine's | 18 interpreter, instead of being executed directly by the machine's |
19 hardware (as true compiled code is), byte-code is completely | 19 hardware (as true compiled code is), byte-code is completely |
20 transportable from machine to machine without recompilation. It is not, | 20 transportable from machine to machine without recompilation. It is not, |
21 however, as fast as true compiled code. | 21 however, as fast as true compiled code. |
22 | |
23 Compiling a Lisp file with the Emacs byte compiler always reads the | |
24 file as multibyte text, even if Emacs was started with @samp{--unibyte}, | |
25 unless the file specifies otherwise. This is so that compilation gives | |
26 results compatible with running the same file without compilation. | |
27 @xref{Loading Non-ASCII}. | |
22 | 28 |
23 In general, any version of Emacs can run byte-compiled code produced | 29 In general, any version of Emacs can run byte-compiled code produced |
24 by recent earlier versions of Emacs, but the reverse is not true. A | 30 by recent earlier versions of Emacs, but the reverse is not true. A |
25 major incompatible change was introduced in Emacs version 19.29, and | 31 major incompatible change was introduced in Emacs version 19.29, and |
26 files compiled with versions since that one will definitely not run | 32 files compiled with versions since that one will definitely not run |
162 function definition, the effect is to install a compiled version of that | 168 function definition, the effect is to install a compiled version of that |
163 function. | 169 function. |
164 @end deffn | 170 @end deffn |
165 | 171 |
166 @deffn Command byte-compile-file filename | 172 @deffn Command byte-compile-file filename |
167 This function compiles a file of Lisp code named @var{filename} into | 173 This function compiles a file of Lisp code named @var{filename} into a |
168 a file of byte-code. The output file's name is made by appending | 174 file of byte-code. The output file's name is made by changing the |
169 @samp{c} to the end of @var{filename}. | 175 @samp{.el} suffix into @samp{.elc}; if @var{filename} does not end in |
176 @samp{.el}, it adds @samp{.elc} to the end of @var{filename}. | |
170 | 177 |
171 Compilation works by reading the input file one form at a time. If it | 178 Compilation works by reading the input file one form at a time. If it |
172 is a definition of a function or macro, the compiled function or macro | 179 is a definition of a function or macro, the compiled function or macro |
173 definition is written out. Other forms are batched together, then each | 180 definition is written out. Other forms are batched together, then each |
174 batch is compiled, and written so that its compiled code will be | 181 batch is compiled, and written so that its compiled code will be |