diff options
| author | Luc Teirlinck | 2004-01-14 22:59:33 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-01-14 22:59:33 +0000 |
| commit | e75c1a57f7d262845b072f1789ca646fc952528f (patch) | |
| tree | b5f6858031fc1cf2a658d2d373681779c63789f8 | |
| parent | 944e099f4321831f962b629ab3b0d1755be47e8f (diff) | |
| download | emacs-e75c1a57f7d262845b072f1789ca646fc952528f.tar.gz emacs-e75c1a57f7d262845b072f1789ca646fc952528f.zip | |
(Compilation Functions): Expand descriptions of `compile-defun',
`byte-compile-file', `byte-recompile-directory' and `batch-byte-compile'.
In particular, mention and describe all optional arguments.
(Disassembly): Correct and clarify the description of `disassemble'.
| -rw-r--r-- | lispref/ChangeLog | 2 | ||||
| -rw-r--r-- | lispref/compile.texi | 62 |
2 files changed, 42 insertions, 22 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 2926eb90d30..78ac60ecb1d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | 2004-01-14 Luc Teirlinck <teirllm@auburn.edu> | 1 | 2004-01-14 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 2 | ||
| 3 | * compile.texi (Compilation Functions): Expand descriptions of | 3 | * compile.texi (Compilation Functions): Expand descriptions of |
| 4 | `compile-defun', `byte-compile-file', byte-recompile-directory' | 4 | `compile-defun', `byte-compile-file', `byte-recompile-directory' |
| 5 | and `batch-byte-compile'. In particular, mention and describe | 5 | and `batch-byte-compile'. In particular, mention and describe |
| 6 | all optional arguments. | 6 | all optional arguments. |
| 7 | (Disassembly): Correct and clarify the description of `disassemble'. | 7 | (Disassembly): Correct and clarify the description of `disassemble'. |
diff --git a/lispref/compile.texi b/lispref/compile.texi index 4d91d2c5883..960b00dd6fc 100644 --- a/lispref/compile.texi +++ b/lispref/compile.texi | |||
| @@ -173,14 +173,18 @@ variable names and function names used by the function, except for | |||
| 173 | certain primitives that are coded as special instructions. | 173 | certain primitives that are coded as special instructions. |
| 174 | @end defun | 174 | @end defun |
| 175 | 175 | ||
| 176 | @deffn Command compile-defun | 176 | @deffn Command compile-defun &optional arg |
| 177 | This command reads the defun containing point, compiles it, and | 177 | This command reads the defun containing point, compiles it, and |
| 178 | evaluates the result. If you use this on a defun that is actually a | 178 | evaluates the result. If you use this on a defun that is actually a |
| 179 | function definition, the effect is to install a compiled version of that | 179 | function definition, the effect is to install a compiled version of that |
| 180 | function. | 180 | function. |
| 181 | |||
| 182 | @code{compile-defun} normally displays the result of evaluation in the | ||
| 183 | echo area, but if @var{arg} is non-@code{nil}, it inserts the result | ||
| 184 | in the current buffer after the form it compiled. | ||
| 181 | @end deffn | 185 | @end deffn |
| 182 | 186 | ||
| 183 | @deffn Command byte-compile-file filename | 187 | @deffn Command byte-compile-file filename &optional load |
| 184 | This function compiles a file of Lisp code named @var{filename} into a | 188 | This function compiles a file of Lisp code named @var{filename} into a |
| 185 | file of byte-code. The output file's name is made by changing the | 189 | file of byte-code. The output file's name is made by changing the |
| 186 | @samp{.el} suffix into @samp{.elc}; if @var{filename} does not end in | 190 | @samp{.el} suffix into @samp{.elc}; if @var{filename} does not end in |
| @@ -193,8 +197,11 @@ batch is compiled, and written so that its compiled code will be | |||
| 193 | executed when the file is read. All comments are discarded when the | 197 | executed when the file is read. All comments are discarded when the |
| 194 | input file is read. | 198 | input file is read. |
| 195 | 199 | ||
| 196 | This command returns @code{t}. When called interactively, it prompts | 200 | This command returns @code{t} if there were no errors and @code{nil} |
| 197 | for the file name. | 201 | otherwise. When called interactively, it prompts for the file name. |
| 202 | |||
| 203 | If @var{load} is non-@code{nil}, this command loads the compiled file | ||
| 204 | after compiling it. Interactively, @var{load} is the prefix argument. | ||
| 198 | 205 | ||
| 199 | @example | 206 | @example |
| 200 | @group | 207 | @group |
| @@ -215,20 +222,28 @@ for the file name. | |||
| 215 | @end example | 222 | @end example |
| 216 | @end deffn | 223 | @end deffn |
| 217 | 224 | ||
| 218 | @deffn Command byte-recompile-directory directory flag | 225 | @deffn Command byte-recompile-directory directory &optional flag force |
| 219 | @cindex library compilation | 226 | @cindex library compilation |
| 220 | This function recompiles every @samp{.el} file in @var{directory} that | 227 | This command recompiles every @samp{.el} file in @var{directory} (or |
| 221 | needs recompilation. A file needs recompilation if a @samp{.elc} file | 228 | its subdirectories) that needs recompilation. A file needs |
| 222 | exists but is older than the @samp{.el} file. | 229 | recompilation if a @samp{.elc} file exists but is older than the |
| 230 | @samp{.el} file. | ||
| 231 | |||
| 232 | When a @samp{.el} file has no corresponding @samp{.elc} file, | ||
| 233 | @var{flag} says what to do. If it is @code{nil}, this command ignores | ||
| 234 | these files. If @var{flag} is 0, it compiles them. If it is neither | ||
| 235 | @code{nil} nor 0, it asks the user whether to compile each such file. | ||
| 223 | 236 | ||
| 224 | When a @samp{.el} file has no corresponding @samp{.elc} file, @var{flag} | 237 | Interactively, @code{byte-recompile-directory} prompts for |
| 225 | says what to do. If it is @code{nil}, these files are ignored. If it | 238 | @var{directory} and @var{flag} is the prefix argument. |
| 226 | is non-@code{nil}, the user is asked whether to compile each such file. | ||
| 227 | 239 | ||
| 228 | The returned value of this command is unpredictable. | 240 | If @var{force} is non-@code{nil}, this command recompiles every |
| 241 | @samp{.el} file that has a @samp{.elc} file. | ||
| 242 | |||
| 243 | The returned value is unpredictable. | ||
| 229 | @end deffn | 244 | @end deffn |
| 230 | 245 | ||
| 231 | @defun batch-byte-compile | 246 | @defun batch-byte-compile &optional noforce |
| 232 | This function runs @code{byte-compile-file} on files specified on the | 247 | This function runs @code{byte-compile-file} on files specified on the |
| 233 | command line. This function must be used only in a batch execution of | 248 | command line. This function must be used only in a batch execution of |
| 234 | Emacs, as it kills Emacs on completion. An error in one file does not | 249 | Emacs, as it kills Emacs on completion. An error in one file does not |
| @@ -236,6 +251,9 @@ prevent processing of subsequent files, but no output file will be | |||
| 236 | generated for it, and the Emacs process will terminate with a nonzero | 251 | generated for it, and the Emacs process will terminate with a nonzero |
| 237 | status code. | 252 | status code. |
| 238 | 253 | ||
| 254 | If @var{noforce} is non-@code{nil}, this function does not recompile | ||
| 255 | files that have an up-to-date @samp{.elc} file. | ||
| 256 | |||
| 239 | @example | 257 | @example |
| 240 | % emacs -batch -f batch-byte-compile *.el | 258 | % emacs -batch -f batch-byte-compile *.el |
| 241 | @end example | 259 | @end example |
| @@ -420,7 +438,7 @@ these messages. | |||
| 420 | defined are always ``located'' at the end of the file, so these | 438 | defined are always ``located'' at the end of the file, so these |
| 421 | commands won't find the places they are really used. To do that, | 439 | commands won't find the places they are really used. To do that, |
| 422 | you must search for the function names. | 440 | you must search for the function names. |
| 423 | 441 | ||
| 424 | You can suppress the compiler warning for calling an undefined | 442 | You can suppress the compiler warning for calling an undefined |
| 425 | function @var{func} by conditionalizing the function call on a | 443 | function @var{func} by conditionalizing the function call on a |
| 426 | @code{fboundp} test, like this: | 444 | @code{fboundp} test, like this: |
| @@ -549,14 +567,16 @@ returns it as the value of the function. | |||
| 549 | ordinary Lisp variables, by transferring values between variables and | 567 | ordinary Lisp variables, by transferring values between variables and |
| 550 | the stack. | 568 | the stack. |
| 551 | 569 | ||
| 552 | @deffn Command disassemble object &optional stream | 570 | @deffn Command disassemble object &optional buffer-or-name |
| 553 | This function prints the disassembled code for @var{object}. If | 571 | This command displays the disassembled code for @var{object}. In |
| 554 | @var{stream} is supplied, then output goes there. Otherwise, the | 572 | interactive use, or if @var{buffer-or-name} is @code{nil} or omitted, |
| 555 | disassembled code is printed to the stream @code{standard-output}. The | 573 | the output goes in a buffer named @samp{*Disassemble*}. If |
| 556 | argument @var{object} can be a function name or a lambda expression. | 574 | @var{buffer-or-name} is non-@code{nil}, it must be a buffer or the |
| 575 | name of an existing buffer. Then the output goes there, at point, and | ||
| 576 | point is left before the output. | ||
| 557 | 577 | ||
| 558 | As a special exception, if this function is used interactively, | 578 | The argument @var{object} can be a function name, a lambda expression |
| 559 | it outputs to a buffer named @samp{*Disassemble*}. | 579 | or a byte-code object. |
| 560 | @end deffn | 580 | @end deffn |
| 561 | 581 | ||
| 562 | Here are two examples of using the @code{disassemble} function. We | 582 | Here are two examples of using the @code{disassemble} function. We |