aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJoakim Verona2012-03-20 18:54:57 +0100
committerJoakim Verona2012-03-20 18:54:57 +0100
commitb827329a89291ed68dd017c53976be7ce5ed3b22 (patch)
treea020a2c4bd3e27be292cfab0973aa85cb0c0c52a /doc
parent28d5f38df4f3b2f2cd9bc36494b3c0d8034c6f6b (diff)
parentf0bcceb9955d5aef6a131a86c4f74cc3e6e4c9ec (diff)
downloademacs-b827329a89291ed68dd017c53976be7ce5ed3b22.tar.gz
emacs-b827329a89291ed68dd017c53976be7ce5ed3b22.zip
upstream
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog15
-rw-r--r--doc/emacs/dired.texi6
-rw-r--r--doc/emacs/help.texi3
-rw-r--r--doc/emacs/mule.texi6
-rw-r--r--doc/emacs/package.texi45
-rw-r--r--doc/lispref/ChangeLog49
-rw-r--r--doc/lispref/display.texi122
-rw-r--r--doc/lispref/frames.texi3
-rw-r--r--doc/lispref/internals.texi180
-rw-r--r--doc/lispref/modes.texi4
-rw-r--r--doc/lispref/os.texi386
-rw-r--r--doc/lispref/package.texi41
12 files changed, 497 insertions, 363 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 5a1d1394b23..f5ccba1005f 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,18 @@
12012-03-17 Chong Yidong <cyd@gnu.org>
2
3 * package.texi (Package Installation): Document use of
4 package-initialize in init file.
5
62012-03-16 Glenn Morris <rgm@gnu.org>
7
8 * help.texi (Language Help):
9 * mule.texi (International Chars):
10 etc/HELLO is for character demonstration.
11
122012-03-15 Dani Moncayo <dmoncayo@gmail.com> (tiny change)
13
14 * dired.texi (Shell Commands in Dired): Fix typo.
15
12012-03-04 Chong Yidong <cyd@gnu.org> 162012-03-04 Chong Yidong <cyd@gnu.org>
2 17
3 * killing.texi (Clipboard): Document clipboard manager. 18 * killing.texi (Clipboard): Document clipboard manager.
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index e048237a4e2..7dd290939fe 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -823,9 +823,9 @@ replaces each occurrence.
823 823
824@item 824@item
825If the command string contains neither @samp{*} nor @samp{?}, Emacs 825If the command string contains neither @samp{*} nor @samp{?}, Emacs
826runs the shell command once for each file, adding the file name is 826runs the shell command once for each file, adding the file name at the
827added at the end. For example, @kbd{! uudecode @key{RET}} runs 827end. For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on
828@code{uudecode} on each file. 828each file.
829@end itemize 829@end itemize
830 830
831 To iterate over the file names in a more complicated fashion, use an 831 To iterate over the file names in a more complicated fashion, use an
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 05a3e546322..84da0a9a681 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -464,7 +464,8 @@ listing the associated character sets, coding systems, and input
464methods, as well as some sample text for that language environment. 464methods, as well as some sample text for that language environment.
465 465
466 The command @kbd{C-h h} (@code{view-hello-file}) displays the file 466 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
467@file{etc/HELLO}, which shows how to say ``hello'' in many languages. 467@file{etc/HELLO}, which demonstrates various character sets by showing
468how to say ``hello'' in many languages.
468 469
469 The command @kbd{C-h I} (@code{describe-input-method}) describes an 470 The command @kbd{C-h I} (@code{describe-input-method}) describes an
470input method---either a specified input method, or by default the 471input method---either a specified input method, or by default the
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index aebff1e463a..aeaec2c502e 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1997, 1999-2012 Free Software Foundation, Inc. 2@c Copyright (C) 1997, 1999-2012 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@node International, Modes, Frames, Top 4@node International, Modes, Frames, Top
5@chapter International Character Set Support 5@chapter International Character Set Support
@@ -137,8 +137,8 @@ writing files, and when exchanging data with subprocesses.
137@cindex undisplayable characters 137@cindex undisplayable characters
138@cindex @samp{?} in display 138@cindex @samp{?} in display
139 The command @kbd{C-h h} (@code{view-hello-file}) displays the file 139 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
140@file{etc/HELLO}, which shows how to say ``hello'' in many languages. 140@file{etc/HELLO}, which illustrates various scripts by showing
141This illustrates various scripts. If some characters can't be 141how to say ``hello'' in many languages. If some characters can't be
142displayed on your terminal, they appear as @samp{?} or as hollow boxes 142displayed on your terminal, they appear as @samp{?} or as hollow boxes
143(@pxref{Undisplayable Characters}). 143(@pxref{Undisplayable Characters}).
144 144
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi
index 7e2aa20d52e..91b25cfa00e 100644
--- a/doc/emacs/package.texi
+++ b/doc/emacs/package.texi
@@ -157,25 +157,38 @@ directory name of the package archive. You can alter this list if you
157wish to use third party package archives---but do so at your own risk, 157wish to use third party package archives---but do so at your own risk,
158and use only third parties that you think you can trust! 158and use only third parties that you think you can trust!
159 159
160 Once a package is downloaded and installed, it takes effect in the 160 Once a package is downloaded and installed, it is @dfn{loaded} into
161current Emacs session. What ``taking effect'' means depends on the 161the current Emacs session. Loading a package is not quite the same as
162package; most packages just make some new commands available, while 162loading a Lisp library (@pxref{Lisp Libraries}); its effect varies
163others have more wide-ranging effects on the Emacs session. For such 163from package to package. Most packages just make some new commands
164information, consult the package's help buffer. 164available, while others have more wide-ranging effects on the Emacs
165 165session. For such information, consult the package's help buffer.
166 By default, Emacs also automatically loads all installed packages 166
167(causing them to ``take effect'') in subsequent Emacs sessions. This 167 By default, Emacs also automatically loads all installed packages in
168happens at startup, after processing the init file (@pxref{Init 168subsequent Emacs sessions. This happens at startup, after processing
169File}). As an exception, Emacs does not load packages at startup if 169the init file (@pxref{Init File}). As an exception, Emacs does not
170invoked with the @samp{-q} or @samp{--no-init-file} options 170load packages at startup if invoked with the @samp{-q} or
171(@pxref{Initial Options}). 171@samp{--no-init-file} options (@pxref{Initial Options}).
172 172
173@vindex package-enable-at-startup 173@vindex package-enable-at-startup
174@findex package-initialize
175 To disable automatic package loading, change the variable 174 To disable automatic package loading, change the variable
176@code{package-enable-at-startup} to @code{nil}. If you do this, you 175@code{package-enable-at-startup} to @code{nil}.
177can use the command @kbd{M-x package-initialize} to load your 176
178packages. 177@findex package-initialize
178 The reason automatic package loading occurs after loading the init
179file is that user options only receive their customized values after
180loading the init file, including user options which affect the
181packaging system. In some circumstances, you may want to load
182packages explicitly in your init file (usually because some other code
183in your init file depends on a package). In that case, your init file
184should call the function @code{package-initialize}. It is up to you
185to ensure that relevant user options, such as @code{package-load-list}
186(see below), are set up prior to the @code{package-initialize} call.
187You should also set @code{package-enable-at-startup} to @code{nil}, to
188avoid loading the packages again after processing the init file.
189Alternatively, you may choose to completely inhibit package loading at
190startup, and invoke the command @kbd{M-x package-initialize} to load
191your packages manually.
179 192
180@vindex package-load-list 193@vindex package-load-list
181 For finer control over package loading, you can use the variable 194 For finer control over package loading, you can use the variable
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 3584c89d5fe..43ae349cb4c 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,52 @@
12012-03-20 Chong Yidong <cyd@gnu.org>
2
3 * display.texi (Forcing Redisplay): Various rewrites to reflect
4 new value of redisplay-dont-pause.
5 (Truncation): Copyedits.
6
72012-03-20 Glenn Morris <rgm@gnu.org>
8
9 * os.texi (Startup Summary): Don't mention initial-buffer-choice = t.
10 Add summary table of some relevant command-line options.
11
122012-03-18 Chong Yidong <cyd@gnu.org>
13
14 * internals.texi (Building Emacs, Garbage Collection): Copyedits.
15 (Writing Emacs Primitives): Re-organize discussion of functions
16 with variable Lisp arguments are handled. Delete an obsolete
17 remark, previously tagged as FIXME.
18
19 * os.texi (Idle Timers): Minor clarification.
20 (Idle Timers): Link to Time of Day for description of time list.
21
222012-03-18 Glenn Morris <rgm@gnu.org>
23
24 * os.texi (System Interface): Flow control was removed.
25 (Startup Summary): General update.
26 (Init File): Don't mention compiling it.
27
282012-03-17 Chong Yidong <cyd@gnu.org>
29
30 * os.texi (Startup Summary): Mention package loading.
31 (Init File): Don't refer to .emacs in section title. Copyedits.
32 (Terminal-Specific): Give a realistic example.
33 (Command-Line Arguments): Reference Entering Emacs instead of
34 repeating the spiel about not restarting Emacs.
35 (Time of Day): Discuss time representation at beginning of node.
36 (Sound Output): Copyedits.
37
38 * package.texi (Packaging Basics): Document package-initialize.
39
402012-03-17 Eli Zaretskii <eliz@gnu.org>
41
42 * frames.texi (Initial Parameters): Add an index entry for
43 minibuffer-only frame.
44
452012-03-16 Glenn Morris <rgm@gnu.org>
46
47 * modes.texi (Major Mode Conventions): Mention the strange
48 relationship between View mode and special modes. (Bug#10650)
49
12012-03-11 Chong Yidong <cyd@gnu.org> 502012-03-11 Chong Yidong <cyd@gnu.org>
2 51
3 * windows.texi (Window Configurations): save-window-excursion is 52 * windows.texi (Window Configurations): save-window-excursion is
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index c70418be52b..b68b0697936 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -86,59 +86,57 @@ attempt to redisplay, in the middle of Lisp code, without actually
86waiting for input. 86waiting for input.
87 87
88@defun redisplay &optional force 88@defun redisplay &optional force
89This function tries immediately to redisplay, provided there are no 89This function tries immediately to redisplay. The optional argument
90pending input events. 90@var{force}, if non-@code{nil}, forces the redisplay to be performed,
91 91instead of being preempted, even if input is pending and the variable
92If the optional argument @var{force} is non-@code{nil}, it does all 92@code{redisplay-dont-pause} is @code{nil} (see below). If
93pending redisplay work even if input is available, with no 93@code{redisplay-dont-pause} is non-@code{nil} (the default), this
94pre-emption. 94function redisplays in any case, i.e.@: @var{force} does nothing.
95 95
96The function returns @code{t} if it actually tried to redisplay, and 96The function returns @code{t} if it actually tried to redisplay, and
97@code{nil} otherwise. A value of @code{t} does not mean that 97@code{nil} otherwise. A value of @code{t} does not mean that
98redisplay proceeded to completion; it could have been pre-empted by 98redisplay proceeded to completion; it could have been preempted by
99newly arriving terminal input. 99newly arriving input.
100@end defun
101
102 @code{redisplay} with no argument tries immediately to redisplay,
103but has no effect on the usual rules for what parts of the screen to
104redisplay. By contrast, the following function adds certain windows
105to the pending redisplay work (as if their contents had completely
106changed), but doesn't immediately try to do any redisplay work.
107
108@defun force-window-update &optional object
109This function forces some or all windows to be updated on next
110redisplay. If @var{object} is a window, it requires eventual
111redisplay of that window. If @var{object} is a buffer or buffer name,
112it requires eventual redisplay of all windows displaying that buffer.
113If @var{object} is @code{nil} (or omitted), it requires eventual
114redisplay of all windows.
115@end defun 100@end defun
116 101
117 @code{force-window-update} does not do a redisplay immediately.
118(Emacs will do that when it waits for input.) Rather, its effect is
119to put more work on the queue to be done by redisplay whenever there
120is a chance.
121
122@defvar redisplay-dont-pause 102@defvar redisplay-dont-pause
123If this variable is non-@code{nil}, pending input does not prevent or 103If this variable is @code{nil}, arriving input events preempt
124halt redisplay; redisplay occurs, and finishes, regardless of whether 104redisplay; Emacs avoids starting a redisplay, and stops any redisplay
125input is available. If it is @code{nil}, Emacs redisplay stops if 105that is in progress, until the input has been processed. In
126input arrives, and does not happen at all if input is available before 106particular, @code{(redisplay)} returns @code{nil} without actually
127it starts. The default is @code{t}. 107redisplaying, if there is pending input.
108
109The default value is @code{t}, which means that pending input does not
110preempt redisplay.
128@end defvar 111@end defvar
129 112
130@defvar redisplay-preemption-period 113@defvar redisplay-preemption-period
131This variable specifies how many seconds Emacs waits between checks 114If @code{redisplay-dont-pause} is @code{nil}, this variable specifies
132for new input during redisplay. (The default is 0.1 seconds.) If 115how many seconds Emacs waits between checks for new input during
133input has arrived when Emacs checks, it pre-empts redisplay and 116redisplay; if input arrives during this interval, redisplay stops and
134processes the available input before trying again to redisplay. 117the input is processed. The default value is 0.1; if the value is
118@code{nil}, Emacs does not check for input during redisplay.
119
120This variable has no effect when @code{redisplay-dont-pause} is
121non-@code{nil} (the default).
122@end defvar
135 123
136If this variable is @code{nil}, Emacs does not check for input during 124 Although @code{redisplay} tries immediately to redisplay, it does
137redisplay, and redisplay cannot be preempted by input. 125not change how Emacs decides which parts of its frame(s) to redisplay.
126By contrast, the following function adds certain windows to the
127pending redisplay work (as if their contents had completely changed),
128but does not immediately try to perform redisplay.
138 129
139This variable is only obeyed on graphical terminals. For 130@defun force-window-update &optional object
140text terminals, see @ref{Terminal Output}. 131This function forces some or all windows to be updated the next time
141@end defvar 132Emacs does a redisplay. If @var{object} is a window, that window is
133to be updated. If @var{object} is a buffer or buffer name, all
134windows displaying that buffer are to be updated. If @var{object} is
135@code{nil} (or omitted), all windows are to be updated.
136
137This function does not do a redisplay immediately; Emacs does that as
138it waits for input, or when the function @code{redisplay} is called.
139@end defun
142 140
143@node Truncation 141@node Truncation
144@section Truncation 142@section Truncation
@@ -169,7 +167,7 @@ If this buffer-local variable is non-@code{nil}, lines that extend
169beyond the right edge of the window are truncated; otherwise, they are 167beyond the right edge of the window are truncated; otherwise, they are
170continued. As a special exception, the variable 168continued. As a special exception, the variable
171@code{truncate-partial-width-windows} takes precedence in 169@code{truncate-partial-width-windows} takes precedence in
172@dfn{partial-width} windows (i.e., windows that do not occupy the 170@dfn{partial-width} windows (i.e.@: windows that do not occupy the
173entire frame width). 171entire frame width).
174@end defopt 172@end defopt
175 173
@@ -192,37 +190,37 @@ a window, that forces truncation.
192 190
193@defvar wrap-prefix 191@defvar wrap-prefix
194If this buffer-local variable is non-@code{nil}, it defines a 192If this buffer-local variable is non-@code{nil}, it defines a
195``prefix'' that is prepended to every continuation line at 193@dfn{wrap prefix} which Emacs displays at the start of every
196display time. (If lines are truncated, the wrap-prefix is never 194continuation line. (If lines are truncated, @code{wrap-prefix} is
197used.) It may be a string or an image (@pxref{Other Display Specs}), 195never used.) Its value may be a string or an image (@pxref{Other
198or a stretch of whitespace such as specified by the @code{:width} or 196Display Specs}), or a stretch of whitespace such as specified by the
199@code{:align-to} display properties (@pxref{Specified Space}). The 197@code{:width} or @code{:align-to} display properties (@pxref{Specified
200value is interpreted in the same way as a @code{display} text 198Space}). The value is interpreted in the same way as a @code{display}
201property. @xref{Display Property}. 199text property. @xref{Display Property}.
202 200
203A wrap-prefix may also be specified for regions of text, using the 201A wrap prefix may also be specified for regions of text, using the
204@code{wrap-prefix} text or overlay property. This takes precedence 202@code{wrap-prefix} text or overlay property. This takes precedence
205over the @code{wrap-prefix} variable. @xref{Special Properties}. 203over the @code{wrap-prefix} variable. @xref{Special Properties}.
206@end defvar 204@end defvar
207 205
208@defvar line-prefix 206@defvar line-prefix
209If this buffer-local variable is non-@code{nil}, it defines a 207If this buffer-local variable is non-@code{nil}, it defines a
210``prefix'' that is prepended to every non-continuation line at 208@dfn{line prefix} which Emacs displays at the start of every
211display time. It may be a string or an image (@pxref{Other Display 209non-continuation line. Its value may be a string or an image
212Specs}), or a stretch of whitespace such as specified by the 210(@pxref{Other Display Specs}), or a stretch of whitespace such as
213@code{:width} or @code{:align-to} display properties (@pxref{Specified 211specified by the @code{:width} or @code{:align-to} display properties
214Space}). The value is interpreted in the same way as a @code{display} 212(@pxref{Specified Space}). The value is interpreted in the same way
215text property. @xref{Display Property}. 213as a @code{display} text property. @xref{Display Property}.
216 214
217A line-prefix may also be specified for regions of text using the 215A line prefix may also be specified for regions of text using the
218@code{line-prefix} text or overlay property. This takes precedence 216@code{line-prefix} text or overlay property. This takes precedence
219over the @code{line-prefix} variable. @xref{Special Properties}. 217over the @code{line-prefix} variable. @xref{Special Properties}.
220@end defvar 218@end defvar
221 219
222 If your buffer contains @emph{very} long lines, and you use 220 If your buffer contains @emph{very} long lines, and you use
223continuation to display them, computing the continuation lines can 221continuation to display them, computing the continuation lines can
224make Emacs redisplay slow. The column computation and indentation 222make redisplay slow. The column computation and indentation functions
225functions also become slow. Then you might find it advisable to set 223also become slow. Then you might find it advisable to set
226@code{cache-long-line-scans} to @code{t}. 224@code{cache-long-line-scans} to @code{t}.
227 225
228@defvar cache-long-line-scans 226@defvar cache-long-line-scans
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index a01ad051489..125d6071cab 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -420,10 +420,11 @@ the initial frame, specify the same parameters in
420@code{initial-frame-alist} with values that match the X resources. 420@code{initial-frame-alist} with values that match the X resources.
421@end defopt 421@end defopt
422 422
423If these parameters specify a separate minibuffer-only frame with 423If these parameters specify a separate @dfn{minibuffer-only frame} with
424@code{(minibuffer . nil)}, and you have not created one, Emacs creates 424@code{(minibuffer . nil)}, and you have not created one, Emacs creates
425one for you. 425one for you.
426 426
427@cindex minibuffer-only frame
427@defopt minibuffer-frame-alist 428@defopt minibuffer-frame-alist
428This variable's value is an alist of parameter values used when 429This variable's value is an alist of parameter values used when
429creating an initial minibuffer-only frame. This is the 430creating an initial minibuffer-only frame. This is the
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 55b18edf2ec..edf892e751a 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -28,42 +28,39 @@ internal aspects of GNU Emacs that may be of interest to C programmers.
28 This section explains the steps involved in building the Emacs 28 This section explains the steps involved in building the Emacs
29executable. You don't have to know this material to build and install 29executable. You don't have to know this material to build and install
30Emacs, since the makefiles do all these things automatically. This 30Emacs, since the makefiles do all these things automatically. This
31information is pertinent to Emacs maintenance. 31information is pertinent to Emacs developers.
32 32
33 Compilation of the C source files in the @file{src} directory 33 Compilation of the C source files in the @file{src} directory
34produces an executable file called @file{temacs}, also called a 34produces an executable file called @file{temacs}, also called a
35@dfn{bare impure Emacs}. It contains the Emacs Lisp interpreter and I/O 35@dfn{bare impure Emacs}. It contains the Emacs Lisp interpreter and
36routines, but not the editing commands. 36I/O routines, but not the editing commands.
37 37
38@cindex @file{loadup.el} 38@cindex @file{loadup.el}
39 The command @w{@samp{temacs -l loadup}} uses @file{temacs} to create 39 The command @w{@command{temacs -l loadup}} would run @file{temacs}
40the real runnable Emacs executable. These arguments direct 40and direct it to load @file{loadup.el}. The @code{loadup} library
41@file{temacs} to evaluate the Lisp files specified in the file 41loads additional Lisp libraries, which set up the normal Emacs editing
42@file{loadup.el}. These files set up the normal Emacs editing 42environment. After this step, the Emacs executable is no longer
43environment, resulting in an Emacs that is still impure but no longer 43@dfn{bare}.
44bare.
45 44
46@cindex dumping Emacs 45@cindex dumping Emacs
47 It takes some time to load the standard Lisp files. Luckily, 46 Because it takes some time to load the standard Lisp files, the
48you don't have to do this each time you run Emacs; @file{temacs} can 47@file{temacs} executable usually isn't run directly by users.
49dump out an executable program called @file{emacs} that has these files 48Instead, as one of the last steps of building Emacs, the command
50preloaded. @file{emacs} starts more quickly because it does not need to 49@samp{temacs -batch -l loadup dump} is run. The special @samp{dump}
51load the files. This is the Emacs executable that is normally 50argument causes @command{temacs} to dump out an executable program,
52installed. 51called @file{emacs}, which has all the standard Lisp files preloaded.
53 52(The @samp{-batch} argument prevents @file{temacs} from trying to
53initialize any of its data on the terminal, so that the tables of
54terminal information are empty in the dumped Emacs.)
55
56@cindex preloaded Lisp files
54@vindex preloaded-file-list 57@vindex preloaded-file-list
55@cindex dumped Lisp files 58 The dumped @file{emacs} executable (also called a @dfn{pure} Emacs)
56 To create @file{emacs}, use the command @samp{temacs -batch -l loadup 59is the one which is installed. The variable
57dump}. The purpose of @samp{-batch} here is to prevent @file{temacs} 60@code{preloaded-file-list} stores a list of the Lisp files preloaded
58from trying to initialize any of its data on the terminal; this ensures 61into the dumped Emacs. If you port Emacs to a new operating system,
59that the tables of terminal information are empty in the dumped Emacs. 62and are not able to implement dumping, then Emacs must load
60The argument @samp{dump} tells @file{loadup.el} to dump a new executable 63@file{loadup.el} each time it starts.
61named @file{emacs}. The variable @code{preloaded-file-list} stores a
62list of the Lisp files that were dumped with the @file{emacs} executable.
63
64 If you port Emacs to a new operating system, and are not able to
65implement dumping, then Emacs must load @file{loadup.el} each time it
66starts.
67 64
68@cindex @file{site-load.el} 65@cindex @file{site-load.el}
69 You can specify additional files to preload by writing a library named 66 You can specify additional files to preload by writing a library named
@@ -163,7 +160,7 @@ all the new data created during an Emacs session are kept
163in the preloaded standard Lisp files---data that should never change 160in the preloaded standard Lisp files---data that should never change
164during actual use of Emacs. 161during actual use of Emacs.
165 162
166 Pure storage is allocated only while @file{temacs} is loading the 163 Pure storage is allocated only while @command{temacs} is loading the
167standard preloaded Lisp libraries. In the file @file{emacs}, it is 164standard preloaded Lisp libraries. In the file @file{emacs}, it is
168marked as read-only (on operating systems that permit this), so that 165marked as read-only (on operating systems that permit this), so that
169the memory space can be shared by all the Emacs jobs running on the 166the memory space can be shared by all the Emacs jobs running on the
@@ -214,31 +211,27 @@ You should not change this flag in a running Emacs.
214 211
215@node Garbage Collection 212@node Garbage Collection
216@section Garbage Collection 213@section Garbage Collection
217@cindex garbage collection
218 214
219@cindex memory allocation 215@cindex memory allocation
220 When a program creates a list or the user defines a new function (such 216 When a program creates a list or the user defines a new function
221as by loading a library), that data is placed in normal storage. If 217(such as by loading a library), that data is placed in normal storage.
222normal storage runs low, then Emacs asks the operating system to 218If normal storage runs low, then Emacs asks the operating system to
223allocate more memory in blocks of 1k bytes. Each block is used for one 219allocate more memory. Different types of Lisp objects, such as
224type of Lisp object, so symbols, cons cells, markers, etc., are 220symbols, cons cells, markers, etc., are segregated in distinct blocks
225segregated in distinct blocks in memory. (Vectors, long strings, 221in memory. (Vectors, long strings, buffers and certain other editing
226buffers and certain other editing types, which are fairly large, are 222types, which are fairly large, are allocated in individual blocks, one
227allocated in individual blocks, one per object, while small strings are 223per object, while small strings are packed into blocks of 8k bytes.)
228packed into blocks of 8k bytes.)
229
230 It is quite common to use some storage for a while, then release it by
231(for example) killing a buffer or deleting the last pointer to an
232object. Emacs provides a @dfn{garbage collector} to reclaim this
233abandoned storage. (This name is traditional, but ``garbage recycler''
234might be a more intuitive metaphor for this facility.)
235 224
236 The garbage collector operates by finding and marking all Lisp objects 225@cindex garbage collection
237that are still accessible to Lisp programs. To begin with, it assumes 226 It is quite common to use some storage for a while, then release it
238all the symbols, their values and associated function definitions, and 227by (for example) killing a buffer or deleting the last pointer to an
239any data presently on the stack, are accessible. Any objects that can 228object. Emacs provides a @dfn{garbage collector} to reclaim this
240be reached indirectly through other accessible objects are also 229abandoned storage. The garbage collector operates by finding and
241accessible. 230marking all Lisp objects that are still accessible to Lisp programs.
231To begin with, it assumes all the symbols, their values and associated
232function definitions, and any data presently on the stack, are
233accessible. Any objects that can be reached indirectly through other
234accessible objects are also accessible.
242 235
243 When marking is finished, all objects still unmarked are garbage. No 236 When marking is finished, all objects still unmarked are garbage. No
244matter what the Lisp program or the user does, it is impossible to refer 237matter what the Lisp program or the user does, it is impossible to refer
@@ -336,11 +329,9 @@ The total size of all strings, in characters.
336The total number of elements of existing vectors. 329The total number of elements of existing vectors.
337 330
338@item used-floats 331@item used-floats
339@c Emacs 19 feature
340The number of floats in use. 332The number of floats in use.
341 333
342@item free-floats 334@item free-floats
343@c Emacs 19 feature
344The number of floats for which space has been obtained from the 335The number of floats for which space has been obtained from the
345operating system, but that are not currently being used. 336operating system, but that are not currently being used.
346 337
@@ -417,7 +408,6 @@ memory used by Lisp data, broken down by data type. By contrast, the
417function @code{memory-limit} provides information on the total amount of 408function @code{memory-limit} provides information on the total amount of
418memory Emacs is currently using. 409memory Emacs is currently using.
419 410
420@c Emacs 19 feature
421@defun memory-limit 411@defun memory-limit
422This function returns the address of the last byte Emacs has allocated, 412This function returns the address of the last byte Emacs has allocated,
423divided by 1024. We divide the value by 1024 to make sure it fits in a 413divided by 1024. We divide the value by 1024 to make sure it fits in a
@@ -428,7 +418,7 @@ memory usage.
428@end defun 418@end defun
429 419
430@defvar memory-full 420@defvar memory-full
431This variable is @code{t} if Emacs is close to out of memory for Lisp 421This variable is @code{t} if Emacs is nearly out of memory for Lisp
432objects, and @code{nil} otherwise. 422objects, and @code{nil} otherwise.
433@end defvar 423@end defvar
434 424
@@ -519,8 +509,9 @@ appearance.)
519@smallexample 509@smallexample
520@group 510@group
521DEFUN ("or", For, Sor, 0, UNEVALLED, 0, 511DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
522 doc: /* Eval args until one of them yields non-nil, then return that 512 doc: /* Eval args until one of them yields non-nil, then return
523value. The remaining args are not evalled at all. 513that value.
514The remaining args are not evalled at all.
524If all args return nil, return nil. 515If all args return nil, return nil.
525@end group 516@end group
526@group 517@group
@@ -566,14 +557,11 @@ This is the name of the Lisp symbol to define as the function name; in
566the example above, it is @code{or}. 557the example above, it is @code{or}.
567 558
568@item fname 559@item fname
569This is the C function name for this function. This is 560This is the C function name for this function. This is the name that
570the name that is used in C code for calling the function. The name is, 561is used in C code for calling the function. The name is, by
571by convention, @samp{F} prepended to the Lisp name, with all dashes 562convention, @samp{F} prepended to the Lisp name, with all dashes
572(@samp{-}) in the Lisp name changed to underscores. Thus, to call this 563(@samp{-}) in the Lisp name changed to underscores. Thus, to call
573function from C code, call @code{For}. Remember that the arguments must 564this function from C code, call @code{For}.
574be of type @code{Lisp_Object}; various macros and functions for creating
575values of type @code{Lisp_Object} are declared in the file
576@file{lisp.h}.
577 565
578@item sname 566@item sname
579This is a C variable name to use for a structure that holds the data for 567This is a C variable name to use for a structure that holds the data for
@@ -627,38 +615,35 @@ too.
627@end table 615@end table
628 616
629 After the call to the @code{DEFUN} macro, you must write the 617 After the call to the @code{DEFUN} macro, you must write the
630argument list that every C function must have, including the types for 618argument list for the C function, including the types for the
631the arguments. For a function with a fixed maximum number of 619arguments. If the primitive accepts a fixed maximum number of Lisp
632arguments, declare a C argument for each Lisp argument, and give them 620arguments, there must be one C argument for each Lisp argument, and
633all type @code{Lisp_Object}. When a Lisp function has no upper limit 621each argument must be of type @code{Lisp_Object}. (Various macros and
634on the number of arguments, its implementation in C actually receives 622functions for creating values of type @code{Lisp_Object} are declared
635exactly two arguments: the first is the number of Lisp arguments, and 623in the file @file{lisp.h}.) If the primitive has no upper limit on
636the second is the address of a block containing their values. They 624the number of Lisp arguments, it must have exactly two C arguments:
637have types @code{int} and @w{@code{Lisp_Object *}}. 625the first is the number of Lisp arguments, and the second is the
626address of a block containing their values. These have types
627@code{int} and @w{@code{Lisp_Object *}} respectively.
638 628
639@cindex @code{GCPRO} and @code{UNGCPRO} 629@cindex @code{GCPRO} and @code{UNGCPRO}
640@cindex protect C variables from garbage collection 630@cindex protect C variables from garbage collection
641 Within the function @code{For} itself, note the use of the macros 631 Within the function @code{For} itself, note the use of the macros
642@code{GCPRO1} and @code{UNGCPRO}. @code{GCPRO1} is used to 632@code{GCPRO1} and @code{UNGCPRO}. These macros are defined for the
643``protect'' a variable from garbage collection---to inform the garbage 633sake of the few platforms which do not use Emacs' default
644collector that it must look in that variable and regard its contents 634stack-marking garbage collector. The @code{GCPRO1} macro ``protects''
645as an accessible object. GC protection is necessary whenever you call 635a variable from garbage collection, explicitly informing the garbage
646@code{eval_sub} (or @code{Feval}) either directly or indirectly. 636collector that that variable and all its contents must be as
647At such a time, any Lisp object that this function may refer to again 637accessible. GC protection is necessary in any function which can
648must be protected somehow. 638perform Lisp evaluation by calling @code{eval_sub} or @code{Feval} as
639a subroutine, either directly or indirectly.
649 640
650 It suffices to ensure that at least one pointer to each object is 641 It suffices to ensure that at least one pointer to each object is
651GC-protected; that way, the object cannot be recycled, so all pointers 642GC-protected. Thus, a particular local variable can do without
652to it remain valid. Thus, a particular local variable can do without
653protection if it is certain that the object it points to will be 643protection if it is certain that the object it points to will be
654preserved by some other pointer (such as another local variable that 644preserved by some other pointer (such as another local variable that
655has a @code{GCPRO}). 645has a @code{GCPRO}). Otherwise, the local variable needs a
656@ignore 646@code{GCPRO}.
657@footnote{Formerly, strings were a special exception; in older Emacs
658versions, every local variable that might point to a string needed a
659@code{GCPRO}.}.
660@end ignore
661Otherwise, the local variable needs a @code{GCPRO}.
662 647
663 The macro @code{GCPRO1} protects just one local variable. If you 648 The macro @code{GCPRO1} protects just one local variable. If you
664want to protect two variables, use @code{GCPRO2} instead; repeating 649want to protect two variables, use @code{GCPRO2} instead; repeating
@@ -667,34 +652,17 @@ want to protect two variables, use @code{GCPRO2} instead; repeating
667implicitly use local variables such as @code{gcpro1}; you must declare 652implicitly use local variables such as @code{gcpro1}; you must declare
668these explicitly, with type @code{struct gcpro}. Thus, if you use 653these explicitly, with type @code{struct gcpro}. Thus, if you use
669@code{GCPRO2}, you must declare @code{gcpro1} and @code{gcpro2}. 654@code{GCPRO2}, you must declare @code{gcpro1} and @code{gcpro2}.
670Alas, we can't explain all the tricky details here.
671 655
672 @code{UNGCPRO} cancels the protection of the variables that are 656 @code{UNGCPRO} cancels the protection of the variables that are
673protected in the current function. It is necessary to do this 657protected in the current function. It is necessary to do this
674explicitly. 658explicitly.
675 659
676 Built-in functions that take a variable number of arguments actually
677accept two arguments at the C level: the number of Lisp arguments, and
678a @code{Lisp_Object *} pointer to a C vector containing those Lisp
679arguments. This C vector may be part of a Lisp vector, but it need
680not be. The responsibility for using @code{GCPRO} to protect the Lisp
681arguments from GC if necessary rests with the caller in this case,
682since the caller allocated or found the storage for them.
683
684 You must not use C initializers for static or global variables unless 660 You must not use C initializers for static or global variables unless
685the variables are never written once Emacs is dumped. These variables 661the variables are never written once Emacs is dumped. These variables
686with initializers are allocated in an area of memory that becomes 662with initializers are allocated in an area of memory that becomes
687read-only (on certain operating systems) as a result of dumping Emacs. 663read-only (on certain operating systems) as a result of dumping Emacs.
688@xref{Pure Storage}. 664@xref{Pure Storage}.
689 665
690@c FIXME is this still true? I don't think so...
691 Do not use static variables within functions---place all static
692variables at top level in the file. This is necessary because Emacs on
693some operating systems defines the keyword @code{static} as a null
694macro. (This definition is used because those systems put all variables
695declared static in a place that becomes read-only after dumping, whether
696they have initializers or not.)
697
698@cindex @code{defsubr}, Lisp symbol for a primitive 666@cindex @code{defsubr}, Lisp symbol for a primitive
699 Defining the C function is not enough to make a Lisp primitive 667 Defining the C function is not enough to make a Lisp primitive
700available; you must also create the Lisp symbol for the primitive and 668available; you must also create the Lisp symbol for the primitive and
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index b0e9d4a3139..946dcb91317 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -525,6 +525,10 @@ mode when creating new buffers (@pxref{Auto Major Mode}), but with such
525@code{special} modes, Fundamental mode is used instead. Modes such as 525@code{special} modes, Fundamental mode is used instead. Modes such as
526Dired, Rmail, and Buffer List use this feature. 526Dired, Rmail, and Buffer List use this feature.
527 527
528The function @code{view-buffer} does not enable View mode in buffers
529whose mode-class is special, because such modes usually provide their
530own View-like bindings.
531
528The @code{define-derived-mode} macro automatically marks the derived 532The @code{define-derived-mode} macro automatically marks the derived
529mode as special if the parent mode is special. Special mode is a 533mode as special if the parent mode is special. Special mode is a
530convenient parent for such modes to inherit from; @xref{Basic Major 534convenient parent for such modes to inherit from; @xref{Basic Major
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index f7df5f4bf87..2563bc57aef 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -8,8 +8,7 @@
8@chapter Operating System Interface 8@chapter Operating System Interface
9 9
10 This chapter is about starting and getting out of Emacs, access to 10 This chapter is about starting and getting out of Emacs, access to
11values in the operating system environment, and terminal input, output, 11values in the operating system environment, and terminal input, output.
12and flow control.
13 12
14 @xref{Building Emacs}, for related information. @xref{Display}, for 13 @xref{Building Emacs}, for related information. @xref{Display}, for
15additional operating system status information pertaining to the 14additional operating system status information pertaining to the
@@ -60,7 +59,7 @@ can customize these actions.
60@cindex @file{startup.el} 59@cindex @file{startup.el}
61 60
62 When Emacs is started up, it performs the following operations 61 When Emacs is started up, it performs the following operations
63(which are defined in @file{startup.el}): 62(see @code{normal-top-level} in @file{startup.el}):
64 63
65@enumerate 64@enumerate
66@item 65@item
@@ -70,6 +69,15 @@ adds the directory's subdirectories to the list, and those are scanned
70in their turn. The files @file{subdirs.el} are normally generated 69in their turn. The files @file{subdirs.el} are normally generated
71automatically when Emacs is installed. 70automatically when Emacs is installed.
72 71
72@item
73It registers input methods by loading any @file{leim-list.el} file
74found in the @code{load-path}.
75
76@c It removes PWD from the environment if it is not accurate.
77@c It abbreviates default-directory.
78
79@c Now normal-top-level calls command-line.
80
73@vindex before-init-time 81@vindex before-init-time
74@item 82@item
75It sets the variable @code{before-init-time} to the value of 83It sets the variable @code{before-init-time} to the value of
@@ -77,32 +85,49 @@ It sets the variable @code{before-init-time} to the value of
77@code{after-init-time} to @code{nil}, which signals to Lisp programs 85@code{after-init-time} to @code{nil}, which signals to Lisp programs
78that Emacs is being initialized. 86that Emacs is being initialized.
79 87
88@c set-locale-environment
89@item
90It sets the language environment and the terminal coding system,
91if requested by environment variables such as @code{LANG}.
92
93@item
94It does some basic parsing of the command-line arguments.
95
80@vindex initial-window-system@r{, and startup} 96@vindex initial-window-system@r{, and startup}
81@vindex window-system-initialization-alist 97@vindex window-system-initialization-alist
82@item 98@item
83It loads the initialization library for the window system specified by 99If not running in batch mode, it initializes the window system that
84the variable @code{initial-window-system} (@pxref{Window Systems, 100the variable @code{initial-window-system} specifies (@pxref{Window
85initial-window-system}). This library's name is 101Systems, initial-window-system}). The initialization function for
86@file{term/@var{windowsystem}-win.el}, where @var{windowsystem} is the 102each supported window system is specified by
87value of @code{initial-window-system}. From that library, it calls 103@code{window-system-initialization-alist}. If the value
88the appropriate initialization function. The initialization function 104of @code{initial-window-system} is @var{windowsystem}, then the
89for each supported window system is specified by 105appropriate initialization function is defined in the file
90@code{window-system-initialization-alist}. 106@file{term/@var{windowsystem}-win.el}. This file should have been
107compiled into the Emacs executable when it was built.
91 108
92@item 109@item
93It sets the language environment and the terminal coding system, 110It runs the normal hook @code{before-init-hook}.
94if requested by environment variables such as @code{LANG}.
95 111
96@item 112@item
97It processes the initial options. (Some of them are handled 113If appropriate (e.g., not in batch mode or started as a daemon), it
98even earlier than this.) 114creates a graphical frame.
99 115
100@item 116@item
101It runs the normal hook @code{before-init-hook}. 117It initializes the initial frame's faces, and sets up the menu bar
118and tool bar if needed. If graphical frames are supported, it sets up
119the tool bar even if the current frame is not a graphical one, since a
120graphical frame may be created later on.
102 121
103@item 122@item
104It initializes the initial frame's faces, and turns on the menu bar 123It use @code{custom-reevaluate-setting} to re-initialize the members
105and tool bar if needed. 124of the list @code{custom-delayed-init-variables}. These are any
125pre-loaded user options whose default value depends on the run-time,
126rather than build-time, context.
127@xref{Building Emacs, custom-initialize-delay}.
128
129@c @item
130@c It registers the colors available for tty frames.
106 131
107@item 132@item
108It loads the library @file{site-start}, if it exists. This is not 133It loads the library @file{site-start}, if it exists. This is not
@@ -127,6 +152,11 @@ It loads your abbrevs from the file specified by
127(@pxref{Abbrev Files, abbrev-file-name}). This is not done if the 152(@pxref{Abbrev Files, abbrev-file-name}). This is not done if the
128option @samp{--batch} was specified. 153option @samp{--batch} was specified.
129 154
155@item
156If @code{package-enable-at-startup} is non-@code{nil}, it calls the
157function @code{package-initialize} to activate any optional Emacs Lisp
158package that has been installed. @xref{Packaging Basics}.
159
130@vindex after-init-time 160@vindex after-init-time
131@item 161@item
132It sets the variable @code{after-init-time} to the value of 162It sets the variable @code{after-init-time} to the value of
@@ -149,13 +179,17 @@ Lisp library, which is specified by the variable
149@code{term-file-prefix} (@pxref{Terminal-Specific}). This is not done 179@code{term-file-prefix} (@pxref{Terminal-Specific}). This is not done
150in @code{--batch} mode, nor if @code{term-file-prefix} is @code{nil}. 180in @code{--batch} mode, nor if @code{term-file-prefix} is @code{nil}.
151 181
182@c Now command-line calls command-line-1.
183
152@item 184@item
153It displays the initial echo area message, unless you have suppressed 185It displays the initial echo area message, unless you have suppressed
154that with @code{inhibit-startup-echo-area-message}. 186that with @code{inhibit-startup-echo-area-message}.
155 187
156@item 188@item
157It processes the action arguments from the command line. 189It processes any command-line options that were not handled earlier.
158 190
191@c This next one is back in command-line, but the remaining bits of
192@c command-line-1 are not done if noninteractive.
159@item 193@item
160It now exits if the option @code{--batch} was specified. 194It now exits if the option @code{--batch} was specified.
161 195
@@ -164,6 +198,15 @@ If @code{initial-buffer-choice} is a string, it visits the file with
164that name. Furthermore, if the @samp{*scratch*} buffer exists and is 198that name. Furthermore, if the @samp{*scratch*} buffer exists and is
165empty, it inserts @code{initial-scratch-message} into that buffer. 199empty, it inserts @code{initial-scratch-message} into that buffer.
166 200
201@c To make things nice and confusing, the next three items can be
202@c called from two places. If displaying a startup screen, they are
203@c called in command-line-1 before the startup screen is shown.
204@c inhibit-startup-hooks is then set and window-setup-hook set to nil.
205@c If not displaying a startup screen, they are are called in
206@c normal-top-level.
207@c FIXME? So it seems they can be called before or after the
208@c daemon/session restore step?
209
167@item 210@item
168It runs @code{emacs-startup-hook} and then @code{term-setup-hook}. 211It runs @code{emacs-startup-hook} and then @code{term-setup-hook}.
169 212
@@ -176,23 +219,38 @@ specify.
176It runs @code{window-setup-hook}. @xref{Window Systems}. 219It runs @code{window-setup-hook}. @xref{Window Systems}.
177 220
178@item 221@item
179If the option @code{--daemon} was specified, it calls
180@code{server-start} and detaches from the controlling terminal.
181@xref{Emacs Server,,, emacs, The GNU Emacs Manual}.
182
183@item
184It displays the @dfn{startup screen}, which is a special buffer that 222It displays the @dfn{startup screen}, which is a special buffer that
185contains information about copyleft and basic Emacs usage. This is 223contains information about copyleft and basic Emacs usage. This is
186not done if @code{initial-buffer-choice} or 224not done if @code{initial-buffer-choice} or
187@code{inhibit-startup-screen} are @code{nil}, nor if the 225@code{inhibit-startup-screen} are @code{nil}, nor if the
188@samp{--no-splash} or @samp{-Q} command-line options were specified. 226@samp{--no-splash} or @samp{-Q} command-line options were specified.
189 227
228@c End of command-line-1.
229
230@c Back to command-line from command-line-1.
231
232@c This is the point at which we actually exit in batch mode, but the
233@c last few bits of command-line-1 are not done in batch mode.
234
235@item
236If the option @code{--daemon} was specified, it calls
237@code{server-start} and detaches from the controlling terminal.
238@xref{Emacs Server,,, emacs, The GNU Emacs Manual}.
239
190@item 240@item
191If started by the X session manager, it calls 241If started by the X session manager, it calls
192@code{emacs-session-restore} passing it as argument the ID of the 242@code{emacs-session-restore} passing it as argument the ID of the
193previous session. @xref{Session Management}. 243previous session. @xref{Session Management}.
244
245@c End of command-line.
246
247@c Back to normal-top-level from command-line.
248
194@end enumerate 249@end enumerate
195 250
251@noindent
252The following options affect some aspects of the startup sequence.
253
196@defopt inhibit-startup-screen 254@defopt inhibit-startup-screen
197This variable, if non-@code{nil}, inhibits the startup screen. In 255This variable, if non-@code{nil}, inhibits the startup screen. In
198that case, Emacs typically displays the @samp{*scratch*} buffer; but 256that case, Emacs typically displays the @samp{*scratch*} buffer; but
@@ -210,9 +268,13 @@ aliases for this variable.
210 268
211@defopt initial-buffer-choice 269@defopt initial-buffer-choice
212This variable, if non-@code{nil}, determines a file or buffer for 270This variable, if non-@code{nil}, determines a file or buffer for
213Emacs to display after starting up, instead of the startup screen. If 271Emacs to display after starting up, instead of the startup screen.
214its value is @code{t}, Emacs displays the @samp{*scratch*} buffer. If 272@ignore
215its value is a string, that specifies the name of a file for Emacs to 273@c I do not think this should be mentioned. AFAICS it is just a dodge
274@c around inhibit-startup-screen not being settable on a site-wide basis.
275If its value is @code{t}, Emacs displays the @samp{*scratch*} buffer.
276@end ignore
277If its value is a string, that specifies the name of a file for Emacs to
216visit. 278visit.
217@end defopt 279@end defopt
218 280
@@ -228,7 +290,7 @@ form to your init file:
228 290
229Emacs explicitly checks for an expression as shown above in your init 291Emacs explicitly checks for an expression as shown above in your init
230file; your login name must appear in the expression as a Lisp string 292file; your login name must appear in the expression as a Lisp string
231constant. Other methods of setting 293constant. You can also use the Custom interface. Other methods of setting
232@code{inhibit-startup-echo-area-message} to the same value do not 294@code{inhibit-startup-echo-area-message} to the same value do not
233inhibit the startup message. This way, you can easily inhibit the 295inhibit the startup message. This way, you can easily inhibit the
234message for yourself if you wish, but thoughtless copying of your init 296message for yourself if you wish, but thoughtless copying of your init
@@ -241,18 +303,49 @@ inserted into the @samp{*scratch*} buffer when Emacs starts up. If it
241is @code{nil}, the @samp{*scratch*} buffer is empty. 303is @code{nil}, the @samp{*scratch*} buffer is empty.
242@end defopt 304@end defopt
243 305
306@noindent
307The following command-line options affect some aspects of the startup
308sequence. @xref{Initial Options,,, emacs, The GNU Emacs Manual}.
309
310@table @code
311@item --no-splash
312Do not display a splash screen.
313
314@item --batch
315Run without an interactive terminal. @xref{Batch Mode}.
316
317@item --daemon
318Do not initialize any display; just start a server in the background.
319
320@item --no-init-file
321@itemx -Q
322Do not load either the init file, or the @file{default} library.
323
324@item --no-site-file
325Do not load the @file{site-start} library.
326
327@item --quick
328@itemx -Q
329Equivalent to @samp{-q --no-site-file --no-splash}.
330@c and --no-site-lisp, but let's not mention that here.
331@end table
332
333
244@node Init File 334@node Init File
245@subsection The Init File, @file{.emacs} 335@subsection The Init File
246@cindex init file 336@cindex init file
247@cindex @file{.emacs} 337@cindex @file{.emacs}
338@cindex @file{init.el}
248 339
249 When you start Emacs, it normally attempts to load your @dfn{init 340 When you start Emacs, it normally attempts to load your @dfn{init
250file}. This is either a file named @file{.emacs} or @file{.emacs.el} 341file}. This is either a file named @file{.emacs} or @file{.emacs.el}
251in your home directory, or a file named @file{init.el} in a 342in your home directory, or a file named @file{init.el} in a
252subdirectory named @file{.emacs.d} in your home directory. Whichever 343subdirectory named @file{.emacs.d} in your home directory.
253place you use, you can also compile the file (@pxref{Byte 344@ignore
345Whichever place you use, you can also compile the file (@pxref{Byte
254Compilation}); then the actual file loaded will be @file{.emacs.elc} 346Compilation}); then the actual file loaded will be @file{.emacs.elc}
255or @file{init.elc}. 347or @file{init.elc}.
348@end ignore
256 349
257 The command-line switches @samp{-q}, @samp{-Q}, and @samp{-u} 350 The command-line switches @samp{-q}, @samp{-Q}, and @samp{-u}
258control whether and where to find the init file; @samp{-q} (and the 351control whether and where to find the init file; @samp{-q} (and the
@@ -267,13 +360,13 @@ file. If those environment variables are absent, though, Emacs uses
267your user-id to find your home directory. 360your user-id to find your home directory.
268 361
269@cindex default init file 362@cindex default init file
270 A site may have a @dfn{default init file}, which is the library 363 An Emacs installation may have a @dfn{default init file}, which is a
271named @file{default.el}. Emacs finds the @file{default.el} file 364Lisp library named @file{default.el}. Emacs finds this file through
272through the standard search path for libraries (@pxref{How Programs Do 365the standard search path for libraries (@pxref{How Programs Do
273Loading}). The Emacs distribution does not come with this file; sites 366Loading}). The Emacs distribution does not come with this file; it is
274may provide one for local customizations. If the default init file 367intended for local customizations. If the default init file exists,
275exists, it is loaded whenever you start Emacs, except in batch mode or 368it is loaded whenever you start Emacs, except in batch mode or if
276if @samp{-q} (or @samp{-Q}) is specified. But your own personal init 369@samp{-q} (or @samp{-Q}) is specified. But your own personal init
277file, if any, is loaded first; if it sets @code{inhibit-default-init} 370file, if any, is loaded first; if it sets @code{inhibit-default-init}
278to a non-@code{nil} value, then Emacs does not subsequently load the 371to a non-@code{nil} value, then Emacs does not subsequently load the
279@file{default.el} file. 372@file{default.el} file.
@@ -343,23 +436,22 @@ in the normal manner, by searching the @code{load-path} directories, and
343trying the @samp{.elc} and @samp{.el} suffixes. 436trying the @samp{.elc} and @samp{.el} suffixes.
344 437
345@cindex Termcap 438@cindex Termcap
346 The usual function of a terminal-specific library is to enable 439 The usual role of a terminal-specific library is to enable special
347special keys to send sequences that Emacs can recognize. It may also 440keys to send sequences that Emacs can recognize. It may also need to
348need to set or add to @code{input-decode-map} if the Termcap or 441set or add to @code{input-decode-map} if the Termcap or Terminfo entry
349Terminfo entry does not specify all the terminal's function keys. 442does not specify all the terminal's function keys. @xref{Terminal
350@xref{Terminal Input}. 443Input}.
351 444
352 When the name of the terminal type contains a hyphen, and no library 445 When the name of the terminal type contains a hyphen, and no library
353is found whose name is identical to the terminal's name, Emacs strips 446is found whose name is identical to the terminal's name, Emacs strips
354from the terminal's name the last hyphen and everything that follows 447from the terminal's name the last hyphen and everything that follows
355it, and tries again. This process is repeated until Emacs finds a 448it, and tries again. This process is repeated until Emacs finds a
356matching library or until there are no more hyphens in the name (the 449matching library, or until there are no more hyphens in the name
357latter means the terminal doesn't have any library specific to it). 450(i.g.@: there is no terminal-specific library). For example, if the
358Thus, for example, if there are no @samp{aaa-48} and @samp{aaa-30} 451terminal name is @samp{xterm-256color} and there is no
359libraries, Emacs will try the same library @file{term/aaa.el} for 452@file{term/xterm-256color.el} library, Emacs tries to load
360terminal types @samp{aaa-48} and @samp{aaa-30-rv}. If necessary, the 453@file{term/xterm.el}. If necessary, the terminal library can evaluate
361library can evaluate @code{(getenv "TERM")} to find the full name of 454@code{(getenv "TERM")} to find the full name of the terminal type.
362the terminal type.@refill
363 455
364 Your init file can prevent the loading of the 456 Your init file can prevent the loading of the
365terminal-specific library by setting the variable 457terminal-specific library by setting the variable
@@ -376,8 +468,8 @@ have their own libraries. @xref{Hooks}.
376 468
377@defvar term-file-prefix 469@defvar term-file-prefix
378@cindex @code{TERM} environment variable 470@cindex @code{TERM} environment variable
379If the @code{term-file-prefix} variable is non-@code{nil}, Emacs loads 471If the value of this variable is non-@code{nil}, Emacs loads a
380a terminal-specific initialization file as follows: 472terminal-specific initialization file as follows:
381 473
382@example 474@example
383(load (concat term-file-prefix (getenv "TERM"))) 475(load (concat term-file-prefix (getenv "TERM")))
@@ -409,29 +501,14 @@ feature.
409@subsection Command-Line Arguments 501@subsection Command-Line Arguments
410@cindex command-line arguments 502@cindex command-line arguments
411 503
412 You can use command-line arguments to request various actions when you 504 You can use command-line arguments to request various actions when
413start Emacs. Since you do not need to start Emacs more than once per 505you start Emacs. Command-line arguments should not be commonly used,
414day, and will often leave your Emacs session running longer than that, 506since the recommended way of using Emacs is to start it just once,
415command-line arguments are hardly ever used. As a practical matter, it 507after logging in, and do all editing in the same Emacs session
416is best to avoid making the habit of using them, since this habit would 508(@pxref{Entering Emacs,,, emacs, The GNU Emacs Manual}); nonetheless,
417encourage you to kill and restart Emacs unnecessarily often. These 509they can be useful when invoking Emacs from session scripts or
418options exist for two reasons: to be compatible with other editors (for 510debugging Emacs itself. This section describes how Emacs processes
419invocation by other programs) and to enable shell scripts to run 511command-line arguments.
420specific Lisp programs.
421
422 This section describes how Emacs processes command-line arguments,
423and how you can customize them.
424
425@ignore
426 (Note that some other editors require you to start afresh each time
427you want to edit a file. With this kind of editor, you will probably
428specify the file as a command-line argument. The recommended way to
429use GNU Emacs is to start it only once, just after you log in, and do
430all your editing in the same Emacs process. Each time you want to edit
431a different file, you visit it with the existing Emacs, which eventually
432comes to have many files in it ready for editing. Usually you do not
433kill the Emacs until you are about to log out.)
434@end ignore
435 512
436@defun command-line 513@defun command-line
437This function parses the command line that Emacs was called with, 514This function parses the command line that Emacs was called with,
@@ -525,9 +602,7 @@ as a file name to visit.
525 602
526 There are two ways to get out of Emacs: you can kill the Emacs job, 603 There are two ways to get out of Emacs: you can kill the Emacs job,
527which exits permanently, or you can suspend it, which permits you to 604which exits permanently, or you can suspend it, which permits you to
528reenter the Emacs process later. As a practical matter, you seldom kill 605reenter the Emacs process later.
529Emacs---only when you are about to log out. Suspending is much more
530common.
531 606
532@menu 607@menu
533* Killing Emacs:: Exiting Emacs irreversibly. 608* Killing Emacs:: Exiting Emacs irreversibly.
@@ -1105,24 +1180,47 @@ The value may be a floating point number.
1105@node Time of Day 1180@node Time of Day
1106@section Time of Day 1181@section Time of Day
1107 1182
1108 This section explains how to determine the current time and the time 1183 This section explains how to determine the current time and time
1109zone. 1184zone.
1110 1185
1186@cindex epoch
1187 Most of these functions represent time as a list of either three
1188integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of
1189two integers, @code{(@var{sec-high} @var{sec-low})}. The integers
1190@var{sec-high} and @var{sec-low} give the high and low bits of an
1191integer number of seconds. This integer number,
1192@ifnottex
1193@var{high} * 2**16 + @var{low},
1194@end ifnottex
1195@tex
1196$high*2^{16}+low$,
1197@end tex
1198is the number of seconds from the @dfn{epoch} (0:00 January 1, 1970
1199UTC) to the specified time. The third list element @var{microsec}, if
1200present, gives the number of microseconds from the start of that
1201second to the specified time.
1202
1203 The return value of @code{current-time} represents time using three
1204integers, while the timestamps in the return value of
1205@code{file-attributes} use two integers (@pxref{Definition of
1206file-attributes}). In function arguments, e.g.@: the @var{time-value}
1207argument to @code{current-time-string}, both two- and three-integer
1208lists are accepted. You can convert times from the list
1209representation into standard human-readable strings using
1210@code{current-time}, or to other forms using the @code{decode-time}
1211and @code{format-time-string} functions documented in the following
1212sections.
1213
1111@defun current-time-string &optional time-value 1214@defun current-time-string &optional time-value
1112This function returns the current time and date as a human-readable 1215This function returns the current time and date as a human-readable
1113string. The format of the string is unvarying; the number of characters 1216string. The format of the string is unvarying; the number of
1114used for each part is always the same, so you can reliably use 1217characters used for each part is always the same, so you can reliably
1115@code{substring} to extract pieces of it. It is wise to count the 1218use @code{substring} to extract pieces of it. You should count
1116characters from the beginning of the string rather than from the end, as 1219characters from the beginning of the string rather than from the end,
1117additional information may some day be added at the end. 1220as additional information may some day be added at the end.
1118 1221
1119The argument @var{time-value}, if given, specifies a time to format 1222The argument @var{time-value}, if given, specifies a time to format
1120instead of the current time. This argument should have the same form 1223(represented as a list of integers), instead of the current time.
1121as the times obtained from @code{current-time} (see below) and from
1122@code{file-attributes} (@pxref{Definition of file-attributes}). It
1123should be a list whose first two elements are integers; a third
1124(microsecond) element, if present, is ignored. @var{time-value} can
1125also be a cons of two integers, but this usage is obsolete.
1126 1224
1127@example 1225@example
1128@group 1226@group
@@ -1133,33 +1231,16 @@ also be a cons of two integers, but this usage is obsolete.
1133@end defun 1231@end defun
1134 1232
1135@defun current-time 1233@defun current-time
1136This function returns the system's time value as a list of three 1234This function returns the current time, represented as a list of three
1137integers: @code{(@var{high} @var{low} @var{microsec})}. The integers 1235integers @code{(@var{sec-high} @var{sec-low} @var{microsec})}. On
1138@var{high} and @var{low} combine to give the number of seconds since 1236systems with only one-second time resolutions, @var{microsec} is 0.
11390:00 January 1, 1970 UTC (Coordinated Universal Time), which is
1140@ifnottex
1141@var{high} * 2**16 + @var{low}.
1142@end ifnottex
1143@tex
1144$high*2^{16}+low$.
1145@end tex
1146
1147The third element, @var{microsec}, gives the microseconds since the
1148start of the current second (or 0 for systems that return time with
1149the resolution of only one second).
1150
1151The first two elements can be compared with file time values such as you
1152get with the function @code{file-attributes}.
1153@xref{Definition of file-attributes}.
1154@end defun 1237@end defun
1155 1238
1156@defun float-time &optional time-value 1239@defun float-time &optional time-value
1157This function returns the current time as a floating-point number of 1240This function returns the current time as a floating-point number of
1158seconds since the epoch. The argument @var{time-value}, if given, 1241seconds since the epoch. The optional argument @var{time-value}, if
1159specifies a time to convert instead of the current time. The argument 1242given, specifies a time (represented as a list of integers) to convert
1160should have the same form as for @code{current-time-string} (see 1243instead of the current time.
1161above). Thus, it accepts the output of @code{current-time} and
1162@code{file-attributes} (@pxref{Definition of file-attributes}).
1163 1244
1164@emph{Warning}: Since the result is floating point, it may not be 1245@emph{Warning}: Since the result is floating point, it may not be
1165exact. Do not use this function if precise time stamps are required. 1246exact. Do not use this function if precise time stamps are required.
@@ -1180,11 +1261,8 @@ adjustment, then the value is constant through time.
1180If the operating system doesn't supply all the information necessary to 1261If the operating system doesn't supply all the information necessary to
1181compute the value, the unknown elements of the list are @code{nil}. 1262compute the value, the unknown elements of the list are @code{nil}.
1182 1263
1183The argument @var{time-value}, if given, specifies a time to analyze 1264The argument @var{time-value}, if given, specifies a time (represented
1184instead of the current time. The argument should have the same form 1265as a list of integers) to analyze instead of the current time.
1185as for @code{current-time-string} (see above). Thus, you can use
1186times obtained from @code{current-time} (see above) and from
1187@code{file-attributes}. @xref{Definition of file-attributes}.
1188@end defun 1266@end defun
1189 1267
1190The current time zone is determined by the @samp{TZ} environment 1268The current time zone is determined by the @samp{TZ} environment
@@ -1196,16 +1274,15 @@ time zone.
1196@node Time Conversion 1274@node Time Conversion
1197@section Time Conversion 1275@section Time Conversion
1198 1276
1199 These functions convert time values (lists of two or three integers) 1277 These functions convert time values (lists of two or three integers,
1200to calendrical information and vice versa. You can get time values 1278as explained in the previous section) into calendrical information and
1201from the functions @code{current-time} (@pxref{Time of Day}) and 1279vice versa.
1202@code{file-attributes} (@pxref{Definition of file-attributes}).
1203 1280
1204 Many 32-bit operating systems are limited to time values that contain 32 bits 1281 Many 32-bit operating systems are limited to time values containing
1205of information; these systems typically handle only the times from 128232 bits of information; these systems typically handle only the times
12061901-12-13 20:45:52 UTC through 2038-01-19 03:14:07 UTC. However, 64-bit 1283from 1901-12-13 20:45:52 UTC through 2038-01-19 03:14:07 UTC.
1207and some 32-bit operating systems have larger time values, and can 1284However, 64-bit and some 32-bit operating systems have larger time
1208represent times far in the past or future. 1285values, and can represent times far in the past or future.
1209 1286
1210 Time conversion functions always use the Gregorian calendar, even 1287 Time conversion functions always use the Gregorian calendar, even
1211for dates before the Gregorian calendar was introduced. Year numbers 1288for dates before the Gregorian calendar was introduced. Year numbers
@@ -1718,9 +1795,9 @@ certain length of time. Aside from how to set them up, idle timers
1718work just like ordinary timers. 1795work just like ordinary timers.
1719 1796
1720@deffn Command run-with-idle-timer secs repeat function &rest args 1797@deffn Command run-with-idle-timer secs repeat function &rest args
1721Set up a timer which runs when Emacs has been idle for @var{secs} 1798Set up a timer which runs the next time Emacs is idle for @var{secs}
1722seconds. The value of @var{secs} may be an integer or a floating point 1799seconds. The value of @var{secs} may be an integer or a floating
1723number; a value of the type returned by @code{current-idle-time} 1800point number; a value of the type returned by @code{current-idle-time}
1724is also allowed. 1801is also allowed.
1725 1802
1726If @var{repeat} is @code{nil}, the timer runs just once, the first time 1803If @var{repeat} is @code{nil}, the timer runs just once, the first time
@@ -1733,13 +1810,13 @@ can use in calling @code{cancel-timer} (@pxref{Timers}).
1733@end deffn 1810@end deffn
1734 1811
1735@cindex idleness 1812@cindex idleness
1736 Emacs becomes ``idle'' when it starts waiting for user input, and it 1813 Emacs becomes @dfn{idle} when it starts waiting for user input, and
1737remains idle until the user provides some input. If a timer is set for 1814it remains idle until the user provides some input. If a timer is set
1738five seconds of idleness, it runs approximately five seconds after Emacs 1815for five seconds of idleness, it runs approximately five seconds after
1739first becomes idle. Even if @var{repeat} is non-@code{nil}, this timer 1816Emacs first becomes idle. Even if @var{repeat} is non-@code{nil},
1740will not run again as long as Emacs remains idle, because the duration 1817this timer will not run again as long as Emacs remains idle, because
1741of idleness will continue to increase and will not go down to five 1818the duration of idleness will continue to increase and will not go
1742seconds again. 1819down to five seconds again.
1743 1820
1744 Emacs can do various things while idle: garbage collect, autosave or 1821 Emacs can do various things while idle: garbage collect, autosave or
1745handle data from a subprocess. But these interludes during idleness do 1822handle data from a subprocess. But these interludes during idleness do
@@ -1753,22 +1830,12 @@ minutes, and even if there have been garbage collections and autosaves.
1753input. Then it becomes idle again, and all the idle timers that are 1830input. Then it becomes idle again, and all the idle timers that are
1754set up to repeat will subsequently run another time, one by one. 1831set up to repeat will subsequently run another time, one by one.
1755 1832
1756@c Emacs 19 feature
1757@defun current-idle-time 1833@defun current-idle-time
1758If Emacs is idle, this function returns the length of time Emacs has 1834If Emacs is idle, this function returns the length of time Emacs has
1759been idle, as a list of three integers: @code{(@var{high} @var{low} 1835been idle, as a list of three integers: @code{(@var{sec-high}
1760@var{microsec})}. The integers @var{high} and @var{low} combine to 1836@var{sec-low} @var{microsec})}, where @var{high} and @var{low} are the
1761give the number of seconds of idleness, which is 1837high and low bits for the number of seconds and @var{microsec} is the
1762@ifnottex 1838additional number of microseconds (@pxref{Time of Day}).
1763@var{high} * 2**16 + @var{low}.
1764@end ifnottex
1765@tex
1766$high*2^{16}+low$.
1767@end tex
1768
1769The third element, @var{microsec}, gives the microseconds since the
1770start of the current second (or 0 for systems that return time with
1771the resolution of only one second).
1772 1839
1773When Emacs is not idle, @code{current-idle-time} returns @code{nil}. 1840When Emacs is not idle, @code{current-idle-time} returns @code{nil}.
1774This is a convenient way to test whether Emacs is idle. 1841This is a convenient way to test whether Emacs is idle.
@@ -1801,9 +1868,9 @@ Here's an example:
1801@end smallexample 1868@end smallexample
1802@end defun 1869@end defun
1803 1870
1804 Some idle timer functions in user Lisp packages have a loop that 1871 Do not write an idle timer function containing a loop which does a
1805does a certain amount of processing each time around, and exits when 1872certain amount of processing each time around, and exits when
1806@code{(input-pending-p)} is non-@code{nil}. That approach seems very 1873@code{(input-pending-p)} is non-@code{nil}. This approach seems very
1807natural but has two problems: 1874natural but has two problems:
1808 1875
1809@itemize 1876@itemize
@@ -1816,9 +1883,9 @@ It blocks out any idle timers that ought to run during that time.
1816@end itemize 1883@end itemize
1817 1884
1818@noindent 1885@noindent
1819To avoid these problems, don't use that technique. Instead, write 1886The correct approach is for the idle timer to reschedule itself after
1820such idle timers to reschedule themselves after a brief pause, using 1887a brief pause, using the method in the @code{timer-function} example
1821the method in the @code{timer-function} example above. 1888above.
1822 1889
1823@node Terminal Input 1890@node Terminal Input
1824@section Terminal Input 1891@section Terminal Input
@@ -2014,9 +2081,8 @@ See also @code{open-dribble-file} in @ref{Recording Input}.
2014@cindex sound 2081@cindex sound
2015 2082
2016 To play sound using Emacs, use the function @code{play-sound}. Only 2083 To play sound using Emacs, use the function @code{play-sound}. Only
2017certain systems are supported; if you call @code{play-sound} on a system 2084certain systems are supported; if you call @code{play-sound} on a
2018which cannot really do the job, it gives an error. Emacs version 20 and 2085system which cannot really do the job, it gives an error.
2019earlier did not support sound at all.
2020 2086
2021 The sound must be stored as a file in RIFF-WAVE format (@samp{.wav}) 2087 The sound must be stored as a file in RIFF-WAVE format (@samp{.wav})
2022or Sun Audio format (@samp{.au}). 2088or Sun Audio format (@samp{.au}).
diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
index eb3612dc868..b17f13b6b89 100644
--- a/doc/lispref/package.texi
+++ b/doc/lispref/package.texi
@@ -15,6 +15,8 @@ install, uninstall, and upgrade it.
15 15
16 The following sections describe how to create a package, and how to 16 The following sections describe how to create a package, and how to
17put it in a @dfn{package archive} for others to download. 17put it in a @dfn{package archive} for others to download.
18@xref{Packages,,, emacs, The GNU Emacs Manual}, for a description of
19user-level features of the packaging system.
18 20
19@menu 21@menu
20* Packaging Basics:: The basic concepts of Emacs Lisp packages. 22* Packaging Basics:: The basic concepts of Emacs Lisp packages.
@@ -91,17 +93,34 @@ definitions are saved to a file named @file{@var{name}-autoloads.el}
91in the content directory. They are typically used to autoload the 93in the content directory. They are typically used to autoload the
92principal user commands defined in the package, but they can also 94principal user commands defined in the package, but they can also
93perform other tasks, such as adding an element to 95perform other tasks, such as adding an element to
94@code{auto-mode-alist} (@pxref{Auto Major Mode}). During this time, 96@code{auto-mode-alist} (@pxref{Auto Major Mode}). Note that a package
95Emacs will also byte-compile the Lisp files. 97typically does @emph{not} autoload every function and variable defined
96 98within it---only the handful of commands typically called to begin
97 After installation, and (by default) each time Emacs is started, the 99using the package. Emacs then byte-compiles every Lisp file in the
98installed package is @dfn{activated}. During activation, Emacs adds 100package.
99the package's content directory to @code{load-path}, and evaluates the 101
100autoload definitions in @file{@var{name}-autoloads.el}. 102 After installation, the installed package is @dfn{loaded}: Emacs
101 103adds the package's content directory to @code{load-path}, and
102 Note that a package typically does @emph{not} autoload every 104evaluates the autoload definitions in @file{@var{name}-autoloads.el}.
103function and variable defined within it---only the handful of commands 105
104typically called to begin using the package. 106 Whenever Emacs starts up, it automatically calls the function
107@code{package-initialize} to load installed packages. This is done
108after loading the init file and abbrev file (if any) and before
109running @code{after-init-hook} (@pxref{Startup Summary}). Automatic
110package loading is disabled if the user option
111@code{package-enable-at-startup} is @code{nil}.
112
113@deffn Command package-initialize &optional no-activate
114This function initializes Emacs' internal record of which packages are
115installed, and loads them. The user option @code{package-load-list}
116specifies which packages to load; by default, all installed packages
117are loaded. @xref{Package Installation,,, emacs, The GNU Emacs
118Manual}.
119
120The optional argument @var{no-activate}, if non-@code{nil}, causes
121Emacs to update its record of installed packages without actually
122loading them; it is for internal use only.
123@end deffn
105 124
106@node Simple Packages 125@node Simple Packages
107@section Simple Packages 126@section Simple Packages