aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-02-27 00:04:37 +0000
committerRichard M. Stallman2005-02-27 00:04:37 +0000
commit9775b55021a532d8c8b3d233bc2906bd2d64d7ac (patch)
tree7d1ce8a681d1200f2b0a02190723fe88be149bf5
parentbe2bd2c2da0ff97863ed966a3bd68c2f8fd9373f (diff)
downloademacs-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.texi184
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.
86It runs the normal hook @code{before-init-hook}. 85It runs the normal hook @code{before-init-hook}.
87 86
88@item 87@item
89It loads the library @file{site-start}, unless the option 88It 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}. 90name is usually @file{site-start.el}.
92@cindex @file{site-start.el} 91@cindex @file{site-start.el}
93 92
94@item 93@item
95It loads your init file (usually @file{~/.emacs}), unless @samp{-q}, 94It 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
97The @samp{-u} option can specify another user whose home directory 96on the command line. The @samp{-u} option can specify another user
98should be used instead of @file{~}. 97whose home directory should be used instead of @file{~}.
99 98
100@item 99@item
101It loads the library @file{default}, unless @code{inhibit-default-init} 100It loads the library @file{default} (if any), unless
102is 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
104is usually @file{default.el}. 103command 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
120It displays the initial echo area message, unless you have suppressed 119It displays the initial echo area message, unless you have suppressed
121that with @code{inhibit-startup-echo-area-message}. 120that with @code{inhibit-startup-echo-area-message} or @samp{-Q}.
122 121
123@item 122@item
124It processes the action arguments from the command line. 123It 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
138It displays copyleft, nonwarranty, and basic use information, provided 137It displays copyleft, nonwarranty, and basic use information, provided
139there were no remaining command-line arguments (a few steps above), 138the value of @code{inhibit-startup-message} is @code{nil}, you didn't
140the value of @code{inhibit-startup-message} is @code{nil}, and the 139specify @samp{--no-splash} or @samp{-Q}, and the buffer is still empty.
141buffer 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
182file}, a file in your home directory. Its normal name is @file{.emacs}, 180file}, a file in your home directory. Its normal name is
183but you can alternatively call it @file{.emacs.el}, which enables you to 181@file{.emacs}, but you can alternatively call it @file{.emacs.el}.
184byte-compile it (@pxref{Byte Compilation}); then the actual file loaded 182You can also store it inside a subdirectory @file{.emacs.d}.
185will be @file{.emacs.elc}. 183Whichever place you use, you can also compile the file (@pxref{Byte
186 184Compilation}); then the actual file loaded will be @file{.emacs.elc}.
187 The command-line switches @samp{-q} and @samp{-u} control whether and 185
188where 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}
189and @samp{-u @var{user}} says to load @var{user}'s init file instead of 187control whether and where to find the init file; @samp{-q} (and the
190yours. @xref{Entering Emacs,,, emacs, The GNU Emacs Manual}. If 188stronger @samp{-Q}) says not to load an init file, while @samp{-u
191neither 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
191option is specified, Emacs uses the @code{LOGNAME} environment
192variable, or the @code{USER} (most systems) or @code{USERNAME} (MS 192variable, or the @code{USER} (most systems) or @code{USERNAME} (MS
193systems) variable, to find your home directory and thus your init file; 193systems) variable, to find your home directory and thus your init
194this way, even if you have su'd, Emacs still loads your own init file. 194file; this way, even if you have su'd, Emacs still loads your own init
195If those environment variables are absent, though, Emacs uses your 195file. If those environment variables are absent, though, Emacs uses
196user-id to find your home directory. 196your 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 200named @file{default.el}. Emacs finds the @file{default.el} file
201standard search path for libraries (@pxref{How Programs Do Loading}). 201through the standard search path for libraries (@pxref{How Programs Do
202The Emacs distribution does not come with this file; sites may provide 202Loading}). The Emacs distribution does not come with this file; sites
203one for local customizations. If the default init file exists, it is 203may provide one for local customizations. If the default init file
204loaded whenever you start Emacs, except in batch mode or if @samp{-q} is 204exists, it is loaded whenever you start Emacs, except in batch mode or
205specified. But your own personal init file, if any, is loaded first; if 205if @samp{-q} (or @samp{-Q}) is specified. But your own personal init
206it sets @code{inhibit-default-init} to a non-@code{nil} value, then 206file, if any, is loaded first; if it sets @code{inhibit-default-init}
207Emacs does not subsequently load the @file{default.el} file. 207to 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
210loads this @emph{before} the user's init file. You can inhibit the 211loads this @emph{before} the user's init file. You can inhibit the
211loading of this file with the option @samp{-no-site-file}. 212loading of this file with the option @samp{--no-site-file}.
212 213
213@defvar site-run-file 214@defvar site-run-file
214This variable specifies the site-customization file to load before the 215This 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
1527If @var{flow} is non-@code{nil}, then Emacs uses @sc{xon/xoff} 1528If @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
1529has no effect except in @sc{cbreak} mode. @xref{Flow Control}. 1530has no effect except in @sc{cbreak} mode.
1530 1531
1531@c Emacs 19 feature 1532@c Emacs 19 feature
1532The argument @var{meta} controls support for input character codes 1533The 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
1621char-table. Then we fill it in to swap the characters @kbd{C-s} and 1622char-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,
1623typing @kbd{C-\} has all the usual effects of typing @kbd{C-s}, and vice 1624typing @kbd{C-\} has all the usual effects of typing @kbd{C-s}, and vice
1624versa. (@xref{Flow Control}, for more information on this subject.) 1625versa.
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
1824track of output sent to the terminal. The variable @code{baud-rate} 1825track of output sent to the terminal. The variable @code{baud-rate}
1825tells you what Emacs thinks is the output speed of the terminal. 1826tells 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
1853This function sends @var{string} to the terminal without alteration. 1854This function sends @var{string} to the terminal without alteration.
1854Control characters in @var{string} have terminal-dependent effects. 1855Control characters in @var{string} have terminal-dependent effects.
1856This function operates only on text terminals.
1855 1857
1856One use of this function is to define function keys on terminals that 1858One use of this function is to define function keys on terminals that
1857have downloadable function key definitions. For example, this is how (on 1859have 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
2011flow-control characters in its command character set?'' For a second
2012view on this issue, read the comments on flow control in the
2013@file{emacs/INSTALL} file from the distribution; for help with Termcap
2014entries 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
2021was natural and uncontroversial. With so many commands needing key
2022assignments, of course we assigned meanings to nearly all @acronym{ASCII}
2023control characters.
2024
2025 Later, some terminals were introduced which required these characters
2026for flow control. They were not very good terminals for full-screen
2027editing, so Emacs maintainers ignored them. In later years, flow
2028control with @kbd{C-s} and @kbd{C-q} became widespread among terminals,
2029but by this time it was usually an option. And the majority of Emacs
2030users, who can turn flow control off, did not want to switch to less
2031mnemonic key bindings for the sake of flow control.
2032
2033 So which usage is ``right''---Emacs's or that of some terminal and
2034concentrator 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
2038techniques (albeit less common in practice) for flow control that
2039preserve transparency of the character stream. Note also that their use
2040for flow control is not an official standard. Interestingly, on the
2041model 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
2045terminals, the flow control problem is gradually disappearing. For the
2046mean time, Emacs provides a convenient way of enabling flow control if
2047you want it: call the function @code{enable-flow-control}.
2048
2049@deffn Command enable-flow-control &optional arg
2050When @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
2052characters @kbd{C-\} and @kbd{C-^} as aliases for them using
2053@code{keyboard-translate-table} (@pxref{Translating Input}).
2054
2055When @var{arg} is a negative integer or zero, it disables these
2056features. When @var{arg} is @code{nil} or omitted, it toggles.
2057Interactively, @var{arg} is the prefix argument. If non-@code{nil},
2058its numeric value is used.
2059@end deffn
2060
2061You can use the function @code{enable-flow-control-on} in your
2062init file to enable flow control automatically on certain
2063terminal types.
2064
2065@defun enable-flow-control-on &rest termtypes
2066This function enables flow control, and the aliases @kbd{C-\} and @kbd{C-^},
2067if 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}
2079It sets @sc{cbreak} mode for terminal input, and tells the operating
2080system to handle flow control. This is done using @code{set-input-mode}.
2081
2082@item
2083It 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
2085lowest level, Emacs never knows that the characters typed were anything
2086but @kbd{C-s} and @kbd{C-q}, so you can in effect type them as @kbd{C-\}
2087and @kbd{C-^} even when they are input for other commands.
2088@xref{Translating Input}.
2089@end enumerate
2090
2091If the terminal is the source of the flow control characters, then once
2092you enable kernel flow control handling, you probably can make do with
2093less padding than normal for that terminal. You can reduce the amount
2094of padding by customizing the Termcap entry. You can also reduce it by
2095setting @code{baud-rate} to a smaller value so that Emacs uses a smaller
2096speed 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
2106to be outputting to an erasable screen. The idea is that you specify 2016to be outputting to an erasable screen. The idea is that you specify
2107Lisp programs to run; when they are finished, Emacs should exit. The 2017Lisp programs to run; when they are finished, Emacs should exit. The
2108way to specify the programs to run is with @samp{-l @var{file}}, which 2018way to specify the programs to run is with @samp{-l @var{file}}, which
2109loads the library named @var{file}, and @samp{-f @var{function}}, which 2019loads the library named @var{file}, or @samp{-f @var{function}}, which
2110calls @var{function} with no arguments. 2020calls @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,
2113either using @code{message}, or using @code{prin1}, etc., with @code{t} 2023either using @code{message}, or using @code{prin1}, etc., with @code{t}