1 @node Startup Paths, Packages, Command Switches, Top
2 @comment node-name, next, previous, up
3 @section How SXEmacs finds Directories and Files
8 SXEmacs deals with a multitude of files during operation. These files
9 are spread over many directories, and SXEmacs determines the location of
10 most of these directories at startup and organizes them into various
13 for the purposes of this section, is simply a list of directories which
14 SXEmacs searches successively in order to locate a file.)
16 @subsection SXEmacs Directory Hierarchies
18 @cindex directory hierarchies
20 Many of the files SXEmacs looks for are located within the SXEmacs
21 installation itself. However, there are several views of what actually
22 constitutes the "SXEmacs installation": SXEmacs may be run from the
23 compilation directory, it may be installed into arbitrary directories,
24 spread over several directories unrelated to each other. Moreover, it
25 may subsequently be moved to a different place. (This last case is not
26 as uncommon as it sounds. Binary kits work this way.) Consequently,
27 SXEmacs has quite complex procedures in place to find directories, no
28 matter where they may be hidden.
30 SXEmacs will always respect directory options passed to @code{configure}.
31 However, if it cannot locate a directory at the configured place, it
32 will initiate a search for the directory in any of a number of
33 @dfn{hierarchies} rooted under a directory which SXEmacs assumes contain
34 parts of the SXEmacs installation; it may locate several such hierarchies
35 and search across them. (Typically, there are just one or two
36 hierarchies: the hierarchy where SXEmacs was or will be installed, and
37 the one where it is being built.) Such a directory containing a
38 hierarchy is called a @dfn{root}.
39 @cindex root of a hierarchy
40 Whenever this section refers to a directory using the shorthand
41 @code{<root>}, it means that SXEmacs searches for it under all
42 hierarchies SXEmacs was able to scrounge up. In a
43 running SXEmacs, the hierarchy roots are stored in the variable
47 @subsection Package Hierarchies
48 @cindex package hierarchies
50 Many relevant directories and files SXEmacs uses are actually not part of
51 the core installation. They are part of any of the many packages
52 usually installed on top of an SXEmacs installation. (@xref{Packages}.)
53 Hence, they play a prominent role in the various paths SXEmacs sets up.
55 SXEmacs locates packages in any of a number of package hierarchies.
56 Package hierarchies fall into three groups: @dfn{early}, @dfn{late},
58 @cindex early package hierarchies
59 @cindex late package hierarchies
60 @cindex last package hierarchies
61 according to the relative location at which they show
62 up in the various SXEmacs paths. Early package hierarchies are at the
63 very front, late ones somewhere in the middle, and last hierarchies are
64 (you guessed it) last.
66 By default, SXEmacs expects an early package hierarchy in the
67 subdirectory @file{.sxemacs/xemacs-packages} of the user's home
70 Moreover, SXEmacs expects late hierarchies in the subdirectories
71 @file{site-packages}, @file{mule-packages}, @file{xemacs-packages}, and
72 @file{sxemacs-packages} (in that order) of the @file{<root>/lib/sxemacs}
73 subdirectory of one of the installation hierarchies. (If you run
74 in-place, these are direct subdirectories of the build directory.)
75 Furthermore, SXEmacs will also search these subdirectories in the
76 @file{<root>/lib/sxemacs-<VERSION>} subdirectory and prefer directories
79 By default, SXEmacs does not have a pre-configured last package
80 hierarchy. Last hierarchies are primarily for using package hierarchies
81 of outdated versions of XEmacs as a fallback option. For example, it is
82 possible to run SXEmacs with the 20.4 package hierarchy as a last
85 It is possible to specify at configure-time the location of the various
86 package hierarchies with the @code{--package-path} option to configure.
88 The early, late, and last components of the package path are separated
89 by double instead of single colons. If all three components are
90 present, they locate the early, late, and last package hierarchies
91 respectively. If two components are present, they locate the early and
92 late hierarchies. If only one component is present, it locates the
93 late hierarchy. At run time, the package path may also be specified via
94 the @code{EMACSPACKAGEPATH} environment variable.
96 An SXEmacs package is laid out just like a normal installed SXEmacs lisp
97 directory. It may have @file{lisp}, @file{etc}, @file{info}, and
98 @file{lib-src} subdirectories. SXEmacs adds these at appropriate places
99 within the various system-wide paths.
101 There may be any number of package hierarchy directories.
103 @subsection Directories and Paths
106 Here is a list of the various directories and paths SXEmacs tries to
107 locate during startup. SXEmacs distinguishes between directories and
108 paths specific to @dfn{version}, @dfn{site}, and @dfn{architecture}
109 when looking for them.
112 @item version-specific
113 @cindex version-specific directories
114 directories are specific to the version of SXEmacs they belong to and
115 typically reside under @file{<root>/lib/sxemacs-<VERSION>}.
117 @cindex site-specific directories
118 directories are independent of the version of SXEmacs they belong to and
119 typically reside under @file{<root>/lib/sxemacs}
120 @item architecture-specific
121 @cindex architecture-specific directories
122 directories are specific both to the version of SXEmacs and the
123 architecture it runs on and typically reside under
124 @file{<root>/lib/sxemacs-<VERSION>/<ARCHITECTURE>}.
127 During installation, all of these directories may also reside directly
128 under @file{<root>}, because that is where they are in the SXEmacs tarball.
130 If SXEmacs runs with the @code{-debug-paths} option (@pxref{Command
131 Switches}), it will print the values of these variables, hopefully
132 aiding in debugging any problems which come up.
137 @vindex lisp-directory
138 Contains the version-specific location of the Lisp files that come with
139 the core distribution of SXEmacs. SXEmacs will search it recursively to a
140 depth of 1 when setting up @code{load-path}.
144 Is where SXEmacs searches for SXEmacs Lisp files with commands like
147 It contains the package lisp directories (see further down) and the
148 version-specific core Lisp directories. If the environment variable
149 @code{EMACSLOADPATH} is set at startup, its directories are prepended to
151 @vindex EMACSLOADPATH
153 @item Info-directory-list
154 @vindex Info-directory-list
155 Contains the location of info files. (See @ref{(info)}.) It contains
156 the package info directories and the version-specific core
157 documentation. Moreover, SXEmacs will add @file{/usr/info},
158 @file{/usr/local/info} as well as the directories of the environment
159 variable @code{INFOPATH}
161 to @code{Info-directory-list}.
164 @vindex exec-directory
165 Is the directory of architecture-dependent files that come with SXEmacs,
166 especially executable programs intended for SXEmacs to invoke.
170 Is the path for executables which SXEmacs may want to start. It contains
171 the package executable paths as well as @code{exec-directory}, and the
172 directories of the environment variables @code{PATH}
174 and @code{EMACSPATH}.
178 @vindex doc-directory
179 Is the directory containing the architecture-specific @file{DOC} file
180 that contains documentation for SXEmacs' commands.
183 @vindex data-directory
184 Is the version-specific directory that contains core data files SXEmacs uses.
185 It may be initialized from the @code{EMACSDATA}
187 environment variable.
189 @item data-directory-list
190 @vindex data-directory-list
191 Is the path where SXEmacs looks for data files. It contains package data
192 directories as well as @code{data-directory}.