[comp.emacs] EVAL-WHEN in emacs

hallvard@IFI.UIO.NO (Hallvard B Furuseth) (06/09/91)

(require 'gnus) IS done at both compile-time and runtime, when it is
done at top level of the .el file (ie not inside another form).

This also means that you can use this to eval BODY both at
compile-time and run-time, if you want it:
(require (prog1 (provide 'foo)
	   BODY...))
It is possible this will fail at run-time with old emacs versions.

I'm the author of new bytecomp someone recently posted two versions
of.  It is slightly better than the original.  Someone told me he got
a 50% speedup and that reached the net, but it's completely wrong.
If you are not an elisp fanatic, I suggest you wait for emacs-19.

My bytecomp:
* Does not compile very short functions.  This is a slight speedup.
* Has some new features, such as (progn-expand ...) - this is
  (eval-when (compile) ...) but I didn't know the proper name.
* Compiles defuns inside defuns correctly, and has a few other bug
  fixes.
* Compiles the whole file, not only defuns & defmacros.  Good for
  your .emacs file, but you can also get the old one to compile
  everything by putting this around the body of your .emacs:
    (defun foo ()
      ...
      (fmakunbound 'foo))
    (foo)


			Hallvard