Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Appendix C Command Line Arguments for Emacs Invocation

GNU Emacs supports command line arguments to request various actions when invoking Emacs. These are for compatibility with other editors and for sophisticated activities. We don't recommend using them for ordinary editing.

Arguments starting with ‘-’ are options, and so is ‘+linenum’. All other arguments specify files to visit. Emacs visits the specified files while it starts up. The last file name on your command line becomes the current buffer; the other files are also visited in other buffers. If there are two files, they are both displayed; otherwise the last file is displayed along with a buffer list that shows what other buffers there are. As with most programs, the special argument ‘--’ says that all subsequent arguments are file names, not options, even if they start with ‘-’.

Emacs command options can specify many things, such as the size and position of the X window Emacs uses, its colors, and so on. A few options support advanced usage, such as running Lisp functions on files in batch mode. The sections of this chapter describe the available options, arranged according to their purpose.

There are two ways of writing options: the short forms that start with a single ‘-’, and the long forms that start with ‘--’. For example, ‘-d’ is a short form and ‘--display’ is the corresponding long form.

The long forms with ‘--’ are easier to remember, but longer to type. However, you don't have to spell out the whole option name; any unambiguous abbreviation is enough. When a long option takes an argument, you can use either a space or an equal sign to separate the option name and the argument. Thus, you can write either ‘--display sugar-bombs:0.0’ or ‘--display=sugar-bombs:0.0’. We recommend an equal sign because it makes the relationship clearer, and the tables below always show an equal sign.

Most options specify how to initialize Emacs, or set parameters for the Emacs session. We call them initial options. A few options specify things to do: for example, load libraries, call functions, or terminate Emacs. These are called action options. These and file names together are called action arguments. Emacs processes all the action arguments in the order they are written. The .emacs file can access the values of the action arguments as the elements of a list in the variable command-line-args.

  Published under the terms of the GNU General Public License Design by Interspire