Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ emacs(1) — Digital UNIX 3.2c

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

X(1X)

xterm(1X)

emacs(1)  —  Commands

NAME

emacs, xemacs − GNU project Emacs

SYNOPSIS

emacs [command-line switches] [file ...]

DESCRIPTION

GNU Emacs is a new version of Emacs, written by the author of the original (PDP-10) Emacs, Richard Stallman.  Its user functionality encompasses  everything other Emacs editors do, and it is easily extensible since its editing commands are written in Lisp. 

Emacs has an extensive interactive help facility, but to use it you must know how to manipulate Emacs windows and buffers.  CTRL-h (backspace or CTRL-h) enters the Help facility.  Help Tutorial (CTRL-h t) requests an interactive tutorial which can teach beginners the fundamentals of Emacs in a few minutes.  Help Apropos (CTRL-h a) helps you find a command given its functionality, Help Character (Ctrl-h c) describes a given character’s effect, and Help Function (CTRL-h f) describes a given Lisp function specified by name. 

Emacs’s Undo command can undo several steps of modification to your buffers, so it is easy to recover from editing mistakes. 

There is an extensive reference manual, but users of other Emacses should have little trouble adapting even without a copy.  Users new to Emacs will be able to use basic features fairly rapidly by studying the tutorial and using the self-documentation features. 

General Emacs Options

The following options are of general interest:

fileEdit file. 

+numberGo to the line specified by number.  (Do not insert a space between the + sign and the number.) 

−qDo not load an init file. 

−u userLoad user’s init file. 

−t fileUse specified file as the terminal instead of using stdin/stdout.  This must be the first argument specified in the command line. 

Lisp Options

The following options are lisp-oriented.  These options are processed in the order encountered. 

−f functionExecute the lisp function function. 

−l fileLoad the lisp code in the file file. 

Batch Options

The following options are useful when running Emacs as a batch editor:

−batch commandfile
Edit in batch mode, using the commands found in commandfile.  The editor will send messages to stdout.  This option must be the first in the argument list. 

−killExit Emacs while in batch mode. 

Using Emacs with X

Emacs has been tailored to work with the X window system.  If you run Emacs from under X windows, it will create its own X window in which to display.  You will probably want to start the editor as a background process (emacs &) so that you can continue using your original window. 

Emacs can be started with the following X switches:

−rn nameSpecifies the program name which should be used when looking up defaults in the user’s X resources.  This must be the first option specified in the command line. 

−wn nameSpecifies the name which should be assigned to the Emacs window. 

−rDisplay the Emacs window in reverse video. 

−iUse the “kitchen sink” bitmap icon when iconifying the Emacs window. 

−font font, −fn font
Set the Emacs window’s font to that specified by font.  You will find the various X fonts in the /usr/lib/X11/fonts directory. 

Note that Emacs will only accept fixed-width fonts.  Under the X11 Release 4 font-naming conventions, any font with the value “m” or “c” in the eleventh field of the font name is a fixed width font.  Furthermore, fonts whose name are of the form width x height are generally fixed-width, as is the font fixed. 

When you specify a font, be sure to put a space between the switch and the font name. 

−b pixelsSet the Emacs window’s border width to the number of pixels specified by pixels.  Defaults to one pixel on each side of the window. 

−ib pixelsSet the window’s internal border width to the number of pixels specified by pixels.  Defaults to one pixel of padding on each side of the window. 

−w geometry, −geometry geometry
Set the Emacs window’s width, height, and position as specified.  The geometry specification is in the standard X format; see X(1X) for more information.  The width and height are specified in characters.  The default is 80 by 24. 

Color Options

The following options let you specify colors for an Emacs window on color displays. 

−fg colorSets the color of the text.  See the file /usr/lib/X11/rgb.txt for a list of valid color names. 

−bg colorSets the color of the window’s background. 

−bd colorSets the color of the window’s border. 

−cr colorSets the color of the window’s text cursor. 

−ms colorSets the color of the window’s mouse cursor. 

X Window Options

The following options let you determine various aspects of how Emacs interacts with your X window environment. 

−d displayname,  −display displayname
Create the Emacs window on the display specified by displayname.  Must be the first option specified in the command line. 

−nwTells Emacs not to use its special interface to X.  If you use this switch when invoking Emacs from an xterm(1X) window, display is done in that window.  This must be the first option specified in the command line. 

X Window Keywords

You can set X default values for your Emacs windows in your .Xresources file, using the following format:

    emacs.keyword:value

