(add-to-list 'load-path "~/elisp/compiled-emacs")) (add-to-list 'load-path "~/elisp/compiled-xemacs") elc files in ~/elisp/compiled-xemacs, then add to your init file (if you share it): ( if ( featurep ' xemacs) elc files in ~/elisp/compiled-emacs, compile with XEmacs and put the. You need to store the compiled files in two different directories, and then you need to add to appropriate directory to your load-path ( LoadPath) depending on which emacsen you are running.Įxample: Compile files with Emacs and put the. Emacs and XEmacsĮmacs and XEmacs ( GnuEmacs, XEmacs) may barf on byte-compiled files that they didn’t byte-compile themselves. el’ files automatically, see AutoRecompile. The information stored in that entry is used by the byte-compiler.įor a way to make Emacs byte-compile and load updated `. You’ll see that it has a ‘Plist’ (property list) with an entry ‘byte-compile’. One of the results returned will be ‘mapcar’ itself. If you want to know whether a function call will be replaced by something different in byte-compiled files, you can use ‘M-x apropos’ – for example, ‘M-x apropos mapcar’. elc file doesn't existĪutoAsyncByteCompile compiles modified *.el with batch-byte-compile automatically. (byte-recompile-directory ".") like before, but in this case force the byte-compilation of an. elc files which has a corresponding newer.
#Emacs load path code#
Here it is an example of Emacs-Lisp code using such a function: compile all the files. This command will only byte-compile files that already have a byte-compiled version unless you provide it with the flag 0. Emacs warns you about this, but you might miss the warning message.Ī good way to prevent this is to get in the habit of using command ‘byte-recompile-directory’ to byte-compile all source files that are newer than their byte-compiled versions. If you change a source file, but don’t remember to byte-compile it again, then Emacs might load the out-of-date byte-compiled file instead of the newer source file. If both source and byte-compiled files are present for the same library at the same place in your ‘load-path’, Emacs will load the byte-compiled file, not the source file. For example with Emacs-Lisp you do: (byte-compile-file "foo.el")ĮmacsLisp source files have extension `. You can byte-compile any EmacsLisp source file using the command ‘byte-compile-file’. It usually won’t hurt to byte-compile your code, but it usually won’t speed things up much either.
A library that should not be byte-compiled will use a local-variable declaration to preveent byte-compilation: -*-no-byte-compile: t -*.
#Emacs load path full#
See 'Byte Compilation' in the GNU Emacs Lisp Reference Manual, for a full description.” The EmacsLispIntro has this to say on ByteCompilation: “ As a practical matter, for most things you might do to customize or extend Emacs, you do not need to byte compile.
Most EmacsLisp libraries run faster when byte-compiled, so you’ll usually want to ensure that the libraries you use are byte-compiled.