aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-11-12 23:59:04 +0000
committerChong Yidong2008-11-12 23:59:04 +0000
commit63961e6a1d35a467292bbabc8b9b33d28bba67dc (patch)
treee14b5c4917f6fe339785108b357855e7f038c6d3
parent07a856853c56617e38859308c493062d86579102 (diff)
downloademacs-63961e6a1d35a467292bbabc8b9b33d28bba67dc.tar.gz
emacs-63961e6a1d35a467292bbabc8b9b33d28bba67dc.zip
(Emacs Invocation): Link to Emacs Server. Note that command-line-args
is processed during startup. (Action Arguments): Correctly describe how file arguments interact with the startup screen. Link to Lisp Interaction for scratch buffer. (Initial Options): Link to Command Example for -batch option. (Environment): Document initial-environment.
-rw-r--r--doc/emacs/cmdargs.texi169
1 files changed, 91 insertions, 78 deletions
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 6be6a983461..2c5f3aabda4 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -11,21 +11,19 @@
11@cindex startup (command line arguments) 11@cindex startup (command line arguments)
12@cindex invocation (command line arguments) 12@cindex invocation (command line arguments)
13 13
14 GNU Emacs supports command line arguments to request various actions 14 Emacs supports command line arguments to request various actions
15when invoking Emacs. These are for compatibility with other editors and 15when invoking Emacs. These are for compatibility with other editors
16for sophisticated activities. We don't recommend using them for 16and for sophisticated activities. We don't recommend using them for
17ordinary editing. 17ordinary editing (@xref{Emacs Server}, for a way to access an existing
18Emacs job from the command line).
18 19
19 Arguments starting with @samp{-} are @dfn{options}, and so is 20 Arguments starting with @samp{-} are @dfn{options}, and so is
20@samp{+@var{linenum}}. All other arguments specify files to visit. 21@samp{+@var{linenum}}. All other arguments specify files to visit.
21Emacs visits the specified files while it starts up. The last file 22Emacs visits the specified files while it starts up. The last file
22name on your command line becomes the current buffer; the other files 23specified on the command line becomes the current buffer; the other
23are also visited in other buffers. If there are two files, they are 24files are also visited in other buffers. As with most programs, the
24both displayed; otherwise the last file is displayed along with a 25special argument @samp{--} says that all subsequent arguments are file
25buffer list that shows what other buffers there are. As with most 26names, not options, even if they start with @samp{-}.
26programs, the special argument @samp{--} says that all subsequent
27arguments are file names, not options, even if they start with
28@samp{-}.
29 27
30 Emacs command options can specify many things, such as the size and 28 Emacs command options can specify many things, such as the size and
31position of the X window Emacs uses, its colors, and so on. A few 29position of the X window Emacs uses, its colors, and so on. A few
@@ -52,14 +50,15 @@ and the tables below always show an equal sign.
52@vindex command-line-args 50@vindex command-line-args
53 Most options specify how to initialize Emacs, or set parameters for 51 Most options specify how to initialize Emacs, or set parameters for
54the Emacs session. We call them @dfn{initial options}. A few options 52the Emacs session. We call them @dfn{initial options}. A few options
55specify things to do: for example, load libraries, call functions, or 53specify things to do, such as loading libraries or calling Lisp
56terminate Emacs. These are called @dfn{action options}. These and file 54functions. These are called @dfn{action options}. These and file
57names together are called @dfn{action arguments}. Emacs processes all 55names together are called @dfn{action arguments}. The action
58the action arguments in the order they are written. The @file{.emacs} file 56arguments are stored as a list of strings in the variable
59can access the values of the action arguments as the elements of a list in 57@code{command-line-args}. (Actually, when Emacs starts up,
60the variable @code{command-line-args}. 58@code{command-line-args} contains all the arguments passed from the
61 59command line; during initialization, the initial arguments are removed
62 60from this list when they are processed, leaving only the action
61arguments.)
63 62
64@menu 63@menu
65* Action Arguments:: Arguments to visit files, load libraries, 64* Action Arguments:: Arguments to visit files, load libraries,
@@ -81,7 +80,7 @@ the variable @code{command-line-args}.
81@node Action Arguments 80@node Action Arguments
82@appendixsec Action Arguments 81@appendixsec Action Arguments
83 82
84 Here is a table of the action arguments and options: 83 Here is a table of action arguments:
85 84
86@table @samp 85@table @samp
87@item @var{file} 86@item @var{file}
@@ -94,9 +93,21 @@ the variable @code{command-line-args}.
94@cindex visiting files, command-line argument 93@cindex visiting files, command-line argument
95@vindex inhibit-startup-buffer-menu 94@vindex inhibit-startup-buffer-menu
96Visit @var{file} using @code{find-file}. @xref{Visiting}. 95Visit @var{file} using @code{find-file}. @xref{Visiting}.
97If you visit several files at startup in this way, Emacs 96
98also displays a Buffer Menu buffer to show you what files it 97When Emacs starts up, it displays the startup buffer in one window,
99has visited. You can inhibit that by setting @code{inhibit-startup-buffer-menu} to @code{t}. 98and the buffer visiting @var{file} in another window
99(@pxref{Windows}). If you supply more than one file argument, the
100displayed file is the last one specified on the command line; the
101other files are visited but their buffers are not shown.
102
103If the startup buffer is disabled (@pxref{Entering Emacs}), then
104@var{file} is visited in a single window if one file argument was
105supplied; with two file arguments, Emacs displays the files in two
106different windows; with more than two file argument, Emacs displays
107the last file specified in one window, plus a Buffer Menu in a
108different window (@pxref{Several Buffers}). To inhibit using the
109Buffer Menu for this, change the variable
110@code{inhibit-startup-buffer-menu} to @code{t}.
100 111
101@item +@var{linenum} @var{file} 112@item +@var{linenum} @var{file}
102@opindex +@var{linenum} 113@opindex +@var{linenum}
@@ -107,7 +118,6 @@ Visit @var{file} using @code{find-file}, then go to line number
107Visit @var{file} using @code{find-file}, then go to line number 118Visit @var{file} using @code{find-file}, then go to line number
108@var{linenum} and put point at column number @var{columnnum}. 119@var{linenum} and put point at column number @var{columnnum}.
109 120
110@need 3000
111@item -l @var{file} 121@item -l @var{file}
112@opindex -l 122@opindex -l
113@itemx --load=@var{file} 123@itemx --load=@var{file}
@@ -149,8 +159,9 @@ Evaluate Lisp expression @var{expression}.
149@item --insert=@var{file} 159@item --insert=@var{file}
150@opindex --insert 160@opindex --insert
151@cindex insert file contents, command-line argument 161@cindex insert file contents, command-line argument
152Insert the contents of @var{file} into the current buffer. This is like 162Insert the contents of @var{file} into the @samp{*scratch*} buffer
153what @kbd{M-x insert-file} does. @xref{Misc File Ops}. 163(@pxref{Lisp Interaction}). This is like what @kbd{M-x insert-file}
164does (@pxref{Misc File Ops}).
154 165
155@item --kill 166@item --kill
156@opindex --kill 167@opindex --kill
@@ -174,12 +185,12 @@ section describes the more general initial options; some other options
174specifically related to the X Window System appear in the following 185specifically related to the X Window System appear in the following
175sections. 186sections.
176 187
177 Some initial options affect the loading of init files. The normal 188 Some initial options affect the loading of the initialization file.
178actions of Emacs are to first load @file{site-start.el} if it exists, 189The normal actions of Emacs are to first load @file{site-start.el} if
179then your own init file @file{~/.emacs} if it exists, and finally 190it exists, then your own initialization file @file{~/.emacs} if it
180@file{default.el} if it exists. @xref{Init File}. Certain options 191exists, and finally @file{default.el} if it exists. @xref{Init File}.
181prevent loading of some of these files or substitute other files for 192Certain options prevent loading of some of these files or substitute
182them. 193other files for them.
183 194
184@table @samp 195@table @samp
185@item -t @var{device} 196@item -t @var{device}
@@ -208,27 +219,30 @@ Don't communicate directly with the window system, disregarding the
208Emacs uses the terminal from which it was launched for all its display 219Emacs uses the terminal from which it was launched for all its display
209and input. 220and input.
210 221
211@need 3000
212@cindex batch mode 222@cindex batch mode
213@item -batch 223@item -batch
214@opindex --batch 224@opindex --batch
215@itemx --batch 225@itemx --batch
216Run Emacs in @dfn{batch mode}. Batch mode is used for running 226Run Emacs in @dfn{batch mode}. Batch mode is used for running
217programs written in Emacs Lisp from shell scripts, makefiles, and so 227programs written in Emacs Lisp from shell scripts, makefiles, and so
218on. You should also use the @samp{-l}, @samp{-f} or @samp{--eval} 228on. To invoke a Lisp program, use the @samp{-batch} option in
219option, to invoke a Lisp program to do batch processing. 229conjunction with one or more of @samp{-l}, @samp{-f} or @samp{--eval}
230(@pxref{Action Arguments}). @xref{Command Example}, for an example.
220 231
221In batch mode, Emacs does not display the text being edited, and the 232In batch mode, Emacs does not display the text being edited, and the
222standard terminal interrupt characters such as @kbd{C-z} and @kbd{C-c} 233standard terminal interrupt characters such as @kbd{C-z} and @kbd{C-c}
223continue to have their normal effect. The functions @code{prin1}, 234have their usual effect. Emacs functions that normally print a
224@code{princ} and @code{print} output to @code{stdout} instead of the 235message in the echo area will print to either the standard output
225echo area, while @code{message} and error messages output to 236stream (@code{stdout}) or the standard error stream (@code{stderr})
226@code{stderr}. Functions that would normally read from the minibuffer 237instead. (To be precise, functions like @code{prin1}, @code{princ}
227take their input from @code{stdin} instead. 238and @code{print} print to @code{stdout}, while @code{message} and
228 239@code{error} print to @code{stderr}.) Functions that normally read
229@samp{--batch} implies @samp{-q} (do not load an init file), but 240keyboard input from the minibuffer take their input from the
230@file{site-start.el} is loaded nonetheless. It also causes Emacs to 241terminal's standard input stream (@code{stdin}) instead.
231exit after processing all the command options. In addition, it 242
243@samp{--batch} implies @samp{-q} (do not load an initialization file),
244but @file{site-start.el} is loaded nonetheless. It also causes Emacs
245to exit after processing all the command options. In addition, it
232disables auto-saving except in buffers for which it has been 246disables auto-saving except in buffers for which it has been
233explicitly requested. 247explicitly requested.
234 248
@@ -257,11 +271,11 @@ comment delimiter.
257@cindex bypassing init and @file{default.el} file 271@cindex bypassing init and @file{default.el} file
258@cindex init file, not loading 272@cindex init file, not loading
259@cindex @file{default.el} file, not loading 273@cindex @file{default.el} file, not loading
260Do not load your Emacs init file @file{~/.emacs}, or @file{default.el} 274Do not load your Emacs initialization file, and do not load the file
261either. Regardless of this switch, @file{site-start.el} is still loaded. 275@file{default.el} either (@pxref{Init File}). Regardless of this
262When invoked like this, Emacs does not allow saving options 276switch, @file{site-start.el} is still loaded. When Emacs is invoked
263changed with the @kbd{M-x customize} command and its variants. 277like this, the Customize facility does not allow options to be saved
264@xref{Easy Customization}. 278(@pxref{Easy Customization}).
265 279
266@item --no-site-file 280@item --no-site-file
267@opindex --no-site-file 281@opindex --no-site-file
@@ -270,37 +284,35 @@ Do not load @file{site-start.el}. The options @samp{-q}, @samp{-u}
270and @samp{--batch} have no effect on the loading of this file---this 284and @samp{--batch} have no effect on the loading of this file---this
271option and @samp{-Q} are the only options that block it. 285option and @samp{-Q} are the only options that block it.
272 286
287@item --no-splash
288@opindex --no-splash
289@vindex inhibit-startup-screen
290@cindex splash screen
291@cindex startup message
292Do not display a startup screen. You can also achieve this effect by
293setting the variable @code{inhibit-startup-screen} to non-@code{nil}
294in your initialization file (@pxref{Entering Emacs}).
295
273@item -Q 296@item -Q
274@opindex -Q 297@opindex -Q
275@itemx --quick 298@itemx --quick
276@opindex --quick 299@opindex --quick
277Start emacs with minimum customizations. This is like using @samp{-q} 300Start emacs with minimum customizations. This is like using
278and @samp{--no-site-file}, but also disables the startup screen. 301@samp{-q}, @samp{--no-site-file}, and @samp{--no-splash} together.
279 302
280@item -daemon 303@item -daemon
281@opindex -daemon 304@opindex -daemon
282@itemx --daemon 305@itemx --daemon
283@opindex --daemon 306@opindex --daemon
284Start emacs in background as a daemon (i.e. it will disconnect from the 307Start Emacs as a daemon---after Emacs starts up, it starts the Emacs
285terminal), do not open any frames and start the server. Clients can 308server and disconnects from the terminal without opening any frames.
286connect and create graphical or terminal frames using 309You can then use the @command{emacsclient} command to connect to Emacs
287@code{emacsclient}. 310for editing. @xref{Emacs Server}, for information about using Emacs
311as a daemon.
288 312
289@item -daemon=@var{SERVER-NAME} 313@item -daemon=@var{SERVER-NAME}
290Start emacs in background as a daemon, and start the server with the 314Start emacs in background as a daemon, and use @var{SERVER-NAME} as
291name set to @var{SERVER-NAME}. 315the server name.
292
293@item --no-splash
294@opindex --no-splash
295@vindex inhibit-startup-screen
296@cindex splash screen
297@cindex startup message
298Do not display a splash screen on startup. You can also achieve this
299effect by setting the variable @code{inhibit-startup-screen} to
300non-@code{nil} in you personal init file (but @emph{not} in
301@file{site-start.el}). (This variable was called
302@code{inhibit-splash-screen} or @code{inhibit-startup-message} in
303previous Emacs versions.)
304 316
305@item --no-desktop 317@item --no-desktop
306@opindex --no-desktop 318@opindex --no-desktop
@@ -311,9 +323,8 @@ Do not reload any saved desktop. @xref{Saving Emacs Sessions}.
311@itemx --user=@var{user} 323@itemx --user=@var{user}
312@opindex --user 324@opindex --user
313@cindex load init file of another user 325@cindex load init file of another user
314Load @var{user}'s Emacs init file @file{~@var{user}/.emacs} instead of 326Load @var{user}'s initialization file instead of your
315your own@footnote{ 327own@footnote{This option has no effect on MS-Windows.}.
316This option has no effect on MS-Windows.}.
317 328
318@item --debug-init 329@item --debug-init
319@opindex --debug-init 330@opindex --debug-init
@@ -422,10 +433,13 @@ software) inherit the environment from Emacs, too.
422 433
423@findex setenv 434@findex setenv
424@findex getenv 435@findex getenv
436@vindex initial-environment
425 Inside Emacs, the command @kbd{M-x getenv} gets the value of an 437 Inside Emacs, the command @kbd{M-x getenv} gets the value of an
426environment variable. @kbd{M-x setenv} sets a variable in the Emacs 438environment variable. @kbd{M-x setenv} sets a variable in the Emacs
427environment. (Environment variable substitutions with @samp{$} work 439environment. (Environment variable substitutions with @samp{$} work
428in the value just as in file names; see @ref{File Names with $}.) 440in the value just as in file names; see @ref{File Names with $}.) The
441variable @code{initial-environment} stores the initial environment
442inherited by Emacs.
429 443
430 The way to set environment variables outside of Emacs depends on the 444 The way to set environment variables outside of Emacs depends on the
431operating system, and especially the shell that you are using. For 445operating system, and especially the shell that you are using. For
@@ -456,11 +470,10 @@ documentation for more information.
456@node General Variables 470@node General Variables
457@appendixsubsec General Variables 471@appendixsubsec General Variables
458 472
459 Here is an alphabetical list of specific environment variables that 473 Here is an alphabetical list of environment variables that have
460have special meanings in Emacs, giving the name of each variable and 474special meanings in Emacs. Most of these variables are also used by
461its meaning. Most of these variables are also used by some other 475some other programs. Emacs does not require any of these environment
462programs. Emacs does not require any of these environment variables 476variables to be set, but it uses their values if they are set.
463to be set, but it uses their values if they are set.
464 477
465@table @env 478@table @env
466@item CDPATH 479@item CDPATH