@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../info/compile
@node Byte Compilation, Advising Functions, Loading, Top
not work in subsequent versions if they contain character constants with
modifier bits.
+@vindex no-byte-compile
+ If you do not want a Lisp file to be compiled, ever, put a file-local
+variable binding for @code{no-byte-compile} into it, like this:
+
+@example
+;; -*-no-byte-compile: t; -*-
+@end example
+
@xref{Compilation Errors}, for how to investigate errors occurring in
byte compilation.
* Docs and Compilation:: Dynamic loading of documentation strings.
* Dynamic Loading:: Dynamic loading of individual functions.
* Eval During Compile:: Code to be evaluated when you compile.
+* Compiler Errors:: Handling compiler error messages.
* Byte-Code Objects:: The data type used for byte-compiled functions.
* Disassembly:: Disassembling byte-code; how to read byte-code.
@end menu
(defun silly-loop (n)
"Return time before and after N iterations of a loop."
(let ((t1 (current-time-string)))
- (while (> (setq n (1- n))
+ (while (> (setq n (1- n))
0))
(list t1 (current-time-string))))
@result{} silly-loop
to what @code{eval-when-compile} does.
@end defspec
+@node Compiler Errors
+@section Compiler Errors
+@cindex compiler errors
+
+ Byte compilation writes errors and warnings into the buffer
+@samp{*Compile-Log*}. The messages include file names and line
+numbers that identify the location of the problem. The usual Emacs
+commands for operating on compiler diagnostics work properly on
+these messages.
+
+ However, the warnings about functions that were used but not
+defined are always ``located'' at the end of the file, so these
+commands won't find the places they are really used. To do that,
+you must search for the function names.
+
+ You can suppress the compiler warning for calling an undefined
+function @var{func} by conditionalizing the function call on a
+@code{fboundp} test, like this:
+
+@example
+(if (fboundp '@var{func}) ...(@var{func} ...)...)
+@end example
+
+@noindent
+The call to @var{func} must be in the @var{then-form} of the @code{if},
+and @var{func} must appear quoted in the call to @code{fboundp}.
+Likewise, you can suppress a compiler warning for an unbound variable
+@var{variable} by conditionalizing its use on a @code{boundp} test,
+like this:
+
+@example
+(if (boundp '@var{variable}) ...@var{variable}...)
+@end example
+
+@noindent
+The reference to @var{variable} must be in the @var{then-form} of the
+@code{if}, and @var{variable} must appear quoted in the call to
+@code{boundp}.
+
+ You can suppress any compiler warnings using the construct
+@code{with-no-warnings}:
+
+@defmac with-no-warnings body...
+In execution, this is equivalent to @code{(progn @var{body}...)},
+but the compiler does not issue warnings for anything that occurs
+inside @var{body}.
+
+We recommend that you use this construct around the smallest
+possible piece of code.
+@end defmac
+
@node Byte-Code Objects
@section Byte-Code Function Objects
@cindex compiled function
@group
0 constant 1 ; @r{Push 1 onto stack.}
-1 varref integer ; @r{Get value of @code{integer}}
+1 varref integer ; @r{Get value of @code{integer}}
; @r{from the environment}
; @r{and push the value}
; @r{onto the stack.}
@group
; @r{Stack now contains:}
; @minus{} @r{decremented value of @code{integer}}
- ; @minus{} @r{@code{factorial}}
+ ; @minus{} @r{@code{factorial}}
; @minus{} @r{value of @code{integer}}
; @minus{} @r{@code{*}}
@end group
(defun silly-loop (n)
"Return time before and after N iterations of a loop."
(let ((t1 (current-time-string)))
- (while (> (setq n (1- n))
+ (while (> (setq n (1- n))
0))
(list t1 (current-time-string))))
@result{} silly-loop
@end group
@group
-19 constant current-time-string ; @r{Push}
+19 constant current-time-string ; @r{Push}
; @r{@code{current-time-string}}
; @r{onto top of stack.}
@end group
@end example
+@ignore
+ arch-tag: f78e3050-2f0a-4dee-be27-d9979a0a2289
+@end ignore