Next: , Up: Emacs Invocation

C.1 Action Arguments

Here is a table of action arguments:

file
--file=file
--find-file=file
--visit=file
Visit file using find-file. See Visiting.

When Emacs starts up, it displays the startup buffer in one window, and the buffer visiting file in another window (see Windows). If you supply more than one file argument, the displayed file is the last one specified on the command line; the other files are visited but their buffers are not shown.

If the startup buffer is disabled (see Entering Emacs), then file is visited in a single window if one file argument was supplied; with two file arguments, Emacs displays the files in two different windows; with more than two file argument, Emacs displays the last file specified in one window, plus a Buffer Menu in a different window (see Several Buffers). To inhibit using the Buffer Menu for this, change the variable inhibit-startup-buffer-menu to t.

+linenum file
Visit file using find-file, then go to line number linenum in it.
+linenum:columnnum file
Visit file using find-file, then go to line number linenum and put point at column number columnnum.
-l file
--load=file
Load a Lisp library named file with the function load. If file is not an absolute file name, Emacs first looks for it in the current directory, then in the directories listed in load-path (see Lisp Libraries).

Warning: If previous command-line arguments have visited files, the current directory is the directory of the last file visited.

-L dir
--directory=dir
Add directory dir to the variable load-path.
-f function
--funcall=function
Call Lisp function function. If it is an interactive function (a command), it reads the arguments interactively just as if you had called the same function with a key sequence. Otherwise, it calls the function with no arguments.
--eval=expression
--execute=expression
Evaluate Lisp expression expression.
--insert=file
Insert the contents of file into the *scratch* buffer (see Lisp Interaction). This is like what M-x insert-file does (see Misc File Ops).
--kill
Exit from Emacs without asking for confirmation.
--help
Print a usage message listing all available options, then exit successfully.
--version
Print Emacs version, then exit successfully.