Bump version to 23.0.91.
[bpt/emacs.git] / doc / man / emacs.1
CommitLineData
c89da685 1.\" See section COPYING for copyright and redistribution information.
3f2d84c7 2.TH EMACS 1 "2007 April 13" "GNU Emacs 23.0.91"
cbe77461
GM
3.
4.
5.SH NAME
6emacs \- GNU project Emacs
7.
8.
9.SH SYNOPSIS
10.B emacs
11[
12.I command-line switches
13] [
14.I files ...\&
15]
16.
17.
18.SH DESCRIPTION
19.I GNU Emacs
20is a version of
21.IR Emacs ,
22written by the author of the original (PDP-10)
23.IR Emacs ,
24Richard Stallman.
25.br
26The primary documentation of GNU Emacs is in the GNU Emacs Manual,
27which you can read using Info, either from Emacs or as a standalone
28program.
29Please look there for complete and up-to-date documentation.
30This man page is updated only when someone volunteers to do so; the
31Emacs maintainers' priority goal is to minimize the amount of time
32this man page takes away from other more useful projects.
33.br
34The user functionality of GNU Emacs encompasses
35everything other
36.I Emacs
37editors do, and it is easily extensible since its
38editing commands are written in Lisp.
39.PP
40.I Emacs
41has an extensive interactive help facility,
42but the facility assumes that you know how to manipulate
43.I Emacs
44windows and buffers.
45CTRL-h or F1 enters the Help facility.
46Help Tutorial (CTRL-h t) starts an interactive tutorial which can
47teach beginners the fundamentals of
48.I Emacs
49in a few minutes.
50Help Apropos (CTRL-h a) helps you
51find a command given its functionality, Help Character (CTRL-h c)
52describes a given character's effect, and Help Function (CTRL-h f)
53describes a given Lisp function specified by name.
54.PP
55.IR Emacs 's
56Undo can undo several steps of modification to your buffers, so it is
57easy to recover from editing mistakes.
58.PP
59.IR "GNU Emacs" 's
60many special packages handle mail reading (RMail) and sending (Mail),
61outline editing (Outline), compiling (Compile), running subshells
62within
63.I Emacs
64windows (Shell), running a Lisp read-eval-print loop
65(Lisp-Interaction-Mode), automated psychotherapy (Doctor), and much more.
66.PP
67There is an extensive reference manual, but
68users of other Emacses
69should have little trouble adapting even
70without a copy.
71Users new to
72.I Emacs
73will be able
74to use basic features fairly rapidly by studying the tutorial and
75using the self-documentation features.
76.
77.SS Emacs Options
78The following options are of general interest:
79.RS
80.TP 8
81.I file
82Edit
83.IR file .
84.TP
85.BI \-\-file " file\fR,\fP " \-\-find-file " file\fR,\fP " \-\-visit " file"
86The same as specifying
87.I file
88directly as an argument.
89.TP
90.BI + number
91Go to the line specified by
92.I number
93(do not insert a space between the "+" sign and
94the number).
95This applies only to the next file specified.
96.TP
97.BI + line:column
98Go to the specified
99.I line
100and
101.IR column .
102.TP
103.BR \-q ", " \-\-no\-init\-file
104Do not load an init file.
105.TP
106.B \-\-no\-site\-file
107Do not load the site-wide startup file.
108.TP
109.B \-\-no\-desktop
110Do not load a saved desktop.
111.TP
112.BR \-nl ", " \-\-no\-shared\-memory
113Do not use shared memory.
114.TP
115.BR \-Q ", " \-\-quick
116Equivalent to "\-q \-\-no\-site\-file \-\-no\-splash".
117.TP
118.B \-\-no\-splash
119Do not display a splash screen during start-up.
120.TP
121.B \-\-debug\-init
122Enable
123.I Emacs
124Lisp debugger during the processing of the user init file
125.BR ~/.emacs .
126This is useful for debugging problems in the init file.
127.TP
128.BI \-u " user\fR,\fP " \-\-user " user"
129Load
130.IR user 's
131init file.
132.TP
133.BI \-t " file\fR,\fP " \-\-terminal " file"
134Use specified
135.I file
136as the terminal instead of using stdin/stdout.
137This must be the first argument specified in the command line.
138.TP
139.BR \-\-multibyte ", " \-\-no-unibyte
140Enable multibyte mode (enabled by default).
141.TP
142.BR \-\-unibyte ", " \-\-no-multibyte
143Enable unibyte mode.
144.TP
145.B \-\-version
146Display
147.I Emacs
148version information and exit.
149.TP
150.B \-\-help
151Display this help and exit.
152.RE
153.PP
154The following options are lisp-oriented
155(these options are processed in the order encountered):
156.RS
157.TP 8
158.BI \-f " function\fR,\fP " \-\-funcall " function"
159Execute the lisp function
160.IR function .
161.TP
162.BI \-l " file\fR,\fP " \-\-load " file"
163Load the lisp code in the file
164.IR file .
165.TP
166.BI \-\-eval " expr\fR,\fP " \-\-execute " expr"
167Evaluate the Lisp expression
168.IR expr .
169.RE
170.PP
171The following options are useful when running
172.I Emacs
173as a batch editor:
174.RS
175.TP 8
176.B \-\-batch
177Edit in batch mode.
178The editor will send messages to stderr.
179This option must be the first in the argument list.
180You must use \-l and \-f options to specify files to execute
181and functions to call.
182.TP
183.BI \-\-script " file"
184Run
185.I file
186as an Emacs Lisp script.
187.TP
188.BI \-\-insert " file"
189Insert contents of
190.I file
191into the current buffer.
192.TP
193.B \-\-kill
194Exit
195.I Emacs
196while in batch mode.
197.TP
198.BI \-L " dir\fR,\fP " \-\-directory " dir"
199Add
200.I dir
201to the list of directories
202.I Emacs
203searches for Lisp files.
204.RE
205.
206.\" START DELETING HERE IF YOU'RE NOT USING X
207.SS Using Emacs with X
208.I Emacs
209has been tailored to work well with the X window system.
210If you run
211.I Emacs
212from under X windows, it will create its own X window to
213display in.
214You will probably want to start the editor as a background
215process so that you can continue using your original window.
216.PP
217.I Emacs
218can be started with the following X switches:
219.RS
220.TP 8
221.BI \-\-name " name"
222Specify the name which should be assigned to the initial
223.I Emacs
224window.
225This controls looking up X resources as well as the window title.
226.TP
227.BI \-T " name\fR,\fP " \-\-title " name"
228Specify the title for the initial X window.
229.TP
230.BR \-r ", " \-rv ", " \-\-reverse\-video
231Display the
232.I Emacs
233window in reverse video.
234.TP
235.BI \-fn " font\fR,\fP " \-\-font " font"
236Set the
237.I Emacs
238window's font to that specified by
239.IR font .
240You will find the various
241.I X
242fonts in the
243.I /usr/lib/X11/fonts
244directory.
245Note that
246.I Emacs
247will only accept fixed width fonts.
248Under the X11 Release 4 font-naming conventions, any font with the
249value "m" or "c" in the eleventh field of the font name is a fixed
250width font.
251Furthermore, fonts whose name are of the form
252.IR width x height
253are generally fixed width, as is the font
254.IR fixed .
255See
256.BR xlsfonts (1)
257for more information.
258
259When you specify a font, be sure to put a space between the
260switch and the font name.
261.TP
262.BI \-\-xrm " resources"
263Set additional X resources.
264.TP
265.BI "\-\-color\fR,\fP \-\-color=" mode
266Override color mode for character terminals;
267.I mode
268defaults to `auto', and can also be `never', `auto', `always',
269or a mode name like `ansi8'.
270.TP
271.BI \-bw " pixels\fR,\fP " \-\-border\-width " pixels"
272Set the
273.I Emacs
274window's border width to the number of pixels specified by
275.IR pixels .
276Defaults to one pixel on each side of the window.
277.TP
278.BI \-ib " pixels\fR,\fP " \-\-internal\-border " pixels"
279Set the window's internal border width to the number of pixels specified
280by
281.IR pixels .
282Defaults to one pixel of padding on each side of the window.
283.TP
284.BI \-g " geometry\fR,\fP " \-\-geometry " geometry"
285Set the
286.I Emacs
287window's width, height, and position as specified.
288The geometry specification is in the standard X format; see
289.BR X (7)
290for more information.
291The width and height are specified in characters; the default is
29280 by 24.
293See the Emacs manual, section "Options for Window Size and Position",
294for information on how window sizes interact
295with selecting or deselecting the tool bar and menu bar.
296.TP
297.BI \-lsp " pixels\fR,\fP " \-\-line\-spacing " pixels"
298Additional space to put between lines.
299.TP
300.BR \-vb ", " \-\-vertical\-scroll\-bars
301Enable vertical scrollbars.
302.TP
303.BR \-fh ", " \-\-fullheight
304Make the first frame as high as the screen.
305.TP
306.BR \-fs ", " \-\-fullscreen
307Make the first frame fullscreen.
308.TP
309.BR \-fw ", " \-\-fullwidth
310Make the first frame as wide as the screen.
311.TP
312.BI \-fg " color\fR,\fP " \-\-foreground\-color " color"
313On color displays, set the color of the text.
314
315Use the command
316.I M\-x list\-colors\-display
317for a list of valid color names.
318.TP
319.BI \-bg " color\fR,\fP " \-\-background\-color " color"
320On color displays, set the color of the window's background.
321.TP
322.BI \-bd " color\fR,\fP " \-\-border\-color " color"
323On color displays, set the color of the window's border.
324.TP
325.BI \-cr " color\fR,\fP " \-\-cursor\-color " color"
326On color displays, set the color of the window's text cursor.
327.TP
328.BI \-ms " color\fR,\fP " \-\-mouse\-color " color"
329On color displays, set the color of the window's mouse cursor.
330.TP
331.BI \-d " displayname\fR,\fP " \-\-display " displayname"
332Create the
333.I Emacs
334window on the display specified by
335.IR displayname .
336Must be the first option specified in the command line.
337.TP
338.BR \-nbi ", " \-\-no\-bitmap\-icon
339Do not use picture of gnu for Emacs icon.
340.TP
341.B \-\-iconic
342Start
343.I Emacs
344in iconified state.
345.TP
346.BR \-nbc ", " \-\-no\-blinking\-cursor
347Disable blinking cursor.
348.TP
349.BR \-nw ", " \-\-no\-window\-system
350Tell
351.I Emacs
352not to use its special interface to X.
353If you use this switch when invoking
354.I Emacs
355from an
356.BR xterm (1)
357window, display is done in that window.
358.TP
359.BR \-D ", " \-\-basic\-display
360This option disables many display features; use it for
361debugging Emacs.
362.RE
363.PP
364You can set
365.I X
366default values for your
367.I Emacs
368windows in your
369.I \.Xresources
370file (see
371.BR xrdb (1)).
372Use the following format:
373.IP
374.RI emacs. keyword : value
375.PP
376where
377.I value
378specifies the default value of
379.IR keyword .
380.I Emacs
381lets you set default values for the following keywords:
382.RS
383.TP 8
384.BR background " (class " Background )
385For color displays,
386sets the window's background color.
387.TP
388.BR bitmapIcon " (class " BitmapIcon )
389If
390.BR bitmapIcon 's
391value is set to
392.IR on ,
393the window will iconify into the "kitchen sink."
394.TP
395.BR borderColor " (class " BorderColor )
396For color displays,
397sets the color of the window's border.
398.TP
399.BR borderWidth " (class " BorderWidth )
400Sets the window's border width in pixels.
401.TP
402.BR cursorColor " (class " Foreground )
403For color displays,
404sets the color of the window's text cursor.
405.TP
406.BR cursorBlink " (class " CursorBlink )
407Specifies whether to make the cursor blink.
408The default is
409.IR on .
410Use
411.I off
412or
413.I false
414to turn cursor blinking off.
415.TP
416.BR font " (class " Font )
417Sets the window's text font.
418.TP
419.BR foreground " (class " Foreground )
420For color displays,
421sets the window's text color.
422.TP
423.BR fullscreen " (class " Fullscreen )
424The desired fullscreen size.
425The value can be one of
426.IR fullboth ,
427.IR fullwidth ,
428or
429.IR fullheight ,
430which correspond to the command-line options `\-fs', `\-fw', and
431`\-fh', respectively.
432Note that this applies to the initial frame only.
433.TP
434.BR geometry " (class " Geometry )
435Sets the geometry of the
436.I Emacs
437window (as described above).
438.TP
439.BR iconName " (class " Title )
440Sets the icon name for the
441.I Emacs
442window icon.
443.TP
444.BR internalBorder " (class " BorderWidth )
445Sets the window's internal border width in pixels.
446.TP
447.BR lineSpacing " (class " LineSpacing )
448Additional space ("leading") between lines, in pixels.
449.TP
450.BR menuBar " (class " MenuBar )
451Gives frames menu bars if
452.IR on ;
453don't have menu bars if
454.IR off .
455See the Emacs manual, sections "Lucid Resources" and "LessTif
456Resources", for how to control the appearance of the menu bar
457if you have one.
458.TP
459.BR minibuffer " (class " Minibuffer )
460If
461.IR none ,
462don't make a minibuffer in this frame.
463It will use a separate minibuffer frame instead.
464.TP
465.BR paneFont " (class " Font )
466Font name for menu pane titles, in non-toolkit versions of
467.IR Emacs .
468.TP
469.BR pointerColor " (class " Foreground )
470For color displays,
471sets the color of the window's mouse cursor.
472.TP
473.BR privateColormap " (class " PrivateColormap )
474If
475.IR on ,
476use a private color map, in the case where the "default
477visual" of class
478.B PseudoColor
479and
480.B Emacs
481is using it.
482.TP
483.BR reverseVideo " (class " ReverseVideo )
484If
485.BR reverseVideo 's
486value is set to
487.IR on ,
488the window will be displayed in reverse video.
489.TP
490.BR screenGamma " (class "ScreenGamma )
491Gamma correction for colors, equivalent to the frame parameter
492`screen\-gamma'.
493.TP
494.BR scrollBarWidth " (class "ScrollBarWidth )
495The scroll bar width in pixels, equivalent to the frame parameter
496`scroll\-bar\-width'.
497.TP
498.BR selectionFont " (class " SelectionFont )
499Font name for pop-up menu items, in non-toolkit versions of
500.IR Emacs .
501(For toolkit versions, see the Emacs manual, sections
502"Lucid Resources" and "LessTif Resources".)
503.TP
504.BR selectionTimeout " (class " SelectionTimeout )
505Number of milliseconds to wait for a selection reply.
506A value of 0 means wait as long as necessary.
507.TP
508.BR synchronous " (class " Synchronous )
509Run Emacs in synchronous mode if
510.IR on .
511Synchronous mode is useful for debugging X problems.
512.TP
513.BR title " (class " Title )
514Sets the title of the
515.I Emacs
516window.
517.TP
518.BR toolBar " (class " ToolBar )
519Number of lines to reserve for the tool bar.
520.TP
521.BR useXIM " (class " UseXIM )
522Turns off use of X input methods (XIM) if
523.I false
524or
525.IR off .
526.TP
527.BR verticalScrollBars " (class " ScrollBars )
528Gives frames scroll bars if
529.IR on ;
530suppresses scroll bars if
531.IR off .
532.TP
533.BR visualClass " (class " VisualClass )
534Specify the "visual" that X should use.
535This tells X how to handle colors.
536The value should start with one of
537.IR TrueColor ,
538.IR PseudoColor ,
539.IR DirectColor ,
540.IR StaticColor ,
541.IR GrayScale ,
542and
543.IR StaticGray ,
544followed by
545.BI \- depth\fR,\fP
546where
547.I depth
548is the number of color planes.
549.RE
550.PP
551If you try to set color values while using a black and white display,
552the window's characteristics will default as follows:
553the foreground color will be set to black,
554the background color will be set to white,
555the border color will be set to grey,
556and the text and mouse cursors will be set to black.
557.
558.SS Using the Mouse
559.PP
560The following lists some of the mouse button bindings for the
561.I Emacs
562window under X11.
563.
564.RS
565.TS
566l l
567- -
568l l.
569MOUSE BUTTON FUNCTION
570left Set point.
571middle Paste text.
572right Cut text into X cut buffer.
573SHIFT-middle Cut text into X cut buffer.
574SHIFT-right Paste text.
575CTRL-middle Cut text into X cut buffer and kill it.
576CTRL-right T{
577Select this window, then split it into two windows.
578Same as typing CTRL\-x 2.
579T}
580.\" START DELETING HERE IF YOU'RE NOT USING X MENUS
581CTRL-SHIFT-left T{
582X buffer menu \(em hold the buttons and keys
583down, wait for menu to appear, select buffer, and release.
584Move mouse out of menu and release to cancel.
585T}
586CTRL-SHIFT-middle T{
587X help menu \(em pop up index card menu for Emacs help.
588T}
589.\" STOP DELETING HERE IF YOU'RE NOT USING X MENUS
590CTRL-SHIFT-right T{
591Select window with mouse, and delete all other windows.
592Same as typing CTRL\-x 1.
593T}
594.\" STOP DELETING HERE IF YOU'RE NOT USING X
595.TE
596.RE
597.
598.
599.SH MANUALS
600You can order printed copies of the GNU Emacs Manual from the Free
601Software Foundation, which develops GNU software.
602See the file ORDERS for ordering information.
603.br
604Your local Emacs maintainer might also have copies available.
605As with all software and publications from FSF, everyone is permitted
606to make and distribute copies of the Emacs manual.
607The TeX source to the manual is also included in the Emacs source
608distribution.
609.
610.
611.SH FILES
612/usr/local/share/info \(em files for the Info documentation browser.
613The complete text of the Emacs reference manual is included in a
614convenient tree structured form.
615Also includes the Emacs Lisp Reference Manual, useful to anyone
616wishing to write programs in the Emacs Lisp extension language.
617
618/usr/local/share/emacs/$VERSION/lisp \(em Lisp source files and
619compiled files that define most editing commands.
620Some are preloaded; others are autoloaded from this directory when
621used.
622
623/usr/local/libexec/emacs/$VERSION/$ARCH \(em various programs that are
624used with GNU Emacs.
625
626/usr/local/share/emacs/$VERSION/etc \(em various files of information.
627
628/usr/local/share/emacs/$VERSION/etc/DOC.* \(em contains the documentation
629strings for the Lisp primitives and preloaded Lisp functions
630of GNU Emacs.
631They are stored here to reduce the size of Emacs proper.
632
633/usr/local/share/emacs/$VERSION/etc/SERVICE lists people offering
634various services to assist users of GNU Emacs, including education,
635troubleshooting, porting and customization.
636.
637.
638.SH BUGS
639There is a mailing list, bug-gnu-emacs@gnu.org, for reporting Emacs
640bugs and fixes.
641But before reporting something as a bug, please try to be sure that
642it really is a bug, not a misunderstanding or a deliberate feature.
643We ask you to read the section ``Reporting Emacs Bugs'' near the
644end of the reference manual (or Info system) for hints on how and
645when to report bugs.
646Also, include the version number of the Emacs you are running in
647\fIevery\fR bug report that you send in.
bdd8da91
GM
648Bugs tend actually to be fixed if they can be isolated, so it is
649in your interest to report them in such a way that they can be
650easily reproduced.
cbe77461
GM
651
652Do not expect a personal answer to a bug report.
653The purpose of reporting bugs is to get them fixed for everyone
654in the next release, if possible.
655For personal assistance, look in the SERVICE file (see above) for
656a list of people who offer it.
657
658Please do not send anything but bug reports to this mailing list.
659For more information about Emacs mailing lists, see the
bdd8da91 660file /usr/local/share/emacs/$VERSION/etc/MAILINGLISTS.
cbe77461
GM
661.
662.
663.SH UNRESTRICTIONS
664.I Emacs
665is free; anyone may redistribute copies of
666.I Emacs
667to
668anyone under the terms stated in the
669.I Emacs
670General Public License,
671a copy of which accompanies each copy of
672.I Emacs
673and which also
674appears in the reference manual.
675.PP
676Copies of
677.I Emacs
678may sometimes be received packaged with distributions of Unix systems,
679but it is never included in the scope of any license covering those
680systems.
681Such inclusion violates the terms on which distribution is permitted.
682In fact, the primary purpose of the General Public License is to
683prohibit anyone from attaching any other restrictions to
684redistribution of
685.IR Emacs .
686.PP
687Richard Stallman encourages you to improve and extend
688.IR Emacs ,
689and urges that
690you contribute your extensions to the GNU library.
691Eventually GNU (Gnu's Not Unix) will be a complete replacement
692for Unix.
693Everyone will be free to use, copy, study and change the GNU system.
694.
695.
696.SH SEE ALSO
697.BR emacsclient (1),
698.BR etags (1),
699.BR X (7),
700.BR xlsfonts (1),
701.BR xterm (1),
702.BR xrdb (1)
703.
704.
705.SH AUTHORS
706.I Emacs
707was written by Richard Stallman and the Free Software Foundation.
708Joachim Martillo and Robert Krawitz added the X features.
709.
710.
711.SH COPYING
712Copyright
713.if t \(co
714.if n (C)
7151995, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
6ed161e1 716 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
cbe77461
GM
717.PP
718Permission is granted to make and distribute verbatim copies of this
719document provided the copyright notice and this permission notice are
720preserved on all copies.
721.PP
722Permission is granted to copy and distribute modified versions of
723this document under the conditions for verbatim copying, provided that
724the entire resulting derived work is distributed under the terms of
725a permission notice identical to this one.
726.PP
727Permission is granted to copy and distribute translations of this
728document into another language, under the above conditions for
729modified versions, except that this permission notice may be stated
730in a translation approved by the Free Software Foundation.
731.
732.\" arch-tag: 04dfd376-b46e-4924-919a-cecc3b257eaa