diff options
| author | Richard M. Stallman | 2005-02-27 00:04:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-02-27 00:04:37 +0000 |
| commit | 9775b55021a532d8c8b3d233bc2906bd2d64d7ac (patch) | |
| tree | 7d1ce8a681d1200f2b0a02190723fe88be149bf5 | |
| parent | be2bd2c2da0ff97863ed966a3bd68c2f8fd9373f (diff) | |
| download | emacs-9775b55021a532d8c8b3d233bc2906bd2d64d7ac.tar.gz emacs-9775b55021a532d8c8b3d233bc2906bd2d64d7ac.zip | |
(Startup Summary): Correct the options; add missing ones.
(Terminal Output, Batch Mode): Clarify.
(Flow Control): Node deleted.
| -rw-r--r-- | lispref/os.texi | 184 |
1 files changed, 47 insertions, 137 deletions
diff --git a/lispref/os.texi b/lispref/os.texi index 0a6e0aa3642..58bab17e139 100644 --- a/lispref/os.texi +++ b/lispref/os.texi | |||
| @@ -30,7 +30,6 @@ pertaining to the terminal and the screen. | |||
| 30 | * Terminal Output:: Recording terminal output for debugging. | 30 | * Terminal Output:: Recording terminal output for debugging. |
| 31 | * Sound Output:: Playing sounds on the computer's speaker. | 31 | * Sound Output:: Playing sounds on the computer's speaker. |
| 32 | * X11 Keysyms:: Operating on key symbols for X Windows | 32 | * X11 Keysyms:: Operating on key symbols for X Windows |
| 33 | * Flow Control:: How to turn output flow control on or off. | ||
| 34 | * Batch Mode:: Running Emacs without terminal interaction. | 33 | * Batch Mode:: Running Emacs without terminal interaction. |
| 35 | * Session Management:: Saving and restoring state with X Session Management. | 34 | * Session Management:: Saving and restoring state with X Session Management. |
| 36 | @end menu | 35 | @end menu |
| @@ -86,22 +85,22 @@ It initializes the window frame and faces, if appropriate. | |||
| 86 | It runs the normal hook @code{before-init-hook}. | 85 | It runs the normal hook @code{before-init-hook}. |
| 87 | 86 | ||
| 88 | @item | 87 | @item |
| 89 | It loads the library @file{site-start}, unless the option | 88 | It loads the library @file{site-start} (if any), unless the option |
| 90 | @samp{-no-site-file} was specified. The library's file name is usually | 89 | @samp{-Q} (or @samp{--no-site-file}) was specified. The library's file |
| 91 | @file{site-start.el}. | 90 | name is usually @file{site-start.el}. |
| 92 | @cindex @file{site-start.el} | 91 | @cindex @file{site-start.el} |
| 93 | 92 | ||
| 94 | @item | 93 | @item |
| 95 | It loads your init file (usually @file{~/.emacs}), unless @samp{-q}, | 94 | It loads your init file (usually @file{~/.emacs}), unless @samp{-q} |
| 96 | @samp{-no-init-file}, or @samp{-batch} was specified on the command line. | 95 | (or @samp{--no-init-file}), @samp{-Q}, or @samp{--batch} was specified |
| 97 | The @samp{-u} option can specify another user whose home directory | 96 | on the command line. The @samp{-u} option can specify another user |
| 98 | should be used instead of @file{~}. | 97 | whose home directory should be used instead of @file{~}. |
| 99 | 98 | ||
| 100 | @item | 99 | @item |
| 101 | It loads the library @file{default}, unless @code{inhibit-default-init} | 100 | It loads the library @file{default} (if any), unless |
| 102 | is non-@code{nil}. (This is not done in @samp{-batch} mode or if | 101 | @code{inhibit-default-init} is non-@code{nil}. (This is not done in |
| 103 | @samp{-q} was specified on the command line.) The library's file name | 102 | @samp{-batch} mode, or if @samp{-Q} or @samp{-q} was specified on the |
| 104 | is usually @file{default.el}. | 103 | command line.) The library's file name is usually @file{default.el}. |
| 105 | @cindex @file{default.el} | 104 | @cindex @file{default.el} |
| 106 | 105 | ||
| 107 | @item | 106 | @item |
| @@ -118,7 +117,7 @@ mode or using a window system. | |||
| 118 | 117 | ||
| 119 | @item | 118 | @item |
| 120 | It displays the initial echo area message, unless you have suppressed | 119 | It displays the initial echo area message, unless you have suppressed |
| 121 | that with @code{inhibit-startup-echo-area-message}. | 120 | that with @code{inhibit-startup-echo-area-message} or @samp{-Q}. |
| 122 | 121 | ||
| 123 | @item | 122 | @item |
| 124 | It processes the action arguments from the command line. | 123 | It processes the action arguments from the command line. |
| @@ -136,9 +135,8 @@ It runs @code{window-setup-hook}. @xref{Window Systems}. | |||
| 136 | 135 | ||
| 137 | @item | 136 | @item |
| 138 | It displays copyleft, nonwarranty, and basic use information, provided | 137 | It displays copyleft, nonwarranty, and basic use information, provided |
| 139 | there were no remaining command-line arguments (a few steps above), | 138 | the value of @code{inhibit-startup-message} is @code{nil}, you didn't |
| 140 | the value of @code{inhibit-startup-message} is @code{nil}, and the | 139 | specify @samp{--no-splash} or @samp{-Q}, and the buffer is still empty. |
| 141 | buffer is still empty. | ||
| 142 | @end enumerate | 140 | @end enumerate |
| 143 | 141 | ||
| 144 | @defopt inhibit-startup-message | 142 | @defopt inhibit-startup-message |
| @@ -179,36 +177,39 @@ for someone else. | |||
| 179 | @cindex @file{.emacs} | 177 | @cindex @file{.emacs} |
| 180 | 178 | ||
| 181 | When you start Emacs, it normally attempts to load your @dfn{init | 179 | When you start Emacs, it normally attempts to load your @dfn{init |
| 182 | file}, a file in your home directory. Its normal name is @file{.emacs}, | 180 | file}, a file in your home directory. Its normal name is |
| 183 | but you can alternatively call it @file{.emacs.el}, which enables you to | 181 | @file{.emacs}, but you can alternatively call it @file{.emacs.el}. |
| 184 | byte-compile it (@pxref{Byte Compilation}); then the actual file loaded | 182 | You can also store it inside a subdirectory @file{.emacs.d}. |
| 185 | will be @file{.emacs.elc}. | 183 | Whichever place you use, you can also compile the file (@pxref{Byte |
| 186 | 184 | Compilation}); then the actual file loaded will be @file{.emacs.elc}. | |
| 187 | The command-line switches @samp{-q} and @samp{-u} control whether and | 185 | |
| 188 | where to find the init file; @samp{-q} says not to load an init file, | 186 | The command-line switches @samp{-q}, @samp{-Q}, and @samp{-u} |
| 189 | and @samp{-u @var{user}} says to load @var{user}'s init file instead of | 187 | control whether and where to find the init file; @samp{-q} (and the |
| 190 | yours. @xref{Entering Emacs,,, emacs, The GNU Emacs Manual}. If | 188 | stronger @samp{-Q}) says not to load an init file, while @samp{-u |
| 191 | neither option is specified, Emacs uses the @code{LOGNAME} environment | 189 | @var{user}} says to load @var{user}'s init file instead of yours. |
| 190 | @xref{Entering Emacs,,, emacs, The GNU Emacs Manual}. If neither | ||
| 191 | option is specified, Emacs uses the @code{LOGNAME} environment | ||
| 192 | variable, or the @code{USER} (most systems) or @code{USERNAME} (MS | 192 | variable, or the @code{USER} (most systems) or @code{USERNAME} (MS |
| 193 | systems) variable, to find your home directory and thus your init file; | 193 | systems) variable, to find your home directory and thus your init |
| 194 | this way, even if you have su'd, Emacs still loads your own init file. | 194 | file; this way, even if you have su'd, Emacs still loads your own init |
| 195 | If those environment variables are absent, though, Emacs uses your | 195 | file. If those environment variables are absent, though, Emacs uses |
| 196 | user-id to find your home directory. | 196 | your user-id to find your home directory. |
| 197 | 197 | ||
| 198 | @cindex default init file | 198 | @cindex default init file |
| 199 | A site may have a @dfn{default init file}, which is the library named | 199 | A site may have a @dfn{default init file}, which is the library |
| 200 | @file{default.el}. Emacs finds the @file{default.el} file through the | 200 | named @file{default.el}. Emacs finds the @file{default.el} file |
| 201 | standard search path for libraries (@pxref{How Programs Do Loading}). | 201 | through the standard search path for libraries (@pxref{How Programs Do |
| 202 | The Emacs distribution does not come with this file; sites may provide | 202 | Loading}). The Emacs distribution does not come with this file; sites |
| 203 | one for local customizations. If the default init file exists, it is | 203 | may provide one for local customizations. If the default init file |
| 204 | loaded whenever you start Emacs, except in batch mode or if @samp{-q} is | 204 | exists, it is loaded whenever you start Emacs, except in batch mode or |
| 205 | specified. But your own personal init file, if any, is loaded first; if | 205 | if @samp{-q} (or @samp{-Q}) is specified. But your own personal init |
| 206 | it sets @code{inhibit-default-init} to a non-@code{nil} value, then | 206 | file, if any, is loaded first; if it sets @code{inhibit-default-init} |
| 207 | Emacs does not subsequently load the @file{default.el} file. | 207 | to a non-@code{nil} value, then Emacs does not subsequently load the |
| 208 | @file{default.el} file. | ||
| 208 | 209 | ||
| 209 | Another file for site-customization is @file{site-start.el}. Emacs | 210 | Another file for site-customization is @file{site-start.el}. Emacs |
| 210 | loads this @emph{before} the user's init file. You can inhibit the | 211 | loads this @emph{before} the user's init file. You can inhibit the |
| 211 | loading of this file with the option @samp{-no-site-file}. | 212 | loading of this file with the option @samp{--no-site-file}. |
| 212 | 213 | ||
| 213 | @defvar site-run-file | 214 | @defvar site-run-file |
| 214 | This variable specifies the site-customization file to load before the | 215 | This variable specifies the site-customization file to load before the |
| @@ -1526,7 +1527,7 @@ uses interrupts if that is the way it knows how to communicate. | |||
| 1526 | 1527 | ||
| 1527 | If @var{flow} is non-@code{nil}, then Emacs uses @sc{xon/xoff} | 1528 | If @var{flow} is non-@code{nil}, then Emacs uses @sc{xon/xoff} |
| 1528 | (@kbd{C-q}, @kbd{C-s}) flow control for output to the terminal. This | 1529 | (@kbd{C-q}, @kbd{C-s}) flow control for output to the terminal. This |
| 1529 | has no effect except in @sc{cbreak} mode. @xref{Flow Control}. | 1530 | has no effect except in @sc{cbreak} mode. |
| 1530 | 1531 | ||
| 1531 | @c Emacs 19 feature | 1532 | @c Emacs 19 feature |
| 1532 | The argument @var{meta} controls support for input character codes | 1533 | The argument @var{meta} controls support for input character codes |
| @@ -1621,7 +1622,7 @@ In the example below, we set @code{keyboard-translate-table} to a | |||
| 1621 | char-table. Then we fill it in to swap the characters @kbd{C-s} and | 1622 | char-table. Then we fill it in to swap the characters @kbd{C-s} and |
| 1622 | @kbd{C-\} and the characters @kbd{C-q} and @kbd{C-^}. Subsequently, | 1623 | @kbd{C-\} and the characters @kbd{C-q} and @kbd{C-^}. Subsequently, |
| 1623 | typing @kbd{C-\} has all the usual effects of typing @kbd{C-s}, and vice | 1624 | typing @kbd{C-\} has all the usual effects of typing @kbd{C-s}, and vice |
| 1624 | versa. (@xref{Flow Control}, for more information on this subject.) | 1625 | versa. |
| 1625 | 1626 | ||
| 1626 | @cindex flow control example | 1627 | @cindex flow control example |
| 1627 | @example | 1628 | @example |
| @@ -1820,7 +1821,7 @@ trigger an Emacs bug, for the sake of a bug report. | |||
| 1820 | @section Terminal Output | 1821 | @section Terminal Output |
| 1821 | @cindex terminal output | 1822 | @cindex terminal output |
| 1822 | 1823 | ||
| 1823 | The terminal output functions send output to the terminal, or keep | 1824 | The terminal output functions send output to a text terminal, or keep |
| 1824 | track of output sent to the terminal. The variable @code{baud-rate} | 1825 | track of output sent to the terminal. The variable @code{baud-rate} |
| 1825 | tells you what Emacs thinks is the output speed of the terminal. | 1826 | tells you what Emacs thinks is the output speed of the terminal. |
| 1826 | 1827 | ||
| @@ -1852,6 +1853,7 @@ This obsolete function returns the value of the variable | |||
| 1852 | @defun send-string-to-terminal string | 1853 | @defun send-string-to-terminal string |
| 1853 | This function sends @var{string} to the terminal without alteration. | 1854 | This function sends @var{string} to the terminal without alteration. |
| 1854 | Control characters in @var{string} have terminal-dependent effects. | 1855 | Control characters in @var{string} have terminal-dependent effects. |
| 1856 | This function operates only on text terminals. | ||
| 1855 | 1857 | ||
| 1856 | One use of this function is to define function keys on terminals that | 1858 | One use of this function is to define function keys on terminals that |
| 1857 | have downloadable function key definitions. For example, this is how (on | 1859 | have downloadable function key definitions. For example, this is how (on |
| @@ -2003,98 +2005,6 @@ how to swap the Meta and Alt modifiers within Emacs: | |||
| 2003 | @end lisp | 2005 | @end lisp |
| 2004 | @end defvar | 2006 | @end defvar |
| 2005 | 2007 | ||
| 2006 | @node Flow Control | ||
| 2007 | @section Flow Control | ||
| 2008 | @cindex flow control characters | ||
| 2009 | |||
| 2010 | This section attempts to answer the question ``Why does Emacs use | ||
| 2011 | flow-control characters in its command character set?'' For a second | ||
| 2012 | view on this issue, read the comments on flow control in the | ||
| 2013 | @file{emacs/INSTALL} file from the distribution; for help with Termcap | ||
| 2014 | entries and DEC terminal concentrators, see @file{emacs/etc/TERMS}. | ||
| 2015 | |||
| 2016 | @cindex @kbd{C-s} | ||
| 2017 | @cindex @kbd{C-q} | ||
| 2018 | At one time, most terminals did not need flow control, and none used | ||
| 2019 | @code{C-s} and @kbd{C-q} for flow control. Therefore, the choice of | ||
| 2020 | @kbd{C-s} and @kbd{C-q} as command characters for searching and quoting | ||
| 2021 | was natural and uncontroversial. With so many commands needing key | ||
| 2022 | assignments, of course we assigned meanings to nearly all @acronym{ASCII} | ||
| 2023 | control characters. | ||
| 2024 | |||
| 2025 | Later, some terminals were introduced which required these characters | ||
| 2026 | for flow control. They were not very good terminals for full-screen | ||
| 2027 | editing, so Emacs maintainers ignored them. In later years, flow | ||
| 2028 | control with @kbd{C-s} and @kbd{C-q} became widespread among terminals, | ||
| 2029 | but by this time it was usually an option. And the majority of Emacs | ||
| 2030 | users, who can turn flow control off, did not want to switch to less | ||
| 2031 | mnemonic key bindings for the sake of flow control. | ||
| 2032 | |||
| 2033 | So which usage is ``right''---Emacs's or that of some terminal and | ||
| 2034 | concentrator manufacturers? This question has no simple answer. | ||
| 2035 | |||
| 2036 | One reason why we are reluctant to cater to the problems caused by | ||
| 2037 | @kbd{C-s} and @kbd{C-q} is that they are gratuitous. There are other | ||
| 2038 | techniques (albeit less common in practice) for flow control that | ||
| 2039 | preserve transparency of the character stream. Note also that their use | ||
| 2040 | for flow control is not an official standard. Interestingly, on the | ||
| 2041 | model 33 teletype with a paper tape punch (around 1970), @kbd{C-s} and | ||
| 2042 | @kbd{C-q} were sent by the computer to turn the punch on and off! | ||
| 2043 | |||
| 2044 | As window systems and PC terminal emulators replace character-only | ||
| 2045 | terminals, the flow control problem is gradually disappearing. For the | ||
| 2046 | mean time, Emacs provides a convenient way of enabling flow control if | ||
| 2047 | you want it: call the function @code{enable-flow-control}. | ||
| 2048 | |||
| 2049 | @deffn Command enable-flow-control &optional arg | ||
| 2050 | When @var{arg} is a positive integer, this function enables use of | ||
| 2051 | @kbd{C-s} and @kbd{C-q} for output flow control, and provides the | ||
| 2052 | characters @kbd{C-\} and @kbd{C-^} as aliases for them using | ||
| 2053 | @code{keyboard-translate-table} (@pxref{Translating Input}). | ||
| 2054 | |||
| 2055 | When @var{arg} is a negative integer or zero, it disables these | ||
| 2056 | features. When @var{arg} is @code{nil} or omitted, it toggles. | ||
| 2057 | Interactively, @var{arg} is the prefix argument. If non-@code{nil}, | ||
| 2058 | its numeric value is used. | ||
| 2059 | @end deffn | ||
| 2060 | |||
| 2061 | You can use the function @code{enable-flow-control-on} in your | ||
| 2062 | init file to enable flow control automatically on certain | ||
| 2063 | terminal types. | ||
| 2064 | |||
| 2065 | @defun enable-flow-control-on &rest termtypes | ||
| 2066 | This function enables flow control, and the aliases @kbd{C-\} and @kbd{C-^}, | ||
| 2067 | if the terminal type is one of @var{termtypes}. For example: | ||
| 2068 | |||
| 2069 | @smallexample | ||
| 2070 | (enable-flow-control-on "vt200" "vt300" "vt101" "vt131") | ||
| 2071 | @end smallexample | ||
| 2072 | @end defun | ||
| 2073 | |||
| 2074 | Here is how @code{enable-flow-control} does its job: | ||
| 2075 | |||
| 2076 | @enumerate | ||
| 2077 | @item | ||
| 2078 | @cindex @sc{cbreak} | ||
| 2079 | It sets @sc{cbreak} mode for terminal input, and tells the operating | ||
| 2080 | system to handle flow control. This is done using @code{set-input-mode}. | ||
| 2081 | |||
| 2082 | @item | ||
| 2083 | It sets up @code{keyboard-translate-table} to translate @kbd{C-\} and | ||
| 2084 | @kbd{C-^} into @kbd{C-s} and @kbd{C-q}. Except at its very | ||
| 2085 | lowest level, Emacs never knows that the characters typed were anything | ||
| 2086 | but @kbd{C-s} and @kbd{C-q}, so you can in effect type them as @kbd{C-\} | ||
| 2087 | and @kbd{C-^} even when they are input for other commands. | ||
| 2088 | @xref{Translating Input}. | ||
| 2089 | @end enumerate | ||
| 2090 | |||
| 2091 | If the terminal is the source of the flow control characters, then once | ||
| 2092 | you enable kernel flow control handling, you probably can make do with | ||
| 2093 | less padding than normal for that terminal. You can reduce the amount | ||
| 2094 | of padding by customizing the Termcap entry. You can also reduce it by | ||
| 2095 | setting @code{baud-rate} to a smaller value so that Emacs uses a smaller | ||
| 2096 | speed when calculating the padding needed. @xref{Terminal Output}. | ||
| 2097 | |||
| 2098 | @node Batch Mode | 2008 | @node Batch Mode |
| 2099 | @section Batch Mode | 2009 | @section Batch Mode |
| 2100 | @cindex batch mode | 2010 | @cindex batch mode |
| @@ -2106,8 +2016,8 @@ terminal, it does not alter the terminal modes, and it does not expect | |||
| 2106 | to be outputting to an erasable screen. The idea is that you specify | 2016 | to be outputting to an erasable screen. The idea is that you specify |
| 2107 | Lisp programs to run; when they are finished, Emacs should exit. The | 2017 | Lisp programs to run; when they are finished, Emacs should exit. The |
| 2108 | way to specify the programs to run is with @samp{-l @var{file}}, which | 2018 | way to specify the programs to run is with @samp{-l @var{file}}, which |
| 2109 | loads the library named @var{file}, and @samp{-f @var{function}}, which | 2019 | loads the library named @var{file}, or @samp{-f @var{function}}, which |
| 2110 | calls @var{function} with no arguments. | 2020 | calls @var{function} with no arguments, or @samp{--eval @var{form}}. |
| 2111 | 2021 | ||
| 2112 | Any Lisp program output that would normally go to the echo area, | 2022 | Any Lisp program output that would normally go to the echo area, |
| 2113 | either using @code{message}, or using @code{prin1}, etc., with @code{t} | 2023 | either using @code{message}, or using @code{prin1}, etc., with @code{t} |