[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

B. Building XEmacs; Allocation of Objects

This chapter describes how the runnable XEmacs executable is dumped with the preloaded Lisp libraries in it and how storage is allocated.

There is an entire separate document, the XEmacs Internals Manual, devoted to the internals of XEmacs from the perspective of the C programmer. It contains much more detailed information about the build process, the allocation and garbage-collection process, and other aspects related to the internals of XEmacs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

B.1 Building XEmacs

This section explains the steps involved in building the XEmacs executable. You don’t have to know this material to build and install XEmacs, since the makefiles do all these things automatically. This information is pertinent to XEmacs maintenance.

The XEmacs Internals Manual contains more information about this.

Compilation of the C source files in the ‘src’ directory produces an executable file called ‘temacs’. It contains the XEmacs Lisp interpreter and I/O routines, but not the editing commands.

Before XEmacs is actually usable, a number of Lisp files need to be loaded. These define all the editing commands, plus most of the startup code and many very basic Lisp primitives. This is accomplished by loading the file ‘loadup.el’, which in turn loads all of the other standardly-loaded Lisp files.

It takes a substantial time to load the standard Lisp files. Luckily, you don’t have to do this each time you run XEmacs; ‘temacs’ can dump out an executable program called ‘xemacs’ that has these files preloaded. ‘xemacs’ starts more quickly because it does not need to load the files. This is the XEmacs executable that is normally installed.

To create ‘xemacs’, use the command ‘temacs -batch -l loadup dump’. The purpose of ‘-batch’ here is to tell ‘temacs’ to run in non-interactive, command-line mode. (‘temacs’ can only run in this fashion. Part of the code required to initialize frames and faces is in Lisp, and must be loaded before XEmacs is able to create any frames.) The argument ‘dump’ tells ‘loadup.el’ to dump a new executable named ‘xemacs’.

The dumping process is highly system-specific, and some operating systems don’t support dumping. On those systems, you must start XEmacs with the ‘temacs -batch -l loadup run-temacs’ command each time you use it. This takes a substantial time, but since you need to start Emacs once a day at most—or once a week if you never log out—the extra time is not too severe a problem. (In older versions of Emacs, you started Emacs from ‘temacs’ using ‘temacs -l loadup’.)

You are free to start XEmacs directly from ‘temacs’ if you want, even if there is already a dumped ‘xemacs’. Normally you wouldn’t want to do that; but the Makefiles do this when you rebuild XEmacs using ‘make all-elc’, which builds XEmacs and simultaneously compiles any out-of-date Lisp files. (You need ‘xemacs’ in order to compile Lisp files. However, you also need the compiled Lisp files in order to dump out ‘xemacs’. If both of these are missing or corrupted, you are out of luck unless you’re able to bootstrap ‘xemacs’ from ‘temacs’. Note that ‘make all-elc’ actually loads the alternative loadup file ‘loadup-el.el’, which works like ‘loadup.el’ but forces XEmacs to ignore any compiled Lisp files even if they exist.)

You can specify additional files to preload by writing a library named ‘site-load.el’ that loads them. However, the advantage of preloading additional files decreases as machines get faster. On modern machines, it is often not advisable, especially if the Lisp code is on a file system local to the machine running XEmacs.

You can specify other Lisp expressions to execute just before dumping by putting them in a library named ‘site-init.el’. However, if they might alter the behavior that users expect from an ordinary unmodified XEmacs, it is better to put them in ‘default.el’, so that users can override them if they wish. See section Summary: Sequence of Actions at Start Up.

Before ‘loadup.el’ dumps the new executable, it finds the documentation strings for primitive and preloaded functions (and variables) in the file where they are stored, by calling Snarf-documentation (see section Access to Documentation Strings). These strings were moved out of the ‘xemacs’ executable to make it smaller. See section Documentation Basics.

Function: dump-emacs to-file from-file

This function dumps the current state of XEmacs into an executable file to-file. It takes symbols from from-file (this is normally the executable file ‘temacs’).

If you use this function in an XEmacs that was already dumped, you must set command-line-processed to nil first for good results. See section Command Line Arguments.

Function: run-emacs-from-temacs &rest args

This is the function that implements the ‘run-temacs’ command-line argument. It is called from ‘loadup.el’ as appropriate. You should most emphatically not call this yourself; it will reinitialize your XEmacs process and you’ll be sorry.

Command: emacs-version &optional arg

This function returns a string describing the version of XEmacs that is running. It is useful to include this string in bug reports.

When called interactively with a prefix argument, insert string at point. Don’t use this function in programs to choose actions according to the system configuration; look at system-configuration instead.

 
(emacs-version)
  ⇒ "XEmacs 20.1 [Lucid] (i586-unknown-linux2.0.29)
                 of Mon Apr  7 1997 on altair.xemacs.org"

Called interactively, the function prints the same information in the echo area.

Variable: emacs-build-time

The value of this variable is the time at which XEmacs was built at the local site.

 
emacs-build-time "Mon Apr  7 20:28:52 1997"
     ⇒
Variable: emacs-version

The value of this variable is the version of Emacs being run. It is a string, e.g. "20.1 XEmacs Lucid".

The following two variables did not exist before FSF GNU Emacs version 19.23 and XEmacs version 19.10, which reduces their usefulness at present, but we hope they will be convenient in the future.

Variable: emacs-major-version

The major version number of Emacs, as an integer. For XEmacs version 20.1, the value is 20.

Variable: emacs-minor-version

The minor version number of Emacs, as an integer. For XEmacs version 20.1, the value is 1.



[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Aidan Kehoe on December 27, 2016 using texi2html 1.82.