Trailing whitespace deleted.
[bpt/emacs.git] / etc / emacs.1
CommitLineData
cf719610 1.\" Copyright (C) 1995, 1999, 2000, 2001 Free Software Foundation, Inc.
b15a393b
GM
2.\"
3.\" This file is part of GNU Emacs.
4.\"
5.\" GNU Emacs is free software; you can redistribute it and/or modify
6.\" it under the terms of the GNU General Public License as published by
7.\" the Free Software Foundation; either version 2, or (at your option)
8.\" any later version.
9.\"
10.\" GNU Emacs is distributed in the hope that it will be useful,
11.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
12.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13.\" GNU General Public License for more details.
14.\"
15.\" You should have received a copy of the GNU General Public License
16.\" along with GNU Emacs; see the file COPYING. If not, write to the
17.\" Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18.\" Boston, MA 02111-1307, USA.
19.\"
177338c4 20'\" t
2398d10d 21.TH EMACS 1 "2001 November 23"
a7bfd66f
DL
22.UC 4
23.SH NAME
24emacs \- GNU project Emacs
25.SH SYNOPSIS
26.B emacs
27[
28.I command-line switches
29] [
30.I files ...
31]
32.br
33.SH DESCRIPTION
34.I GNU Emacs
177c0ea7 35is a version of
a7bfd66f 36.I Emacs,
177c0ea7 37written by the author of the original (PDP-10)
a7bfd66f
DL
38.I Emacs,
39Richard Stallman.
40.br
41The primary documentation of GNU Emacs is in the GNU Emacs Manual,
42which you can read on line using Info, a subsystem of Emacs. Please
43look there for complete and up-to-date documentation. This man page
44is updated only when someone volunteers to do so; the Emacs
45maintainers' priority goal is to minimize the amount of time this man
46page takes away from other more useful projects.
47.br
48The user functionality of GNU Emacs encompasses
177c0ea7
JB
49everything other
50.I Emacs
a7bfd66f
DL
51editors do, and it is easily extensible since its
52editing commands are written in Lisp.
53.PP
54.I Emacs
55has an extensive interactive help facility,
56but the facility assumes that you know how to manipulate
57.I Emacs
58windows and buffers.
2398d10d 59CTRL-h or F1 enters the Help facility. Help Tutorial (CTRL-h t)
a7bfd66f 60requests an interactive tutorial which can teach beginners the fundamentals
177c0ea7
JB
61of
62.I Emacs
a7bfd66f
DL
63in a few minutes.
64Help Apropos (CTRL-h a) helps you
65find a command given its functionality, Help Character (CTRL-h c)
66describes a given character's effect, and Help Function (CTRL-h f)
67describes a given Lisp function specified by name.
68.PP
69.I Emacs's
70Undo can undo several steps of modification to your buffers, so it is
71easy to recover from editing mistakes.
72.PP
73.I GNU Emacs's
74many special packages handle mail reading (RMail) and sending (Mail),
75outline editing (Outline), compiling (Compile), running subshells
76within
77.I Emacs
78windows (Shell), running a Lisp read-eval-print loop
79(Lisp-Interaction-Mode), and automated psychotherapy (Doctor).
80.PP
81There is an extensive reference manual, but
82users of other Emacses
83should have little trouble adapting even
84without a copy. Users new to
85.I Emacs
86will be able
87to use basic features fairly rapidly by studying the tutorial and
88using the self-documentation features.
89.PP
90.SM Emacs Options
91.PP
92The following options are of general interest:
93.TP 8
94.I file
95Edit
96.I file.
97.TP
98.BI \+ number
99Go to the line specified by
100.I number
101(do not insert a space between the "+" sign and
102the number).
103.TP
2398d10d
EZ
104.BI \+ line:column
105Go to the specified
106.I line
107and
108.I column
109.TP
a7bfd66f
DL
110.B \-q
111Do not load an init file.
112.TP
2398d10d
EZ
113.B \-no-site-file
114Do not load the site-wide startup file.
115.TP
116.BI \-debug-init
177c0ea7 117Enable
2398d10d
EZ
118.I Emacs
119Lisp debugger during the processing of the user init file
120.BI ~/.emacs.
121This is useful for debugging problems in the init file.
122.TP
a7bfd66f
DL
123.BI \-u " user"
124Load
125.I user's
126init file.
127.TP
128.BI \-t " file"
129Use specified
130.I file
131as the terminal instead of using stdin/stdout.
132This must be the first argument specified in the command line.
2398d10d
EZ
133.TP
134.B \-version
135Display
136.I Emacs
137version information and exit.
a7bfd66f
DL
138.PP
139The following options are lisp-oriented
140(these options are processed in the order encountered):
141.TP 8
142.BI \-f " function"
143Execute the lisp function
144.I function.
145.TP
146.BI \-l " file"
147Load the lisp code in the file
148.I file.
2398d10d
EZ
149.TP
150.BI \-eval " expr"
151Evaluate the Lisp expression
152.I expr.
a7bfd66f
DL
153.PP
154The following options are useful when running
155.I Emacs
156as a batch editor:
157.TP 8
158.BI \-batch
159Edit in batch mode. The editor will send messages to stderr. This
160option must be the first in the argument list. You must use -l and -f
161options to specify files to execute and functions to call.
162.TP
163.B \-kill
177c0ea7
JB
164Exit
165.I Emacs
a7bfd66f 166while in batch mode.
2398d10d
EZ
167.TP
168.BI \-L " directory"
169Add
170.I directory
177c0ea7 171to the list of directories
2398d10d
EZ
172.I Emacs
173searches for Lisp files.
a7bfd66f
DL
174.\" START DELETING HERE IF YOU'RE NOT USING X
175.PP
176.SM Using Emacs with X
177.PP
178.I Emacs
179has been tailored to work well with the X window system.
180If you run
181.I Emacs
182from under X windows, it will create its own X window to
183display in. You will probably want to start the editor
184as a background process
185so that you can continue using your original window.
186.PP
187.I Emacs
188can be started with the following X switches:
189.TP 8
190.BI \-name " name"
191Specifies the name which should be assigned to the initial
192.I Emacs
193window. This controls looking up X resources as well as the window title.
194.TP 8
195.BI \-title " name"
196Specifies the title for the initial X window.
197.TP 8
198.B \-r
199Display the
200.I Emacs
201window in reverse video.
202.TP
203.B \-i
204Use the "kitchen sink" bitmap icon when iconifying the
205.I Emacs
206window.
207.TP
208.BI \-font " font, " \-fn " font"
209Set the
210.I Emacs
211window's font to that specified by
212.I font.
213You will find the various
214.I X
215fonts in the
216.I /usr/lib/X11/fonts
217directory.
218Note that
219.I Emacs
220will only accept fixed width fonts.
221Under the X11 Release 4 font-naming conventions, any font with the
222value "m" or "c" in the eleventh field of the font name is a fixed
223width font. Furthermore, fonts whose name are of the form
224.IR width x height
225are generally fixed width, as is the font
226.IR fixed .
227See
228.IR xlsfonts (1)
229for more information.
230
231When you specify a font, be sure to put a space between the
232switch and the font name.
233.TP
9002d21f 234.BI \-bw " pixels"
a7bfd66f
DL
235Set the
236.I Emacs
237window's border width to the number of pixels specified by
238.I pixels.
239Defaults to one pixel on each side of the window.
240.TP
241.BI \-ib " pixels"
242Set the window's internal border width to the number of pixels specified
177c0ea7 243by
a7bfd66f
DL
244.I pixels.
245Defaults to one pixel of padding on each side of the window.
246.PP
247.TP 8
62022aad 248.BI \-\-geometry " geometry"
a7bfd66f
DL
249Set the
250.I Emacs
251window's width, height, and position as specified. The geometry
252specification is in the standard X format; see
253.IR X (1)
254for more information.
255The width and height are specified in characters; the default is 80 by
62022aad
RS
25624. See the Emacs manual, section "Options for Window Size and Position",
257for information on how window sizes interact
258with selecting or deselecting the tool bar and menu bar.
a7bfd66f
DL
259.PP
260.TP 8
261.BI \-fg " color"
262On color displays, sets the color of the text.
263
264See the file
265.I /usr/lib/X11/rgb.txt
266for a list of valid
267color names.
268.TP
269.BI \-bg " color"
270On color displays,
271sets the color of the window's background.
272.TP
273.BI \-bd " color"
274On color displays,
275sets the color of the window's border.
276.TP
277.BI \-cr " color"
278On color displays,
279sets the color of the window's text cursor.
280.TP
281.BI \-ms " color"
282On color displays,
283sets the color of the window's mouse cursor.
284.TP
285.BI \-d " displayname, " \-display " displayname"
286Create the
287.I Emacs
288window on the display specified by
289.IR displayname .
290Must be the first option specified in the command line.
291.TP
292.B \-nw
293Tells
294.I Emacs
295not to use its special interface to X. If you use this
296switch when invoking
297.I Emacs
298from an
299.IR xterm (1)
300window, display is done in that window.
301This must be the first option specified in the command line.
302.PP
303You can set
304.I X
305default values for your
306.I Emacs
307windows in your
308.I \.Xresources
309file (see
310.IR xrdb (1)).
311Use the following format:
312.IP
313emacs.keyword:value
314.PP
315where
316.I value
317specifies the default value of
318.I keyword.
319.I Emacs
320lets you set default values for the following keywords:
321.TP 8
322.B font (\fPclass\fB Font)
323Sets the window's text font.
324.TP
325.B reverseVideo (\fPclass\fB ReverseVideo)
326If
327.I reverseVideo's
328value is set to
329.I on,
330the window will be displayed in reverse video.
331.TP
332.B bitmapIcon (\fPclass\fB BitmapIcon)
333If
334.I bitmapIcon's
335value is set to
336.I on,
337the window will iconify into the "kitchen sink."
338.TP
339.B borderWidth (\fPclass\fB BorderWidth)
340Sets the window's border width in pixels.
341.TP
342.B internalBorder (\fPclass\fB BorderWidth)
343Sets the window's internal border width in pixels.
344.TP
345.B foreground (\fPclass\fB Foreground)
346For color displays,
347sets the window's text color.
348.TP
349.B background (\fPclass\fB Background)
350For color displays,
351sets the window's background color.
352.TP
353.B borderColor (\fPclass\fB BorderColor)
354For color displays,
355sets the color of the window's border.
356.TP
357.B cursorColor (\fPclass\fB Foreground)
358For color displays,
359sets the color of the window's text cursor.
360.TP
361.B pointerColor (\fPclass\fB Foreground)
362For color displays,
363sets the color of the window's mouse cursor.
364.TP
365.B geometry (\fPclass\fB Geometry)
366Sets the geometry of the
367.I Emacs
368window (as described above).
369.TP
370.B title (\fPclass\fB Title)
371Sets the title of the
372.I Emacs
373window.
374.TP
375.B iconName (\fPclass\fB Title)
376Sets the icon name for the
377.I Emacs
378window icon.
379.PP
380If you try to set color values while using a black and white display,
381the window's characteristics will default as follows:
382the foreground color will be set to black,
383the background color will be set to white,
384the border color will be set to grey,
385and the text and mouse cursors will be set to black.
386.PP
177c0ea7 387.SM Using the Mouse
a7bfd66f
DL
388.PP
389The following lists the mouse button bindings for the
390.I Emacs
391window under X11.
392
177338c4
EZ
393.TS
394l l.
a7bfd66f 395MOUSE BUTTON FUNCTION
a7bfd66f 396left Set point.
a7bfd66f 397middle Paste text.
a7bfd66f 398right Cut text into X cut buffer.
a7bfd66f 399SHIFT-middle Cut text into X cut buffer.
a7bfd66f 400SHIFT-right Paste text.
a7bfd66f 401CTRL-middle Cut text into X cut buffer and kill it.
177338c4 402CTRL-right T{
177c0ea7 403Select this window, then split it into
a7bfd66f 404two windows. Same as typing CTRL-x 2.
177338c4 405T}
a7bfd66f 406.\" START DELETING HERE IF YOU'RE NOT USING X MENUS
177338c4
EZ
407CTRL-SHIFT-left T{
408X buffer menu--hold the buttons and keys
177c0ea7 409down, wait for menu to appear, select
a7bfd66f
DL
410buffer, and release. Move mouse out of
411menu and release to cancel.
177338c4
EZ
412T}
413CTRL-SHIFT-middle X help menu--pop up index card menu for Emacs help.
a7bfd66f 414.\" STOP DELETING HERE IF YOU'RE NOT USING X MENUS
177338c4
EZ
415CTRL-SHIFT-right T{
416Select window with mouse, and delete all
a7bfd66f 417other windows. Same as typing CTRL-x 1.
177338c4 418T}
a7bfd66f 419.\" STOP DELETING HERE IF YOU'RE NOT USING X
177338c4 420.TE
a7bfd66f
DL
421.PP
422.SH MANUALS
423You can order printed copies of the GNU Emacs Manual from the Free
424Software Foundation, which develops GNU software. See the file ORDERS
425for ordering information.
426.br
427Your local Emacs maintainer might also have copies available. As
428with all software and publications from FSF, everyone is permitted to
429make and distribute copies of the Emacs manual. The TeX source to the
430manual is also included in the Emacs source distribution.
431.PP
432.SH FILES
433/usr/local/info - files for the Info documentation browser
434(a subsystem of Emacs) to refer to. Currently not much of Unix
435is documented here, but the complete text of the Emacs reference
436manual is included in a convenient tree structured form.
437
438/usr/local/share/emacs/$VERSION/src - C source files and object files
439
440/usr/local/share/emacs/$VERSION/lisp - Lisp source files and compiled files
441that define most editing commands. Some are preloaded;
442others are autoloaded from this directory when used.
177c0ea7 443
a7bfd66f
DL
444/usr/local/share/emacs/$VERSION/etc - various programs that are used with
445GNU Emacs, and some files of information.
446
447/usr/local/share/emacs/$VERSION/etc/DOC.* - contains the documentation
448strings for the Lisp primitives and preloaded Lisp functions
449of GNU Emacs. They are stored here to reduce the size of
450Emacs proper.
451
452/usr/local/share/emacs/$VERSION/etc/OTHER.EMACSES discusses GNU Emacs
453vs. other versions of Emacs.
454.br
455/usr/local/share/emacs/$VERSION/etc/SERVICE lists people offering
456various services to assist users of GNU Emacs, including education,
457troubleshooting, porting and customization.
458.br
459These files also have information useful to anyone wishing to write
460programs in the Emacs Lisp extension language, which has not yet been fully
461documented.
462
463/usr/local/com/emacs/lock - holds lock files that are made for all
464files being modified in Emacs, to prevent simultaneous modification
465of one file by two users.
466
467.\" START DELETING HERE IF YOU'RE NOT USING X
468/usr/lib/X11/rgb.txt - list of valid X color names.
469.\" STOP DELETING HERE IF YOU'RE NOT USING X
470.PP
471.SH BUGS
472There is a mailing list, bug-gnu-emacs@prep.ai.mit.edu on the internet
473(ucbvax!prep.ai.mit.edu!bug-gnu-emacs on UUCPnet), for reporting Emacs
474bugs and fixes. But before reporting something as a bug, please try
475to be sure that it really is a bug, not a misunderstanding or a
476deliberate feature. We ask you to read the section ``Reporting Emacs
477Bugs'' near the end of the reference manual (or Info system) for hints
478on how and when to report bugs. Also, include the version number of
479the Emacs you are running in \fIevery\fR bug report that you send in.
480
481Do not expect a personal answer to a bug report. The purpose of reporting
482bugs is to get them fixed for everyone in the next release, if possible.
483For personal assistance, look in the SERVICE file (see above) for
484a list of people who offer it.
485
486Please do not send anything but bug reports to this mailing list.
487Send requests to be added to mailing lists to the special list
488info-gnu-emacs-request@prep.ai.mit.edu (or the corresponding UUCP
489address). For more information about Emacs mailing lists, see the
490file /usr/local/emacs/etc/MAILINGLISTS. Bugs tend actually to be
491fixed if they can be isolated, so it is in your interest to report
492them in such a way that they can be easily reproduced.
493.PP
494Bugs that I know about are: shell will not work with programs
495running in Raw mode on some Unix versions.
496.SH UNRESTRICTIONS
497.PP
177c0ea7
JB
498.I Emacs
499is free; anyone may redistribute copies of
500.I Emacs
a7bfd66f 501to
177c0ea7
JB
502anyone under the terms stated in the
503.I Emacs
a7bfd66f 504General Public License,
177c0ea7
JB
505a copy of which accompanies each copy of
506.I Emacs
a7bfd66f
DL
507and which also
508appears in the reference manual.
509.PP
510Copies of
511.I Emacs
512may sometimes be received packaged with distributions of Unix systems,
513but it is never included in the scope of any license covering those
514systems. Such inclusion violates the terms on which distribution
515is permitted. In fact, the primary purpose of the General Public
516License is to prohibit anyone from attaching any other restrictions
177c0ea7 517to redistribution of
a7bfd66f
DL
518.I Emacs.
519.PP
177c0ea7
JB
520Richard Stallman encourages you to improve and extend
521.I Emacs,
a7bfd66f
DL
522and urges that
523you contribute your extensions to the GNU library. Eventually GNU
524(Gnu's Not Unix) will be a complete replacement for Berkeley
525Unix.
526Everyone will be free to use, copy, study and change the GNU system.
527.SH SEE ALSO
528X(1), xlsfonts(1), xterm(1), xrdb(1)
529.SH AUTHORS
530.PP
531.I Emacs
532was written by Richard Stallman and the Free Software Foundation.
533Joachim Martillo and Robert Krawitz added the X features.
0096aed2 534.SH COPYING
177c0ea7 535Copyright
0096aed2
EZ
536.if t \(co
537.if n (c)
7ef5e870 5381995, 1999, 2000, 2001 Free Software Foundation, Inc.
0096aed2 539.PP
2398d10d
EZ
540Permission is granted to make and distribute verbatim copies of this
541document provided the copyright notice and this permission notice are
542preserved on all copies.
543.PP
544Permission is granted to copy and distribute modified versions of
545this document under the conditions for verbatim copying, provided that
546the entire resulting derived work is distributed under the terms of
547a permission notice identical to this one.
0096aed2 548.PP
2398d10d
EZ
549Permission is granted to copy and distribute translations of this
550document into another language, under the above conditions for
551modified versions, except that this permission notice may be stated
552in a translation approved by the Free Software Foundation.