diff options
| author | Joakim Verona | 2012-03-20 18:54:57 +0100 |
|---|---|---|
| committer | Joakim Verona | 2012-03-20 18:54:57 +0100 |
| commit | b827329a89291ed68dd017c53976be7ce5ed3b22 (patch) | |
| tree | a020a2c4bd3e27be292cfab0973aa85cb0c0c52a /doc | |
| parent | 28d5f38df4f3b2f2cd9bc36494b3c0d8034c6f6b (diff) | |
| parent | f0bcceb9955d5aef6a131a86c4f74cc3e6e4c9ec (diff) | |
| download | emacs-b827329a89291ed68dd017c53976be7ce5ed3b22.tar.gz emacs-b827329a89291ed68dd017c53976be7ce5ed3b22.zip | |
upstream
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 15 | ||||
| -rw-r--r-- | doc/emacs/dired.texi | 6 | ||||
| -rw-r--r-- | doc/emacs/help.texi | 3 | ||||
| -rw-r--r-- | doc/emacs/mule.texi | 6 | ||||
| -rw-r--r-- | doc/emacs/package.texi | 45 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 49 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 122 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/internals.texi | 180 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 386 | ||||
| -rw-r--r-- | doc/lispref/package.texi | 41 |
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 @@ | |||
| 1 | 2012-03-17 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * package.texi (Package Installation): Document use of | ||
| 4 | package-initialize in init file. | ||
| 5 | |||
| 6 | 2012-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 | |||
| 12 | 2012-03-15 Dani Moncayo <dmoncayo@gmail.com> (tiny change) | ||
| 13 | |||
| 14 | * dired.texi (Shell Commands in Dired): Fix typo. | ||
| 15 | |||
| 1 | 2012-03-04 Chong Yidong <cyd@gnu.org> | 16 | 2012-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 |
| 825 | If the command string contains neither @samp{*} nor @samp{?}, Emacs | 825 | If the command string contains neither @samp{*} nor @samp{?}, Emacs |
| 826 | runs the shell command once for each file, adding the file name is | 826 | runs the shell command once for each file, adding the file name at the |
| 827 | added at the end. For example, @kbd{! uudecode @key{RET}} runs | 827 | end. For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on |
| 828 | @code{uudecode} on each file. | 828 | each 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 | |||
| 464 | methods, as well as some sample text for that language environment. | 464 | methods, 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 |
| 468 | how 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 |
| 470 | input method---either a specified input method, or by default the | 471 | input 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 |
| 141 | This illustrates various scripts. If some characters can't be | 141 | how to say ``hello'' in many languages. If some characters can't be |
| 142 | displayed on your terminal, they appear as @samp{?} or as hollow boxes | 142 | displayed 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 | |||
| 157 | wish to use third party package archives---but do so at your own risk, | 157 | wish to use third party package archives---but do so at your own risk, |
| 158 | and use only third parties that you think you can trust! | 158 | and 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 |
| 161 | current Emacs session. What ``taking effect'' means depends on the | 161 | the current Emacs session. Loading a package is not quite the same as |
| 162 | package; most packages just make some new commands available, while | 162 | loading a Lisp library (@pxref{Lisp Libraries}); its effect varies |
| 163 | others have more wide-ranging effects on the Emacs session. For such | 163 | from package to package. Most packages just make some new commands |
| 164 | information, consult the package's help buffer. | 164 | available, while others have more wide-ranging effects on the Emacs |
| 165 | 165 | session. 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 |
| 168 | happens at startup, after processing the init file (@pxref{Init | 168 | subsequent Emacs sessions. This happens at startup, after processing |
| 169 | File}). As an exception, Emacs does not load packages at startup if | 169 | the init file (@pxref{Init File}). As an exception, Emacs does not |
| 170 | invoked with the @samp{-q} or @samp{--no-init-file} options | 170 | load 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}. |
| 177 | can use the command @kbd{M-x package-initialize} to load your | 176 | |
| 178 | packages. | 177 | @findex package-initialize |
| 178 | The reason automatic package loading occurs after loading the init | ||
| 179 | file is that user options only receive their customized values after | ||
| 180 | loading the init file, including user options which affect the | ||
| 181 | packaging system. In some circumstances, you may want to load | ||
| 182 | packages explicitly in your init file (usually because some other code | ||
| 183 | in your init file depends on a package). In that case, your init file | ||
| 184 | should call the function @code{package-initialize}. It is up to you | ||
| 185 | to ensure that relevant user options, such as @code{package-load-list} | ||
| 186 | (see below), are set up prior to the @code{package-initialize} call. | ||
| 187 | You should also set @code{package-enable-at-startup} to @code{nil}, to | ||
| 188 | avoid loading the packages again after processing the init file. | ||
| 189 | Alternatively, you may choose to completely inhibit package loading at | ||
| 190 | startup, and invoke the command @kbd{M-x package-initialize} to load | ||
| 191 | your 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 @@ | |||
| 1 | 2012-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 | |||
| 7 | 2012-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 | |||
| 12 | 2012-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 | |||
| 22 | 2012-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 | |||
| 28 | 2012-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 | |||
| 40 | 2012-03-17 Eli Zaretskii <eliz@gnu.org> | ||
| 41 | |||
| 42 | * frames.texi (Initial Parameters): Add an index entry for | ||
| 43 | minibuffer-only frame. | ||
| 44 | |||
| 45 | 2012-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 | |||
| 1 | 2012-03-11 Chong Yidong <cyd@gnu.org> | 50 | 2012-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 | |||
| 86 | waiting for input. | 86 | waiting for input. |
| 87 | 87 | ||
| 88 | @defun redisplay &optional force | 88 | @defun redisplay &optional force |
| 89 | This function tries immediately to redisplay, provided there are no | 89 | This function tries immediately to redisplay. The optional argument |
| 90 | pending input events. | 90 | @var{force}, if non-@code{nil}, forces the redisplay to be performed, |
| 91 | 91 | instead of being preempted, even if input is pending and the variable | |
| 92 | If the optional argument @var{force} is non-@code{nil}, it does all | 92 | @code{redisplay-dont-pause} is @code{nil} (see below). If |
| 93 | pending redisplay work even if input is available, with no | 93 | @code{redisplay-dont-pause} is non-@code{nil} (the default), this |
| 94 | pre-emption. | 94 | function redisplays in any case, i.e.@: @var{force} does nothing. |
| 95 | 95 | ||
| 96 | The function returns @code{t} if it actually tried to redisplay, and | 96 | The 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 |
| 98 | redisplay proceeded to completion; it could have been pre-empted by | 98 | redisplay proceeded to completion; it could have been preempted by |
| 99 | newly arriving terminal input. | 99 | newly arriving input. |
| 100 | @end defun | ||
| 101 | |||
| 102 | @code{redisplay} with no argument tries immediately to redisplay, | ||
| 103 | but has no effect on the usual rules for what parts of the screen to | ||
| 104 | redisplay. By contrast, the following function adds certain windows | ||
| 105 | to the pending redisplay work (as if their contents had completely | ||
| 106 | changed), but doesn't immediately try to do any redisplay work. | ||
| 107 | |||
| 108 | @defun force-window-update &optional object | ||
| 109 | This function forces some or all windows to be updated on next | ||
| 110 | redisplay. If @var{object} is a window, it requires eventual | ||
| 111 | redisplay of that window. If @var{object} is a buffer or buffer name, | ||
| 112 | it requires eventual redisplay of all windows displaying that buffer. | ||
| 113 | If @var{object} is @code{nil} (or omitted), it requires eventual | ||
| 114 | redisplay 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 | ||
| 119 | to put more work on the queue to be done by redisplay whenever there | ||
| 120 | is a chance. | ||
| 121 | |||
| 122 | @defvar redisplay-dont-pause | 102 | @defvar redisplay-dont-pause |
| 123 | If this variable is non-@code{nil}, pending input does not prevent or | 103 | If this variable is @code{nil}, arriving input events preempt |
| 124 | halt redisplay; redisplay occurs, and finishes, regardless of whether | 104 | redisplay; Emacs avoids starting a redisplay, and stops any redisplay |
| 125 | input is available. If it is @code{nil}, Emacs redisplay stops if | 105 | that is in progress, until the input has been processed. In |
| 126 | input arrives, and does not happen at all if input is available before | 106 | particular, @code{(redisplay)} returns @code{nil} without actually |
| 127 | it starts. The default is @code{t}. | 107 | redisplaying, if there is pending input. |
| 108 | |||
| 109 | The default value is @code{t}, which means that pending input does not | ||
| 110 | preempt redisplay. | ||
| 128 | @end defvar | 111 | @end defvar |
| 129 | 112 | ||
| 130 | @defvar redisplay-preemption-period | 113 | @defvar redisplay-preemption-period |
| 131 | This variable specifies how many seconds Emacs waits between checks | 114 | If @code{redisplay-dont-pause} is @code{nil}, this variable specifies |
| 132 | for new input during redisplay. (The default is 0.1 seconds.) If | 115 | how many seconds Emacs waits between checks for new input during |
| 133 | input has arrived when Emacs checks, it pre-empts redisplay and | 116 | redisplay; if input arrives during this interval, redisplay stops and |
| 134 | processes the available input before trying again to redisplay. | 117 | the 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 | |||
| 120 | This variable has no effect when @code{redisplay-dont-pause} is | ||
| 121 | non-@code{nil} (the default). | ||
| 122 | @end defvar | ||
| 135 | 123 | ||
| 136 | If this variable is @code{nil}, Emacs does not check for input during | 124 | Although @code{redisplay} tries immediately to redisplay, it does |
| 137 | redisplay, and redisplay cannot be preempted by input. | 125 | not change how Emacs decides which parts of its frame(s) to redisplay. |
| 126 | By contrast, the following function adds certain windows to the | ||
| 127 | pending redisplay work (as if their contents had completely changed), | ||
| 128 | but does not immediately try to perform redisplay. | ||
| 138 | 129 | ||
| 139 | This variable is only obeyed on graphical terminals. For | 130 | @defun force-window-update &optional object |
| 140 | text terminals, see @ref{Terminal Output}. | 131 | This function forces some or all windows to be updated the next time |
| 141 | @end defvar | 132 | Emacs does a redisplay. If @var{object} is a window, that window is |
| 133 | to be updated. If @var{object} is a buffer or buffer name, all | ||
| 134 | windows displaying that buffer are to be updated. If @var{object} is | ||
| 135 | @code{nil} (or omitted), all windows are to be updated. | ||
| 136 | |||
| 137 | This function does not do a redisplay immediately; Emacs does that as | ||
| 138 | it 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 | |||
| 169 | beyond the right edge of the window are truncated; otherwise, they are | 167 | beyond the right edge of the window are truncated; otherwise, they are |
| 170 | continued. As a special exception, the variable | 168 | continued. 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 |
| 173 | entire frame width). | 171 | entire 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 |
| 194 | If this buffer-local variable is non-@code{nil}, it defines a | 192 | If 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 |
| 196 | display time. (If lines are truncated, the wrap-prefix is never | 194 | continuation line. (If lines are truncated, @code{wrap-prefix} is |
| 197 | used.) It may be a string or an image (@pxref{Other Display Specs}), | 195 | never used.) Its value may be a string or an image (@pxref{Other |
| 198 | or a stretch of whitespace such as specified by the @code{:width} or | 196 | Display 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 |
| 200 | value is interpreted in the same way as a @code{display} text | 198 | Space}). The value is interpreted in the same way as a @code{display} |
| 201 | property. @xref{Display Property}. | 199 | text property. @xref{Display Property}. |
| 202 | 200 | ||
| 203 | A wrap-prefix may also be specified for regions of text, using the | 201 | A 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 |
| 205 | over the @code{wrap-prefix} variable. @xref{Special Properties}. | 203 | over the @code{wrap-prefix} variable. @xref{Special Properties}. |
| 206 | @end defvar | 204 | @end defvar |
| 207 | 205 | ||
| 208 | @defvar line-prefix | 206 | @defvar line-prefix |
| 209 | If this buffer-local variable is non-@code{nil}, it defines a | 207 | If 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 |
| 211 | display time. It may be a string or an image (@pxref{Other Display | 209 | non-continuation line. Its value may be a string or an image |
| 212 | Specs}), 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 | 211 | specified by the @code{:width} or @code{:align-to} display properties |
| 214 | Space}). The value is interpreted in the same way as a @code{display} | 212 | (@pxref{Specified Space}). The value is interpreted in the same way |
| 215 | text property. @xref{Display Property}. | 213 | as a @code{display} text property. @xref{Display Property}. |
| 216 | 214 | ||
| 217 | A line-prefix may also be specified for regions of text using the | 215 | A 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 |
| 219 | over the @code{line-prefix} variable. @xref{Special Properties}. | 217 | over 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 |
| 223 | continuation to display them, computing the continuation lines can | 221 | continuation to display them, computing the continuation lines can |
| 224 | make Emacs redisplay slow. The column computation and indentation | 222 | make redisplay slow. The column computation and indentation functions |
| 225 | functions also become slow. Then you might find it advisable to set | 223 | also 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 | ||
| 423 | If these parameters specify a separate minibuffer-only frame with | 423 | If 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 |
| 425 | one for you. | 425 | one for you. |
| 426 | 426 | ||
| 427 | @cindex minibuffer-only frame | ||
| 427 | @defopt minibuffer-frame-alist | 428 | @defopt minibuffer-frame-alist |
| 428 | This variable's value is an alist of parameter values used when | 429 | This variable's value is an alist of parameter values used when |
| 429 | creating an initial minibuffer-only frame. This is the | 430 | creating 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 |
| 29 | executable. You don't have to know this material to build and install | 29 | executable. You don't have to know this material to build and install |
| 30 | Emacs, since the makefiles do all these things automatically. This | 30 | Emacs, since the makefiles do all these things automatically. This |
| 31 | information is pertinent to Emacs maintenance. | 31 | information 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 |
| 34 | produces an executable file called @file{temacs}, also called a | 34 | produces 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 |
| 36 | routines, but not the editing commands. | 36 | I/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} |
| 40 | the real runnable Emacs executable. These arguments direct | 40 | and direct it to load @file{loadup.el}. The @code{loadup} library |
| 41 | @file{temacs} to evaluate the Lisp files specified in the file | 41 | loads additional Lisp libraries, which set up the normal Emacs editing |
| 42 | @file{loadup.el}. These files set up the normal Emacs editing | 42 | environment. After this step, the Emacs executable is no longer |
| 43 | environment, resulting in an Emacs that is still impure but no longer | 43 | @dfn{bare}. |
| 44 | bare. | ||
| 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 |
| 48 | you 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. |
| 49 | dump out an executable program called @file{emacs} that has these files | 48 | Instead, as one of the last steps of building Emacs, the command |
| 50 | preloaded. @file{emacs} starts more quickly because it does not need to | 49 | @samp{temacs -batch -l loadup dump} is run. The special @samp{dump} |
| 51 | load the files. This is the Emacs executable that is normally | 50 | argument causes @command{temacs} to dump out an executable program, |
| 52 | installed. | 51 | called @file{emacs}, which has all the standard Lisp files preloaded. |
| 53 | 52 | (The @samp{-batch} argument prevents @file{temacs} from trying to | |
| 53 | initialize any of its data on the terminal, so that the tables of | ||
| 54 | terminal 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 | 59 | is the one which is installed. The variable |
| 57 | dump}. The purpose of @samp{-batch} here is to prevent @file{temacs} | 60 | @code{preloaded-file-list} stores a list of the Lisp files preloaded |
| 58 | from trying to initialize any of its data on the terminal; this ensures | 61 | into the dumped Emacs. If you port Emacs to a new operating system, |
| 59 | that the tables of terminal information are empty in the dumped Emacs. | 62 | and are not able to implement dumping, then Emacs must load |
| 60 | The argument @samp{dump} tells @file{loadup.el} to dump a new executable | 63 | @file{loadup.el} each time it starts. |
| 61 | named @file{emacs}. The variable @code{preloaded-file-list} stores a | ||
| 62 | list 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 | ||
| 65 | implement dumping, then Emacs must load @file{loadup.el} each time it | ||
| 66 | starts. | ||
| 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 | |||
| 163 | in the preloaded standard Lisp files---data that should never change | 160 | in the preloaded standard Lisp files---data that should never change |
| 164 | during actual use of Emacs. | 161 | during 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 |
| 167 | standard preloaded Lisp libraries. In the file @file{emacs}, it is | 164 | standard preloaded Lisp libraries. In the file @file{emacs}, it is |
| 168 | marked as read-only (on operating systems that permit this), so that | 165 | marked as read-only (on operating systems that permit this), so that |
| 169 | the memory space can be shared by all the Emacs jobs running on the | 166 | the 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 |
| 221 | as 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. |
| 222 | normal storage runs low, then Emacs asks the operating system to | 218 | If normal storage runs low, then Emacs asks the operating system to |
| 223 | allocate more memory in blocks of 1k bytes. Each block is used for one | 219 | allocate more memory. Different types of Lisp objects, such as |
| 224 | type of Lisp object, so symbols, cons cells, markers, etc., are | 220 | symbols, cons cells, markers, etc., are segregated in distinct blocks |
| 225 | segregated in distinct blocks in memory. (Vectors, long strings, | 221 | in memory. (Vectors, long strings, buffers and certain other editing |
| 226 | buffers and certain other editing types, which are fairly large, are | 222 | types, which are fairly large, are allocated in individual blocks, one |
| 227 | allocated in individual blocks, one per object, while small strings are | 223 | per object, while small strings are packed into blocks of 8k bytes.) |
| 228 | packed 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 | ||
| 232 | object. Emacs provides a @dfn{garbage collector} to reclaim this | ||
| 233 | abandoned storage. (This name is traditional, but ``garbage recycler'' | ||
| 234 | might 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 |
| 237 | that 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 |
| 238 | all the symbols, their values and associated function definitions, and | 227 | by (for example) killing a buffer or deleting the last pointer to an |
| 239 | any data presently on the stack, are accessible. Any objects that can | 228 | object. Emacs provides a @dfn{garbage collector} to reclaim this |
| 240 | be reached indirectly through other accessible objects are also | 229 | abandoned storage. The garbage collector operates by finding and |
| 241 | accessible. | 230 | marking all Lisp objects that are still accessible to Lisp programs. |
| 231 | To begin with, it assumes all the symbols, their values and associated | ||
| 232 | function definitions, and any data presently on the stack, are | ||
| 233 | accessible. Any objects that can be reached indirectly through other | ||
| 234 | accessible 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 |
| 244 | matter what the Lisp program or the user does, it is impossible to refer | 237 | matter 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. | |||
| 336 | The total number of elements of existing vectors. | 329 | The total number of elements of existing vectors. |
| 337 | 330 | ||
| 338 | @item used-floats | 331 | @item used-floats |
| 339 | @c Emacs 19 feature | ||
| 340 | The number of floats in use. | 332 | The number of floats in use. |
| 341 | 333 | ||
| 342 | @item free-floats | 334 | @item free-floats |
| 343 | @c Emacs 19 feature | ||
| 344 | The number of floats for which space has been obtained from the | 335 | The number of floats for which space has been obtained from the |
| 345 | operating system, but that are not currently being used. | 336 | operating 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 | |||
| 417 | function @code{memory-limit} provides information on the total amount of | 408 | function @code{memory-limit} provides information on the total amount of |
| 418 | memory Emacs is currently using. | 409 | memory Emacs is currently using. |
| 419 | 410 | ||
| 420 | @c Emacs 19 feature | ||
| 421 | @defun memory-limit | 411 | @defun memory-limit |
| 422 | This function returns the address of the last byte Emacs has allocated, | 412 | This function returns the address of the last byte Emacs has allocated, |
| 423 | divided by 1024. We divide the value by 1024 to make sure it fits in a | 413 | divided 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 |
| 431 | This variable is @code{t} if Emacs is close to out of memory for Lisp | 421 | This variable is @code{t} if Emacs is nearly out of memory for Lisp |
| 432 | objects, and @code{nil} otherwise. | 422 | objects, 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 |
| 521 | DEFUN ("or", For, Sor, 0, UNEVALLED, 0, | 511 | DEFUN ("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 |
| 523 | value. The remaining args are not evalled at all. | 513 | that value. |
| 514 | The remaining args are not evalled at all. | ||
| 524 | If all args return nil, return nil. | 515 | If 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 | |||
| 566 | the example above, it is @code{or}. | 557 | the example above, it is @code{or}. |
| 567 | 558 | ||
| 568 | @item fname | 559 | @item fname |
| 569 | This is the C function name for this function. This is | 560 | This is the C function name for this function. This is the name that |
| 570 | the name that is used in C code for calling the function. The name is, | 561 | is used in C code for calling the function. The name is, by |
| 571 | by convention, @samp{F} prepended to the Lisp name, with all dashes | 562 | convention, @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 |
| 573 | function from C code, call @code{For}. Remember that the arguments must | 564 | this function from C code, call @code{For}. |
| 574 | be of type @code{Lisp_Object}; various macros and functions for creating | ||
| 575 | values of type @code{Lisp_Object} are declared in the file | ||
| 576 | @file{lisp.h}. | ||
| 577 | 565 | ||
| 578 | @item sname | 566 | @item sname |
| 579 | This is a C variable name to use for a structure that holds the data for | 567 | This 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 |
| 630 | argument list that every C function must have, including the types for | 618 | argument list for the C function, including the types for the |
| 631 | the arguments. For a function with a fixed maximum number of | 619 | arguments. If the primitive accepts a fixed maximum number of Lisp |
| 632 | arguments, declare a C argument for each Lisp argument, and give them | 620 | arguments, there must be one C argument for each Lisp argument, and |
| 633 | all type @code{Lisp_Object}. When a Lisp function has no upper limit | 621 | each argument must be of type @code{Lisp_Object}. (Various macros and |
| 634 | on the number of arguments, its implementation in C actually receives | 622 | functions for creating values of type @code{Lisp_Object} are declared |
| 635 | exactly two arguments: the first is the number of Lisp arguments, and | 623 | in the file @file{lisp.h}.) If the primitive has no upper limit on |
| 636 | the second is the address of a block containing their values. They | 624 | the number of Lisp arguments, it must have exactly two C arguments: |
| 637 | have types @code{int} and @w{@code{Lisp_Object *}}. | 625 | the first is the number of Lisp arguments, and the second is the |
| 626 | address 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 | 633 | sake of the few platforms which do not use Emacs' default |
| 644 | collector that it must look in that variable and regard its contents | 634 | stack-marking garbage collector. The @code{GCPRO1} macro ``protects'' |
| 645 | as an accessible object. GC protection is necessary whenever you call | 635 | a variable from garbage collection, explicitly informing the garbage |
| 646 | @code{eval_sub} (or @code{Feval}) either directly or indirectly. | 636 | collector that that variable and all its contents must be as |
| 647 | At such a time, any Lisp object that this function may refer to again | 637 | accessible. GC protection is necessary in any function which can |
| 648 | must be protected somehow. | 638 | perform Lisp evaluation by calling @code{eval_sub} or @code{Feval} as |
| 639 | a 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 |
| 651 | GC-protected; that way, the object cannot be recycled, so all pointers | 642 | GC-protected. Thus, a particular local variable can do without |
| 652 | to it remain valid. Thus, a particular local variable can do without | ||
| 653 | protection if it is certain that the object it points to will be | 643 | protection if it is certain that the object it points to will be |
| 654 | preserved by some other pointer (such as another local variable that | 644 | preserved by some other pointer (such as another local variable that |
| 655 | has a @code{GCPRO}). | 645 | has 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 | ||
| 658 | versions, every local variable that might point to a string needed a | ||
| 659 | @code{GCPRO}.}. | ||
| 660 | @end ignore | ||
| 661 | Otherwise, 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 |
| 664 | want to protect two variables, use @code{GCPRO2} instead; repeating | 649 | want to protect two variables, use @code{GCPRO2} instead; repeating |
| @@ -667,34 +652,17 @@ want to protect two variables, use @code{GCPRO2} instead; repeating | |||
| 667 | implicitly use local variables such as @code{gcpro1}; you must declare | 652 | implicitly use local variables such as @code{gcpro1}; you must declare |
| 668 | these explicitly, with type @code{struct gcpro}. Thus, if you use | 653 | these 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}. |
| 670 | Alas, 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 |
| 673 | protected in the current function. It is necessary to do this | 657 | protected in the current function. It is necessary to do this |
| 674 | explicitly. | 658 | explicitly. |
| 675 | 659 | ||
| 676 | Built-in functions that take a variable number of arguments actually | ||
| 677 | accept two arguments at the C level: the number of Lisp arguments, and | ||
| 678 | a @code{Lisp_Object *} pointer to a C vector containing those Lisp | ||
| 679 | arguments. This C vector may be part of a Lisp vector, but it need | ||
| 680 | not be. The responsibility for using @code{GCPRO} to protect the Lisp | ||
| 681 | arguments from GC if necessary rests with the caller in this case, | ||
| 682 | since 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 |
| 685 | the variables are never written once Emacs is dumped. These variables | 661 | the variables are never written once Emacs is dumped. These variables |
| 686 | with initializers are allocated in an area of memory that becomes | 662 | with initializers are allocated in an area of memory that becomes |
| 687 | read-only (on certain operating systems) as a result of dumping Emacs. | 663 | read-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 | ||
| 692 | variables at top level in the file. This is necessary because Emacs on | ||
| 693 | some operating systems defines the keyword @code{static} as a null | ||
| 694 | macro. (This definition is used because those systems put all variables | ||
| 695 | declared static in a place that becomes read-only after dumping, whether | ||
| 696 | they 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 |
| 700 | available; you must also create the Lisp symbol for the primitive and | 668 | available; 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 |
| 526 | Dired, Rmail, and Buffer List use this feature. | 526 | Dired, Rmail, and Buffer List use this feature. |
| 527 | 527 | ||
| 528 | The function @code{view-buffer} does not enable View mode in buffers | ||
| 529 | whose mode-class is special, because such modes usually provide their | ||
| 530 | own View-like bindings. | ||
| 531 | |||
| 528 | The @code{define-derived-mode} macro automatically marks the derived | 532 | The @code{define-derived-mode} macro automatically marks the derived |
| 529 | mode as special if the parent mode is special. Special mode is a | 533 | mode as special if the parent mode is special. Special mode is a |
| 530 | convenient parent for such modes to inherit from; @xref{Basic Major | 534 | convenient 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 |
| 11 | values in the operating system environment, and terminal input, output, | 11 | values in the operating system environment, and terminal input, output. |
| 12 | and flow control. | ||
| 13 | 12 | ||
| 14 | @xref{Building Emacs}, for related information. @xref{Display}, for | 13 | @xref{Building Emacs}, for related information. @xref{Display}, for |
| 15 | additional operating system status information pertaining to the | 14 | additional 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 | |||
| 70 | in their turn. The files @file{subdirs.el} are normally generated | 69 | in their turn. The files @file{subdirs.el} are normally generated |
| 71 | automatically when Emacs is installed. | 70 | automatically when Emacs is installed. |
| 72 | 71 | ||
| 72 | @item | ||
| 73 | It registers input methods by loading any @file{leim-list.el} file | ||
| 74 | found 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 |
| 75 | It sets the variable @code{before-init-time} to the value of | 83 | It 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 |
| 78 | that Emacs is being initialized. | 86 | that Emacs is being initialized. |
| 79 | 87 | ||
| 88 | @c set-locale-environment | ||
| 89 | @item | ||
| 90 | It sets the language environment and the terminal coding system, | ||
| 91 | if requested by environment variables such as @code{LANG}. | ||
| 92 | |||
| 93 | @item | ||
| 94 | It 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 |
| 83 | It loads the initialization library for the window system specified by | 99 | If not running in batch mode, it initializes the window system that |
| 84 | the variable @code{initial-window-system} (@pxref{Window Systems, | 100 | the variable @code{initial-window-system} specifies (@pxref{Window |
| 85 | initial-window-system}). This library's name is | 101 | Systems, initial-window-system}). The initialization function for |
| 86 | @file{term/@var{windowsystem}-win.el}, where @var{windowsystem} is the | 102 | each supported window system is specified by |
| 87 | value of @code{initial-window-system}. From that library, it calls | 103 | @code{window-system-initialization-alist}. If the value |
| 88 | the appropriate initialization function. The initialization function | 104 | of @code{initial-window-system} is @var{windowsystem}, then the |
| 89 | for each supported window system is specified by | 105 | appropriate 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 |
| 107 | compiled into the Emacs executable when it was built. | ||
| 91 | 108 | ||
| 92 | @item | 109 | @item |
| 93 | It sets the language environment and the terminal coding system, | 110 | It runs the normal hook @code{before-init-hook}. |
| 94 | if requested by environment variables such as @code{LANG}. | ||
| 95 | 111 | ||
| 96 | @item | 112 | @item |
| 97 | It processes the initial options. (Some of them are handled | 113 | If appropriate (e.g., not in batch mode or started as a daemon), it |
| 98 | even earlier than this.) | 114 | creates a graphical frame. |
| 99 | 115 | ||
| 100 | @item | 116 | @item |
| 101 | It runs the normal hook @code{before-init-hook}. | 117 | It initializes the initial frame's faces, and sets up the menu bar |
| 118 | and tool bar if needed. If graphical frames are supported, it sets up | ||
| 119 | the tool bar even if the current frame is not a graphical one, since a | ||
| 120 | graphical frame may be created later on. | ||
| 102 | 121 | ||
| 103 | @item | 122 | @item |
| 104 | It initializes the initial frame's faces, and turns on the menu bar | 123 | It use @code{custom-reevaluate-setting} to re-initialize the members |
| 105 | and tool bar if needed. | 124 | of the list @code{custom-delayed-init-variables}. These are any |
| 125 | pre-loaded user options whose default value depends on the run-time, | ||
| 126 | rather 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 |
| 108 | It loads the library @file{site-start}, if it exists. This is not | 133 | It 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 |
| 128 | option @samp{--batch} was specified. | 153 | option @samp{--batch} was specified. |
| 129 | 154 | ||
| 155 | @item | ||
| 156 | If @code{package-enable-at-startup} is non-@code{nil}, it calls the | ||
| 157 | function @code{package-initialize} to activate any optional Emacs Lisp | ||
| 158 | package that has been installed. @xref{Packaging Basics}. | ||
| 159 | |||
| 130 | @vindex after-init-time | 160 | @vindex after-init-time |
| 131 | @item | 161 | @item |
| 132 | It sets the variable @code{after-init-time} to the value of | 162 | It 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 |
| 150 | in @code{--batch} mode, nor if @code{term-file-prefix} is @code{nil}. | 180 | in @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 |
| 153 | It displays the initial echo area message, unless you have suppressed | 185 | It displays the initial echo area message, unless you have suppressed |
| 154 | that with @code{inhibit-startup-echo-area-message}. | 186 | that with @code{inhibit-startup-echo-area-message}. |
| 155 | 187 | ||
| 156 | @item | 188 | @item |
| 157 | It processes the action arguments from the command line. | 189 | It 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 |
| 160 | It now exits if the option @code{--batch} was specified. | 194 | It 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 | |||
| 164 | that name. Furthermore, if the @samp{*scratch*} buffer exists and is | 198 | that name. Furthermore, if the @samp{*scratch*} buffer exists and is |
| 165 | empty, it inserts @code{initial-scratch-message} into that buffer. | 199 | empty, 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 |
| 168 | It runs @code{emacs-startup-hook} and then @code{term-setup-hook}. | 211 | It runs @code{emacs-startup-hook} and then @code{term-setup-hook}. |
| 169 | 212 | ||
| @@ -176,23 +219,38 @@ specify. | |||
| 176 | It runs @code{window-setup-hook}. @xref{Window Systems}. | 219 | It runs @code{window-setup-hook}. @xref{Window Systems}. |
| 177 | 220 | ||
| 178 | @item | 221 | @item |
| 179 | If 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 | ||
| 184 | It displays the @dfn{startup screen}, which is a special buffer that | 222 | It displays the @dfn{startup screen}, which is a special buffer that |
| 185 | contains information about copyleft and basic Emacs usage. This is | 223 | contains information about copyleft and basic Emacs usage. This is |
| 186 | not done if @code{initial-buffer-choice} or | 224 | not 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 | ||
| 236 | If 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 |
| 191 | If started by the X session manager, it calls | 241 | If 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 |
| 193 | previous session. @xref{Session Management}. | 243 | previous 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 | ||
| 252 | The following options affect some aspects of the startup sequence. | ||
| 253 | |||
| 196 | @defopt inhibit-startup-screen | 254 | @defopt inhibit-startup-screen |
| 197 | This variable, if non-@code{nil}, inhibits the startup screen. In | 255 | This variable, if non-@code{nil}, inhibits the startup screen. In |
| 198 | that case, Emacs typically displays the @samp{*scratch*} buffer; but | 256 | that 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 |
| 212 | This variable, if non-@code{nil}, determines a file or buffer for | 270 | This variable, if non-@code{nil}, determines a file or buffer for |
| 213 | Emacs to display after starting up, instead of the startup screen. If | 271 | Emacs to display after starting up, instead of the startup screen. |
| 214 | its value is @code{t}, Emacs displays the @samp{*scratch*} buffer. If | 272 | @ignore |
| 215 | its 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. | ||
| 275 | If its value is @code{t}, Emacs displays the @samp{*scratch*} buffer. | ||
| 276 | @end ignore | ||
| 277 | If its value is a string, that specifies the name of a file for Emacs to | ||
| 216 | visit. | 278 | visit. |
| 217 | @end defopt | 279 | @end defopt |
| 218 | 280 | ||
| @@ -228,7 +290,7 @@ form to your init file: | |||
| 228 | 290 | ||
| 229 | Emacs explicitly checks for an expression as shown above in your init | 291 | Emacs explicitly checks for an expression as shown above in your init |
| 230 | file; your login name must appear in the expression as a Lisp string | 292 | file; your login name must appear in the expression as a Lisp string |
| 231 | constant. Other methods of setting | 293 | constant. 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 |
| 233 | inhibit the startup message. This way, you can easily inhibit the | 295 | inhibit the startup message. This way, you can easily inhibit the |
| 234 | message for yourself if you wish, but thoughtless copying of your init | 296 | message 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 | |||
| 241 | is @code{nil}, the @samp{*scratch*} buffer is empty. | 303 | is @code{nil}, the @samp{*scratch*} buffer is empty. |
| 242 | @end defopt | 304 | @end defopt |
| 243 | 305 | ||
| 306 | @noindent | ||
| 307 | The following command-line options affect some aspects of the startup | ||
| 308 | sequence. @xref{Initial Options,,, emacs, The GNU Emacs Manual}. | ||
| 309 | |||
| 310 | @table @code | ||
| 311 | @item --no-splash | ||
| 312 | Do not display a splash screen. | ||
| 313 | |||
| 314 | @item --batch | ||
| 315 | Run without an interactive terminal. @xref{Batch Mode}. | ||
| 316 | |||
| 317 | @item --daemon | ||
| 318 | Do not initialize any display; just start a server in the background. | ||
| 319 | |||
| 320 | @item --no-init-file | ||
| 321 | @itemx -Q | ||
| 322 | Do not load either the init file, or the @file{default} library. | ||
| 323 | |||
| 324 | @item --no-site-file | ||
| 325 | Do not load the @file{site-start} library. | ||
| 326 | |||
| 327 | @item --quick | ||
| 328 | @itemx -Q | ||
| 329 | Equivalent 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 |
| 250 | file}. This is either a file named @file{.emacs} or @file{.emacs.el} | 341 | file}. This is either a file named @file{.emacs} or @file{.emacs.el} |
| 251 | in your home directory, or a file named @file{init.el} in a | 342 | in your home directory, or a file named @file{init.el} in a |
| 252 | subdirectory named @file{.emacs.d} in your home directory. Whichever | 343 | subdirectory named @file{.emacs.d} in your home directory. |
| 253 | place you use, you can also compile the file (@pxref{Byte | 344 | @ignore |
| 345 | Whichever place you use, you can also compile the file (@pxref{Byte | ||
| 254 | Compilation}); then the actual file loaded will be @file{.emacs.elc} | 346 | Compilation}); then the actual file loaded will be @file{.emacs.elc} |
| 255 | or @file{init.elc}. | 347 | or @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} |
| 258 | control whether and where to find the init file; @samp{-q} (and the | 351 | control 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 | |||
| 267 | your user-id to find your home directory. | 360 | your 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 |
| 271 | named @file{default.el}. Emacs finds the @file{default.el} file | 364 | Lisp library named @file{default.el}. Emacs finds this file through |
| 272 | through the standard search path for libraries (@pxref{How Programs Do | 365 | the standard search path for libraries (@pxref{How Programs Do |
| 273 | Loading}). The Emacs distribution does not come with this file; sites | 366 | Loading}). The Emacs distribution does not come with this file; it is |
| 274 | may provide one for local customizations. If the default init file | 367 | intended for local customizations. If the default init file exists, |
| 275 | exists, it is loaded whenever you start Emacs, except in batch mode or | 368 | it is loaded whenever you start Emacs, except in batch mode or if |
| 276 | if @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 |
| 277 | file, if any, is loaded first; if it sets @code{inhibit-default-init} | 370 | file, if any, is loaded first; if it sets @code{inhibit-default-init} |
| 278 | to a non-@code{nil} value, then Emacs does not subsequently load the | 371 | to 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 | |||
| 343 | trying the @samp{.elc} and @samp{.el} suffixes. | 436 | trying 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 |
| 347 | special keys to send sequences that Emacs can recognize. It may also | 440 | keys to send sequences that Emacs can recognize. It may also need to |
| 348 | need to set or add to @code{input-decode-map} if the Termcap or | 441 | set or add to @code{input-decode-map} if the Termcap or Terminfo entry |
| 349 | Terminfo entry does not specify all the terminal's function keys. | 442 | does not specify all the terminal's function keys. @xref{Terminal |
| 350 | @xref{Terminal Input}. | 443 | Input}. |
| 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 |
| 353 | is found whose name is identical to the terminal's name, Emacs strips | 446 | is found whose name is identical to the terminal's name, Emacs strips |
| 354 | from the terminal's name the last hyphen and everything that follows | 447 | from the terminal's name the last hyphen and everything that follows |
| 355 | it, and tries again. This process is repeated until Emacs finds a | 448 | it, and tries again. This process is repeated until Emacs finds a |
| 356 | matching library or until there are no more hyphens in the name (the | 449 | matching library, or until there are no more hyphens in the name |
| 357 | latter means the terminal doesn't have any library specific to it). | 450 | (i.g.@: there is no terminal-specific library). For example, if the |
| 358 | Thus, for example, if there are no @samp{aaa-48} and @samp{aaa-30} | 451 | terminal name is @samp{xterm-256color} and there is no |
| 359 | libraries, Emacs will try the same library @file{term/aaa.el} for | 452 | @file{term/xterm-256color.el} library, Emacs tries to load |
| 360 | terminal types @samp{aaa-48} and @samp{aaa-30-rv}. If necessary, the | 453 | @file{term/xterm.el}. If necessary, the terminal library can evaluate |
| 361 | library can evaluate @code{(getenv "TERM")} to find the full name of | 454 | @code{(getenv "TERM")} to find the full name of the terminal type. |
| 362 | the 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 |
| 365 | terminal-specific library by setting the variable | 457 | terminal-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 |
| 379 | If the @code{term-file-prefix} variable is non-@code{nil}, Emacs loads | 471 | If the value of this variable is non-@code{nil}, Emacs loads a |
| 380 | a terminal-specific initialization file as follows: | 472 | terminal-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 |
| 413 | start Emacs. Since you do not need to start Emacs more than once per | 505 | you start Emacs. Command-line arguments should not be commonly used, |
| 414 | day, and will often leave your Emacs session running longer than that, | 506 | since the recommended way of using Emacs is to start it just once, |
| 415 | command-line arguments are hardly ever used. As a practical matter, it | 507 | after logging in, and do all editing in the same Emacs session |
| 416 | is best to avoid making the habit of using them, since this habit would | 508 | (@pxref{Entering Emacs,,, emacs, The GNU Emacs Manual}); nonetheless, |
| 417 | encourage you to kill and restart Emacs unnecessarily often. These | 509 | they can be useful when invoking Emacs from session scripts or |
| 418 | options exist for two reasons: to be compatible with other editors (for | 510 | debugging Emacs itself. This section describes how Emacs processes |
| 419 | invocation by other programs) and to enable shell scripts to run | 511 | command-line arguments. |
| 420 | specific Lisp programs. | ||
| 421 | |||
| 422 | This section describes how Emacs processes command-line arguments, | ||
| 423 | and how you can customize them. | ||
| 424 | |||
| 425 | @ignore | ||
| 426 | (Note that some other editors require you to start afresh each time | ||
| 427 | you want to edit a file. With this kind of editor, you will probably | ||
| 428 | specify the file as a command-line argument. The recommended way to | ||
| 429 | use GNU Emacs is to start it only once, just after you log in, and do | ||
| 430 | all your editing in the same Emacs process. Each time you want to edit | ||
| 431 | a different file, you visit it with the existing Emacs, which eventually | ||
| 432 | comes to have many files in it ready for editing. Usually you do not | ||
| 433 | kill the Emacs until you are about to log out.) | ||
| 434 | @end ignore | ||
| 435 | 512 | ||
| 436 | @defun command-line | 513 | @defun command-line |
| 437 | This function parses the command line that Emacs was called with, | 514 | This 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, |
| 527 | which exits permanently, or you can suspend it, which permits you to | 604 | which exits permanently, or you can suspend it, which permits you to |
| 528 | reenter the Emacs process later. As a practical matter, you seldom kill | 605 | reenter the Emacs process later. |
| 529 | Emacs---only when you are about to log out. Suspending is much more | ||
| 530 | common. | ||
| 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 |
| 1109 | zone. | 1184 | zone. |
| 1110 | 1185 | ||
| 1186 | @cindex epoch | ||
| 1187 | Most of these functions represent time as a list of either three | ||
| 1188 | integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of | ||
| 1189 | two 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 | ||
| 1191 | integer 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 | ||
| 1198 | is the number of seconds from the @dfn{epoch} (0:00 January 1, 1970 | ||
| 1199 | UTC) to the specified time. The third list element @var{microsec}, if | ||
| 1200 | present, gives the number of microseconds from the start of that | ||
| 1201 | second to the specified time. | ||
| 1202 | |||
| 1203 | The return value of @code{current-time} represents time using three | ||
| 1204 | integers, while the timestamps in the return value of | ||
| 1205 | @code{file-attributes} use two integers (@pxref{Definition of | ||
| 1206 | file-attributes}). In function arguments, e.g.@: the @var{time-value} | ||
| 1207 | argument to @code{current-time-string}, both two- and three-integer | ||
| 1208 | lists are accepted. You can convert times from the list | ||
| 1209 | representation into standard human-readable strings using | ||
| 1210 | @code{current-time}, or to other forms using the @code{decode-time} | ||
| 1211 | and @code{format-time-string} functions documented in the following | ||
| 1212 | sections. | ||
| 1213 | |||
| 1111 | @defun current-time-string &optional time-value | 1214 | @defun current-time-string &optional time-value |
| 1112 | This function returns the current time and date as a human-readable | 1215 | This function returns the current time and date as a human-readable |
| 1113 | string. The format of the string is unvarying; the number of characters | 1216 | string. The format of the string is unvarying; the number of |
| 1114 | used for each part is always the same, so you can reliably use | 1217 | characters 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 | 1218 | use @code{substring} to extract pieces of it. You should count |
| 1116 | characters from the beginning of the string rather than from the end, as | 1219 | characters from the beginning of the string rather than from the end, |
| 1117 | additional information may some day be added at the end. | 1220 | as additional information may some day be added at the end. |
| 1118 | 1221 | ||
| 1119 | The argument @var{time-value}, if given, specifies a time to format | 1222 | The argument @var{time-value}, if given, specifies a time to format |
| 1120 | instead of the current time. This argument should have the same form | 1223 | (represented as a list of integers), instead of the current time. |
| 1121 | as the times obtained from @code{current-time} (see below) and from | ||
| 1122 | @code{file-attributes} (@pxref{Definition of file-attributes}). It | ||
| 1123 | should be a list whose first two elements are integers; a third | ||
| 1124 | (microsecond) element, if present, is ignored. @var{time-value} can | ||
| 1125 | also 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 |
| 1136 | This function returns the system's time value as a list of three | 1234 | This function returns the current time, represented as a list of three |
| 1137 | integers: @code{(@var{high} @var{low} @var{microsec})}. The integers | 1235 | integers @code{(@var{sec-high} @var{sec-low} @var{microsec})}. On |
| 1138 | @var{high} and @var{low} combine to give the number of seconds since | 1236 | systems with only one-second time resolutions, @var{microsec} is 0. |
| 1139 | 0: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 | |||
| 1147 | The third element, @var{microsec}, gives the microseconds since the | ||
| 1148 | start of the current second (or 0 for systems that return time with | ||
| 1149 | the resolution of only one second). | ||
| 1150 | |||
| 1151 | The first two elements can be compared with file time values such as you | ||
| 1152 | get 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 |
| 1157 | This function returns the current time as a floating-point number of | 1240 | This function returns the current time as a floating-point number of |
| 1158 | seconds since the epoch. The argument @var{time-value}, if given, | 1241 | seconds since the epoch. The optional argument @var{time-value}, if |
| 1159 | specifies a time to convert instead of the current time. The argument | 1242 | given, specifies a time (represented as a list of integers) to convert |
| 1160 | should have the same form as for @code{current-time-string} (see | 1243 | instead of the current time. |
| 1161 | above). 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 |
| 1165 | exact. Do not use this function if precise time stamps are required. | 1246 | exact. Do not use this function if precise time stamps are required. |
| @@ -1180,11 +1261,8 @@ adjustment, then the value is constant through time. | |||
| 1180 | If the operating system doesn't supply all the information necessary to | 1261 | If the operating system doesn't supply all the information necessary to |
| 1181 | compute the value, the unknown elements of the list are @code{nil}. | 1262 | compute the value, the unknown elements of the list are @code{nil}. |
| 1182 | 1263 | ||
| 1183 | The argument @var{time-value}, if given, specifies a time to analyze | 1264 | The argument @var{time-value}, if given, specifies a time (represented |
| 1184 | instead of the current time. The argument should have the same form | 1265 | as a list of integers) to analyze instead of the current time. |
| 1185 | as for @code{current-time-string} (see above). Thus, you can use | ||
| 1186 | times 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 | ||
| 1190 | The current time zone is determined by the @samp{TZ} environment | 1268 | The 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, |
| 1200 | to calendrical information and vice versa. You can get time values | 1278 | as explained in the previous section) into calendrical information and |
| 1201 | from the functions @code{current-time} (@pxref{Time of Day}) and | 1279 | vice 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 |
| 1205 | of information; these systems typically handle only the times from | 1282 | 32 bits of information; these systems typically handle only the times |
| 1206 | 1901-12-13 20:45:52 UTC through 2038-01-19 03:14:07 UTC. However, 64-bit | 1283 | from 1901-12-13 20:45:52 UTC through 2038-01-19 03:14:07 UTC. |
| 1207 | and some 32-bit operating systems have larger time values, and can | 1284 | However, 64-bit and some 32-bit operating systems have larger time |
| 1208 | represent times far in the past or future. | 1285 | values, 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 |
| 1211 | for dates before the Gregorian calendar was introduced. Year numbers | 1288 | for 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 | |||
| 1718 | work just like ordinary timers. | 1795 | work 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 |
| 1721 | Set up a timer which runs when Emacs has been idle for @var{secs} | 1798 | Set up a timer which runs the next time Emacs is idle for @var{secs} |
| 1722 | seconds. The value of @var{secs} may be an integer or a floating point | 1799 | seconds. The value of @var{secs} may be an integer or a floating |
| 1723 | number; a value of the type returned by @code{current-idle-time} | 1800 | point number; a value of the type returned by @code{current-idle-time} |
| 1724 | is also allowed. | 1801 | is also allowed. |
| 1725 | 1802 | ||
| 1726 | If @var{repeat} is @code{nil}, the timer runs just once, the first time | 1803 | If @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 |
| 1737 | remains idle until the user provides some input. If a timer is set for | 1814 | it remains idle until the user provides some input. If a timer is set |
| 1738 | five seconds of idleness, it runs approximately five seconds after Emacs | 1815 | for five seconds of idleness, it runs approximately five seconds after |
| 1739 | first becomes idle. Even if @var{repeat} is non-@code{nil}, this timer | 1816 | Emacs first becomes idle. Even if @var{repeat} is non-@code{nil}, |
| 1740 | will not run again as long as Emacs remains idle, because the duration | 1817 | this timer will not run again as long as Emacs remains idle, because |
| 1741 | of idleness will continue to increase and will not go down to five | 1818 | the duration of idleness will continue to increase and will not go |
| 1742 | seconds again. | 1819 | down 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 |
| 1745 | handle data from a subprocess. But these interludes during idleness do | 1822 | handle 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. | |||
| 1753 | input. Then it becomes idle again, and all the idle timers that are | 1830 | input. Then it becomes idle again, and all the idle timers that are |
| 1754 | set up to repeat will subsequently run another time, one by one. | 1831 | set 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 |
| 1758 | If Emacs is idle, this function returns the length of time Emacs has | 1834 | If Emacs is idle, this function returns the length of time Emacs has |
| 1759 | been idle, as a list of three integers: @code{(@var{high} @var{low} | 1835 | been 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 |
| 1761 | give the number of seconds of idleness, which is | 1837 | high and low bits for the number of seconds and @var{microsec} is the |
| 1762 | @ifnottex | 1838 | additional 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 | |||
| 1769 | The third element, @var{microsec}, gives the microseconds since the | ||
| 1770 | start of the current second (or 0 for systems that return time with | ||
| 1771 | the resolution of only one second). | ||
| 1772 | 1839 | ||
| 1773 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. | 1840 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. |
| 1774 | This is a convenient way to test whether Emacs is idle. | 1841 | This 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 |
| 1805 | does a certain amount of processing each time around, and exits when | 1872 | certain 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 |
| 1807 | natural but has two problems: | 1874 | natural 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 |
| 1819 | To avoid these problems, don't use that technique. Instead, write | 1886 | The correct approach is for the idle timer to reschedule itself after |
| 1820 | such idle timers to reschedule themselves after a brief pause, using | 1887 | a brief pause, using the method in the @code{timer-function} example |
| 1821 | the method in the @code{timer-function} example above. | 1888 | above. |
| 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 |
| 2017 | certain systems are supported; if you call @code{play-sound} on a system | 2084 | certain systems are supported; if you call @code{play-sound} on a |
| 2018 | which cannot really do the job, it gives an error. Emacs version 20 and | 2085 | system which cannot really do the job, it gives an error. |
| 2019 | earlier 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}) |
| 2022 | or Sun Audio format (@samp{.au}). | 2088 | or 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 |
| 17 | put it in a @dfn{package archive} for others to download. | 17 | put it in a @dfn{package archive} for others to download. |
| 18 | @xref{Packages,,, emacs, The GNU Emacs Manual}, for a description of | ||
| 19 | user-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} | |||
| 91 | in the content directory. They are typically used to autoload the | 93 | in the content directory. They are typically used to autoload the |
| 92 | principal user commands defined in the package, but they can also | 94 | principal user commands defined in the package, but they can also |
| 93 | perform other tasks, such as adding an element to | 95 | perform 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 |
| 95 | Emacs will also byte-compile the Lisp files. | 97 | typically does @emph{not} autoload every function and variable defined |
| 96 | 98 | within it---only the handful of commands typically called to begin | |
| 97 | After installation, and (by default) each time Emacs is started, the | 99 | using the package. Emacs then byte-compiles every Lisp file in the |
| 98 | installed package is @dfn{activated}. During activation, Emacs adds | 100 | package. |
| 99 | the package's content directory to @code{load-path}, and evaluates the | 101 | |
| 100 | autoload definitions in @file{@var{name}-autoloads.el}. | 102 | After installation, the installed package is @dfn{loaded}: Emacs |
| 101 | 103 | adds the package's content directory to @code{load-path}, and | |
| 102 | Note that a package typically does @emph{not} autoload every | 104 | evaluates the autoload definitions in @file{@var{name}-autoloads.el}. |
| 103 | function and variable defined within it---only the handful of commands | 105 | |
| 104 | typically 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 | ||
| 108 | after loading the init file and abbrev file (if any) and before | ||
| 109 | running @code{after-init-hook} (@pxref{Startup Summary}). Automatic | ||
| 110 | package 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 | ||
| 114 | This function initializes Emacs' internal record of which packages are | ||
| 115 | installed, and loads them. The user option @code{package-load-list} | ||
| 116 | specifies which packages to load; by default, all installed packages | ||
| 117 | are loaded. @xref{Package Installation,,, emacs, The GNU Emacs | ||
| 118 | Manual}. | ||
| 119 | |||
| 120 | The optional argument @var{no-activate}, if non-@code{nil}, causes | ||
| 121 | Emacs to update its record of installed packages without actually | ||
| 122 | loading 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 |