aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-03-04 17:55:23 +0000
committerRichard M. Stallman2007-03-04 17:55:23 +0000
commit0c47ccd44ef2de6c7df6241b46bb99977251427b (patch)
treec48d5c62e9082d58e5d5881e0bf06a8de8f2507e
parent107159602ce83adbbe9922003b7aea133f9cb480 (diff)
downloademacs-0c47ccd44ef2de6c7df6241b46bb99977251427b.tar.gz
emacs-0c47ccd44ef2de6c7df6241b46bb99977251427b.zip
(Eval During Compile): Clarify putting macros in eval-when-compile.
-rw-r--r--lispref/compile.texi13
1 files changed, 8 insertions, 5 deletions
diff --git a/lispref/compile.texi b/lispref/compile.texi
index 0d63887e1cc..4ed0eb8c1bf 100644
--- a/lispref/compile.texi
+++ b/lispref/compile.texi
@@ -454,11 +454,10 @@ used to load it for compiling, but not executing. For example,
454 (require 'my-macro-package)) ;; only macros needed from this 454 (require 'my-macro-package)) ;; only macros needed from this
455@end lisp 455@end lisp
456 456
457The same sort of thing goes for macros or @code{defalias}es defined 457The same sort of thing goes for macros and @code{defsubst} functions
458locally and only for use within the file. They can be defined while 458defined locally and only for use within the file. They are needed for
459compiling, but then not needed when executing. This is good for code 459compiling the file, but in most cases they are not needed for
460that's only a fallback for compatibility with other versions of Emacs. 460execution of the compiled file. For example,
461For example.
462 461
463@lisp 462@lisp
464(eval-when-compile 463(eval-when-compile
@@ -467,6 +466,10 @@ For example.
467 (compatibility code)))) 466 (compatibility code))))
468@end lisp 467@end lisp
469 468
469@noindent
470This is often good for code that's only a fallback for compatibility
471with other versions of Emacs.
472
470@strong{Common Lisp Note:} At top level, @code{eval-when-compile} is analogous to the Common 473@strong{Common Lisp Note:} At top level, @code{eval-when-compile} is analogous to the Common
471Lisp idiom @code{(eval-when (compile eval) @dots{})}. Elsewhere, the 474Lisp idiom @code{(eval-when (compile eval) @dots{})}. Elsewhere, the
472Common Lisp @samp{#.} reader macro (but not when interpreting) is closer 475Common Lisp @samp{#.} reader macro (but not when interpreting) is closer