where value specifies the default value of keyword.  Emacs lets you set default values for the following keywords:

font (class Font)
Sets the window’s text font.

reverseVideo (class ReverseVideo)
If reverseVideo’s value is set to on, the window will be displayed in reverse video. 

bitmapIcon (class BitmapIcon)
If bitmapIcon’s value is set to on, the window will iconify into the “kitchen sink.”

borderWidth (class BorderWidth)
Sets the window’s border width in pixels.

internalBorder (class BorderWidth)
Sets the window’s internal border width in pixels.

foreground (class Foreground)
For color displays, sets the window’s text color.

background (class Background)
For color displays, sets the window’s background color.

borderColor (class BorderColor)
For color displays, sets the color of the window’s border.

cursorColor (class Foreground)
For color displays, sets the color of the window’s text cursor.

pointerColor (class Foreground)
For color displays, sets the color of the window’s mouse cursor.

geometry (class Geometry)
Sets the geometry of the Emacs window (as described above). 

title (class Title)
Sets the title of the Emacs window. 

iconName (class Title)
Sets the icon name for the Emacs window icon. 

If you try to set color values while using a black and white display, the window’s characteristics will default as follows:

•  The foreground color will be set to black
•  The background color will be set to white
•  The border color will be set to grey.
•  The text and mouse cursors will be set to black.

Using the Mouse

The following mouse button bindings apply for the Emacs window under X11:

GNU Emacs Key Bindings for X Windows
Key  Button  Function
Unshifted  left  x-mouse-set-mark
middle  x-mouse-set-point
right  x-mouse-select
Control  middle  x-cut-and-wipe-text
right  x-mouse-select-and-split
Shift  middle  x-cut-text
right  x-paste-text
Control-Shift  left  x-buffer-menu
middle  x-help
right  x-mouse-keep-one-window

NOTES

Manuals

PostScript files of the Emacs manuals are located in /usr/lib/emacs/doc. 

You can order printed copies of the GNU Emacs Manual from the Free Software Foundation, which develops GNU software.  Contact them for the price of the manual.  Their address is:

    Free Software Foundation
    675 Mass Ave.
    Cambridge, MA 02139

As with all software and publications from FSF, everyone is permitted to make and distribute copies of the Emacs manual.  The TeX source to the manual is included in the Emacs source distribution. 

Authors

Emacs was written by Richard Stallman and the Free Software Foundation.  Joachim Martillo and Robert Krawitz added the X features. 

FILES

/usr/lib/emacs/src - C source files and object files

/usr/lib/emacs/lisp - Lisp source files and compiled files that define most editing commands.  Some are preloaded; others are autoloaded from this directory when used. 

/usr/lib/emacs/etc - various programs that are used with GNU Emacs, and some files of information. 

/usr/lib/emacs/etc/DOC.∗ - contains the documentation strings for the Lisp primitives and preloaded Lisp functions of GNU Emacs.  They are stored here to reduce the size of Emacs proper. 

/usr/lib/emacs/etc/DIFF discusses GNU Emacs vs. Twenex Emacs;

/usr/lib/emacs/etc/CCADIFF discusses GNU Emacs vs. CCA Emacs;

/usr/lib/emacs/etc/GOSDIFF discusses GNU Emacs vs. Gosling Emacs. 

These files also have information useful to anyone wishing to write programs in the Emacs Lisp extension language, which has not yet been fully documented. 

/usr/lib/emacs/info - files for the Info documentation browser (a subsystem of Emacs) to refer to.  Currently not much of UNIX is documented here, but the complete text of the Emacs reference manual is included in a convenient tree structured form. 

/usr/lib/X11/rgb.txt - list of valid X color names. 

UNRESTRICTIONS

Emacs is free; anyone may redistribute copies of Emacs to anyone under the terms stated in the Emacs General Public License, a copy of which accompanies each copy of Emacs, and which also appears in the reference manual. 

Copies of Emacs may sometimes be received packaged with distributions of UNIX systems, but it is never included in the scope of any license covering those systems.  Such inclusion violates the terms on which distribution is permitted.  In fact, the primary purpose of the General Public License is to prohibit anyone from attaching any other restrictions to redistribution of Emacs. 

Richard Stallman encourages you to improve and extend Emacs, and urges that you contribute your extensions to the GNU library.  Eventually GNU (GNU’s Not UNIX) will be a complete replacement for Berkeley UNIX.  Everyone will be able to use the GNU system for free. 

RELATED INFORMATION

Commands: X(1X), xterm(1X)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026