aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGlenn Morris2007-09-06 04:50:28 +0000
committerGlenn Morris2007-09-06 04:50:28 +0000
commit8cf51b2c2f18417403f27fdc215f369af887d89b (patch)
tree32b8f5cdf35f0c2e674c0f6a3d2e842396080b32 /doc
parent19e364e29522a20357a236d8501725db47f7feee (diff)
downloademacs-8cf51b2c2f18417403f27fdc215f369af887d89b.tar.gz
emacs-8cf51b2c2f18417403f27fdc215f369af887d89b.zip
Move here from ../../man
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/.gitignore23
-rw-r--r--doc/emacs/ChangeLog8267
-rw-r--r--doc/emacs/Makefile.in368
-rw-r--r--doc/emacs/abbrevs.texi457
-rw-r--r--doc/emacs/ack.texi1574
-rw-r--r--doc/emacs/anti.texi306
-rw-r--r--doc/emacs/arevert-xtra.texi191
-rw-r--r--doc/emacs/basic.texi776
-rw-r--r--doc/emacs/buffers.texi665
-rw-r--r--doc/emacs/building.texi1440
-rw-r--r--doc/emacs/cal-xtra.texi838
-rw-r--r--doc/emacs/calendar.texi1687
-rw-r--r--doc/emacs/cmdargs.texi1263
-rw-r--r--doc/emacs/commands.texi294
-rw-r--r--doc/emacs/custom.texi2515
-rw-r--r--doc/emacs/dired-xtra.texi49
-rw-r--r--doc/emacs/dired.texi1317
-rw-r--r--doc/emacs/display.texi1259
-rw-r--r--doc/emacs/doclicense.texi416
-rw-r--r--doc/emacs/emacs-xtra.texi126
-rw-r--r--doc/emacs/emacs.texi1365
-rw-r--r--doc/emacs/emerge-xtra.texi414
-rw-r--r--doc/emacs/entering.texi170
-rw-r--r--doc/emacs/files.texi2950
-rw-r--r--doc/emacs/fixit.texi471
-rw-r--r--doc/emacs/fortran-xtra.texi548
-rw-r--r--doc/emacs/frames.texi1113
-rw-r--r--doc/emacs/glossary.texi1323
-rw-r--r--doc/emacs/gnu.texi567
-rw-r--r--doc/emacs/gpl.texi721
-rw-r--r--doc/emacs/help.texi666
-rw-r--r--doc/emacs/indent.texi244
-rw-r--r--doc/emacs/killing.texi699
-rw-r--r--doc/emacs/kmacro.texi616
-rw-r--r--doc/emacs/m-x.texi75
-rw-r--r--doc/emacs/macos.texi429
-rw-r--r--doc/emacs/maintaining.texi862
-rw-r--r--doc/emacs/major.texi206
-rw-r--r--doc/emacs/makefile.w32-in144
-rw-r--r--doc/emacs/mark.texi452
-rw-r--r--doc/emacs/mini.texi580
-rw-r--r--doc/emacs/misc.texi2559
-rw-r--r--doc/emacs/msdog-xtra.texi687
-rw-r--r--doc/emacs/msdog.texi766
-rw-r--r--doc/emacs/mule.texi1535
-rw-r--r--doc/emacs/picture-xtra.texi291
-rw-r--r--doc/emacs/programs.texi1773
-rw-r--r--doc/emacs/regs.texi330
-rw-r--r--doc/emacs/rmail.texi1430
-rw-r--r--doc/emacs/screen.texi359
-rw-r--r--doc/emacs/search.texi1361
-rw-r--r--doc/emacs/sending.texi724
-rw-r--r--doc/emacs/text.texi2901
-rw-r--r--doc/emacs/trouble.texi1066
-rw-r--r--doc/emacs/vc-xtra.texi32
-rw-r--r--doc/emacs/vc1-xtra.texi151
-rw-r--r--doc/emacs/vc2-xtra.texi789
-rw-r--r--doc/emacs/windows.texi387
-rw-r--r--doc/emacs/xresources.texi1216
59 files changed, 56803 insertions, 0 deletions
diff --git a/doc/emacs/.gitignore b/doc/emacs/.gitignore
new file mode 100644
index 00000000000..3ff56b474dd
--- /dev/null
+++ b/doc/emacs/.gitignore
@@ -0,0 +1,23 @@
1*.aux
2*.cp
3*.cps
4*.dvi
5*.fn
6*.fns
7*.ky
8*.kys
9*.log
10*.op
11*.ops
12*.pdf
13*.pg
14*.pgs
15*.ps
16*.tmp
17*.toc
18*.tp
19*.tps
20*.vr
21*.vrs
22Makefile
23makefile
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
new file mode 100644
index 00000000000..51803a75727
--- /dev/null
+++ b/doc/emacs/ChangeLog
@@ -0,0 +1,8267 @@
12007-09-06 Glenn Morris <rgm@gnu.org>
2
3 * Move manual sources from man/ to subdirectories of doc/.
4 Split into the Emacs manual in emacs/, and other manuals in misc/.
5 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Reduce to just the Emacs
6 manual.
7 (infodir): New variable.
8 (info): Use $infodir.
9 (emacsman): Delete target, not needed any more.
10 Move all targets that are not the Emacs manual to misc/Makefile.in.
11 (mostlyclean): Remove `gnustmp'.
12 * makefile.w32-in (INFO_TARGETS, DVI_TARGETS): Reduce to just the Emacs
13 manual.
14 (MULTI_INSTALL_INFO, ENVADD): Go up one more level.
15 (emacsman): Delete target, not needed any more.
16 (clean): Remove all info files but Emacs manual.
17 Move all targets that are not the Emacs manual to misc/Makefile.in.
18 * emacs-xtra.texi, emacs.texi (setfilename): Go up one more level.
19
20 * Makefile.in (INFOSOURCES): Delete.
21 (.SUFFIXES): Use $(TEXI2DVI) rather than texi2dvi.
22 (mostlyclean): Add *.op, *.ops. Move *.aux *.cps *.fns *.kys *.pgs
23 *.vrs *.toc here...
24 (maintainer-clean): ...from here.
25
262007-09-05 Glenn Morris <rgm@gnu.org>
27
28 * custom.texi (Safe File Variables): Clarify `!' and risky variables.
29
302007-09-01 Jay Belanger <jay.p.belanger@gmail.com>
31
32 * calc.texi (Date Conversions): Clarify definition of
33 Julian day numbering.
34 (Date Forms): Clarify definition of Julian day numbering;
35 add some history.
36
372007-08-30 Carsten Dominik <dominik@science.uva.nl>
38
39 * org.texi: Version 5.07
40
412007-08-29 Glenn Morris <rgm@gnu.org>
42
43 * emacs.texi (EMACSVER): Increase to 23.0.50.
44
452007-08-24 IRIE Tetsuya <irie@t.email.ne.jp> (tiny change)
46
47 * message.texi (MIME): Replace mml-attach with mml-attach-file.
48
492007-08-22 Carsten Dominik <dominik@science.uva.nl>
50
51 * org.texi (Adding hyperlink types): New section.
52 (Embedded LaTeX): Chapter updated because of LaTeX export.
53 (LaTeX export): New section.
54 (Using links out): New section.
55
562007-08-22 Glenn Morris <rgm@gnu.org>
57
58 * faq.texi (Learning how to do something): Refcards now in
59 etc/refcards/ directory.
60
612007-08-22 Michael Albinus <michael.albinus@gmx.de>
62
63 * tramp.texi (Remote Programs): Persistency file must be cleared when
64 changing `tramp-remote-path'.
65 (Filename Syntax): Don't use @var{} constructs inside the @trampfn
66 macro.
67
682007-08-17 Eli Zaretskii <eliz@gnu.org>
69
70 * basic.texi (Position Info): Add index entry for face at point.
71 Mention that character faces are also displayed by "C-u C-x =".
72
732007-08-17 Jay Belanger <jay.p.belanger@gmail.com>
74
75 * calc.texi: Move contents to beginning of file.
76 (Algebraic Entry): Fix the formatting of an example.
77
782007-08-15 Jay Belanger <jay.p.belanger@gmail.com>
79
80 * calc.texi (Basic Operations on Units): Mention exact versus
81 inexact conversions.
82
832007-08-14 Jay Belanger <jay.p.belanger@gmail.com>
84
85 * calc.texi (Basic Operations on Units): Mention default
86 values for new units.
87 (Quick Calculator Mode): Mention that binary format will
88 be displayed.
89
902007-08-14 Katsumi Yamaoka <yamaoka@jpl.org>
91
92 * gnus.texi (Selecting a Group): Mention gnus-maximum-newsgroup.
93
942007-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
95
96 * gnus.texi (NNTP): Mention nntp-xref-number-is-evil.
97
982007-08-08 Glenn Morris <rgm@gnu.org>
99
100 * glossary.texi (Glossary): Deprecate `iff'.
101 * gnus.texi, sieve.texi: Replace `iff'.
102
1032007-08-07 Chong Yidong <cyd@stupidchicken.com>
104
105 * files.texi (File Conveniences): Document point motion keys in Image
106 mode.
107
1082007-08-03 Jay Belanger <jay.p.belanger@gmail.com>
109
110 * calc.texi (Basic Graphics): Mention the graphing of error
111 forms.
112 (Graphics Options): Mention how `g s' handles error forms.
113 (Curve Fitting): Mention plotting the curves.
114 (Standard Nonlinear Models): Add additional models.
115 (Curve Fitting Details): Mention the Levenberg-Marquardt method.
116 (Linear Fits): Correct result.
117
1182007-08-01 Alan Mackenzie <acm@muc.de>
119
120 * cc-mode.texi (Mailing Lists and Bug Reports): Correct "-no-site-file"
121 to "--no-site-file".
122
1232007-07-29 Michael Albinus <michael.albinus@gmx.de>
124
125 * tramp.texi (Frequently Asked Questions): Point to mode line
126 extension in Emacs 23.1.
127
128 * trampver.texi: Update release number.
129
1302007-07-27 Glenn Morris <rgm@gnu.org>
131
132 * calc.texi (Copying)
133 * emacs.texi (Copying): Include license text from gpl.texi, rather than
134 in-line.
135
136 * gpl.texi: New file with text of GPL.
137 * Makefile.in (EMACSSOURCES): Add gpl.texi.
138
1392007-07-26 Dan Nicolaescu <dann@ics.uci.edu>
140
141 * vc2-xtra.texi (Customizing VC): Add GIT and HG.
142
143 * dired.texi (Wdired): Mention C-x C-q key binding.
144
1452007-07-28 Nick Roberts <nickrob@snap.net.nz>
146
147 * building.texi (GDB Graphical Interface): Qualify use of "M-x gdba".
148
1492007-07-25 Glenn Morris <rgm@gnu.org>
150
151 * calc.texi (Copying)
152 * emacs.texi (Copying): Replace license with GPLv3.
153
154 * Relicense all FSF files to GPLv3 or later.
155
1562007-07-24 Glenn Morris <rgm@gnu.org>
157
158 * calendar.texi (Writing Calendar Files): cal-tex-diary etc only work
159 for some calendars.
160
1612007-07-23 Nick Roberts <nickrob@snap.net.nz>
162
163 * screen.texi (Mode Line): Describe new mode-line flag that shows if
164 default-directory for the current buffer is on a remote machine.
165
1662007-07-22 Michael Albinus <michael.albinus@gmx.de>
167
168 Sync with Tramp 2.1.10.
169
170 * tramp.texi (trampfn): Expand macro implementation in order to handle
171 empty arguments.
172 (trampfnmhl, trampfnuhl, trampfnhl): Remove macros. Replace all
173 occurencies by trampfn.
174 (Frequently Asked Questions): Extend example code for host
175 identification in the modeline. Add bbdb to approaches shortening Tramp
176 file names to be typed.
177
178 * trampver.texi: Update release number.
179
1802007-07-21 Eli Zaretskii <eliz@gnu.org>
181
182 * vc2-xtra.texi (Customizing VC) <vc-handled-backends>: Update the
183 default value.
184
1852007-07-21 Richard Stallman <rms@gnu.org>
186
187 * files.texi (Why Version Control?): Improve previous change.
188
1892007-07-18 Eric S. Raymond <esr@snark.thyrsus.com>
190
191 * files.texi (Why Version Control?): New node.
192
1932007-07-17 Michael Albinus <michael.albinus@gmx.de>
194
195 * tramp.texi: Move @setfilename ../info/tramp up, outside the header
196 section. Reported by <poti@potis.org>.
197 (Remote processes): Arguments of the program to be debugged are taken
198 literally.
199 (Frequently Asked Questions): Simplify recentf example.
200
2012007-07-14 Karl Berry <karl@gnu.org>
202
203 * info.texi (@copying): New Back-Cover Text.
204
205 * info.texi (Quitting Info): Move to proper place in source.
206 (Reported by Benno Schulenberg.)
207
2082007-07-13 Eli Zaretskii <eliz@gnu.org>
209
210 * Makefile.in (../info/emacs-mime): Use --enable-encoding.
211
212 * makefile.w32-in ($(infodir)/emacs-mime): Ditto.
213
214 * emacs-mime.texi: Add @documentencoding directive.
215
2162007-07-12 Nick Roberts <nickrob@snap.net.nz>
217
218 * tramp.texi (Remote processes): Add an anchor to the subsection
219 "Running a debugger on a remote host".
220
221 * building.texi (Starting GUD): Add xref to this anchor.
222
2232007-07-12 Michael Albinus <michael.albinus@gmx.de>
224
225 * tramp.texi (Remote processes): Don't call it "experimental" any
226 longer. Add subsection about running a debugger on a remote host.
227
2282007-07-10 Carsten Dominik <dominik@science.uva.nl>
229
230 * org.texi (Properties and columns): Chapter rewritten.
231
2322007-07-08 Michael Albinus <michael.albinus@gmx.de>
233
234 * tramp.texi:
235 * trampver.texi: Migrate to Tramp 2.1.
236
2372007-07-02 Carsten Dominik <dominik@science.uva.nl>
238
239 * org.texi (Properties): New chapter.
240
2412007-07-02 Reiner Steib <Reiner.Steib@gmx.de>
242
243 * gnus-faq.texi ([3.2]): Fix locating of environment variables in the
244 Control Panel.
245
246 * gnus.texi (Misc Article): Add index entry for
247 gnus-single-article-buffer.
248
2492007-06-27 Andreas Seltenreich <andreas@gate450.dyndns.org>
250
251 * gnus.texi (Starting Up): Fix typo.
252
2532007-06-25 Katsumi Yamaoka <yamaoka@jpl.org>
254
255 * gnus.texi (Asynchronous Fetching): Fix typo.
256
2572007-06-24 Karl Berry <karl@gnu.org>
258
259 * emacs.texi: new Back-Cover Text.
260
2612007-06-20 Jay Belanger <jay.p.belanger@gmail.com>
262
263 * calc.texi:Change ifinfo to ifnottex (as appropriate) throughout.
264 (About This Manual): Remove redundant information.
265 (Getting Started): Mention author.
266 (Basic Arithmetic, Customizing Calc): Make description of the
267 variable `calc-multiplication-has-precedence' match its new effect.
268
2692007-06-19 Jay Belanger <jay.p.belanger@gmail.com>
270
271 * calc.texi (Basic Arithmetic, Customizing Calc): Mention
272 the variable `calc-multiplication-has-precedence'.
273
2742007-06-19 Carsten Dominik <dominik@science.uva.nl>
275
276 * org.texi (Tag): Section swapped with node Timestamps.
277 (Formula syntax for Lisp): Document new `L' flag.
278
2792007-06-06 Andreas Seltenreich <andreas@gate450.dyndns.org>
280
281 * gnus.texi (Misc Group Stuff, Summary Buffer)
282 (Server Commands, Article Keymap): Fix typo. s/function/command/.
283
2842007-06-07 Alan Mackenzie <acm@muc.de>
285
286 * display.texi (Optional Mode Line): Document the new form of
287 line+column numbers, "(561,2)".
288
2892007-06-06 Juanma Barranquero <lekktu@gmail.com>
290
291 * cc-mode.texi (Comment Commands, Getting Started, Style Variables):
292 * gnus.texi (Article Buttons, Mail Source Customization)
293 (Sending or Not Sending, Customizing NNDiary):
294 * maintaining.texi (Create Tags Table):
295 * message.texi (Message Headers):
296 * mh-e.texi (HTML): Fix typos.
297
2982007-06-07 Michael Albinus <michael.albinus@gmx.de>
299
300 Sync with Tramp 2.0.56.
301
302 * tramp.texi (Frequently Asked Questions): Improve ~/.zshrc
303 settings. Reported by Ted Zlatanov <tzz@lifelogs.com>.
304
3052007-06-02 Chong Yidong <cyd@stupidchicken.com>
306
307 * Version 22.1 released.
308
3092007-05-26 Michael Olson <mwolson@gnu.org>
310
311 * erc.texi (Modules): Fix references to completion modules.
312
3132007-05-09 Reiner Steib <Reiner.Steib@gmx.de>
314
315 * gnus.texi (Running NNDiary): Use ~/.gnus.el instead of gnusrc.
316
3172007-05-09 Didier Verna <didier@xemacs.org>
318
319 * gnus.texi (Email Based Diary): New. Proper documentation for the
320 nndiary back end and the gnus-diary library.
321
3222007-05-07 Karl Berry <karl@gnu.org>
323
324 * emacs.texi (EMACSVER): Back to 22.
325
3262007-05-06 Richard Stallman <rms@gnu.org>
327
328 * maintaining.texi (Create Tags Table): Clean up previous change.
329
3302007-05-05 Francesco Potort,Al(B <pot@gnu.org>
331
332 * maintaining.texi (Create Tags Table): Add text about the dangers of
333 making symbolic links to tags files.
334
3352007-05-04 Karl Berry <karl@gnu.org>
336
337 * emacs.texi (EMACSVER) [smallbook]: 22.1 for printed version, not 22.
338
3392007-05-03 Karl Berry <karl@gnu.org>
340
341 * emacs.texi (EMACSVER) [smallbook]: 22 for printed version.
342
343 * .cvsignore (*.pdf): New entry.
344
345 * texinfo.tex: Update from current version for better pdf generation.
346
347 * emacs.texi (\urlcolor, \linkcolor) [smallbook]: \let to \Black
348 for printing.
349
3502007-05-01 Richard Stallman <rms@gnu.org>
351
352 * cmdargs.texi (Initial Options): Under --batch, mention --eval.
353
3542007-04-30 Reiner Steib <Reiner.Steib@gmx.de>
355
356 * gnus.texi (Article Highlighting): Clarify gnus-cite-parse-max-size.
357
3582007-04-28 Glenn Morris <rgm@gnu.org>
359
360 * ack.texi (Acknowledgments):
361 * anti.texi (Antinews):
362 * faq.texi (New in Emacs 22):
363 * programs.texi (Program Modes): Restore mention of python.el pending
364 consideration of legal status.
365
3662007-04-28 Richard Stallman <rms@gnu.org>
367
368 * files.texi (File Names): Fixes to ~ description on MS systems.
369
3702007-04-27 J.D. Smith <jdsmith@as.arizona.edu>
371
372 * idlwave.texi: Minor updates for IDLWAVE 6.1.
373
3742007-04-26 Glenn Morris <rgm@gnu.org>
375
376 * emacs.texi (EMACSVER): Increase to 22.1.50.
377
3782007-04-25 Karl Berry <karl@gnu.org>
379
380 * emacs.texi: Improve line breaks on copyright page,
381 similar layout to lispref, 8.5x11 by default.
382
383 * dired.texi (Image-Dired): Improve line break, fix typo.
384
3852007-04-24 Chong Yidong <cyd@stupidchicken.com>
386
387 * programs.texi (Program Modes):
388 * faq.texi (New in Emacs 22):
389 * anti.texi (Antinews):
390 * ack.texi (Acknowledgments): python.el removed.
391
3922007-04-23 Jay Belanger <jay.p.belanger@gmail.com>
393
394 * calc.texi (Reporting bugs): Update maintainer's address.
395
3962007-04-23 Chong Yidong <cyd@stupidchicken.com>
397
398 * display.texi (Highlight Interactively): Correct description of
399 hi-lock-file-patterns-policy.
400
401 * files.texi (File Archives): Mention self-extracting executables.
402
4032007-04-23 Eli Zaretskii <eliz@gnu.org>
404
405 * search.texi (Unconditional Replace, Query Replace): Add xref to
406 "Replacement and Case".
407
4082007-04-22 Chong Yidong <cyd@stupidchicken.com>
409
410 * dired.texi (Image-Dired): Move from Thumbnails node.
411 * misc.texi (Thumbnails): Node deleted.
412 * emacs.texi (Top): Update node listing.
413
414 * files.texi (File Conveniences):
415 * ack.texi (Acknowledgments):
416 * faq.texi (New in Emacs 22): Rename "tumme" to "image-dired".
417
4182007-04-21 Richard Stallman <rms@gnu.org>
419
420 * display.texi (Highlight Interactively): Correct previous change.
421 Clarify doc of hi-lock-find-patterns, and move new features into it.
422
4232007-04-20 David Koppelman <koppel@ece.lsu.edu>
424
425 * display.texi (Highlight Interactively): Document
426 hi-lock-file-patterns-policy.
427
4282007-04-20 Martin Rudalics <rudalics@gmx.at>
429
430 * display.texi (Scrolling): Fix typo.
431
4322007-04-15 Jay Belanger <belanger@truman.edu>
433
434 * calc.texi (Title page): Remove the date.
435 (Basic Arithmetic): Emphasize that / binds less strongly than *.
436 (The Standard Calc Interface): Change trail title.
437 (Floats): Mention that when non-decimal floats are entered, only
438 approximations are stored.
439 (Copying): Move to the appendices.
440 (GNU Free Documentation License): Add as an appendix.
441
4422007-04-15 Chong Yidong <cyd@stupidchicken.com>
443
444 * ada-mode.texi, autotype.texi, cc-mode.texi, cl.texi:
445 * dired-x.texi, ebrowse.texi, ediff.texi:
446 * emacs-mime.texi, erc.texi, eshell.texi:
447 * eudc.texi, flymake.texi, forms.texi, gnus.texi:
448 * idlwave.texi, message.texi, newsticker.texi, org.texi:
449 * pcl-cvs.texi, pgg.texi, rcirc.texi, reftex.texi, sc.texi:
450 * ses.texi, sieve.texi, smtpmail.texi, speedbar.texi:
451 * tramp.texi, url.texi, vip.texi, viper.texi, widget.texi:
452 * woman.texi: Include GFDL.
453
454 * doclicense.texi: Remove node heading, so that it can be included by
455 other files.
456
457 * emacs.texi: Insert node heading for GFDL.
458
459 * dired-x.texi: Relicence under GFDL. Remove date from title page.
460
461 * calc.texi (Algebraic Tutorial): Emphasize that / binds less strongly
462 than *.
463
4642007-04-14 Carsten Dominik <dominik@science.uva.nl>
465
466 * org.texi (Formula syntax for Calc): Emphasize the operator precedence
467 in Calc.
468
4692007-04-14 Eli Zaretskii <eliz@gnu.org>
470
471 * cmdargs.texi (Colors): Qualify "color of window" index entry by
472 "command line".
473
474 * display.texi (Faces): Refer to "Creating Frames" for face
475 and other frame customizations in .emacs.
476
477 * frames.texi (Creating Frames): Mention that face customizations can
478 be put in .emacs. Add index entries.
479
4802007-04-12 Richard Stallman <rms@gnu.org>
481
482 * glossary.texi (Glossary): Explain `iff'.
483
4842007-04-11 Karl Berry <karl@gnu.org>
485
486 * gnu.texi (Top),
487 * macos.texi (Mac Font Specs),
488 * anti.texi (Antinews),
489 * xresources.texi (Resources),
490 * misc.texi (Emulation),
491 * calendar.texi (Daylight Saving),
492 * dired.texi (Dired and Find),
493 * rmail.texi (Remote Mailboxes),
494 * sending.texi (Mail Headers),
495 * programs.texi (Which Function),
496 * files.texi (Recover),
497 * buffers.texi (Uniquify),
498 * frames.texi (Wheeled Mice),
499 * killing.texi (Rectangles): Wording to improve breaks in
500 8.5x11 format.
501 * mule.texi (Language Environments): \hbadness=10000 since there's
502 no way to reword.
503 * emacs.texi (smallbook): New @set to more easily switch between
504 smallbook and 8.5x11.
505
5062007-04-11 Richard Stallman <rms@gnu.org>
507
508 * files.texi (File Conveniences): Add xref to Tumme.
509 Delete text about Thumbnail mode.
510
5112007-04-09 Romain Francoise <romain@orebokech.com>
512
513 * faq.texi (New in Emacs 22): Mention improvements to the Windows and
514 Mac OS ports. Make it clear that mouse-1 complements and doesn't
515 replace mouse-2.
516
5172007-04-09 Alan Mackenzie <acm@muc.de>
518
519 * cmdargs.texi (Initial Options): Call "inhibit-splash-screen" by its
520 new name. Insert concept index entries.
521
5222007-04-08 Richard Stallman <rms@gnu.org>
523
524 * url.texi: Fix some indexing.
525 (Disk Caching): Drop discussion of old/other Emacs versions.
526
5272007-04-08 Chong Yidong <cyd@stupidchicken.com>
528
529 * display.texi (Standard Faces): Document prefix arg for
530 list-faces-display.
531
532 * rmail.texi (Rmail Scrolling): Document rmail-end-of-message.
533
534 * woman.texi (Word at point, Interface Options): woman-topic-at-point
535 renamed to woman-use-topic-at-point. Document new behavior.
536
5372007-04-07 Chong Yidong <cyd@stupidchicken.com>
538
539 * url.texi (Disk Caching): Say Emacs 21 "and later".
540
541 * cc-mode.texi (Font Locking Preliminaries): Link to Emacs manual node
542 on Font locking which now mentions JIT lock.
543
544 * killing.texi (Deletion): Rewrite description of M-\ prefix argument.
545
546 * files.texi (Misc File Ops): Rewrite description of
547 insert-file-literally.
548
5492007-04-01 Michael Olson <mwolson@gnu.org>
550
551 * erc.texi: Update for the ERC 5.2 release.
552
5532007-03-31 David Kastrup <dak@gnu.org>
554
555 * woman.texi (Topic, Interface Options): Explain changes semantics of
556 woman-manpath in order to consider MANPATH_MAP entries.
557
5582007-03-31 Eli Zaretskii <eliz@gnu.org>
559
560 * misc.texi (Printing): Postscript -> PostScript.
561
562 * emacs-mime.texi (Non-MIME): Postscript -> PostScript.
563
564 * ack.texi (Acknowledgments): Postscript -> PostScript.
565
566 * custom.texi (Init File, Init Non-ASCII): Fix last change.
567
568 * emacs.texi (Top): Fix the menu due to the change in custom.texi
569 below.
570
5712007-03-30 Chong Yidong <cyd@stupidchicken.com>
572
573 * custom.texi (Non-ASCII Rebinding): Node deleted. Material moved to
574 Init Non-ASCII.
575 (Init Rebinding, Init Syntax): Link to Init Non-ASCII instead.
576 (Init Non-ASCII): New node.
577
5782007-03-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
579
580 * macos.texi (Mac Font Specs): Mention AppleAntiAliasingThreshold.
581
5822007-03-26 Richard Stallman <rms@gnu.org>
583
584 * pgg.texi (Caching passphrase): Clean up previous change.
585
5862007-03-25 Thien-Thi Nguyen <ttn@gnu.org>
587
588 * gnus.texi (Setting Process Marks): Fix typo.
589
5902007-03-25 Romain Francoise <romain@orebokech.com>
591
592 * faq.texi (New in Emacs 22): Reorganize using an itemized list for
593 readability, and include various fixes by Daniel Brockman, Nick Roberts
594 and Dieter Wilhelm.
595
5962007-03-24 Thien-Thi Nguyen <ttn@gnu.org>
597
598 * gnus.texi (Splitting Mail): Reword "splitting"-as-adj to be -as-noun.
599
600 * gnus.texi (Mail Source Specifiers): Fix typo.
601
6022007-03-22 Ralf Angeli <angeli@caeruleus.net>
603
604 * reftex.texi (Imprint): Update maintainer information.
605
6062007-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
607
608 * message.texi (Message Buffers): Update documentation for
609 message-generate-new-buffers.
610
6112007-03-15 Daiki Ueno <ueno@unixuser.org>
612
613 * pgg.texi (Caching passphrase): Describe pgg-passphrase-coding-system.
614
6152007-03-21 Glenn Morris <rgm@gnu.org>
616
617 * eshell.texi (Known problems): Emacs 22 comes with eshell 2.4.2.
618
6192007-03-19 Chong Yidong <cyd@stupidchicken.com>
620
621 * eshell.texi (Known problems): Emacs 21 -> 22.
622
623 * cc-mode.texi (Performance Issues): Update note about 21.3 to 22.1.
624
6252007-03-18 Jay Belanger <belanger@truman.edu>
626
627 * calc.texi (Time Zones): Mention that the DST rules changed in 2007.
628
6292007-03-12 Glenn Morris <rgm@gnu.org>
630
631 * calc.texi (Time Zones): Switch to new North America DST rule.
632
633 * calendar.texi, emacs.texi (Daylight Saving): Rename node from
634 "Daylight Savings".
635
636 * calc.texi, calendar.texi: Replace "daylight savings" with "daylight
637 saving" in text throughout.
638
6392007-03-11 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
640
641 * gnus.texi (Mail and Post): Update documentation for gnus-user-agent.
642 The variable now uses a list of symbols instead of just a symbol.
643 Reported by Christoph Conrad <christoph.conrad@gmx.de>.
644
6452007-03-06 Romain Francoise <romain@orebokech.com>
646
647 * faq.texi (New in Emacs 22): Don't say "now" too much. Add MH-E to
648 new packages, and mention Gnus update.
649
6502007-03-04 Richard Stallman <rms@gnu.org>
651
652 * custom.texi (Safe File Variables): Minor correction.
653
6542007-02-27 Katsumi Yamaoka <yamaoka@jpl.org>
655
656 * gnus.texi (NNTP): Mention nntp-never-echoes-commands and
657 nntp-open-connection-functions-never-echo-commands.
658
6592007-02-28 Thien-Thi Nguyen <ttn@gnu.org>
660
661 * rmail.texi (Movemail): Add internal ref.
662 Don't indent the intro for the PROTO table.
663 Format PROTO table items with @code.
664
6652007-02-27 Chong Yidong <cyd@stupidchicken.com>
666
667 * pgg.texi (Caching passphrase): Document gpg-agent usage, gpg-agent
668 problems on the console, and security risk in not using gpg-agent.
669
6702007-02-26 Nick Roberts <nickrob@snap.net.nz>
671
672 * building.texi: Remove references to bashdb.
673
6742007-02-25 Carsten Dominik <dominik@science.uva.nl>
675
676 * org.texi (The spreadsheet): Renamed from "Table calculations".
677 Completely reorganized and rewritten.
678 (CamelCase links): Section removed.
679 (Repeating items): New section.
680 (Tracking TODO state changes): New section.
681 (Agenda views): Chapter reorganized and rewritten.
682 (HTML export): Section rewritten.
683 (Tables in arbitrary syntax): New section.
684 (Summary): Better feature summary.
685 (Activation): Document problem with cut-and-paste of Lisp code
686 from PDF files.
687 (Visibility cycling): Document indirect buffer use.
688 (Structure editing): Document sorting.
689 (Remember): Section rewritten.
690 (Time stamps): Better description of time stamp types.
691 (Tag searches): Document regular expression search for tags.
692 (Stuck projects): New section.
693 (In-buffer settings): New keywords.
694 (History and Acknowledgments): Updated description.
695
6962007-02-24 Alan Mackenzie <acm@muc.de>
697
698 * cc-mode.texi (Movement Commands): Insert two missing command names.
699 (Getting Started): Slight wording correction (use conditional).
700
7012007-02-22 Kim F. Storm <storm@cua.dk>
702
703 * widget.texi (User Interface, Basic Types): Document need to put some
704 text before the %v escape in :format string in editable-field widget.
705
7062007-02-19 Juanma Barranquero <lekktu@gmail.com>
707
708 * mule.texi (Language Environments): Update list of supported language
709 environments.
710
7112007-02-18 Romain Francoise <romain@orebokech.com>
712
713 * pcl-cvs.texi (Miscellaneous commands): q runs `cvs-bury-buffer', not
714 `cvs-mode-quit'.
715
7162007-02-14 Kim F. Storm <storm@cua.dk>
717
718 * building.texi (Grep Searching): Fix lgrep doc.
719
7202007-02-12 Chong Yidong <cyd@stupidchicken.com>
721
722 * back.texi: Remove unused file.
723
7242007-02-10 Markus Triska <markus.triska@gmx.at>
725
726 * widget.texi (Programming Example): Put constant strings in :format.
727
7282007-02-07 Juanma Barranquero <lekktu@gmail.com>
729
730 * faq.texi (Fullscreen mode on MS-Windows): New node.
731
7322007-02-05 Francesco Potort,Al(B <pot@gnu.org>
733
734 * maintaining.texi (Tag Syntax): Now --members is the default for
735 etags, not for ctags yet.
736
7372007-02-04 David Kastrup <dak@gnu.org>
738
739 * faq.texi (AUCTeX): Update version number. Should probably be done
740 for other packages as well.
741
7422007-02-03 Eli Zaretskii <eliz@gnu.org>
743
744 * emacs.texi (Top): Update the top-level menus. Make the detailed menu
745 headers compliant with Texinfo guidelines and with what texnfo-upd.el
746 expects. Add comments to prevent people from inadvertently modifying
747 the key parts needed by `texinfo-multiple-files-update'.
748
7492007-01-29 Chong Yidong <cyd@stupidchicken.com>
750
751 * frames.texi (Secondary Selection): Window clicked does not matter
752 when mouse-yank-at-point is non-nil.
753
7542007-01-28 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
755
756 * gnus.texi (Batching Agents): Fix example. Reported by Tassilo Horn
757 <tassilo@member.fsf.org>.
758
7592007-01-27 Eli Zaretskii <eliz@gnu.org>
760
761 * msdog.texi (ls in Lisp): Document ls-lisp-format-time-list and
762 ls-lisp-use-localized-time-format.
763
7642007-01-20 Markus Triska <markus.triska@gmx.at>
765
766 * flymake.texi (Flymake mode): find-file-hook instead of ...-hooks.
767
7682007-01-13 Michael Olson <mwolson@gnu.org>
769
770 * erc.texi (Modules): Mention capab-identify module.
771
7722007-01-16 Glenn Morris <rgm@gnu.org>
773
774 * abbrevs.texi (Editing Abbrevs): Describe how to disable a
775 system abbrev.
776
7772007-01-11 Richard Stallman <rms@gnu.org>
778
779 * msdog.texi (Windows Keyboard): Another small cleanup.
780
7812007-01-10 Richard Stallman <rms@gnu.org>
782
783 * msdog.texi (Windows Keyboard): Yet another try to make
784 everyone happy with that passage.
785
7862007-01-05 Richard Stallman <rms@gnu.org>
787
788 * anti.texi (Antinews): Mention M-x shell scrolling.
789
7902007-01-05 Nick Roberts <nickrob@snap.net.nz>
791
792 * building.texi (Watch Expressions): Describe gdb-max-children.
793
7942007-01-05 Michael Olson <mwolson@gnu.org>
795
796 * erc.texi (Getting Started): Update for /RECONNECT command.
797
7982007-01-04 Richard Stallman <rms@gnu.org>
799
800 * ebrowse.texi: Change C-c b to C-c C-m.
801
802 * msdog.texi (Windows Keyboard): Clarify previous change.
803
8042007-01-03 Reiner Steib <Reiner.Steib@gmx.de>
805
806 * gnus.texi (Customizing Articles): Use index entries for gnus-treat-*
807 variables only in info to avoid redundant entries in the printed
808 manual.
809
8102007-01-02 Richard Stallman <rms@gnu.org>
811
812 * custom.texi (Changing a Variable): Minor clarification.
813 (Specific Customization): customize-customized => customize-unsaved.
814
815 * entering.texi (Entering Emacs): Clean up text about restarting
816 Emacs for each file.
817
818 * misc.texi (Shell Options): Minor cleanup.
819
820 * msdog.texi (Windows Keyboard): Explain that Windows was incompatible
821 with Emacs, not vice versa.
822
823 * programs.texi (Symbol Completion): Recommend customizing
824 window manager.
825
826 * xresources.texi (Resources): Minor fix.
827
8282007-01-02 Daiki Ueno <ueno@unixuser.org>
829
830 * message.texi (Using PGP/MIME): Document gpg-agent usage.
831
8322007-01-02 Reiner Steib <Reiner.Steib@gmx.de>
833
834 * message.texi (Security): Split into sub-nodes.
835
8362007-01-01 Alan Mackenzie <acm@muc.de>
837
838 * cc-mode.texi ("Limitations and Known Bugs"): Document problems with
839 eval-after-load in Emacs <=21 and a workaround. Document that
840 trigraphs are not supported.
841
8422007-01-01 Alan Mackenzie <acm@muc.de>
843
844 * cc-mode.texi ("Filling and Breaking"): Amend the doc for
845 c-context-line-break. When invoked within a string, preserve
846 whitespace. Add a backslash only when also in a macro.
847
8482007-01-01 Alan Mackenzie <acm@muc.de>
849
850 * cc-mode.texi ("Choosing a Style"): Mention c-file-style.
851
8522007-01-01 Alan Mackenzie <acm@muc.de>
853
854 * cc-mode.texi ("Movement Commands", "Sample .emacs File"): C-M-[ae]
855 are now bound by default to c-\(beginning\|end\)-of-defun by default.
856
8572007-01-01 Alan Mackenzie <acm@muc.de>
858
859 * cc-mode.texi ("Other Commands"): Move c-set-style (C-c .) here from
860 "Choosing a Style".
861
862 * cc-mode.texi ("Styles"): Add @dfn{style}.
863
8642007-01-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
865
866 * xresources.texi (Table of Resources): Add scrollBarWidth resource.
867
8682007-01-01 Richard Stallman <rms@gnu.org>
869
870 * commands.texi (User Input): Document keys stolen by window mangers.
871
8722006-12-31 Richard Stallman <rms@gnu.org>
873
874 * custom.texi (Specific Customization): Document customize-option
875 instead of customize-variable.
876
8772006-12-31 Kim F. Storm <storm@cua.dk>
878
879 * major.texi (Choosing Modes): Document auto-mode-case-fold.
880
8812006-12-30 Kim F. Storm <storm@cua.dk>
882
883 * killing.texi (CUA Bindings): Fix typo.
884
885 * xresources.texi (Table of Resources): Mention grow-only value for
886 auto-resize-tool-bars.
887
8882006-12-30 Michael Albinus <michael.albinus@gmx.de>
889
890 Sync with Tramp 2.0.55.
891
892 * trampver.texi: Update release number.
893
8942006-12-29 Reiner Steib <Reiner.Steib@gmx.de>
895
896 * gnus.texi (Customizing Articles): Add index entries for all
897 gnus-treat-* variables.
898
8992006-12-29 Jouni K. Sepp,Ad(Bnen <jks@iki.fi>
900
901 * gnus.texi (IMAP): Fix incorrect explanation of
902 nnimap-search-uids-not-since-is-evil in documentation for
903 nnimap-expunge-search-string.
904
9052006-12-27 Reiner Steib <Reiner.Steib@gmx.de>
906
907 * gnus.texi (ifile spam filtering): Rename spam-ifile-database-path to
908 spam-ifile-database.
909
9102006-12-26 Reiner Steib <Reiner.Steib@gmx.de>
911
912 * gnus.texi (Spam Package Configuration Examples): Don't encourage to
913 rebind C-s.
914
9152006-12-26 Jouni K. Sepp,Ad(Bnen <jks@iki.fi>
916
917 * gnus.texi (Group Parameters, Group Maintenance, Topic Commands)
918 (Mail Group Commands, Expiring Mail, IMAP): Add index entries for
919 "expiring mail".
920 (IMAP): Document nnimap-search-uids-not-since-is-evil and
921 nnimap-nov-is-evil.
922
9232006-12-27 Eli Zaretskii <eliz@gnu.org>
924
925 * msdog.texi (Windows Keyboard): Mention widespread Windows bindings,
926 and how to get them back.
927
9282006-12-26 Richard Stallman <rms@gnu.org>
929
930 * calendar.texi (Holidays): Holiday listing is based on current
931 practice, but DST is not.
932
9332006-12-25 Richard Stallman <rms@gnu.org>
934
935 * emacs.texi (Top): Update subnode menus.
936
937 * mark.texi (Transient Mark): Fix xref.
938
939 * killing.texi (Graphical Kill): Node deleted.
940 (Killing): Add xref to Cut and Paste.
941 (CUA Bindings): Update xref.
942
943 * frames.texi (Cut and Paste): New section to hold other nodes.
944 (Mouse Commands): Node demoted.
945 (Cut/Paste Other App): Split out from Mouse Commands.
946 (Word and Line Mouse): Likewise.
947 (Secondary Selection, Clipboard): Nodes demoted.
948
9492006-12-25 Kevin Ryde <user42@zip.com.au>
950
951 * cl.texi (Sorting Sequences): In sort*, add a little cautionary note
952 about the key procedure being used heavily.
953
9542006-12-24 Chong Yidong <cyd@stupidchicken.com>
955
956 * pgg.texi (Caching passphrase): Default for pgg-gpg-use-agent changed
957 to t.
958 (Prerequisites): Add explanation about gpg-agent.
959
9602006-12-24 Kevin Ryde <user42@zip.com.au>
961
962 * calendar.texi (Holidays): US daylight saving begins second Sunday
963 in March for 2007 onwards.
964 (Daylight Savings): Show new US default daylight saving rules, 2nd
965 Sun in Mar to 1st Sun in Nov, now in cal-dst.el.
966
9672006-12-23 Chong Yidong <cyd@stupidchicken.com>
968
969 * calendar.texi (Scroll Calendar): < and > are switched.
970
9712006-12-23 Kevin Rodgers <ihs_4664@yahoo.com>
972
973 * killing.texi (Deletion): Describe M-\ prefix argument.
974
9752006-12-23 Richard Stallman <rms@gnu.org>
976
977 * search.texi (Regexp Search): Explain why forward and reverse regexp
978 search are not mirror images.
979
9802006-12-22 Kevin Ryde <user42@zip.com.au>
981
982 * cl.texi (Sorting Sequences): Typo in sort*, example showed plain
983 "sort" instead of "sort*".
984
9852006-12-19 Richard Stallman <rms@gnu.org>
986
987 * calc.texi (History and Acknowledgements): Recognize that Emacs
988 now does have floating point.
989
9902006-12-19 Kim F. Storm <storm@cua.dk>
991
992 * major.texi (Choosing Modes): Describe match-function elements for
993 magic-mode-alist.
994
9952006-12-19 Michael Albinus <michael.albinus@gmx.de>
996
997 * tramp.texi (External transfer methods): Describe new method `scpc'.
998
9992006-12-18 Eli Zaretskii <eliz@gnu.org>
1000
1001 * msdog.texi (Windows Keyboard): Add a footnote about "Windows" keys
1002 peculiarities.
1003
10042006-12-18 Richard Stallman <rms@gnu.org>
1005
1006 * abbrevs.texi (Editing Abbrevs): Fix previous change.
1007
10082006-12-17 Sascha Wilde <wilde@sha-bang.de>
1009
1010 * pgg.texi: Added short note on gpg-agent to the introduction.
1011
10122006-12-17 Alan Mackenzie <acm@muc.de>
1013
1014 * programs.texi (Left Margin Paren): Remove the bit which says
1015 that CC Mode sets open-paren-in-column-0-is-defun-start to nil.
1016 Discuss some of the issues of setting this option to nil.
1017
10182006-12-17 Glenn Morris <rgm@gnu.org>
1019
1020 * abbrevs.texi (Editing Abbrevs): Mention system abbrevs.
1021
10222006-12-16 Eli Zaretskii <eliz@gnu.org>
1023
1024 * msdog.texi (Windows Keyboard): Clarify `w32-recognize-altgr' effect.
1025 (Windows Files): `w32-get-true-file-attributes' is only relevant for
1026 NTFS volumes.
1027 (ls in Lisp): `links' in `ls-lisp-verbosity' is only relevant to NTFS
1028 volumes.
1029
10302006-12-15 Eli Zaretskii <eliz@gnu.org>
1031
1032 * text.texi (HTML Mode): Fix "C-c TAB".
1033
10342006-12-13 Reiner Steib <Reiner.Steib@gmx.de>
1035
1036 * gnus.texi (Hiding Headers): Document that `long-to' and `many-to'
1037 also applies to Cc.
1038
10392006-12-12 Reiner Steib <Reiner.Steib@gmx.de>
1040
1041 * gnus.texi (X-Face): Clarify. Say which programs are required
1042 on Windows.
1043
10442006-12-09 Richard Stallman <rms@gnu.org>
1045
1046 * misc.texi (Invoking emacsclient): Simplify TCP file text.
1047
10482006-12-08 Kevin Rodgers <ihs_4664@yahoo.com>
1049
1050 * files.texi (Misc File Ops): Document insert-file-literally.
1051
10522006-12-08 Eli Zaretskii <eliz@gnu.org>
1053
1054 * cmdargs.texi (Colors): Note that --color is intended for overriding
1055 the terminal defaults, not for normal invocation.
1056
1057 * misc.texi (Emacs Server): Improve wording. Don't mention the
1058 ``server program''. Add a cross-reference to "Init File" node.
1059 (Invoking emacsclient): Add index entries. Document both short and
1060 long versions of command-line options. Document the -f option.
1061
10622006-12-08 Michael Olson <mwolson@gnu.org>
1063
1064 * erc.texi (Modules): Remove documentation for list module.
1065
10662006-12-06 Richard Stallman <rms@gnu.org>
1067
1068 * text.texi (Outline Format): Say to set outline-regexp
1069 and outline-level with major modes and file local variables.
1070
10712006-12-05 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org>
1072
1073 * anti.texi (Antinews): Mention the alternative to
1074 `~/.emacs_SHELLNAME', which is `~/.emacs.d/init_SHELLNAME.sh'.
1075
1076 * faq.texi (^M in the shell buffer): Ditto.
1077
1078 * misc.texi (Interactive Shell): Ditto.
1079
10802006-12-04 Eli Zaretskii <eliz@gnu.org>
1081
1082 * emacs.texi (Acknowledgments): Fix Arne J@o{}rgensen's name.
1083
1084 * ack.texi (Acknowledgments): Fix Arne J@o{}rgensen's name.
1085
10862006-12-01 Eli Zaretskii <eliz@gnu.org>
1087
1088 * mule.texi (Enabling Multibyte): Rephrase the confusing reference to a
1089 colon in the mode line.
1090
1091 * msdog.texi (Windows Processes) [@ifnottex]: Mention w32-shell-execute.
1092
10932006-11-26 Nick Roberts <nickrob@snap.net.nz>
1094
1095 * building.texi (Watch Expressions): Mention SPC for expanding/
1096 contracting watch expressions.
1097
10982006-11-26 Kim F. Storm <storm@cua.dk>
1099
1100 * kmacro.texi (Basic Keyboard Macro): Mention F3/F4 more.
1101
11022006-11-26 Nick Roberts <nickrob@snap.net.nz>
1103
1104 * building.texi (Debugger Operation): Define text command mode.
1105 Clarify how tooltips work.
1106 (GDB Graphical Interface): Explain how to run in text command mode
1107 more clearly.
1108
11092006-11-25 Juanma Barranquero <lekktu@gmail.com>
1110
1111 * mule.texi (Defining Fontsets): Fix use of `charset' and `font'.
1112
11132006-11-22 Juanma Barranquero <lekktu@gmail.com>
1114
1115 * anti.texi (Antinews): Mention --server-file and TCP sockets.
1116
11172006-11-20 Michael Olson <mwolson@gnu.org>
1118
1119 * erc.texi: Call this the 5.2 stable pre-release of ERC.
1120
11212006-11-18 Chong Yidong <cyd@stupidchicken.com>
1122
1123 * misc.texi (Interactive Shell): INSIDE_EMACS is set to t,
1124 and EMACS is deprecated.
1125
11262006-11-18 Juanma Barranquero <lekktu@gmail.com>
1127
1128 * makefile.w32-in (emacs.dvi): Remove xresmini.texi.
1129
11302006-11-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
1131
1132 * Makefile.in (emacs.dvi): Remove xresmini.texi.
1133
1134 * emacs.texi: Include xresources.texi both for info and dvi.
1135
1136 * xresources.texi: Merge text from xresmini.texi.
1137
11382006-11-17 Carsten Dominik <dominik@science.uva.nl>
1139
1140 * org.texi: Fix typos.
1141 (Agenda commands): Document `C-k'.
1142
11432006-11-16 Eli Zaretskii <eliz@gnu.org>
1144
1145 * url.texi (http/https): Fix a typo in the HTTP URL.
1146
11472006-11-14 Stephen Leake <stephen_leake@stephe-leake.org>
1148
1149 * ada-mode.texi: Total rewrite.
1150
11512006-11-13 Carsten Dominik <dominik@science.uva.nl>
1152
1153 * org.texi: Minor typo fixes.
1154
11552006-11-13 Bill Wohler <wohler@newt.com>
1156
1157 Release MH-E manual version 8.0.3.
1158
1159 * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
1160 release 8.0.3.
1161
1162 * mh-e.texi (Incorporating Mail): Use output of "mhparam Path"
1163 to set MAILDIR.
1164 (Reading Mail): Document the customization of read-mail-command
1165 for MH-E.
1166 (Viewing Attachments): Document mm-discouraged-alternatives.
1167 (Tool Bar): Fix Texinfo for mh-xemacs-use-tool-bar-flag.
1168 (Junk): Add more information about the settings of mh-junk-background
1169 in a program. Add /usr/bin/mh to PATH in examples.
1170
11712006-11-12 Richard Stallman <rms@gnu.org>
1172
1173 * woman.texi: Update author address but say he no longer maintains it.
1174
11752006-11-12 Roberto Rodr,Am(Bguez <lanubeblanca@googlemail.com> (tiny change)
1176
1177 * glossary.texi: Fix typos.
1178
11792006-11-10 Carsten Dominik <carsten.dominik@gmail.com>
1180
1181 * org.texi (ARCHIVE tag): Document C-TAB for forcing cycling of
1182 archived trees.
1183 (Checkboxes): Section moved to chapter 5, and extended.
1184 (The date/time prompt): New section.
1185 (Link abbreviations): New section.
1186 (Presentation and sorting): New section.
1187 (Custom agenda views): Section completely rewritten.
1188 (Summary): Compare with Planner.
1189 (Feedback): More info about creating backtraces.
1190 (Plain lists): Modified example.
1191 (Breaking down tasks): New section.
1192 (Custom time format): New section.
1193 (Time stamps): Document inactive timestamps.
1194 (Setting tags): More details about fast tag selection.
1195 (Block agenda): New section.
1196 (Custom agenda views): Section rewritten.
1197 (Block agenda): New section.
1198
11992006-11-07 Michael Albinus <michael.albinus@gmx.de>
1200
1201 * tramp.texi (Configuration): scp is the default method.
1202 (Default Method): Use ssh as example for another method.
1203
12042006-11-06 Richard Stallman <rms@gnu.org>
1205
1206 * emacs.texi (Acknowledgments): Fix name spelling, add Anna Bigatti.
1207
1208 * ack.texi (Acknowledgments): Fix name spelling.
1209
12102006-11-01 Juri Linkov <juri@jurta.org>
1211
1212 * search.texi (Word Search): Document incremental word search.
1213
12142006-10-28 Glenn Morris <rgm@gnu.org>
1215
1216 * ack.texi (Acknowledgments): Add cal-html author.
1217
1218 * calendar.texi (Writing Calendar Files): Rename section (was "LaTeX
1219 Calendar"). Describe new package cal-html.
1220 * emacs.texi (Top): Rename old node "LaTeX Calendar" to "Writing
1221 Calendar Files."
1222
12232006-10-27 Richard Stallman <rms@gnu.org>
1224
1225 * woman.texi: Downcase nroff/troff/roff.
1226 (Installation): Chapter deleted. Some xrefs deleted.
1227 (Background): woman doesn't advise man ;-).
1228
12292006-10-26 Roberto Rodr,Am(Bguez <lanubeblanca@googlemail.com> (tiny change)
1230
1231 * ada-mode.texi (Project files, Identifier completion)
1232 (Automatic Casing, Debugging, Using non-standard file names)
1233 (Working Remotely): Fix typos.
1234
12352006-10-23 Richard Stallman <rms@gnu.org>
1236
1237 * abbrevs.texi (Expanding Abbrevs): Expansion happens only when
1238 Abbrev mode is enabled.
1239
12402006-10-20 Masatake YAMATO <jet@gyve.org>
1241
1242 * cc-mode.texi (Sample .emacs File): Added missing `)' in
1243 sample code `my-c-initialization-hook'.
1244
12452006-10-19 Stuart D. Herring <herring@lanl.gov>
1246
1247 * widget.texi: Fix typos.
1248
12492006-10-19 Michael Albinus <michael.albinus@gmx.de>
1250
1251 * tramp.texi (Frequently Asked Questions): Remove questions marked with
1252 "???". There have been no complaints for years, so the information
1253 must be appropriate.
1254
12552006-10-16 Richard Stallman <rms@gnu.org>
1256
1257 * widget.texi: Use @var instead of capitalization.
1258 Clarify many widget type descriptions.
1259
1260 * emacs.texi: Update ISBN.
1261
12622006-10-13 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
1263
1264 * gnus.texi (Other modes): Fix typo. Add alternative index entry for
1265 gnus-dired-attach.
1266 (Selecting a Group): Fix typo.
1267
12682006-10-12 Roberto Rodr,Am(Bguez <lanubeblanca@googlemail.com> (tiny change)
1269
1270 * widget.texi: Fix typos.
1271
12722006-10-11 Kim F. Storm <storm@cua.dk>
1273
1274 * emacs.texi (Acknowledgments): Use @dotless{i}.
1275
12762006-10-08 Nick Roberts <nickrob@snap.net.nz>
1277
1278 * building.texi (Breakpoints Buffer): Mention catchpoints.
1279
12802006-10-08 Kim F. Storm <storm@cua.dk>
1281
1282 * ack.texi (Acknowledgments): Update.
1283
1284 * emacs.texi (Acknowledgments): Fix bad @/ form.
1285
12862006-10-06 Reiner Steib <Reiner.Steib@gmx.de>
1287
1288 * gnus.texi (Image Enhancements): Update for Emacs 22.
1289
1290 * gnus-faq.texi ([1.3]): Update.
1291
12922006-10-06 Richard Stallman <rms@gnu.org>
1293
1294 * faq.texi (Displaying the current line or column):
1295 Delete "As of Emacs 20".
1296
12972006-10-06 Romain Francoise <romain@orebokech.com>
1298
1299 * faq.texi (VM): VM works with Emacs 22 too.
1300
13012006-10-06 Richard Stallman <rms@gnu.org>
1302
1303 * ebrowse.texi: Remove Emacs version "21" from title.
1304
13052006-10-05 Kim F. Storm <storm@cua.dk>
1306
1307 * emacs.texi (Acknowledgments): Add more contributors.
1308
13092006-10-03 Richard Stallman <rms@gnu.org>
1310
1311 * emacs.texi (Acknowledgments): Update version and edition.
1312
13132006-10-02 Reiner Steib <Reiner.Steib@gmx.de>
1314
1315 * gnus.texi (Foreign Groups): Say where change of editing commands are
1316 stored. Add reference to `gnus-parameters'.
1317
13182006-10-01 Karl Berry <karl@gnu.org>
1319
1320 * custom.texi (Customization Groups): Page break to keep example buffer
1321 on one page.
1322
13232006-09-30 Karl Berry <karl@gnu.org>
1324
1325 * programs.texi (Basic Indent): @need to improve page break.
1326 * text.texi: Rewording to improve page breaks, and use @LaTeX{}.
1327
13282006-09-29 Glenn Morris <rgm@gnu.org>
1329
1330 * calendar.texi (Date Formats): Doc fix for european-calendar-style.
1331
13322006-09-29 Karl Berry <karl@gnu.org>
1333
1334 * windows.texi (Basic Window): Remove forced @break, no longer
1335 desirable.
1336 * frames.texi (Frame Commands),
1337 * mark.texi (Marking Objects): Reword to avoid bad page break.
1338 * display.texi (Auto Scrolling): Use @tie{} to avoid bad line break.
1339
13402006-09-19 Richard Stallman <rms@gnu.org>
1341
1342 * frames.texi (Dialog Boxes): Clean up wording: avoid passive,
1343 stick to present tense.
1344
13452006-09-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
1346
1347 * frames.texi (Dialog Boxes): Rename x-use-old-gtk-file-dialog
1348 to x-gtk-use-old-file-dialog.
1349 (Dialog Boxes): Document x-gtk-file-dialog-help-text.
1350
13512006-09-15 Jay Belanger <belanger@truman.edu>
1352
1353 * calc.texi, emacs.texi, mh-e.texi (GNU GENERAL PUBLIC LICENSE):
1354 Change "Library Public License" to "Lesser Public License"
1355 throughout. Use "yyyy" to represent year.
1356
13572006-09-15 Carsten Dominik <dominik@science.uva.nl>
1358
1359 * org.texi (Setting tags): Typo fix.
1360
13612006-09-14 Reiner Steib <Reiner.Steib@gmx.de>
1362
1363 * gnus.texi (Oort Gnus): Add @xref for `mm-fill-flowed'.
1364
13652006-09-12 Reiner Steib <Reiner.Steib@gmx.de>
1366
1367 * files.texi (Visiting): Add index entry "open file".
1368
1369 * reftex.texi (Citations Outside LaTeX): Simplify lisp example.
1370
13712006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1372
1373 * faq.texi (Escape sequences in shell output): EMACS is now set
1374 to Emacs's absolute file name, not to "t".
1375 (^M in the shell buffer): Likewise.
1376 * misc.texi (Interactive Shell): Likewise.
1377
13782006-09-11 Richard Stallman <rms@gnu.org>
1379
1380 * building.texi (Compilation Mode): Clarification.
1381 (Grep Searching): Add xref to Compilation Mode.
1382
13832006-09-11 Reiner Steib <Reiner.Steib@gmx.de>
1384
1385 * gnus.texi (Mail Source Specifiers): Mention problem of duplicate
1386 mails with pop3-leave-mail-on-server. Fix wording.
1387 (Limiting): Improve gnus-summary-limit-to-articles.
1388 (X-Face): Fix typo.
1389
13902006-09-11 Simon Josefsson <jas@extundo.com>
1391
1392 * smtpmail.texi (Authentication): Explain TLS and SSL better, based on
1393 suggested by Phillip Lord <phillip.lord@newcastle.ac.uk>.
1394
13952006-09-08 Richard Stallman <rms@gnu.org>
1396
1397 * search.texi (Search): Ref multi-file search commands here.
1398 (Other Repeating Search): Not here.
1399
14002006-09-06 Simon Josefsson <jas@extundo.com>
1401
1402 * smtpmail.texi (Authentication): Mention SSL.
1403
14042006-09-01 Eli Zaretskii <eliz@gnu.org>
1405
1406 * rcirc.texi (Internet Relay Chat, Useful IRC commands):
1407 Don't use @indicateurl.
1408
1409 * cc-mode.texi (Subword Movement): Don't use @headitem.
1410 (Custom Braces, Clean-ups): Don't use @tie.
1411
14122006-08-29 Michael Albinus <michael.albinus@gmx.de>
1413
1414 Sync with Tramp 2.0.54.
1415
1416 * tramp.texi (Bug Reports): The Tramp mailing list is moderated now.
1417 Suggested by Adrian Phillips <a.phillips@met.no>.
1418
14192006-08-28 Richard Stallman <rms@gnu.org>
1420
1421 * windows.texi (Split Window): Update xref.
1422
1423 * basic.texi (Continuation Lines): Update xref.
1424
1425 * indent.texi (Tab Stops): Update xref.
1426
1427 * emacs.texi (Top): Update subnode menu.
1428
1429 * display.texi (Line Truncation, Displaying Boundaries): New nodes,
1430 split out of Display Custom.
1431
14322006-08-25 Kim F. Storm <storm@cua.dk>
1433
1434 * display.texi (Display Custom): Add variables overline-margin
1435 and x-underline-at-descent-line.
1436
14372006-08-25 Richard Stallman <rms@gnu.org>
1438
1439 * entering.texi (Exiting): Rewrite to give graphical displays
1440 priority over text terminals.
1441
1442 * search.texi (Incremental Search): Move index entries.
1443
14442006-08-23 Chong Yidong <cyd@stupidchicken.com>
1445
1446 * custom.texi (Init File): Reference Find Init to avoid "home
1447 directory" confusion.
1448
14492006-08-22 Nick Roberts <nickrob@snap.net.nz>
1450
1451 * building.texi (Other GDB-UI Buffers): Describe how to edit
1452 a value in the locals buffer.
1453
14542006-08-21 Richard Stallman <rms@gnu.org>
1455
1456 * search.texi (Basic Isearch): Add `isearch' index entry.
1457
14582006-08-16 Richard Stallman <rms@gnu.org>
1459
1460 * misc.texi (Saving Emacs Sessions): Clean up wording.
1461
1462 * mark.texi (Marking Objects): Mention term "select all".
1463
1464 * emacs.texi (Top): Update subnode menu.
1465
1466 * help.texi (Help Mode): Move node up in file.
1467
14682006-08-15 Carsten Dominik <dominik@science.uva.nl>
1469
1470 * org.texi (Installation, Activation): Split from Installation and
1471 Activation.
1472 (Clocking work time): Documented new features.
1473
14742006-08-15 Nick Roberts <nickrob@snap.net.nz>
1475
1476 * building.texi (Stack Buffer): Explain fringe arrow.
1477
14782006-08-13 Alex Schroeder <alex@gnu.org>
1479
1480 * rcirc.texi (Configuration): Use correct variable in rcirc-authinfo
1481 example.
1482
14832006-08-12 Eli Zaretskii <eliz@gnu.org>
1484
1485 * faq.texi (How to add fonts): New node.
1486
1487 * misc.texi (Saving Emacs Sessions): Clarify when desktop is restored
1488 on startup.
1489
14902006-08-11 Romain Francoise <romain@orebokech.com>
1491
1492 * ack.texi (Acknowledgments): Delete mention to zone-mode.el.
1493
14942006-08-10 Sven Joachim <svenjoac@gmx.de> (tiny change)
1495
1496 * mule.texi (Recognize Coding, Text Coding): Fix typos.
1497
14982006-08-10 Richard Stallman <rms@gnu.org>
1499
1500 * text.texi (Format Faces): Substantial rewrites to deal
1501 with face merging. Empty regions don't count. Clarify
1502 face property inheritance.
1503
15042006-08-08 Romain Francoise <romain@orebokech.com>
1505
1506 * dired.texi (Marks vs Flags): Fix typo reported by Ari Roponen
1507 <arjuropo@cc.jyu.fi>.
1508
15092006-08-05 Romain Francoise <romain@orebokech.com>
1510
1511 * faq.texi (New in Emacs 22): Expand.
1512
15132006-08-04 Eli Zaretskii <eliz@gnu.org>
1514
1515 * cmdargs.texi (Window Size X) <--geometry>: Only width and height
1516 apply to all frames.
1517
15182006-08-03 Michael Olson <mwolson@gnu.org>
1519
1520 * erc.texi: Update for ERC 5.1.4.
1521
15222006-08-01 Richard Stallman <rms@gnu.org>
1523
1524 * help.texi (Name Help): Add index entries for describe-variable.
1525
15262006-08-01 Nick Roberts <nickrob@snap.net.nz>
1527
1528 * building.texi (GDB Graphical Interface): Shorten node names.
1529 (GDB-UI Layout): Use GDB-related.
1530 (Other GDB-UI Buffers): Simplify English.
1531
15322006-07-31 Richard Stallman <rms@gnu.org>
1533
1534 * search.texi (Query Replace): Add xref for Dired's Q command.
1535
15362006-07-28 Katsumi Yamaoka <yamaoka@jpl.org>
1537
1538 * gnus.texi (Oort Gnus): Mention that the Lisp files are now installed
1539 in .../site-lisp/gnus/ by default.
1540 [ From gnus-news.texi in the trunk. ]
1541
15422006-07-27 Reiner Steib <Reiner.Steib@gmx.de>
1543
1544 * gnus.texi (MIME Commands): Additions for yEnc.
1545
15462006-07-31 Nick Roberts <nickrob@snap.net.nz>
1547
1548 * building.texi (GDB commands in Fringe): Rename to...
1549 (Source Buffers): ..this and move forward. Describe hollow arrow and
1550 new option gdb-find-source-frame.
1551
15522006-07-29 Richard Stallman <rms@gnu.org>
1553
1554 * dired.texi (Operating on Files): Simplify previous change
1555 and fix Texinfo usage.
1556
15572006-07-29 Eli Zaretskii <eliz@gnu.org>
1558
1559 * dired.texi (Operating on Files): Add cross-references. State the
1560 Unix commands that do similar things.
1561
15622006-07-28 Richard Stallman <rms@gnu.org>
1563
1564 * mark.texi (Transient Mark): Clarify that region never disappears
1565 when Transient Mark mode is off, and not when it is on.
1566
15672006-07-27 Richard Stallman <rms@gnu.org>
1568
1569 * search.texi (Non-ASCII Isearch): Clarify. Mention C-q.
1570
15712006-07-24 Richard Stallman <rms@gnu.org>
1572
1573 * xresources.texi (GTK styles): Fix texinfo usage.
1574
1575 * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi:
1576 * faq.texi: Move periods and commas inside quotes.
1577
1578 * commands.texi (User Input): Explain why we teach keyboard cmds.
1579
1580 * xresources.texi, xresmini.texi, search.texi, programs.texi:
1581 * misc.texi, kmacro.texi, killing.texi, glossary.texi:
1582 * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi:
1583 * doclicense.texi, display.texi, dired.texi, basic.texi:
1584 * anti.texi, ack.texi: Move periods and commas inside quotes.
1585
15862006-07-22 Eli Zaretskii <eliz@gnu.org>
1587
1588 * cmdargs.texi (General Variables): Document EMAIL.
1589
15902006-07-21 Eli Zaretskii <eliz@gnu.org>
1591
1592 * frames.texi (Frame Commands): Mention that focus-follows-mouse
1593 doesn't have effect on MS-Windows.
1594
15952006-07-20 Jay Belanger <belanger@truman.edu>
1596
1597 * calc.texi (Error forms): Mention M-+ keybinding for `calc-plus-minus'.
1598
15992006-07-18 Chong Yidong <cyd@stupidchicken.com>
1600
1601 * faq.texi (Security risks with Emacs): Document Emacs 22
1602 file-local-variable mechanism.
1603
16042006-07-17 Richard Stallman <rms@gnu.org>
1605
1606 * building.texi (Grep Searching): Explain about chaining grep commands.
1607
16082006-07-12 Michael Olson <mwolson@gnu.org>
1609
1610 * erc.texi: Update for ERC 5.1.3.
1611
16122006-07-12 Alex Schroeder <alex@gnu.org>
1613
1614 * rcirc.texi: Fix typos.
1615 (Getting started with rcirc): New calling convention for M-x irc.
1616 Mention #rcirc. Removed channel tracking.
1617 (Configuration): Changed the names of all variables that got changed
1618 recently, eg. rcirc-server to rcirc-default-server. Added
1619 documentation for rcirc-authinfo, some background for Bitlbee, and
1620 rcirc-track-minor-mode.
1621 (Scrolling conservatively): Fixed the xref from Auto Scrolling to just
1622 Scrolling.
1623 (Reconnecting after you have lost the connection): Fixed example code
1624 to match code changes.
1625
16262006-07-10 Nick Roberts <nickrob@snap.net.nz>
1627
1628 * killing.texi, gnus.texi, message.texi, mini.texi: Fix typos.
1629
16302006-07-09 Chong Yidong <cyd@stupidchicken.com>
1631
1632 * misc.texi (Invoking emacsclient): Document behavior when emacsclient
1633 is invoked for multiple files.
1634
16352006-07-08 Eli Zaretskii <eliz@gnu.org>
1636
1637 * msdog.texi (Windows Keyboard) [@iftex]: Add an @inforef to the
1638 on-line manual for the rest of this node.
1639 (Windows Mouse) <w32-pass-extra-mouse-buttons-to-system>: Include
1640 unconditionally.
1641 (Windows Processes) <w32-quote-process-args>: Include unconditionally.
1642 Improve wording.
1643 (Windows Printing): Improve wording.
1644 (Windows Misc) [@iftex]: Add an @inforef to the on-line manual for the
1645 rest of this node.
1646
16472006-07-07 Carsten Dominik <dominik@science.uva.nl>
1648
1649 * org.texi (Exporting): Document `C-c C-e' as the prefix for exporting
1650 commands.
1651 (Global TODO list): Document the use of the variables
1652 `org-agenda-todo-ignore-scheduled' and
1653 `org-agenda-todo-list-sublevels'.
1654
16552006-07-05 Richard Stallman <rms@gnu.org>
1656
1657 * faq.texi (Scrolling only one line): Fix xref.
1658
16592006-07-05 Thien-Thi Nguyen <ttn@gnu.org>
1660
1661 * building.texi (Lisp Eval):
1662 * faq.texi (Evaluating Emacs Lisp code):
1663 Throughout, replace eval-current-buffer with eval-buffer.
1664
16652006-07-05 Nick Roberts <nickrob@snap.net.nz>
1666
1667 * mule.texi (Coding Systems, Specify Coding): Link descriptions
1668 of character translation.
1669
16702006-07-04 Nick Roberts <nickrob@snap.net.nz>
1671
1672 * rmail.texi (Remote Mailboxes): Add missing @code keyword.
1673
16742006-07-03 Karl Berry <karl@gnu.org>
1675
1676 * emacs.texi (\hbadness): Set to 6000 so we aren't bothered by
1677 not-too-underfull hboxes in the TeX output.
1678 * abbrevs.texi, buffers.texi, building.texi, calendar.texi,
1679 * cmdargs.texi, custom.texi, dired.texi, macos.texi,
1680 * maintaining.texi, misc.texi, mule.texi, programs.texi, rmail.texi,
1681 * sending.texi, text.texi: Fix overfull/underfull boxes.
1682
16832006-07-03 Romain Francoise <romain@orebokech.com>
1684
1685 * m-x.texi (M-x): Fix.
1686
16872006-07-03 Richard Stallman <rms@gnu.org>
1688
1689 * rcirc.texi (Scrolling conservatively): Fix xref.
1690
1691 * pcl-cvs.texi (Viewing differences): Usage fix.
1692
1693 * search.texi (Other Repeating Search): filename -> file name.
1694
1695 * misc.texi (Narrowing): Minor cleanups.
1696
1697 * files.texi (Visiting): filename -> file name.
1698
1699 * emacs.texi (Top): Update subnode menus.
1700
1701 * mule.texi (Coding Systems): Move char translation stuff here.
1702 (Specify Coding, Output Coding): New nodes, out of Recognize Coding.
1703 (Recognize Coding): Substantial local rewrites.
1704 (International): Update menu.
1705
1706 * display.texi (Auto Scrolling): New node, broken out of Scrolling.
1707 (Scrolling): Substantial local rewrites.
1708 (Display): Update menu and intro.
1709
1710 * dired.texi: filename -> file name.
1711
1712 * custom.texi (Safe File Variables): Texinfo usage fix.
1713
17142006-07-03 Ted Zlatanov <tzz@lifelogs.com>
1715
1716 * help.texi, m-x.texi: Lots of cleanups.
1717
17182006-07-03 Carsten Dominik <dominik@science.uva.nl>
1719
1720 * org.texi (Agenda commands): Document `s' key to save all org-mode
1721 buffers.
1722
17232006-06-30 Eli Zaretskii <eliz@gnu.org>
1724
1725 * msdog.texi (ls in Lisp, Windows Keyboard, Windows Mouse)
1726 (Windows Processes, Windows Misc): Shorten the printed version by
1727 selectively conditioning less important portions by @ifnottex.
1728
17292006-06-30 Ralf Angeli <angeli@caeruleus.net>
1730
1731 * pcl-cvs.texi (Customizing Faces): Remove -face suffix from face
1732 names. Mention `cvs-msg' face.
1733
17342006-06-29 Carsten Dominik <dominik@science.uva.nl>
1735
1736 * org.texi (Checkboxes): New section.
1737
17382006-06-28 Carsten Dominik <dominik@science.uva.nl>
1739
1740 * org.texi (Embedded LaTeX): Fix typos and implement small improvements
1741 throughout this chapter.
1742
17432006-06-27 Chong Yidong <cyd@stupidchicken.com>
1744
1745 * info.texi (Help-Small-Screen): Clarify placement of "All" and "Top"
1746 text for standalone vs Emacs info.
1747 (Help): Clarify header line description. Use mouse-1 for clicks.
1748 (Help-P): Use mouse-1 for clicks.
1749 (Help-^L): "Top" and "All" not displayed with dashes in Emacs.
1750 (Help-^L, Help-M, Help-Int, Search Index, Go to node)
1751 (Choose menu subtopic): Remove gratuitous Emacs command names.
1752 (Help-FOO): Put usual behavior first.
1753 (Help-Xref): Clicking on xrefs works in Emacs.
1754 (Search Text): Clarify what the default behavior is.
1755 (Create Info buffer): Fix Emacs window/X window confusion.
1756 (Emacs Info Variables): Fix for new Emacs init file behavior.
1757
17582006-06-27 Richard Stallman <rms@gnu.org>
1759
1760 * mini.texi (Minibuffer File): Minor cleanup.
1761
17622006-06-25 Nick Roberts <nickrob@snap.net.nz>
1763
1764 * frames.texi (XTerm Mouse): Rename to...
1765 (Text-Only Mouse): ...this. Mention t-mouse-mode.
1766
1767 * emacs.texi (Top): Use new node name.
1768
17692006-06-24 Eli Zaretskii <eliz@gnu.org>
1770
1771 * emacs.texi (Top): Update the detailed menu according to changes in
1772 msdog.texi.
1773
1774 * msdog.texi (Windows Keyboard): New section.
1775 (Windows Mouse): New section.
1776 (Windows System Menu): Remove section (text merged with "Windows
1777 Keyboard").
1778 (Windows Misc): New section.
1779
1780 * dired.texi (Dired Enter): Refer to msdog.texi for ls-lisp emulation.
1781
1782 * msdog.texi (ls in Lisp): New section.
1783
1784 * files.texi (Visiting): Document case-insensitive wildcard matching
1785 under find-file-wildcards.
1786
17872006-06-24 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
1788
1789 * gnus.texi (Summary Buffer Lines): Fix typo.
1790
17912006-06-23 Carsten Dominik <dominik@science.uva.nl>
1792
1793 * org.texi (Embedded LaTeX): New chapter.
1794 (Archiving): Section rewritten.
1795 (Enhancing text): Some parts moved to the new chapter about LaTeX.
1796
17972006-06-20 Bill Wohler <wohler@newt.com>
1798
1799 Release MH-E manual version 8.0.1.
1800
1801 * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
1802 release 8.0.1.
1803 (Preface): Depend on GNU mailutils 1.0 and higher.
1804
18052006-06-19 Katsumi Yamaoka <yamaoka@jpl.org>
1806
1807 * message.texi (News Headers): Update message-syntax-checks section.
1808
18092006-06-19 Karl Berry <karl@gnu.org>
1810
1811 * info.texi (Advanced): Mention C-q, especially with ?.
1812
18132006-06-19 Carsten Dominik <dominik@science.uva.nl>
1814
1815 * org.texi (Publishing links): Document the `:link-validation-function'
1816 property.
1817 (Extensions and Hacking): New chapter, includes some sections of the
1818 "Miscellaneous" chapter.
1819
18202006-06-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1821
1822 * macos.texi (Mac Input): Add description of mac-function-modifier.
1823 Now Unicode keyboard layouts work.
1824
18252006-06-10 Carsten Dominik <dominik@science.uva.nl>
1826
1827 * org.texi (Progress logging): New section.
1828
18292006-06-10 Richard Stallman <rms@gnu.org>
1830
1831 * mule.texi (Recognize Coding): Clarify previous change.
1832
18332006-06-09 Kenichi Handa <handa@m17n.org>
1834
1835 * mule.texi (Recognize Coding): Describe the convention of "CODING!"
1836 notation.
1837
18382006-06-07 Kevin Ryde <user42@zip.com.au>
1839
1840 * mule.texi (Coding Systems): Footnote xref "MS-DOS and MULE" in main
1841 manual for @ifnottex, but in emacs-extra for @iftex.
1842
1843 * cmdargs.texi (General Variables): Fix smtpmail xref.
1844
18452006-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
1846
1847 * viper.texi (Viper Specials):
1848 * programs.texi (Comment Commands):
1849 * gnus.texi (Example Setup):
1850 * faq.texi (Backspace invokes help):
1851 * dired-x.texi (Optional Installation Dired Jump):
1852 * custom.texi (Specifying File Variables):
1853 * calc.texi (Defining Simple Commands): Use ;; instead of ;;; to better
1854 follow coding conventions.
1855
18562006-05-18 Reiner Steib <Reiner.Steib@gmx.de>
1857
1858 * gnus.texi (Saving Articles): Clarify gnus-summary-save-article-mail.
1859
18602006-06-07 Nick Roberts <nickrob@snap.net.nz>
1861
1862 * building.texi (Watch Expressions): Move node to end.
1863 (GDB Graphical Interface): Move description of clicks in fringe...
1864 (GDB commands in the Fringe): ...to here. New node.
1865
18662006-06-06 Carsten Dominik <dominik@science.uva.nl>
1867
1868 * org.texi (ASCII export): Document indentation adaptation.
1869 (Setting tags): Document mutually-exclusive tags.
1870
18712006-06-05 Romain Francoise <romain@orebokech.com>
1872
1873 * url.texi (irc): Mention new funs `url-irc-rcirc' and `url-irc-erc'.
1874 Fix typo.
1875
1876 * gnus-faq.texi (Question 8.6): Update reference to the Gnus
1877 channel (#gnus@irc.freenode.net).
1878 Fix typos. Update copyright notice.
1879
1880 * cc-mode.texi (Getting Started, Indentation Commands, Config Basics)
1881 (Custom Filling and Breaking, Custom Braces, Syntactic Symbols)
1882 (Line-Up Functions, Custom Macros):
1883 * ediff.texi (Window and Frame Configuration)
1884 (Highlighting Difference Regions, Highlighting Difference Regions):
1885 * emacs-mime.texi (Display Customization):
1886 * erc.texi (History):
1887 * eshell.texi (Known problems):
1888 * eudc.texi (Overview, BBDB):
1889 * gnus.texi (NNTP, IMAP, Advanced Scoring Examples)
1890 (The problem of spam, SpamOracle, Extending the Spam package)
1891 (Conformity, Terminology):
1892 * idlwave.texi (Routine Info, Routine Info)
1893 (Class and Keyword Inheritance, Padding Operators)
1894 (Breakpoints and Stepping, Electric Debug Mode)
1895 (Examining Variables, Troubleshooting):
1896 * org.texi (Creating timestamps):
1897 * reftex.texi (Commands, Options, Changes):
1898 * tramp.texi (Inline methods, Password caching)
1899 (Auto-save and Backup, Issues):
1900 * vip.texi (Files, Commands in Insert Mode):
1901 * viper.texi (Emacs Preliminaries, States in Viper)
1902 (Packages that Change Keymaps, Viper Specials, Groundwork):
1903 * xresmini.texi (GTK resources):
1904 Fix various typos.
1905
19062006-06-05 Nick Roberts <nickrob@snap.net.nz>
1907
1908 * building.texi (GDB Graphical Interface): Update bindings.
1909 (Commands of GUD): Add gud-print. Remove gud-run.
1910 Restate availability more generally.
1911
19122006-06-03 Ted Zlatanov <tzz@lifelogs.com>
1913
1914 * mini.texi: Lots of cleanups.
1915
19162006-06-01 Luc Teirlinck <teirllm@auburn.edu>
1917
1918 * misc.texi (Shell History Copying): Update descriptions of `C-c RET'
1919 and Mouse-2.
1920
19212006-06-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
1922
1923 * screen.texi (Menu Bar): Change menu-bar-start to menu-bar-open.
1924
19252006-05-31 Michael Ernst <mernst@alum.mit.edu>
1926
1927 * ediff.texi: Fix typos.
1928
19292006-05-31 Richard Stallman <rms@gnu.org>
1930
1931 * basic.texi (Moving Point): Fix previous change.
1932
19332006-05-30 Carsten Dominik <dominik@science.uva.nl>
1934
1935 * org.texi: Small typo fixes.
1936
19372006-05-29 Michael Albinus <michael.albinus@gmx.de>
1938
1939 * tramp.texi (Frequently Asked Questions): Disable zsh zle.
1940
19412006-05-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
1942
1943 * screen.texi (Menu Bar): F10 for Gtk+/Lesstif/Lucid menus.
1944
19452006-05-28 Ted Zlatanov <tzz@lifelogs.com>
1946
1947 * basic.texi: Many simplifications and improvements in wording.
1948
19492006-05-27 Thien-Thi Nguyen <ttn@gnu.org>
1950
1951 * pcl-cvs.texi: Fix typos.
1952 (Customization): Say "us".
1953
19542006-05-26 Eli Zaretskii <eliz@gnu.org>
1955
1956 * org.texi: Remove bogus @setfilename.
1957
19582006-05-26 Carsten Dominik <dominik@science.uva.nl>
1959
1960 * org.texi (ASCII export): Omit command name.
1961 (HTML export): Add prefix to all lines in Local Variable example.
1962 (Acknowledgments): Typeset names in italics.
1963
19642006-05-26 Nick Roberts <nickrob@snap.net.nz>
1965
1966 * anti.texi (Antinews): Create a node for gdb-ui.
1967
19682006-05-24 Carsten Dominik <dominik@science.uva.nl>
1969
1970 * org.texi (Plain lists): Add new item navigation commands.
1971 (External links): Document elisp and info links.
1972 (Custom searches): New section.
1973 (Publishing): New chapter.
1974 (HTML export): Include a list of supported CSS classes.
1975 (Setting tags): Describe the fast-tag-setting interface.
1976
19772006-05-22 Reiner Steib <Reiner.Steib@gmx.de>
1978
1979 * frames.texi (Menu Bars, Tool Bars): Add index entries.
1980
19812006-05-20 Richard Stallman <rms@gnu.org>
1982
1983 * dired.texi (Dired Navigation): dired-goto-file is now j.
1984
19852006-05-20 Luc Teirlinck <teirllm@auburn.edu>
1986
1987 * dired-x.texi: ifinfo -> ifnottex.
1988
19892006-05-20 Eli Zaretskii <eliz@gnu.org>
1990
1991 * mule.texi (Coding Systems): Mention the undecided-* coding systems
1992 and their aliases.
1993
1994 * msdog.texi (Windows Printing): Mention non-support of plain text
1995 printing with some el-cheapo printers, and suggest a workaround.
1996
19972006-05-20 Kevin Ryde <user42@zip.com.au>
1998
1999 * text.texi (TeX Print): tex-dvi-view-command has a default value,
2000 remove the bit saying you must set it.
2001
20022006-05-19 Luc Teirlinck <teirllm@auburn.edu>
2003
2004 * trouble.texi (Checklist):
2005 * text.texi (Text, Auto Fill, Text Mode):
2006 * search.texi (Nonincremental Search):
2007 * rmail.texi (Rmail Labels):
2008 * mule.texi (Input Methods, Multibyte Conversion):
2009 * misc.texi (Gnus, Where to Look, PostScript):
2010 * maintaining.texi (Create Tags Table):
2011 * indent.texi (Indentation Commands):
2012 * fixit.texi (Spelling):
2013 * emacs.texi (Copying):
2014 * custom.texi (Init File): ifinfo -> ifnottex.
2015
20162006-05-18 Reiner Steib <Reiner.Steib@gmx.de>
2017
2018 * gnus.texi (Saving Articles): Clarify gnus-summary-save-article-mail.
2019
20202006-05-17 Richard Stallman <rms@gnu.org>
2021
2022 * files.texi (Diff Mode): Mention C-x `.
2023
20242006-05-08 Richard Stallman <rms@gnu.org>
2025
2026 * custom.texi (Disabling): Textual cleanups.
2027
20282006-05-12 Reiner Steib <Reiner.Steib@gmx.de>
2029
2030 * message.texi (Interface): Add tool bar customization.
2031 (MIME): Index and text additions for mml-attach.
2032 (MIME): Describe mml-dnd-protocol-alist and
2033 mml-dnd-attach-options.
2034
2035 * gnus.texi (Oort Gnus): Reorder entries in sections.
2036 Fix some entries.
2037 (Starting Up): Add references to "Emacs for Heathens" and to
2038 "Finding the News". Add user-full-name and user-mail-address.
2039 (Group Buffer Format): Add tool bar customization and update.
2040 (Summary Buffer): Add tool bar customization.
2041 (Posting Styles): Add message-alternative-emails.
2042
20432006-05-12 Glenn Morris <rgm@gnu.org>
2044
2045 * calendar.texi (Displaying the Diary, Format of Diary File):
2046 Refer to diary-view-entries, diary-list-entries,
2047 diary-show-all-entries rather than obsolete aliases.
2048
20492006-05-12 Eli Zaretskii <eliz@gnu.org>
2050
2051 * calendar.texi (Calendar/Diary, Holidays, Displaying the Diary)
2052 (Displaying the Diary, Special Diary Entries, Importing Diary):
2053 * building.texi (Compilation Shell):
2054 * buffers.texi (Several Buffers) [iftex]: Replace @xref's to
2055 emacs-xtra with @inforef's.
2056
2057 * files.texi (Visiting): Fix wording.
2058
2059 * mule.texi (Coding Systems, Text Coding): More indexing.
2060 Mention that C-x RET f can set eol conversion.
2061
20622006-05-09 Michael Albinus <michael.albinus@gmx.de>
2063
2064 * tramp.texi (Filename completion): Improve wording.
2065
20662006-05-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2067
2068 * xresmini.texi (GTK resources): Insert GTK description.
2069
2070 * xresources.texi (GTK resources): metafont should be menufont.
2071
20722006-05-07 Romain Francoise <romain@orebokech.com>
2073
2074 * faq.texi (Using regular expressions): Fix typo.
2075 (Packages that do not come with Emacs): Fix capitalization.
2076 (Replacing text across multiple files): Expand node to explain how
2077 to use `dired-do-query-replace-regexp' in more detail, based on
2078 suggestion by Eric Hanchrow <offby1@blarg.net>.
2079
20802006-05-06 Michael Albinus <michael.albinus@gmx.de>
2081
2082 * mini.texi (Completion Options):
2083 * tramp.texi (Filename completion): Completion of remote files'
2084 method, user name and host name is active only in partial
2085 completion mode.
2086
20872006-05-06 Bill Wohler <wohler@newt.com>
2088
2089 Release MH-E manual version 8.0.
2090
2091 * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
2092 release 8.0.
2093
20942006-05-06 Bill Wohler <wohler@newt.com>
2095
2096 * mh-e.texi (MH-BOOK-HOME): Change from
2097 http://www.ics.uci.edu/~mh/book/mh to
2098 http://rand-mh.sourceforge.net/book/mh.
2099 Replace .htm suffix with .html for MH book files.
2100 (Using This Manual): Update key binding for getting relevant
2101 chapter in Info from command key.
2102 (Ranges): Fix itemx.
2103
21042006-05-06 Eli Zaretskii <eliz@gnu.org>
2105
2106 * makefile.w32-in (emacs.dvi):
2107 * Makefile.in (emacs.dvi): Add xresmini.texi.
2108
2109 * xresmini.texi (Table of Resources): Remove xref to non-existent
2110 node "LessTif Resources".
2111
2112 * msdog.texi (Microsoft Windows):
2113 * calendar.texi (Calendar/Diary, Displaying the Diary)
2114 (Special Diary Entries, Importing Diary, Holidays):
2115 * programs.texi (Program Modes):
2116 * text.texi (Text):
2117 * buffers.texi (Several Buffers):
2118 * files.texi (Comparing Files): Fix cross-references to emacs-xtra.
2119
21202006-05-06 Eli Zaretskii <eliz@gnu.org>
2121
2122 The following changes merge the emacs-xtra manual into the main
2123 manual, but only for on-line version of the manual.
2124
2125 * vc2-xtra.texi (Version Backups, Local Version Control)
2126 (Making Snapshots, Change Logs and VC, Version Headers)
2127 (Customizing VC, CVS Options) [ifnottex]: Conditional xref's for
2128 on-line manual.
2129
2130 * vc1-xtra.texi (VC Dired Mode) [ifnottex]: Conditional xref's
2131 for on-line manual.
2132
2133 * msdog-xtra.texi (MS-DOS, MS-DOS Keyboard, MS-DOS Mouse)
2134 (MS-DOS Display, MS-DOS File Names, MS-DOS Printing)
2135 (MS-DOS and MULE, MS-DOS Processes) [ifnottex]: Conditional xref's
2136 for on-line manual.
2137
2138 * fortran-xtra.texi (Fortran, Fortran Autofill)
2139 (Fortran Autofill, Fortran Abbrev) [ifnottex]: Conditional xref's
2140 for on-line manual.
2141
2142 * picture-xtra.texi (Basic Picture, Rectangles in Picture) [ifnottex]:
2143 Conditional xref's for on-line manual.
2144
2145 * emerge-xtra.texi (Emerge, Overview of Emerge)
2146 (Fine Points of Emerge) [ifnottex]: Conditional xref's for on-line
2147 manual.
2148
2149 * Makefile.in (INFO_TARGETS): Remove ../info/emacs-xtra.
2150 (EMACS_XTRA): New variable, lists the new *-xtra.texi files.
2151 (EMACSSOURCES): Use EMACS_XTRA.
2152 (../info/emacs-xtra): Remove.
2153 (emacs-xtra.dvi): Add EMACS_XTRA to prerequisites.
2154
2155 * makefile.w32-in (INFO_TARGETS): Remove $(infodir)/emacs-xtra.
2156 (EMACS_XTRA): New variable, lists the new *-xtra.texi files.
2157 (EMACSSOURCES): Use EMACS_XTRA.
2158 ($(infodir)/emacs-xtra): Remove.
2159 (emacs-xtra.dvi): Add EMACS_XTRA to prerequisites.
2160
2161 * trouble.texi (Quitting):
2162 * text.texi (Text):
2163 * programs.texi (Program Modes):
2164 * msdog.texi (Microsoft Windows):
2165 * frames.texi (Frames):
2166 * files.texi (Backup, Version Control, VC Concepts)
2167 (Types of Log File, Advanced C-x v v, Log Buffer, Old Versions)
2168 (Registering, VC Status, VC Undo, Multi-User Branching)
2169 (Comparing Files):
2170 * calendar.texi (Calendar/Diary, Holidays, Displaying the Diary)
2171 (Displaying the Diary, Special Diary Entries, Importing Diary):
2172 * buffers.texi (Several Buffers): Replace inforef to emacs-xtra by
2173 conditional xref's, depending on @iftex/@ifnottex.
2174
2175 * msdog.texi (Microsoft Windows) [ifnottex]: Add menu entry for
2176 "MS-DOS". @include msdog-xtra.texi.
2177
2178 * programs.texi (Programs) [ifnottex]: Add menu entry for "Fortran".
2179 <Top Level> [ifnottex]: @include fortran-xtra.texi.
2180
2181 * files.texi (Secondary VC Commands) [ifnottex]: Add menu entries
2182 for vc-xtra.texi subsections.
2183 (VC Undo) [ifnottex]: @include vc1-xtra.texi and @lowersections it.
2184 (Multi-User Branching) [ifnottex]: @include vc2-xtra.texi.
2185
2186 * sending.texi (Sending Mail): A @node line without explicit Prev,
2187 Next, and Up links.
2188
2189 * abbrevs.texi (Abbrevs): A @node line without explicit Prev,
2190 Next, and Up links.
2191
2192 * emacs.texi (Top) [ifnottex]: Add menu entries for "Picture Mode"
2193 and its sections. @include picture-xtra.texi.
2194
2195 * maintaining.texi (Maintaining) [ifnottex]: Add menu entry for
2196 "Emerge".
2197 (List Tags) [ifnottex]: @include emerge-xtra.texi.
2198
2199 * cal-xtra.texi (Daylight Savings): Remove this node: it is an
2200 exact duplicate of its name-sake in calendar.texi.
2201
2202 * calendar.texi (Calendar/Diary) [ifnottex]: Add menu item for
2203 "Advanced Calendar/Diary Usage".
2204 (Time Intervals) [ifnottex]: @include cal-xtra.texi.
2205
2206 * dired.texi (Subdirectories in Dired) [ifnottex]: @include
2207 dired-xtra.texi.
2208 (Dired) [ifnottex]: Add menu entry for "Subdir Switches".
2209
2210 * files.texi (Reverting) [ifnottex]: @include arevert-xtra.texi.
2211 (Files) [ifnottex]: Add menu entry for Autorevert.
2212
2213 * emacs-xtra.texi (Introduction): Reword to make consistent with
2214 printed version only.
2215 <Top level>: Remove the body of all chapters and move them to the
2216 new *-xtra.texi files. Use @raisesections and @lowersections to
2217 convert sections to chapters etc.
2218
2219 * msdog-xtra.texi:
2220 * fortran-xtra.texi:
2221 * vc-xtra.texi:
2222 * vc1-xtra.texi:
2223 * vc2-xtra.texi:
2224 * emerge-xtra.texi:
2225 * cal-xtra.texi:
2226 * dired-xtra.texi:
2227 * arevert-xtra.texi: New files, with text from respective chapters
2228 of emacs-xtra.texi. Convert each @chapter into @section, @section
2229 into @subsection, etc.
2230
2231 * emacs-xtra.texi (MS-DOS): Renamed from "MS-DOG". All references
2232 updated.
2233
2234 * msdog.texi (Microsoft Windows): Rename from "Emacs and Microsoft
2235 Windows". All references updated.
2236
22372006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2238
2239 * macos.texi (Mac Input): Mention input from Character Palette.
2240 (Mac Font Specs): Fix typo.
2241
22422006-05-05 Richard Stallman <rms@gnu.org>
2243
2244 * files.texi (Diff Mode): Minor cleanup.
2245
22462006-05-05 Karl Berry <karl@gnu.org>
2247
2248 * texinfo.tex (\definetextfonsizexi, \definetextfonsizex): New cmds.
2249 (\fonttextsize): New user-level command to change text font size.
2250 * emacs.texi: Call @fonttextsize 10, inside @tex to avoid
2251 errors from the current release of makeinfo (4.8).
2252 * help.texi (Library Keywords): Change widest word in multitable
2253 template from `emulations' to `convenience'. (Not sure if this is
2254 related to the font change.)
2255
22562006-05-05 Eli Zaretskii <eliz@gnu.org>
2257
2258 * files.texi (File Names): Add a footnote about limited support of
2259 ~USER on MS-Windows.
2260
2261 * cmdargs.texi (Initial Options): Add a footnote about limited
2262 support of ~USER on MS-Windows.
2263
22642006-05-03 Richard Stallman <rms@gnu.org>
2265
2266 * files.texi (Diff Mode): Node moved here.
2267 (Comparing Files): Delete what duplicates new node.
2268 (Files): Put Diff Mode in menu.
2269
2270 * misc.texi (Diff Mode): Moved to files.texi.
2271
2272 * emacs.texi (Top): Update menu for Diff Mode.
2273
2274 * trouble.texi (Emergency Escape): Simplify.
2275
2276 * emacs.texi (Top): Minor clarification.
2277
22782006-05-03 Teodor Zlatanov <tzz@lifelogs.com>
2279
2280 * commands.texi, entering.texi, screen.texi: Many simplifications.
2281
22822006-05-03 Richard Stallman <rms@gnu.org>
2283
2284 * commands.texi (Text Characters): Delete paragraph about unibyte
2285 non-ASCII printing chars.
2286
2287 * killing.texi (Killing): Say "graphical displays".
2288 * display.texi: Say "graphical displays".
2289
2290 * cmdargs.texi (Misc X): Say "graphical displays".
2291
22922006-05-01 Richard Stallman <rms@gnu.org>
2293
2294 * emacs.texi (Top): Add Diff Mode to menu.
2295
22962006-05-01 Aaron S. Hawley <Aaron.Hawley@uvm.edu>
2297
2298 * misc.texi (Diff Mode): New node.
2299
23002006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2301
2302 * macos.texi (Mac International): Now Carbon Emacs has ATSUI support.
2303 (Mac Environment Variables): Shorten example line.
2304 (Mac Font Specs): Shorten lisp lines. Add descriptions for ATSUI.
2305
23062006-05-01 Nick Roberts <nickrob@snap.net.nz>
2307
2308 * building.texi (GUD Customization): Describe cases %d and %c.
2309 Update description for %e.
2310
23112006-04-30 Glenn Morris <rgm@gnu.org>
2312
2313 * calendar.texi (LaTeX Calendar): Mention cal-tex-preamble-extra.
2314
23152006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
2316
2317 * custom.texi (Examining): Update C-h v output example.
2318
23192006-04-29 Kim F. Storm <storm@cua.dk>
2320
2321 * building.texi (Grep Searching): Add lgrep and rgrep.
2322
23232006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
2324
2325 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify.
2326
23272006-04-26 Sascha Wilde <wilde@sha-bang.de> (tiny change)
2328
2329 * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent.
2330
23312006-04-24 Bill Wohler <wohler@newt.com>
2332
2333 * mh-e.texi (Getting Started): Make it more explicit that you need
2334 to install MH. Add pointers to current MH implementations.
2335
23362006-04-23 Richard Stallman <rms@gnu.org>
2337
2338 * emacs.texi [TeX]: Use xresmini.texi instead of xresources.texi.
2339
2340 * xresmini.texi: New file.
2341
2342 * xresources.texi (Face Resources): Split table into font resources
2343 and the rest. Combine similar attributes for brevity.
2344
23452006-04-21 Bill Wohler <wohler@newt.com>
2346
2347 Release MH-E manual version 7.94.
2348
2349 * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
2350 release 7.94.
2351
23522006-04-21 Carsten Dominik <dominik@science.uva.nl>
2353
2354 * org.texi: Many small fixes.
2355 (Handling links): Rename from "Managing links".
2356
23572006-04-21 Eli Zaretskii <eliz@gnu.org>
2358
2359 * emacs-xtra.texi (MS-DOS File Names): Remove section about
2360 backslashes and case-insensitivity in file names (moved to the
2361 main manual).
2362 (MS-DOS Printing): Move most of the text to the main manual.
2363
2364 * msdog.texi (Windows Files, Windows HOME, MS-Windows Printing):
2365 New nodes.
2366 (Windows Processes, Windows System Menu): Add index entries and
2367 fix wording.
2368
23692006-04-20 Reiner Steib <Reiner.Steib@gmx.de>
2370
2371 * gnus.texi (Spam Statistics Package): Fix typo in @pxref.
2372 (Splitting mail using spam-stat): Fix @xref.
2373
23742006-04-20 Chong Yidong <cyd@stupidchicken.com>
2375
2376 * gnus.texi (Spam Package): Major revision of the text.
2377 Previouly this node was "Filtering Spam Using The Spam ELisp Package".
2378
23792006-04-20 Carsten Dominik <dominik@science.uva.nl>
2380
2381 * org.texi (Time stamps): Better explanation of the purpose of
2382 different time stamps.
2383 (Structure editing, Plain lists): More details on how new items
2384 and headings are inserted.
2385
23862006-04-18 J.D. Smith <jdsmith@as.arizona.edu>
2387
2388 * misc.texi (Shell Ring): Add notes on saved input when
2389 navigating off the end of the history list.
2390
23912006-04-18 Chong Yidong <cyd@mit.edu>
2392
2393 * misc.texi (Shell Options): Correct default value of
2394 comint-scroll-show-maximum-output.
2395
23962006-04-18 Carsten Dominik <dominik@science.uva.nl>
2397
2398 * org.texi (Formula syntax): Fix link to Calc Manual.
2399
24002006-04-17 Reiner Steib <Reiner.Steib@gmx.de>
2401
2402 * gnus.texi (Emacsen): Don't support Emacs 20.7 and XEmacs 21.1.
2403
24042006-04-17 Bill Wohler <wohler@newt.com>
2405
2406 * mh-e.texi (Folders): Update mh-before-quit-hook and
2407 mh-quit-hook example with code that removes the buffers rather
2408 than just bury them.
2409
24102006-04-18 Nick Roberts <nickrob@snap.net.nz>
2411
2412 * building.texi (Watch Expressions): Update.
2413
24142006-04-17 Michael Albinus <michael.albinus@gmx.de>
2415
2416 Sync with Tramp 2.0.53.
2417
24182006-04-13 Carsten Dominik <dominik@science.uva.nl>
2419
2420 * org.texi (Updating settings): New section.
2421 (Visibility cycling): Better names for the startup folding
2422 options.
2423 (Exporting): Completely restructured.
2424 (The very busy C-c C-c key): New section.
2425 (Summary of in-buffer settings): New section.
2426
24272006-04-12 Richard Stallman <rms@gnu.org>
2428
2429 * search.texi: Clean up previous change.
2430
24312006-04-12 Eli Zaretskii <eliz@gnu.org>
2432
2433 * search.texi (Regexp Backslash, Regexp Replace): Add index
2434 entries for ``back reference'' and mention the term itself in the
2435 text.
2436
24372006-04-11 Richard Stallman <rms@gnu.org>
2438
2439 * custom.texi (Safe File Variables):
2440 Document enable-local-variables = :safe.
2441
24422006-04-11 Karl Berry <karl@gnu.org>
2443
2444 * emacs-xtra.texi, emacs.texi (Dired under VC, VC Dired Commands)
2445 (Remote Repositories, Version Backups, Local Version Control)
2446 (Snapshots, Making and Using Snapshots, Snapshot Caveats)
2447 (Miscellaneous Commands and Features of VC, Change Logs and VC)
2448 (Renaming VC Work Files and Master Files)
2449 (Inserting Version Control Headers, Customizing VC, General Options)
2450 (Options for RCS and SCCS, Options specific for CVS): Move all
2451 these nodes to emacs-xtra.texi, for brevity.
2452 * cmdargs.texi, files.texi: Change cross-references.
2453
24542006-04-11 Reiner Steib <Reiner.Steib@gmx.de>
2455
2456 * gnus.texi, gnus-faq.texi, message.texi: Gnus v5.10.8 is released.
2457
24582006-04-10 Reiner Steib <Reiner.Steib@gmx.de>
2459
2460 * gnus.texi (Misc Group Stuff, Summary Buffer, Article Keymap)
2461 (Server Commands): Key `v' is reserved for users.
2462
24632006-04-11 J.D. Smith <jdsmith@as.arizona.edu>
2464
2465 * files.texi (Old Versions): Update description of vc-annotate's
2466 use of color to indicate date ranges.
2467
24682006-04-11 Carsten Dominik <dominik@science.uva.nl>
2469
2470 * org.texi (Link format): New section, emphasis on bracket links.
2471 (External links): Document bracket links.
2472 (FAQ): Expand to cover shell links and the new link format.
2473
24742006-04-09 Kevin Ryde <user42@zip.com.au>
2475
2476 * org.texi (Formula syntax): Typo in node name of calc-eval xref.
2477
2478 * sending.texi (Mail Sending): In send-mail-function @pxref smtpmail,
2479 put info and printed manual names the right way around.
2480
24812006-04-09 Karl Berry <karl@gnu.org>
2482
2483 * msdog.texi, emacs-xtra.texi: Move all the MS-DOS material to
2484 emacs-xtra.texi, leaving only MS Windows information.
2485 * building.texi, emacs.texi, frames.texi, gnu.texi, macos.texi,
2486 * msdog.texi, mule.texi, trouble.texi: Change cross-references and
2487 node names.
2488
2489 * emacs.texi: Move @summarycontents and @contents to the beginning
2490 of the file.
2491
24922006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
2493
2494 * gnus.texi (Summary Buffer Lines): Add `*'.
2495
24962006-04-07 Jochen K,A|(Bpper <jochen@fhi-berlin.mpg.de>
2497
2498 * gnus.texi (Group Parameters):
2499 Mention gnus-permanently-visible-groups.
2500
25012006-04-06 Katsumi Yamaoka <yamaoka@jpl.org>
2502
2503 * gnus.texi (Face): Fix typo.
2504
25052006-04-05 Reiner Steib <Reiner.Steib@gmx.de>
2506
2507 * gnus.texi (X-Face): Clarify.
2508 (Face): Need Emacs with PNG support.
2509
25102006-04-08 Kevin Ryde <user42@zip.com.au>
2511
2512 * text.texi (Fill Commands): fill-nobreak-predicate is now a hook.
2513
25142006-04-07 Richard Stallman <rms@gnu.org>
2515
2516 * programs.texi (Comments, Comment Commands, Options for Comments)
2517 (Multi-Line Comments): "Align", not "indent".
2518 (Basic Indent): C-j deletes trailing whitespace before the newline.
2519
25202006-04-06 Richard Stallman <rms@gnu.org>
2521
2522 * idlwave.texi: Delete the blocks "not suitable for inclusion with
2523 Emacs".
2524
2525 * programs.texi (Basic Indent): Clarify relationship of C-j to TAB.
2526
25272006-04-06 Eli Zaretskii <eliz@gnu.org>
2528
2529 * killing.texi (Rectangles): Add index entry for marking a rectangle.
2530
25312006-04-06 J.D. Smith <jdsmith@as.arizona.edu>
2532
2533 * idlwave.texi: Updated for IDLWAVE version 6.0, factoring out
2534 blocks not suitable for inclusion with Emacs using variable
2535 PARTOFEMACS.
2536
25372006-04-05 Richard Stallman <rms@gnu.org>
2538
2539 * emacs.texi (Top): Update subnode menu.
2540
2541 * trouble.texi (Unasked-for Search): Node deleted.
2542 (Lossage): Delete from menu.
2543
25442006-04-04 Richard Stallman <rms@gnu.org>
2545
2546 * trouble.texi: Various cleanups.
2547 (Checklist): Don't bother saying how to snail a bug report.
2548 (Emergency Escape): Much rewriting.
2549 (After a Crash): Rename the core dump immediately.
2550 (Total Frustration): Call it a psychotherapist.
2551 (Bug Criteria): Avoid "illegal instruction".
2552 (Sending Patches): We always put the contributor's name in.
2553
2554 * misc.texi (Thumbnails): Minor correction.
2555
25562006-04-04 Simon Josefsson <jas@extundo.com>
2557
2558 * gnus.texi (Security): Improve.
2559
25602006-04-03 Richard Stallman <rms@gnu.org>
2561
2562 * misc.texi (Thumbnails): Minor cleanup.
2563
25642006-04-02 Karl Berry <karl@gnu.org>
2565
2566 * sending.texi (Mail Sending): pxref to Top needs five args.
2567
2568 * texinfo.tex: Update to current version (2006-03-21.13).
2569
25702006-04-02 Bill Wohler <wohler@newt.com>
2571
2572 * mh-e.texi (Getting Started, Junk, Bug Reports)
2573 (MH FAQ and Support): Fix URLs.
2574
25752006-03-31 Romain Francoise <romain@orebokech.com>
2576
2577 * gnus.texi (Virtual Groups): `nnvirtual-always-rescan' defaults
2578 to t, not nil (and has for the past eight years).
2579
25802006-03-31 Richard Stallman <rms@gnu.org>
2581
2582 * emacs.texi (Top): Update subnode menu.
2583
2584 * help.texi (Help Mode): Cleanup.
2585
2586 * dired.texi: Many cleanups.
2587 (Dired Deletion): Describe dired-recursive-deletes.
2588 (Operating on Files): dired-create-directory moved.
2589 (Misc Dired Features): Move to here.
2590 (Tumme): Node moved to misc.texi.
2591
2592 * custom.texi: Many cleanups.
2593 (Minor Modes): Don't mention ISO Accents Mode.
2594 (Examining): Update C-h v output example.
2595 (Hooks): Add index and xref for add-hook.
2596 (Locals): Delete list of vars that are always per-buffer. Rearrange.
2597 (Local Keymaps): Don't mention lisp-mode-map, c-mode-map.
2598
2599 * misc.texi: Many cleanups.
2600 (beginning): Add to summary of topics.
2601 (Shell): Put eshell xref at the end. Remove eshell from table.
2602 (Thumbnails): New node.
2603
26042006-03-31 Reiner Steib <Reiner.Steib@gmx.de>
2605
2606 * message.texi, gnus.texi: Bump version to 5.11.
2607
26082006-03-29 Reiner Steib <Reiner.Steib@gmx.de>
2609
2610 * gnus.texi (Top): Add comment about version line.
2611
2612 * message.texi (Top): Ditto. Change to take named versions into
2613 account.
2614
26152006-03-28 Reiner Steib <Reiner.Steib@gmx.de>
2616
2617 * gnus.texi (Posting Styles): Add x-face-file to example.
2618 (X-Face): Refer to posting styles.
2619
2620 * gnus-faq.texi ([5.8]): Add x-face-file.
2621 ([8.4]): Add links to gmane.emacs.gnus.user and
2622 gmane.emacs.gnus.general.
2623
26242006-03-28 Eli Zaretskii <eliz@gnu.org>
2625
2626 * files.texi (File Name Cache): Make it clear that the cache is
2627 not persistent.
2628
26292006-03-27 Reiner Steib <Reiner.Steib@gmx.de>
2630
2631 * gnus-faq.texi: Use .invalid.
2632 ([5.4]): Fix gnus-posting-styles example.
2633
26342006-03-27 Romain Francoise <romain@orebokech.com>
2635
2636 * faq.texi (Emacs/W3): Rename from `w3-mode'. Mention that
2637 Emacs/W3 needs a new maintainer.
2638 (Ispell): Update author and version info.
2639 (Mailcrypt): Mention PGG.
2640 (New in Emacs 22): Add PGG to the list of new packages.
2641 Include minor changes from "Ramprasad B" <ramprasad_i82@yahoo.com>
2642 updating dead URLs.
2643
26442006-03-25 Karl Berry <karl@gnu.org>
2645
2646 * ada-mode.texi, autotype.texi, calc.texi, cc-mode.texi, cl.texi,
2647 * dired-x.texi, ebrowse.texi, ediff.texi, emacs-mime.texi,
2648 * emacs-xtra.texi, emacs.texi, erc.texi, eshell.texi, eudc.texi,
2649 * faq.texi, forms.texi, gnu.texi, gnus.texi, idlwave.texi,
2650 * info.texi, message.texi, mh-e.texi, pcl-cvs.texi, pgg.texi,
2651 * rcirc.texi, reftex.texi, sc.texi, ses.texi, sieve.texi,
2652 * speedbar.texi, url.texi, vip.texi, viper.texi, widget.texi,
2653 * woman.texi: (1) use @copyright{} instead of (C) in typeset text;
2654 (2) do not indent copyright year list (or anything else).
2655
26562006-03-21 Bill Wohler <wohler@newt.com>
2657
2658 * mh-e.texi (Folders): Various edits.
2659
26602006-03-20 Romain Francoise <romain@orebokech.com>
2661
2662 * gnus.texi (Mail Folders): Grammar fix.
2663
26642006-03-21 Juanma Barranquero <lekktu@gmail.com>
2665
2666 * files.texi (VC Dired Mode): Remove misplaced brackets.
2667
26682006-03-21 Andre Spiegel <spiegel@gnu.org>
2669
2670 * files.texi: Various updates and clarifications in the VC chapter.
2671
26722006-03-19 Luc Teirlinck <teirllm@auburn.edu>
2673
2674 * help.texi (Help Mode): Document "C-c C-c".
2675
26762006-03-19 Bill Wohler <wohler@newt.com>
2677
2678 * mh-e.texi (Replying): Document Mail-Followup-To.
2679 Change manually-formatted table to multitable. Add debugging info.
2680 Move description of mh-reply-default-reply-to into paragraph
2681 that describes its values.
2682
26832006-03-17 Bill Wohler <wohler@newt.com>
2684
2685 * mh-e.texi: Use smallexample and smalllisp consistenly.
2686 (Sending Mail Tour): Update method of entering
2687 addresses and subject.
2688 (Sending Mail Tour, Reading Mail Tour, Processing Mail Tour)
2689 (Adding Attachments, Searching): Update screenshots for Emacs 22.
2690
26912006-03-16 Luc Teirlinck <teirllm@auburn.edu>
2692
2693 * emacs-xtra.texi (Top): Avoid ugly continuation line in
2694 menu in the standalone Info reader.
2695
26962006-03-15 Chong Yidong <cyd@stupidchicken.com>
2697
2698 * emacs-xtra.texi (Emerge, Picture Mode, Fortran): New chapters,
2699 moved here from Emacs manual.
2700
2701 * programs.texi (Fortran): Section moved to emacs-xtra.
2702 (Program Modes): Xref to Fortran in emacs-xtra.
2703
2704 * maintaining.texi (Emerge): Move to emacs-xtra.
2705 * files.texi (Comparing Files): Xref to Emerge in emacs-xtra.
2706
2707 * picture.texi: File deleted.
2708 * Makefile.in:
2709 * makefile.w32-in: Remove picture.texi.
2710
2711 * text.texi (Text): Xref to Picture Mode in emacs-xtra.
2712 * abbrevs.texi (Abbrevs):
2713 * sending.texi (Sending Mail): Picture node removed.
2714
2715 * emacs.texi (Top): Update node listings.
2716
27172006-03-15 Carsten Dominik <dominik@science.uva.nl>
2718
2719 * org.texi: Version number change only.
2720
27212006-03-14 Bill Wohler <wohler@newt.com>
2722
2723 * mh-e.texi: Add index entries around each paragraph rather than
2724 depend on entries from beginning of node. Doing so ensures that
2725 index entries are less likely to be forgotten if text is cut and
2726 pasted, and are necessary anyway if the references are on a
2727 separate page. It seems that makeinfo is now (v. 4.8) only
2728 producing one index entry per node, so there is no longer any
2729 excuse not to. Use subheading instead of heading. The incorrect
2730 use of heading produced very large fonts in Info--as large as the
2731 main heading.
2732 (From Bill Wohler): MH-E never did appear in Emacs 21--MH-E
2733 versions 6 and 7 appeared *around* the time of these Emacs releases.
2734
27352006-03-13 Carsten Dominik <dominik@science.uva.nl>
2736
2737 * org.texi (Clean view): Document new startup options.
2738
27392006-03-12 Richard Stallman <rms@gnu.org>
2740
2741 * calendar.texi: Various cleanups.
2742
27432006-03-11 Bill Wohler <wohler@newt.com>
2744
2745 * mh-e.texi (Preface, More About MH-E, Options, HTML, Folders)
2746 (Composing, Scan Line Formats): Fix @refs.
2747 (Getting Started): Define MH profile and MH profile components.
2748 (Incorporating Mail, Reading Mail, Viewing, Printing)
2749 (Sending Mail, Forwarding, Editing Drafts, Inserting Letter)
2750 (Signature, Aliases, Scan Line Formats): Use @code instead of @samp
2751 for string constants.
2752 (Tool Bar): Remove spurious quote.
2753 (Junk): Use ``...'' instead of "...".
2754 (Scan Line Formats): Replace @samp with @kbd.
2755
27562006-03-11 Luc Teirlinck <teirllm@auburn.edu>
2757
2758 * search.texi (Regexps): Use @samp for regexp that is not in Lisp
2759 syntax.
2760
27612006-03-10 Katsumi Yamaoka <yamaoka@jpl.org>
2762
2763 * gnus.texi (NoCeM): Mention gnus-use-nocem can also be a number.
2764
27652006-03-10 Reiner Steib <Reiner.Steib@gmx.de>
2766
2767 * gnus.texi (Fancy Mail Splitting): Improve sentences so as to be
2768 easy to understand.
2769
27702006-03-09 Katsumi Yamaoka <yamaoka@jpl.org>
2771
2772 * gnus.texi: Markup fix.
2773 (Fancy Mail Splitting): Specify new feature.
2774
27752006-03-08 Katsumi Yamaoka <yamaoka@jpl.org>
2776
2777 * gnus.texi (Fancy Mail Splitting): Improve descriptions about
2778 partial-words matching.
2779
27802006-03-07 Reiner Steib <Reiner.Steib@gmx.de>
2781
2782 * emacs-mime.texi (Display Customization): Reword image/.* stuff.
2783
2784 * gnus.texi (Oort Gnus): Add note about `gnus-load'.
2785 (MIME Commands): Fix mm-discouraged-alternatives.
2786
27872006-03-08 Luc Teirlinck <teirllm@auburn.edu>
2788
2789 * search.texi (Regexps): More accurately describe which characters
2790 are special in which situations. Recommend _not_ to quote `]' or
2791 `-' when they are not special.
2792
27932006-03-07 Carsten Dominik <dominik@science.uva.nl>
2794
2795 * org.texi: Version number change only.
2796
27972006-03-06 Bill Wohler <wohler@newt.com>
2798
2799 * mh-e.texi: Move from SourceForge repository to Savannah.
2800 This is version 7.93, which is a total rewrite from the previous
2801 edition 1.3 for MH-E version 5.0.2, and corresponds to MH-E
2802 version 7.93.
2803
28042006-03-03 Reiner Steib <Reiner.Steib@gmx.de>
2805
2806 * gnus.texi (Oort Gnus): Add `mm-fill-flowed'.
2807
28082006-03-01 Carsten Dominik <dominik@science.uva.nl>
2809
2810 * org.texi (Interaction): Add item about `org-mouse.el' by
2811 Piotr Zielinski.
2812 (Managing links): Document that also mouse-1 can be used to
2813 activate a link.
2814 (Headlines, FAQ): Add entry about hiding leading stars.
2815 (Miscellaneous): Resort the sections in this chapter to a more
2816 logical sequence.
2817
28182006-02-28 Andre Spiegel <spiegel@gnu.org>
2819
2820 * files.texi (Old Versions): Clarify operation of C-x v =.
2821
28222006-02-27 Simon Josefsson <jas@extundo.com>
2823
2824 * emacs-mime.texi (Flowed text): Add mm-fill-flowed. (Sync
2825 2004-01-27 from the trunk).
2826
28272006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
2828
2829 * cc-mode.texi: Rename c-hungry-backspace to
2830 c-hungry-delete-backwards, at the request of RMS. Leave the old
2831 name as an alias.
2832
28332006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
2834
2835 * cc-mode.texi: Correct the definition of c-beginning-of-defun, to
2836 include the function header within the defun.
2837
28382006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
2839
2840 * cc-mode.texi: Correct two typos.
2841
28422006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
2843
2844 * cc-mode.texi (Comment Commands): State that C-u M-; kills any
2845 existing comment.
2846 (Electric Keys): Add a justification for electric indentation.
2847 (Hungry WS Deletion): Clear up the names and complications of the
2848 BACKSPACE and DELETE keys.
2849
28502006-02-23 Juri Linkov <juri@jurta.org>
2851
2852 * faq.texi (Common requests): Move `Turning on auto-fill by
2853 default' after `Wrapping words automatically'. Move `Working with
2854 unprintable characters' before `Searching for/replacing newlines'.
2855 Move `Replacing highlighted text' after `Highlighting a region'.
2856 Merge `Repeating commands' and `Repeating a command as many times
2857 as possible' into the former.
2858 (Packages that do not come with Emacs): Add refs to Gmane and
2859 etc/MORE.STUFF.
2860
28612006-02-23 Juri Linkov <juri@jurta.org>
2862
2863 * faq.texi (Newsgroup archives): Update URLs of GNU mail archives.
2864 (Reporting bugs): Suggest using `M-x report-emacs-bug'.
2865 Add xref to `(emacs)Reporting Bugs'.
2866 (Getting a printed manual): Add URL to other formats of the manual.
2867 (Common requests): Fix menu.
2868 (Highlighting a region): Remove ref to `Turning on syntax highlighting'.
2869 (Horizontal scrolling): Mention `truncate-partial-width-windows'.
2870 (Inserting text at the beginning of each line): Add pxref to
2871 `Changing the included text prefix'.
2872 (Forcing the cursor to remain in the same column): Mention `track-eol'
2873 and `set-goal-column'. Add pxref to `(emacs)Moving Point'.
2874 (Replacing text across multiple files): Add keybinding `Q' for
2875 `dired-do-query-replace'.
2876
28772006-02-22 Carsten Dominik <dominik@science.uva.nl>
2878
2879 * reftex.texi: Version number and date change only.
2880
2881 * org.texi (Internal Links): Rewrite to cover the modified
2882 linking system.
2883
28842006-02-21 Nick Roberts <nickrob@snap.net.nz>
2885
2886 * building.texi (Watch Expressions): Update and describe
2887 gdb-speedbar-auto-raise.
2888
28892006-02-19 Richard M. Stallman <rms@gnu.org>
2890
2891 * emacs.texi: Use @smallbook.
2892 (Top): Update ref to Emacs paper, delete ref to Cookbook.
2893 Update subnode menu.
2894
2895 * building.texi (Lisp Interaction): Minor addition.
2896
28972006-02-18 Nick Roberts <nickrob@snap.net.nz>
2898
2899 * building.texi (Watch Expressions): Update and be more precise.
2900
29012006-02-17 Eli Zaretskii <eliz@gnu.org>
2902
2903 * faq.texi: Remove the coding cookie, it's not needed anymore.
2904
29052006-02-15 Francesco Potort,Al(B <pot@gnu.org>
2906
2907 * maintaining.texi (Create Tags Table): Explain why the
2908 exception when etags writes to files under the /dev tree.
2909
29102006-02-14 Richard M. Stallman <rms@gnu.org>
2911
2912 * custom.texi (Safe File Variables): Lots of clarification.
2913 Renamed from Unsafe File Variables.
2914
29152006-02-14 Chong Yidong <cyd@stupidchicken.com>
2916
2917 * custom.texi (Unsafe File Variables): File variable confirmation
2918 assumed denied in batch mode.
2919
29202006-02-14 Richard M. Stallman <rms@gnu.org>
2921
2922 * building.texi (GDB User Interface Layout): Don't say `inferior'
2923 for program being debugged.
2924
29252006-02-15 Nick Roberts <nickrob@snap.net.nz>
2926
2927 * building.texi (GDB Graphical Interface):
2928 Replace gdb-use-inferior-io-buffer with gdb-use-separate-io-buffer.
2929
29302006-02-13 Chong Yidong <cyd@stupidchicken.com>
2931
2932 * custom.texi (Specifying File Variables, Unsafe File Variables):
2933 New nodes, split from File Variables. Document new file local
2934 variable behavior.
2935
29362006-02-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2937
2938 * display.texi (Standard Faces):
2939 * faq.texi (Colors on a TTY):
2940 * files.texi (Visiting):
2941 * frames.texi (Clipboard):
2942 * glossary.texi (Glossary) <Clipboard>:
2943 * xresources.texi (X Resources): Mention Mac OS port.
2944
29452006-02-12 Karl Berry <karl@gnu.org>
2946
2947 * faq.texi (Emacs for Atari ST): Use Sch@"auble instead of the
2948 8-bit accented a.
2949
29502006-02-12 Richard M. Stallman <rms@gnu.org>
2951
2952 * building.texi (Building): Clarify topic in intro.
2953
2954 * maintaining.texi (Maintaining): Change title; clarify topic.
2955 Delete duplicate index entries.
2956
2957 * building.texi (Other GDB User Interface Buffers): Clarifications.
2958
2959 * text.texi (Cell Commands): Clarifications.
2960
2961 * programs.texi (Defuns): Delete duplicate explanation of
2962 left-margin paren convention.
2963 (Hungry Delete): Minor cleanup.
2964
29652006-02-11 Mathias Dahl <mathias.dahl@gmail.com>
2966
2967 * dired.texi (Tumme): More tumme documentation.
2968
29692006-02-11 Alan Mackenzie <acm@muc.de>
2970
2971 * programs.texi ("Hungry Delete"): Correct the appellation of the
2972 backspace and delete keys to @kbd{DEL} and @kbd{DELETE}.
2973
29742006-02-11 Mathias Dahl <mathias.dahl@gmail.com>
2975
2976 * dired.texi (Tumme): Fix small bug.
2977
29782006-02-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2979
2980 * macos.texi (Mac International): Rename "fontset-mac" to
2981 "fontset-standard".
2982
29832006-02-09 Reiner Steib <Reiner.Steib@gmx.de>
2984
2985 * gnus.texi (Gnus Versions): Add history beyond start of Oort.
2986
29872006-02-09 Mathias Dahl <mathias.dah@gmail.com>
2988
2989 * dired.texi (Tumme): Basic documentation for Tumme added.
2990
29912006-02-08 Romain Francoise <romain@orebokech.com>
2992
2993 * faq.texi (Top): Remove paragraph about the FAQ being a
2994 transitional document, etc.
2995 (Searching for/replacing newlines): New node.
2996 (Yanking text in isearch): New node.
2997 (Inserting text at the beginning of each line): Rename and make
2998 more general, mention `M-;' in Message mode.
2999
30002006-02-07 Luc Teirlinck <teirllm@auburn.edu>
3001
3002 * mule.texi (International):
3003 * programs.texi (Basic Indent): Fix typos.
3004
3005 * faq.texi (Meta key does not work in xterm)
3006 (Emacs does not display 8-bit characters)
3007 (Inputting eight-bit characters):
3008 * custom.texi (Minor Modes):
3009 * display.texi (Text Display):
3010 * commands.texi (Text Characters): Update xrefs.
3011
30122006-02-07 Richard M. Stallman <rms@gnu.org>
3013
3014 * emacs.texi (Top): Update subnode menu.
3015 Update info on old Emacs papers.
3016 (Intro): "Graphical display", not window system.
3017
3018 * xresources.texi (GTK styles): Minor clarifications.
3019
3020 * trouble.texi: "Graphical display", not window system.
3021 (Stuck Recursive): Minor clarification.
3022
3023 * text.texi: Minor clarifications.
3024 (Sentences): Explain why two-space convention is better.
3025 Explain sentence-end-without-period here.
3026 (Fill Commands): Not here.
3027 (Refill): Node moved down.
3028 (Filling): Update menu.
3029 (Table Creation, Cell Justification, Column Commands): Clarify.
3030
3031 * sending.texi: Minor clarifications.
3032
3033 * search.texi (Regexp Backslash): Clarification.
3034
3035 * rmail.texi: Minor cleanups.
3036 (Rmail): Delete digression about `rmail-mode'.
3037 (Rmail Inbox): Delete false advice wrt rmail-primary-inbox-list.
3038 (Rmail Files): Mention C-u M-x rmail.
3039 (Rmail Reply): Mention References.
3040 (Rmail Display): Mention rmail-nonignored-headers.
3041
3042 * programs.texi: Minor cleanups.
3043 (Comment Commands): Mention momentary Transient Mark mode.
3044 (Matching): Be more specific about customizing show-paren-mode.
3045 (Info Lookup): Don't list the modes that support C-h S.
3046 Just say what it does in an unsupported mode.
3047 (Man Page): Delete excessive info on customizing woman.
3048 (Motion in C): Don't mention c-for/backward-into-nomenclature.
3049
3050 * abbrevs.texi: Minor clarifications.
3051 (Dabbrev Customization): Talk about "dynamic abbrev expansion",
3052 not "dynamic abbrevs" as if they were a kind of abbrev.
3053
3054 * picture.texi (Picture): Minor cleanup.
3055
3056 * mule.texi (Communication Coding): Say "other applications".
3057 (Fontsets): Not specific to X. Add xref to X Resources.
3058 (Unibyte Mode): Rename from Single-Byte Character Support.
3059 "Graphical display", not window system.
3060 (International): Update menu.
3061
3062 * maintaining.texi (Format of ChangeLog):
3063 New node, split out from ChangeLog.
3064 (ChangeLog): Clarifications in the remaining text.
3065 (Create Tags Table, Etags Regexps, Select Tags Table): Cleanups.
3066 (Find Tag): Add @w.
3067 (Tags Search): Explain tag table order here. Simplify grep ref.
3068 (List Tags): tags-tag-face is a variable, not a face.
3069 (Emerge): Cleanups.
3070
3071 * kmacro.texi (Keyboard Macro Counter): Rewrite for clarity.
3072 (Keyboard Macros): Avoid "the user".
3073
3074 * killing.texi: "Graphical display", not window system.
3075
3076 * help.texi (Help Echo): "Graphical display", not window system.
3077
3078 * glossary.texi: Say "you", not "the user". Say "graphical display".
3079
3080 * frames.texi: Minor cleanups. "Graphical display", not window system.
3081
3082 * files.texi (Visiting): Make drag-and-drop not X-specific.
3083
3084 * custom.texi: Minor cleanups. "Graphical display", not window system.
3085
3086 * cmdargs.texi: Minor cleanups.
3087
3088 * building.texi (Compilation): Move and split kill-compilation para.
3089 Add para about multiple compilers.
3090 (Compilation Mode): Commands also available in grep mode and others.
3091 Mention C-u C-x ` more tutorially. Clarify C-x `.
3092 (Compilation Shell): Clarify. Put Bash example first.
3093 (Grep Searching): Minor cleanups; add @w.
3094 (Debuggers): Minor cleanups.
3095 (Starting GUD): Make GDB xgraphical mode issue clearer.
3096 (Debugger Operation): Lots of clarifications including
3097 GDB tooltip side-effect issue.
3098 (Commands of GUD): Clarify.
3099 (GUD Customization): Add bashdb-mode-hook.
3100 (GDB Graphical Interface): Rewrite for clarity.
3101 (GDB User Interface Layout): Rewrite for clarity.
3102 (Stack Buffer, Watch Expressions): Likewise.
3103 (Other GDB User Interface Buffers): Cleanups.
3104 (Lisp Libraries, External Lisp): Cleanup.
3105
3106 * basic.texi (Position Info): "Graphical displays", rather than
3107 window systems.
3108
3109 * anti.texi: Minor cleanup.
3110
31112006-02-06 Romain Francoise <romain@orebokech.com>
3112
3113 * faq.texi (VM): VM now at version 7.19.
3114 Set myself as maintainer of this file.
3115
31162006-02-04 Michael Olson <mwolson@gnu.org>
3117
3118 * erc.texi (History): Note that ERC is now included with Emacs.
3119
31202006-02-03 Eli Zaretskii <eliz@gnu.org>
3121
3122 * custom.texi (Init File, Find Init): Add cross-references to
3123 where $HOME is described.
3124
31252006-02-01 Luc Teirlinck <teirllm@auburn.edu>
3126
3127 * frames.texi (Frame Parameters): Remove @item for S-Mouse-1; it
3128 is not inside the @table.
3129
3130 * emacs.texi (Top): Correct node name.
3131
3132 * files.texi (File Names): Fix @xref.
3133 (Reverting): Fix typo.
3134
3135 * mule.texi (International): Correct node name.
3136
3137 * kmacro.texi (Save Keyboard Macro): Add missing @kbd to @table.
3138
31392006-02-01 Richard M. Stallman <rms@gnu.org>
3140
3141 * emacs.texi (Top): Update subnode menu.
3142
3143 * mule.texi: Minor clarifications.
3144 Reduce the specific references to X Windows.
3145 Refer to "graphical" terminals, rather than window systems.
3146 (Text Coding): Rename from Specify Coding.
3147 (Communication Coding, File Name Coding, Terminal Coding):
3148 New nodes split out from Text Coding.
3149
3150 * kmacro.texi: Minor clarifications.
3151 (Keyboard Macro Ring): Comment out some excessive commands.
3152 (Basic Keyboard Macro): Split up the table, putting part in each node.
3153
3154 * major.texi: Minor clarifications.
3155
3156 * misc.texi (Single Shell, Interactive Shell): Fix xrefs.
3157
3158 * windows.texi: Minor clarifications.
3159 (Change Window): Don't describe mode-line mouse cmds here.
3160 Add xref to Mode Line Mouse.
3161
3162 * msdog.texi (Text and Binary, MS-DOS and MULE): Fix xrefs.
3163
3164 * macos.texi (Mac International): Fix xref.
3165
3166 * indent.texi: Minor clarifications.
3167
3168 * frames.texi: Minor clarifications.
3169 Reduce the specific references to X Windows.
3170 Refer to "graphical" terminals, rather than window systems.
3171 (Frame Parameters): Don't mention commands like
3172 set-foreground-color. Just say to customize a face.
3173 (Drag and Drop): Lisp-level stuff moved to Emacs Lisp manual.
3174
3175 * files.texi: Minor clarifications.
3176 (Numbered Backups): New node, split out from Backup Names.
3177
3178 * display.texi (Font Lock): C mode no longer depends on (-in-col-0.
3179
3180 * cmdargs.texi (General Variables): Fix xref.
3181
3182 * buffers.texi: Minor clarifications.
3183
31842006-01-31 Romain Francoise <romain@orebokech.com>
3185
3186 * message.texi (Message Headers): Explain what
3187 `message-alternative-emails' does in more detail.
3188 Update copyright year.
3189
31902006-01-31 Richard M. Stallman <rms@gnu.org>
3191
3192 * display.texi (Scrolling, Horizontal Scrolling, Follow Mode):
3193 Nodes moved to top.
3194
3195 * display.texi: Minor clarifications.
3196 (Display): Rearrange menu.
3197 (Standard Faces): Mention query-replace face.
3198 (Faces): Simplify.
3199 (Font Lock): Simplify face customization info.
3200 (Highlight Changes): Node merged into Highlight Interactively.
3201 (Highlight Interactively): Much rewriting and cleanup.
3202 (Optional Mode Line): Narrowed line number not good for goto-line.
3203 Simplify face customization advice.
3204 (Text Display): Mention use of escape-glyph face.
3205 Move ctl-arrow and tab-width here.
3206 (Display Custom): Move no-redraw-on-reenter to end of node.
3207
3208 * search.texi: Minor clarifications.
3209 (Isearch Scroll): Simplify.
3210 (Other Repeating Search): Document multi-occur-in-matching-buffers.
3211
3212 * regs.texi (Registers): Mention bookmarks here.
3213
3214 * mark.texi: Minor clarifications.
3215 (Selective Undo): Node deleted.
3216
3217 * m-x.texi: Minor clarifications.
3218
3219 * killing.texi: Minor clarifications.
3220 Refer to "graphical" terminals, rather than window systems.
3221
3222 * help.texi: Clarifications.
3223 (Help): Don't describe C-h F and C-h K here.
3224 (Key Help): Describe C-h K here.
3225 (Name Help): Mention Emacs Lisp Intro.
3226 Describe C-h F here.
3227 (Misc Help): Mention C-h F and C-h K only briefly.
3228
3229 * fixit.texi (Undo): New node, mostly copied from basic.texi.
3230 Selective undo text merged in.
3231 (Spelling): Mention Aspell along with Ispell.
3232
3233 * emacs.texi (Top): Update subnode menus.
3234
3235 * basic.texi (Basic Undo): Rename from Undo. Most of text
3236 moved to new Undo node.
3237
32382006-01-30 Juanma Barranquero <lekktu@gmail.com>
3239
3240 * makefile.w32-in (clean): Add newsticker, sieve, pgg, erc and rcirc.
3241
32422006-01-29 Chong Yidong <cyd@stupidchicken.com>
3243
3244 * basic.texi (Continuation Lines, Inserting Text):
3245 Mention longlines mode.
3246
32472006-01-29 Richard M. Stallman <rms@gnu.org>
3248
3249 * screen.texi: Minor cleaups.
3250 (Screen): Clean up the intro paragraphs.
3251 (Mode Line): Lots of rewriting. Handle frame-name better.
3252 eol-mnemonic-... vars moved out.
3253
3254 * emacs.texi (Top): Change menu item for MS-DOS node.
3255 Update subnode menu.
3256
3257 * msdog.texi (MS-DOS): Rewrite intro to explain how this
3258 chapter relates to Windows. Title changed.
3259
3260 * mini.texi: Minor cleanups.
3261
3262 * mark.texi (Selective Undo): New node, text moved from basic.texi.
3263 (Mark): Put it in the menu.
3264
3265 * entering.texi: Minor cleanups.
3266
3267 * emacs.texi (Top): Add xref to Mac chapter; explain Windows better.
3268 (Intro): Refer to "graphical" terminals, rather than X.
3269
3270 * display.texi (Display Custom): Add xref to Variables.
3271 (Optional Mode Line): eol-mnemonic-... vars moved here.
3272
3273 * commands.texi: Minor cleanups. Refer to "graphical" terminals,
3274 rather than X.
3275
3276 * cc-mode.texi (Indentation Commands): Inserts newline, not "linefeed".
3277
3278 * basic.texi: Minor cleanups.
3279 (Undo): selective-undo moved.
3280
32812006-01-29 Michael Olson <mwolson@gnu.org>
3282
3283 * makefile.w32-in ($(infodir)/erc, erc.dvi): New targets.
3284
3285 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add ERC.
3286
3287 * faq.texi (New in Emacs 22): Mention ERC.
3288
32892006-01-28 Luc Teirlinck <teirllm@auburn.edu>
3290
3291 * rcirc.texi: Capitalize dir entry for consistency with the entry
3292 in info/dir and other entries in the Emacs category.
3293 Fix typos. Delete trailing whitespace.
3294
32952006-01-28 Bj,Av(Brn Lindstr,Av(Bm <bkhl@elektrubadur.se>
3296
3297 * rcirc.texi: Some @cindex changes, some changes from @kbd to @key.
3298
32992006-01-27 Eli Zaretskii <eliz@gnu.org>
3300
3301 * makefile.w32-in ($(infodir)/rcirc, rcirc.dvi): New targets.
3302 (INFO_TARGETS, DVI_TARGETS): Add rcirc.
3303
3304 * Makefile.in (../info/rcirc, rcirc.dvi): New targets.
3305 (INFO_TARGETS, DVI_TARGETS): Add rcirc.
3306
33072006-01-27 Alex Schroeder <alex@gnu.org>
3308
3309 * rcirc.texi: New file.
3310
33112006-01-25 Luc Teirlinck <teirllm@auburn.edu>
3312
3313 * anti.texi (Antinews): Various corrections and additions.
3314
33152006-01-23 Juri Linkov <juri@jurta.org>
3316
3317 * custom.texi (Easy Customization, Customization Groups)
3318 (Browsing Custom): Mention links along with buttons.
3319
3320 * widget.texi (User Interface): Add S-TAB for widget-backward.
3321
33222006-01-22 Michael Albinus <michael.albinus@gmx.de>
3323
3324 Sync with Tramp 2.0.52.
3325
3326 * tramp.texi (Frequently Asked Questions): Remove Ange-FTP item.
3327 Add Tramp disabling item. New item for common connection problems.
3328 (various): Apply "ftp" as method for the download URL.
3329 (Bug Reports): Refer to FAQ for common problems.
3330
33312006-01-21 Eli Zaretskii <eliz@gnu.org>
3332
3333 * widget.texi (User Interface): Use @key for TAB.
3334
3335 * text.texi (TeX Print): Use @key for TAB.
3336
3337 * ses.texi (Formulas, Printer functions): Use @key for TAB.
3338
3339 * kmacro.texi (Keyboard Macro Step-Edit): Use @key for TAB.
3340
3341 * ebrowse.texi (Switching to Tree, Symbol Completion): Use @key
3342 for TAB.
3343
3344 * cc-mode.texi (Indentation Calculation): Use @key for TAB.
3345
33462006-01-15 Sven Joachim <svenjoac@gmx.de> (tiny change)
3347
3348 * files.texi (File Aliases): Don't claim that usually separate
3349 buffers are created for two file names that name the same data.
3350 Mention additional situations where different names mean the same
3351 file on disk.
3352
33532006-01-19 Richard M. Stallman <rms@gnu.org>
3354
3355 * killing.texi (Deletion): Upcase @key argument.
3356
3357 * custom.texi (Custom Themes): Minor cleanup.
3358
3359 * programs.texi (Hungry Delete): Upcase @key argument.
3360
33612006-01-16 Katsumi Yamaoka <yamaoka@jpl.org>
3362
3363 * gnus.texi: Update copyright.
3364
33652006-01-16 Juri Linkov <juri@jurta.org>
3366
3367 * display.texi (Standard Faces): Add `mode-line-buffer-id'.
3368 Move `mode-line-highlight' before `mode-line-buffer-id'.
3369
33702006-01-13 Katsumi Yamaoka <yamaoka@jpl.org>
3371
3372 * gnus.texi (Article Washing): Additions.
3373
33742006-01-08 Alex Schroeder <alex@gnu.org>
3375
3376 * pgg.texi (Caching passphrase): Rewording.
3377
33782006-01-14 Richard M. Stallman <rms@gnu.org>
3379
3380 * basic.texi (Inserting Text): Minor cleanup.
3381
33822006-01-13 Carsten Dominik <dominik@science.uva.nl>
3383
3384 * org.texi (Agenda commands): Document tags command.
3385
33862006-01-11 Luc Teirlinck <teirllm@auburn.edu>
3387
3388 * custom.texi (Changing a Variable, Face Customization):
3389 Update for changes in Custom menus.
3390
33912006-01-10 Katsumi Yamaoka <yamaoka@jpl.org>
3392
3393 * gnus.texi (RSS): Document nnrss-wash-html-in-text-plain-parts.
3394
33952006-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
3396
3397 * gnus.texi (RSS): Addition.
3398
33992005-12-22 Katsumi Yamaoka <yamaoka@jpl.org>
3400
3401 * gnus.texi (Summary Post Commands): Fix function bound to `S O p'.
3402
34032005-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
3404
3405 * emacs-mime.texi (Display Customization): Add setting example to
3406 mm-discouraged-alternatives.
3407
34082006-01-09 Stefan Monnier <monnier@iro.umontreal.ca>
3409
3410 * flymake.texi (Obtaining Flymake): Remove chapter since Emacs's
3411 version is the canonical version.
3412
34132006-01-08 Alex Schroeder <alex@gnu.org>
3414
3415 * pgg.texi (Caching passphrase): Rewording.
3416
34172006-01-06 Eli Zaretskii <eliz@gnu.org>
3418
3419 * flymake.texi (Obtaining Flymake): Update Flymake's CVS
3420 repository URL.
3421
34222006-01-06 Carsten Dominik <dominik@science.uva.nl>
3423
3424 * org.texi: Removed the accidentally re-added empty line in the
3425 direntry.
3426
34272006-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3428
3429 * macos.texi (Mac International): Undo last change.
3430
34312006-01-05 Carsten Dominik <dominik@science.uva.nl>
3432
3433 * org.texi (Agenda Views): Chapter reorganized.
3434
34352006-01-02 Chong Yidong <cyd@stupidchicken.com>
3436
3437 * custom.texi (Custom Themes): Describe the new
3438 customize-create-theme interface.
3439
34402005-12-30 Juri Linkov <juri@jurta.org>
3441
3442 * basic.texi (Position Info): Update example.
3443
34442005-12-29 Romain Francoise <romain@orebokech.com>
3445
3446 * faq.texi (Using Customize): New node.
3447
34482005-12-28 Luc Teirlinck <teirllm@auburn.edu>
3449
3450 * org.texi: Remove blank line in @direntry. It is non-standard
3451 and recursively produces blank lines all over the dir file (when
3452 using Texinfo 4.8).
3453
34542005-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
3455
3456 * frames.texi (Dialog Boxes): Add x-gtk-show-hidden-files.
3457
34582005-12-24 Chong Yidong <cyd@stupidchicken.com>
3459
3460 * custom.texi (Custom Themes): `load-theme' always loads.
3461
34622005-12-23 Juri Linkov <juri@jurta.org>
3463
3464 * display.texi (Highlight Interactively): Use double space to
3465 separate sentences. Replace C-p with M-p, and C-n with M-n.
3466
34672005-12-22 Richard M. Stallman <rms@gnu.org>
3468
3469 * custom.texi (Easy Customization and subnodes):
3470 Replace "active field" with "button".
3471 Use "user option" only for variables.
3472 Use "setting" for variable-or-face.
3473
34742005-12-22 Luc Teirlinck <teirllm@auburn.edu>
3475
3476 * buffers.texi (Select Buffer): Change order in table to make
3477 "Similar" refer to the correct item.
3478 (Indirect Buffers): Minor rewording.
3479
34802005-12-21 Luc Teirlinck <teirllm@auburn.edu>
3481
3482 * widget.texi (atoms): Delete obsolete remark about `file' widget.
3483
34842005-12-20 Juri Linkov <juri@jurta.org>
3485
3486 * files.texi (VC Status): Put P and N near p and n.
3487
34882005-12-20 Carsten Dominik <dominik@science.uva.nl>
3489
3490 * org.texi (Tags): Boolean logic documented.
3491 (Agenda Views): Document custom commands.
3492
34932005-12-20 David Kastrup <dak@gnu.org>
3494
3495 * faq.texi (AUCTeX): Update version and mailing list info.
3496
34972005-12-19 Richard M. Stallman <rms@gnu.org>
3498
3499 * programs.texi (Electric C): Delete the info about newline control.
3500 (Other C Commands): Minor cleanup.
3501 (Left Margin Paren): Minor cleanup.
3502
35032005-12-19 Luc Teirlinck <teirllm@auburn.edu>
3504
3505 * custom.texi (Easy Customization): Add "Browsing Custom" to menu.
3506 (Customization Groups): Delete text moved to "Browsing Custom".
3507 (Browsing Custom): New node.
3508 (Specific Customization): Clarify which commands only work for
3509 loaded options.
3510
35112005-12-18 Bill Wohler <wohler@newt.com>
3512
3513 * frames.texi (Tool Bars): Shorten text of previous change.
3514
35152005-12-18 Aaron S. Hawley <Aaron.Hawley@uvm.edu>
3516
3517 * files.texi (VC Status): Document log-view mode.
3518
35192005-12-18 Bill Wohler <wohler@newt.com>
3520
3521 * frames.texi (Tool Bars): Mention that you can turn off tool bars
3522 permanently via the customize interface.
3523
35242005-12-17 Katsumi Yamaoka <yamaoka@jpl.org>
3525
3526 * gnus.texi (MIME Commands): Mention addition of
3527 multipart/alternative to gnus-buttonized-mime-types and add xref
3528 to mm-discouraged-alternatives.
3529
3530 * emacs-mime.texi (Display Customization): Mention addition of
3531 "image/.*" and add xref to gnus-buttonized-mime-types in the
3532 mm-discouraged-alternatives section.
3533
35342005-12-16 Carsten Dominik <dominik@science.uva.nl>
3535
3536 * org.texi (Tags): New section.
3537 (Agenda Views): Chapter reorganized.
3538
35392005-12-16 Ralf Angeli <angeli@iwi.uni-sb.de>
3540
3541 * killing.texi (Killing by Lines): Document `kill-whole-line'
3542 function.
3543
35442005-12-16 Eli Zaretskii <eliz@gnu.org>
3545
3546 * org.texi (Internal Links): Add a missing comma after an @xref.
3547
35482005-12-16 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu>
3549
3550 * buffers.texi (Select Buffer): Change `prev-buffer' to
3551 `previous-buffer'. Indicate that these functions use a frame
3552 local buffer list.
3553
35542005-12-14 Chong Yidong <cyd@stupidchicken.com>
3555
3556 * faq.texi (Filling paragraphs with a single space): No need to
3557 change sentence-end now.
3558
35592005-12-13 Romain Francoise <romain@orebokech.com>
3560
3561 * faq.texi (Scrolling only one line): Use `scroll-conservatively'.
3562
35632005-12-12 Jay Belanger <belanger@truman.edu>
3564
3565 * faq.texi (Calc): Update version number.
3566
35672005-12-12 Carsten Dominik <dominik@science.uva.nl>
3568
3569 * org.texi (Progress Logging): New section.
3570
35712005-12-12 Richard M. Stallman <rms@gnu.org>
3572
3573 * custom.texi (Easy Customization): Change menu comment.
3574 (Prefix Keymaps): Fix spelling of Control-X-prefix.
3575
3576 * help.texi (Apropos): Rewrite. Talk about "apropos patterns".
3577 (Help): Among the Apropos commands, describe only C-h a here.
3578
35792005-12-11 Richard M. Stallman <rms@gnu.org>
3580
3581 * programs.texi (Options for Comments): Comment-end starts with space.
3582
3583 * glossary.texi (Glossary): Minor cleanup.
3584
3585 * files.texi (Old Versions): Use @table.
3586
35872005-12-10 Romain Francoise <romain@orebokech.com>
3588
3589 Update the Emacs FAQ for the 22.1 release.
3590
3591 * faq.texi: Set VER to `22.1'.
3592 (Basic editing): Explain how to use localized versions of the
3593 Tutorial. Mention that `C-h r' displays the manual. Delete
3594 obsolete WWW link to an Emacs 18 tutorial.
3595 (Getting a printed manual): Point to the new locations of the
3596 manuals on the GNU Web site.
3597 (Emacs Lisp documentation): Explain that the Emacs Lisp manual is
3598 available via Info (it was previously distributed separately).
3599 (Installing Texinfo documentation): The latest version of Texinfo
3600 is 4.8, not 4.0.
3601 (Informational files for Emacs): COPYING is the GNU General Public
3602 License, not the Emacs General Public License.
3603 (Informational files for Emacs): Delete obsolete link to the
3604 GNUinfo pages as they have been removed from the GNU Web site.
3605 (New in Emacs 22): New node.
3606 (Setting up a customization file): Say that most packages support
3607 Customize nowadays.
3608 (Colors on a TTY): Delete reference to instructions on how to
3609 enable syntax highlighting, it is now enabled by default.
3610 (Turning on abbrevs by default): Emacs now reads the abbrevs file
3611 at startup automatically.
3612 (Controlling case sensitivity): Mention `M-c' in isearch.
3613 (Using an already running Emacs process): Emacs now creates the
3614 socket in `/tmp/emacsUID'. Fix typos. Change default location of
3615 gnuserv. As emacsclient can now run Lisp code as well, delete a
3616 sentence praising gnuserv for that. Simplify description of how
3617 the client/server operation works.
3618 (Compiler error messages): Delete obsolete text (compile.el has
3619 been rewritten).
3620 (Indenting switch statements): Fix typo.
3621 (Matching parentheses): Simplify setup instructions, mention the
3622 menu bar item in the Options menu.
3623 (Repeating a command as many times as possible): Mention `C-x e'.
3624 (Going to a line by number): Mention new keymap and bindings
3625 `M-g M-g', `M-g M-p' and `M-g M-n'.
3626 (Turning on syntax highlighting): Now on by default. Simplify.
3627 (Replacing highlighted text): Use `1', not `t'.
3628 (Problems with very large files): The maximum size is now 256MB on
3629 32-bit machines.
3630 (^M in the shell buffer): Mention `comint-process-echoes'.
3631 (Emacs for Apple computers): Emacs 22 has native support for Mac
3632 OS X.
3633 (Translating names to IP addresses): Delete node.
3634 (Binding keys to commands): Fix typo.
3635 (SPC no longer completes file names): New node.
3636 (MIME with Emacs mail packages): Delete section about the Emacs
3637 MIME FAQ (it's not reachable anymore).
3638
36392005-12-10 David Koppelman <koppel@ece.lsu.edu>
3640
3641 * display.texi (Highlight Interactively): Include
3642 global-hi-lock-mode. Add miscellaneous details and elaborations.
3643
36442005-12-09 Richard M. Stallman <rms@gnu.org>
3645
3646 * display.texi (Font Lock): Delete the Global FL menu item.
3647
36482005-12-09 Luc Teirlinck <teirllm@auburn.edu>
3649
3650 * custom.texi (Minibuffer Maps): Mention the maps for file name
3651 completion.
3652
36532005-12-09 Kim F. Storm <storm@cua.dk>
3654
3655 * killing.texi (CUA Bindings): Describe how to use C-x and C-c as
3656 prefix keys even when mark is active. Decribe that RET moves
3657 cursor to next corner in rectangle; clarify insert around rectangle.
3658
36592005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
3660
3661 * cc-mode.texi: The manual has been extensively revised: the
3662 information about using CC Mode has been separated from the larger
3663 and more difficult chapters about configuration. It has been
3664 updated for CC Mode 5.31.
3665
36662005-12-05 Katsumi Yamaoka <yamaoka@jpl.org>
3667
3668 * pgg.texi (User Commands): Fix description of pgg-verify-region.
3669 (Selecting an implementation): Fix descriptions.
3670
36712005-11-30 Katsumi Yamaoka <yamaoka@jpl.org>
3672
3673 * message.texi (Various Message Variables): Addition.
3674
36752005-11-29 Katsumi Yamaoka <yamaoka@jpl.org>
3676
3677 * message.texi: Fix default values.
3678
36792005-11-25 Katsumi Yamaoka <yamaoka@jpl.org>
3680
3681 * message.texi (Header Commands): Clarify descriptions of
3682 message-cross-post-followup-to, message-reduce-to-to-cc, and
3683 message-insert-wide-reply.
3684 (Various Commands): Fix kindex for message-kill-to-signature;
3685 clarify description of message-tab.
3686
36872005-11-22 Katsumi Yamaoka <yamaoka@jpl.org>
3688
3689 * message.texi (Mailing Lists): Fix description about MFT.
3690
3691 * gnus.texi (Emacs Lisp): Use ~/.gnus.el instead of ~/.emacs.
3692
36932005-11-17 Katsumi Yamaoka <yamaoka@jpl.org>
3694
3695 * gnus.texi (Slow Terminal Connection): Replace old description
3696 with new one.
3697
36982005-11-16 Katsumi Yamaoka <yamaoka@jpl.org>
3699
3700 * gnus.texi (Oort Gnus): Use ~/.gnus.el instead of ~/.emacs;
3701 replace X-Draft-Headers with X-Draft-From.
3702
37032005-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
3704
3705 * gnus.texi (Various Various): Fix the default value of
3706 nnheader-max-head-length.
3707 (Gnus Versions): Fix typo.
3708
37092005-12-08 Luc Teirlinck <teirllm@auburn.edu>
3710
3711 * custom.texi (Customization): Use xref to elisp manual for
3712 non-TeX output.
3713 (Minor Modes): Update.
3714 (Customization Groups, Changing a Variable, Face Customization):
3715 Update for new appearance of Custom buffers.
3716 (Changing a Variable): `custom-buffer-done-function' has been
3717 replaced by `custom-buffer-done-kill'.
3718 (Specific Customization): In the `customize-group' buffer, a
3719 subgroup's contents are not "hidden". They are not included at
3720 all. They have no [Show] button.
3721 (Mouse Buttons): Add pxref to description of mouse event lists in
3722 Elisp manual. Add `menu-bar' and `header-line' dummy prefix keys.
3723 (Find Init): Emacs now looks for ~/.emacs.d/init.el instead of
3724 ~/.emacs.d/.emacs, if it can not find ~/.emacs(.el).
3725
37262005-12-08 Richard M. Stallman <rms@gnu.org>
3727
3728 * mini.texi (Completion Commands, Completion):
3729 In file name input, SPC does not do completion.
3730
37312005-12-08 Carsten Dominik <dominik@science.uva.nl>
3732
3733 * org.texi (Structure editing): Document new functionality of
3734 M-RET.
3735
37362005-12-08 Nick Roberts <nickrob@snap.net.nz>
3737
3738 * building.texi (GDB Graphical Interface): Explain screen size
3739 setting.
3740 (Other GDB User Interface Buffers): Describe features specific to
3741 GDB 6.4.
3742
37432005-12-06 Luc Teirlinck <teirllm@auburn.edu>
3744
3745 * org.texi (Internal Links): Fix Texinfo usage.
3746
37472005-12-06 Carsten Dominik <dominik@science.uva.nl>
3748
3749 * org.texi (TODO basics): Document the global todo list.
3750 (TODO items): Documents sparse tree for specific TODO
3751 keywords.
3752
37532005-12-01 Nick Roberts <nickrob@snap.net.nz>
3754
3755 * building.texi (GDB User Interface Layout): Describe how to
3756 kill associated buffers.
3757 (Breakpoints Buffer): Use D instead of d for gdb-delete-breakpoint.
3758 (Watch Expressions): Be more precise.
3759 (Other GDB User Interface Buffers): Describe how to change a
3760 register value.
3761
37622005-11-30 Carsten Dominik <dominik@science.uva.nl>
3763
3764 * org.texi (Plain Lists): Typos fixed.
3765
37662005-11-28 Jay Belanger <belanger@truman.edu>
3767
3768 * calc.texi: Change references of `M-#' to `C-x *' prefix.
3769
37702005-11-24 Carsten Dominik <dominik@science.uva.nl>
3771
3772 * org.texi (Structure editing): New item moving commands added.
3773 (Plain Lists): New section.
3774
37752005-11-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3776
3777 * macos.texi (Mac Input): Remove description of
3778 mac-command-key-is-meta. Add descriptions of
3779 mac-control-modifier, mac-command-modifier, and
3780 mac-option-modifier.
3781 (Mac International): Fix description of conversion of clipboard data.
3782 (Mac Font Specs): Add example of font customization by face attributes.
3783
37842005-11-22 Nick Roberts <nickrob@snap.net.nz>
3785
3786 * building.texi (Watch Expressions): Expand description.
3787 (Other GDB User Interface Buffers): Describe local map for
3788 gud-watch.
3789
37902005-11-21 Chong Yidong <cyd@stupidchicken.com>
3791
3792 * display.texi (Font Lock): Font lock is enabled by default now.
3793
37942005-11-20 Juri Linkov <juri@jurta.org>
3795
3796 * basic.texi (Position Info): Update examples of the output.
3797 Remove the fact that examples are produced in the TeXinfo buffer,
3798 because in the Info reader users will get a different output from
3799 `C-x ='.
3800
3801 * building.texi (Compilation Mode): Remove paragraph duplicated
3802 from the node `Compilation'. Add `compilation-skip-threshold'.
3803
3804 * display.texi (Font Lock): Suggest more user-friendly method of
3805 finding all Font Lock faces (M-x customize-group RET font-lock-faces).
3806
38072005-11-18 Richard M. Stallman <rms@gnu.org>
3808
3809 * files.texi (Registering): Mention @@ in mode line.
3810
3811 * mini.texi (Minibuffer File): Clarify previous change. Add @findex.
3812
38132005-11-08 Aaron S. Hawley <Aaron.Hawley@uvm.edu>
3814
3815 * files.texi (Renaming and VC): Some back-ends don't
3816 handle renaming.
3817
38182005-11-18 Carsten Dominik <dominik@science.uva.nl>
3819
3820 * org.texi (FAQ): Document `org-table-tab-jumps-over-hlines'.
3821 (Agenda): Document commands `org-cycle-agenda-files' and
3822 `org-agenda-file-to-front'
3823 (Built-in table editor): Document `org-table-sort-lines'.
3824 (HTML formatting): Export of hand-formatted lists.
3825
38262005-11-17 Juri Linkov <juri@jurta.org>
3827
3828 * emacs.texi (Top):
3829 * display.texi (Highlight Interactively): Put this font-lock based
3830 mode near Font Lock node.
3831
38322005-11-16 Chong Yidong <cyd@stupidchicken.com>
3833
3834 * ack.texi (Acknowledgments): Acknowledge Andrew Zhilin for Emacs
3835 icons.
3836
38372005-11-12 Kim F. Storm <storm@cua.dk>
3838
3839 * help.texi (Help): Fix C-h a entry. Add C-h d entry.
3840 (Help Summary): Add C-h d and C-h e.
3841 (Apropos): Clarify that all apropos commands may search for either
3842 list of words or a regexp. Add C-h d for apropos-documentation.
3843 Describe apropos-documentation-sort-by-scores user option.
3844
38452005-11-10 Katsumi Yamaoka <yamaoka@jpl.org>
3846
3847 * gnus.texi (XVarious): Fix description of gnus-use-toolbar; add
3848 new variable gnus-toolbar-thickness.
3849
38502005-11-08 Katsumi Yamaoka <yamaoka@jpl.org>
3851
3852 * gnus.texi (XVarious): Revert description of gnus-use-toolbar.
3853
38542005-11-07 Katsumi Yamaoka <yamaoka@jpl.org>
3855
3856 * gnus.texi (X-Face): Fix description.
3857 (XVarious): Remove gnus-xmas-logo-color-alist and
3858 gnus-xmas-logo-color-style; fix description of gnus-use-toolbar.
3859
38602005-11-01 Katsumi Yamaoka <yamaoka@jpl.org>
3861
3862 * gnus.texi (Group Parameters): Mention new variable
3863 gnus-parameters-case-fold-search.
3864 (Home Score File): Addition.
3865
38662005-11-09 Luc Teirlinck <teirllm@auburn.edu>
3867
3868 * killing.texi (CUA Bindings): Add @section.
3869
38702005-11-10 Kim F. Storm <storm@cua.dk>
3871
3872 * emacs.texi (Top): Add CUA Bindings entry to menu.
3873
3874 * killing.texi (CUA Bindings): New node. Moved here from
3875 misc.texi and extended with info on rectangle commands and
3876 rectangle highlighting, interface to registers, and the global
3877 mark feature.
3878
3879 * misc.texi (Emulation): Move CUA bindings item to killing.texi.
3880
3881 * regs.texi: Prev link points to CUA Bindings node.
3882
38832005-11-07 Luc Teirlinck <teirllm@auburn.edu>
3884
3885 * help.texi (Help Echo): By default, help echos are only shown on
3886 mouse-over, not on point-over.
3887
38882005-11-04 J,Ai(Br,At(Bme Marant <jerome@marant.org>
3889
3890 * misc.texi (Shell Mode): Describe how to activate password echoing.
3891
38922005-11-04 Ulf Jasper <ulf.jasper@web.de>
3893
3894 * newsticker.texi: VERSION changed to 1.9. Updated UPDATED.
3895 (Overview): List supported feed types.
3896 (Installation): No installation necessary when using autoload.
3897 (Configuration): Rename "RSS" to "news".
3898
38992005-11-04 Ken Manheimer <ken.manheimer@gmail.com>
3900
3901 * pgg.texi (User Commands): Document additional passphrase
3902 argument for pgg-encrypt-*, pgg-decrypt-*, and pgg-sign-* functions.
3903 (Backend methods): Likewise for corresponding pgg-scheme-* functions.
3904
39052005-11-04 Carsten Dominik <dominik@science.uva.nl>
3906
3907 * org.texi: Version number changed to 3.19.
3908
39092005-11-04 Romain Francoise <romain@orebokech.com>
3910
3911 * mark.texi (Mark Ring): Fix typo.
3912
39132005-11-03 Richard M. Stallman <rms@gnu.org>
3914
3915 * mark.texi (Mark Ring): Mention set-mark-command-repeat-pop.
3916
39172005-11-01 Bill Wohler <wohler@newt.com>
3918
3919 * help.texi (Help Mode): Fix typo.
3920
39212005-11-01 Nick Roberts <nickrob@snap.net.nz>
3922
3923 * building.texi (Other GDB User Interface Buffers): Describe
3924 the command gdb-use-inferior-io-buffer.
3925
39262005-10-31 Romain Francoise <romain@orebokech.com>
3927
3928 * files.texi (Compressed Files): Fix typo.
3929
3930 * buffers.texi (Misc Buffer): Downcase `*shell*'.
3931
3932 * windows.texi (Force Same Window): Likewise.
3933
39342005-10-30 Bill Wohler <wohler@newt.com>
3935
3936 * help.texi (Help Mode): URLs viewed with browse-url.
3937
39382005-10-31 Nick Roberts <nickrob@snap.net.nz>
3939
3940 * building.texi (GDB Graphical Interface): Don't reference
3941 gdb-mouse-set-clear-breakpoint. Explain gdb-mouse-until
3942 must stay in same frame.
3943
39442005-10-29 Chong Yidong <cyd@stupidchicken.com>
3945
3946 * custom.texi (Init File): Document ~/.emacs.d/init.el.
3947
3948 * anti.texi (Antinews): Likewise.
3949
39502005-10-29 Sascha Wilde <wilde@sha-bang.de>
3951
3952 * pgg.texi (How to use): Update the example to add autoload of
3953 pgg-encrypt-symmetric-region.
3954 (User Commands): Document pgg-encrypt-symmetric-region.
3955 (Backend methods): Document pgg-scheme-encrypt-symmetric-region.
3956
39572005-10-28 Bill Wohler <wohler@newt.com>
3958
3959 * help.texi (Help): Help mode now creates hyperlinks for URLs.
3960
39612005-10-28 Richard M. Stallman <rms@gnu.org>
3962
3963 * files.texi (Visiting): Explain how to enter ? in a file name.
3964
3965 * trouble.texi (Memory Full): Mention !MEM FULL! in mode line.
3966
39672005-10-27 Jay Belanger <belanger@truman.edu>
3968
3969 * calc.texi (Predefined Units): Fix the symbol for a TeX points,
3970 mention other TeX-related units.
3971
39722005-10-25 Nick Roberts <nickrob@snap.net.nz>
3973
3974 * building.texi (GDB Graphical Interface): Describe
3975 gdb-mouse-until.
3976
39772005-10-23 Richard M. Stallman <rms@gnu.org>
3978
3979 * custom.texi (Init File): Recommend when to use site-start.el.
3980
39812005-10-23 Lars Hansen <larsh@soem.dk>
3982
3983 * dired-x.texi (Miscellaneous Commands): Replace
3984 dired-do-relative-symlink by dired-do-relsymlink and
3985 dired-do-relative-symlink-regexp by dired-do-relsymlink-regexp.
3986
39872005-10-23 Jay Belanger <belanger@truman.edu>
3988
3989 * calc.texi (Predefined Units): Use `alpha' for the fine structure
3990 constant.
3991
39922005-10-23 Michael Albinus <michael.albinus@gmx.de>
3993
3994 * faq.texi (Bugs and problems): Replace
3995 `dired-move-to-filename-regexp' by
3996 `directory-listing-before-filename-regexp'.
3997
39982005-10-22 Eli Zaretskii <eliz@gnu.org>
3999
4000 * newsticker.texi (UPDATED): Set value.
4001
40022005-10-17 Katsumi Yamaoka <yamaoka@jpl.org>
4003
4004 * gnus.texi (Document Groups): Remove duplicate item.
4005
40062005-10-21 Juri Linkov <juri@jurta.org>
4007
4008 * custom.texi (Examining): Mention accessing the old variable
4009 value via M-n in set-variable.
4010
40112005-10-21 Carsten Dominik <dominik@science.uva.nl>
4012
4013 * org.texi (Summary): Mention iCalendar support.
4014 (Exporting): Document iCalendar support.
4015
40162005-10-18 Romain Francoise <romain@orebokech.com>
4017
4018 * files.texi (Version Systems): Capitalize GNU.
4019
4020 * viper.texi (Viper Specials): Likewise.
4021
40222005-10-18 Nick Roberts <nickrob@snap.net.nz>
4023
4024 * building.texi (Compilation Mode): Remove redundant paragraph.
4025 (Watch Expressions): Remove paragraph to reflect code change.
4026
40272005-10-17 Juri Linkov <juri@jurta.org>
4028
4029 * info.texi (Getting Started, Search Index, Expert Info):
4030 Fix wording.
4031 (Search Text): Replace `echo area' with `mode line'.
4032 (Search Index): Both `i' and `,' find all index entries.
4033 Replace example `C-f' with `C-l' (which exists in index of Info
4034 manual) and delete spaces in its keyboard input sequence.
4035 Delete unnecessary explanations about literal characters.
4036
40372005-10-16 Richard M. Stallman <rms@gnu.org>
4038
4039 * building.texi (Compilation Mode, Compilation): Clarified.
4040
40412005-10-15 Richard M. Stallman <rms@gnu.org>
4042
4043 * misc.texi (Saving Emacs Sessions): Mention savehist library.
4044
40452005-10-14 Katsumi Yamaoka <yamaoka@jpl.org>
4046
4047 * gnus.texi (Document Server Internals): Addition.
4048
40492005-10-13 Katsumi Yamaoka <yamaoka@jpl.org>
4050
4051 * gnus.texi (A note on namespaces): Fix RFC reference.
4052
40532005-10-12 Katsumi Yamaoka <yamaoka@jpl.org>
4054
4055 * gnus.texi (RSS): Fix key description.
4056
40572005-10-11 Katsumi Yamaoka <yamaoka@jpl.org>
4058
4059 * gnus.texi: Emacs/w3 -> Emacs/W3.
4060 (Browsing the Web): Fix description.
4061 (Web Searches): Ditto.
4062 (Customizing W3): Ditto.
4063
40642005-10-07 Katsumi Yamaoka <yamaoka@jpl.org>
4065
4066 * gnus.texi (Maildir): Clarify expire-age and expire-group.
4067
40682005-10-13 Kenichi Handa <handa@m17n.org>
4069
4070 * basic.texi (Position Info): Fix previous change.
4071
40722005-10-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
4073
4074 * cmdargs.texi (Icons X): Fix typo.
4075
40762005-10-12 Kenichi Handa <handa@m17n.org>
4077
4078 * basic.texi (Position Info): Describe the case that Emacs shows
4079 "part of display ...".
4080
40812005-10-11 Jay Belanger <belanger@truman.edu>
4082
4083 * calc.texi (Integration): Mention using `a i' to compute definite
4084 integrals.
4085
40862005-10-11 Juri Linkov <juri@jurta.org>
4087
4088 * info.texi: Rearrange nodes.
4089 (Top): Update menu. Change ref `Info for Experts' to
4090 `Advanced Info Commands'.
4091 (Getting Started): Fix description of manual's parts.
4092 (Help-Int): Change xref `Info Search' to `Search Index', and
4093 `Expert Info' to `Advanced'.
4094 (Advanced): Move node one level up.
4095 (Search Text, Search Index): New nodes split out from `Info Search'.
4096 (Go to node, Choose menu subtopic, Create Info buffer): New nodes
4097 split out from `Advanced'.
4098 (Advanced, Emacs Info Variables): De-document editing an Info file
4099 in Info.
4100 (Emacs Info Variables): Move node from `Expert Info' to `Advanced'.
4101 (Creating an Info File): Delete node and move its text to
4102 `Expert Info'.
4103
41042005-10-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
4105
4106 * cmdargs.texi (Icons X): -nb => -nbi.
4107
41082005-10-10 Chong Yidong <cyd@stupidchicken.com>
4109
4110 * frames.texi (Speedbar): A couple more clarifications.
4111
41122005-10-11 Nick Roberts <nickrob@snap.net.nz>
4113
4114 * building.texi (GDB User Interface Layout): Improve diagram.
4115 (Watch Expressions): Explain how to make speedbar global.
4116 (Other GDB User Interface Buffers): Make references more precise.
4117
41182005-10-10 Carsten Dominik <dominik@science.uva.nl>
4119
4120 * org.texi (Workflow states): Documented that change in keywords
4121 becomes active only after restart of Emacs.
4122
41232005-10-09 Richard M. Stallman <rms@gnu.org>
4124
4125 * frames.texi (Speedbar): Clarify the text.
4126
41272005-10-09 Chong Yidong <cyd@stupidchicken.com>
4128
4129 * frames.texi (Speedbar): Add information on keybindings,
4130 dismissing the speedbar, and buffer display mode. Link to
4131 speedbar manual.
4132
41332005-10-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
4134
4135 * cmdargs.texi (Icons X): Removed options -i, -itype, --icon-type,
4136 added -nb, --no-bitmap-icon.
4137
41382005-10-08 Michael Albinus <michael.albinus@gmx.de>
4139
4140 Sync with Tramp 2.0.51.
4141
41422005-10-08 Nick Roberts <nickrob@snap.net.nz>
4143
4144 * speedbar.texi (Introduction): Describe new location of speedbar
4145 on menubar.
4146 (Basic Key Bindings): Remove descriptions of bindings that have
4147 been removed.
4148
41492005-10-07 Nick Roberts <nickrob@snap.net.nz>
4150
4151 * building.texi (GDB Graphical Interface): Add variables and
4152 functions to indices. Be more precise.
4153
41542005-10-05 Nick Roberts <nickrob@snap.net.nz>
4155
4156 * speedbar.texi (GDB): Describe use of watch expressions.
4157
41582005-10-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
4159
4160 * frames.texi (Drag and Drop): Remove the x- from
4161 x-dnd-open-file-other-window and xdnd-protocol-alist.
4162
41632005-09-30 Romain Francoise <romain@orebokech.com>
4164
4165 * mini.texi (Minibuffer): The default value now appears before the
4166 colon in minibuffer prompts.
4167
41682005-09-28 Simon Josefsson <jas@extundo.com>
4169
4170 * message.texi (IDNA): Fix.
4171
41722005-09-28 Katsumi Yamaoka <yamaoka@jpl.org>
4173
4174 * gnus.texi (NNTP): Remove nntp-buggy-select, nntp-read-timeout,
4175 nntp-server-hook, and nntp-warn-about-losing-connection; fix
4176 description of nntp-open-connection-function.
4177 (Common Variables): Fix descriptions.
4178
41792005-09-26 Katsumi Yamaoka <yamaoka@jpl.org>
4180
4181 * gnus.texi (Server Buffer Format): Document the %a format spec.
4182
41832005-09-25 Richard M. Stallman <rms@gnu.org>
4184
4185 * search.texi (Regexp Search): Doc search-whitespace-regexp.
4186
41872005-09-22 Katsumi Yamaoka <yamaoka@jpl.org>
4188
4189 * gnus.texi (Mail): Fix gnus-confirm-mail-reply-to-news entry.
4190
41912005-09-20 Emanuele Giaquinta <emanuele.giaquinta@gmail.com> (tiny change)
4192
4193 * text.texi (Paragraphs): Correction about Paragraph-Indent Text mode.
4194
41952005-09-23 Carsten Dominik <dominik@science.uva.nl>
4196
4197 * org.texi Version 3.16.
4198
41992005-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4200
4201 * emacs.texi (Top): Update submenus from macos.texi.
4202
4203 * macos.texi: Change `Mac OS 8 or 9' to `Mac OS Classic'.
4204 (Mac OS): Update feature support status.
4205 (Mac Input): List supported input scripts. Remove description
4206 about `mac-keyboard-text-encoding'. Mention mouse button
4207 emulation and related variables.
4208 (Mac International): Mention Central European and Cyrillic
4209 support. Now `keyboard-coding-system' is dynamically changed.
4210 Add description about coding system for selection. Add
4211 description about language environment.
4212 (Mac Environment Variables): Mention
4213 `~/.MacOSX/environment.plist'. Give example of command line
4214 arguments. Add Preferences support.
4215 (Mac Directories): Explicitly state that this node is for Mac OS
4216 Classic only.
4217 (Mac Font Specs): Mention specification for scalable fonts. List
4218 supported charsets. Add preferred way of creating fontsets. Add
4219 description about `mac-allow-anti-aliasing'.
4220 (Mac Functions): Add descriptions about `mac-set-file-creator',
4221 `mac-get-file-creator', `mac-set-file-type', `mac-get-file-type',
4222 and `mac-get-preference'.
4223
42242005-09-19 Miles Bader <miles@gnu.org>
4225
4226 * newsticker.texi: Get rid of CVS keywords.
4227
42282005-09-15 Katsumi Yamaoka <yamaoka@jpl.org>
4229
4230 * gnus.texi (Finding the Parent): Fix description of how Gnus
4231 finds article.
4232
42332005-09-14 Jari Aalto <jari.aalto@cante.net>
4234
4235 * gnus.texi (Advanced Scoring Examples): New examples to teach how
4236 to drop off non-answered articles.
4237
42382005-09-19 Juanma Barranquero <lekktu@gmail.com>
4239
4240 * makefile.w32-in (newsticker.dvi): Use parentheses instead of curly
4241 braces (which are unsupported by NMAKE) for macro `srcdir'.
4242
42432005-09-17 Eli Zaretskii <eliz@gnu.org>
4244
4245 * makefile.w32-in (INFO_TARGETS, DVI_TARGETS): Add newsticker targets.
4246 (../info/newsticker, newsticker.dvi): New targets.
4247
42482005-09-17 Ulf Jasper <ulf.jasper@web.de>
4249
4250 * newsticker.texi: Replace @command with @code. Replace @example
4251 with @lisp.
4252 (Top): Added explanations to menu items.
4253 (GNU Free Documentation License): Removed.
4254
42552005-09-16 Romain Francoise <romain@orebokech.com>
4256
4257 Update all files to specify GFDL version 1.2.
4258
4259 * doclicense.texi (GNU Free Documentation License): Update to
4260 version 1.2.
4261
42622005-09-15 Richard M. Stallman <rms@gnu.org>
4263
4264 * buffers.texi (List Buffers): Fix xref.
4265
4266 * rmail.texi (Rmail Basics): Fix xref.
4267
4268 * emacs.texi (Top): Update subnode menus.
4269
4270 * files.texi (Saving Commands): New node, broken out of Saving.
4271 (Customize Save): New node, broken out of Saving.
4272 Clarify effect of write-region-inhibit-fsync.
4273 (Misc File Ops): Say write-region-inhibit-fsync affects write-region.
4274
4275 * newsticker.texi: Fix @setfilename.
4276
4277 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add newsticker targets.
4278 (../info/newsticker, newsticker.dvi): New targets.
4279
42802005-09-14 Romain Francoise <romain@orebokech.com>
4281
4282 * files.texi (Saving): Mention write-region-inhibit-fsync.
4283
42842005-09-05 Chong Yidong <cyd@stupidchicken.com>
4285
4286 * custom.texi (Custom Themes): New node.
4287
42882005-09-03 Richard M. Stallman <rms@gnu.org>
4289
4290 * search.texi (Search Case): Mention vars that control
4291 case-fold-search for various operations.
4292
42932005-08-30 Carsten Dominik <dominik@science.uva.nl>
4294
4295 * org.texi: Version 3.15.
4296
42972005-08-29 Luc Teirlinck <teirllm@auburn.edu>
4298
4299 * ses.texi: Combine all three indices into one.
4300 Correct a few typos.
4301
43022005-08-19 Katsumi Yamaoka <yamaoka@jpl.org>
4303
4304 * emacs-mime.texi (time-date): Fix description of safe-date-to-time.
4305
43062005-08-18 Katsumi Yamaoka <yamaoka@jpl.org>
4307
4308 * emacs-mime.texi (Handles): Remove duplicate item.
4309 (Encoding Customization): Fix the default value for
4310 mm-coding-system-priorities.
4311 (Charset Translation): Emacs doesn't use mm-mime-mule-charset-alist.
4312 (Basic Functions): Fix reference.
4313
43142005-08-09 Katsumi Yamaoka <yamaoka@jpl.org>
4315
4316 * gnus.texi (Charsets): Fj hierarchy uses iso-2022-jp.
4317
43182005-08-22 Juri Linkov <juri@jurta.org>
4319
4320 * display.texi (Standard Faces): Merge the text from
4321 `(elisp)Standard Faces' into this node.
4322
43232005-08-18 Luc Teirlinck <teirllm@auburn.edu>
4324
4325 * emacs.texi (Top): Delete menu item for deleted node
4326 Keyboard Translations.
4327
43282005-08-18 Richard M. Stallman <rms@gnu.org>
4329
4330 * faq.texi (Obtaining the FAQ): Delete refs to Lerner's email
4331 and web site.
4332
4333 * trouble.texi (Unasked-for Search):
4334 Delete xref to Keyboard Translations.
4335
4336 * glossary.texi (Glossary): Delete xref.
4337
4338 * faq.texi (Swapping keys): Xref for normal-erase-is-backspace-mode,
4339 not keyboard-translate.
4340
4341 * custom.texi (Minor Modes): Say that the list here is not complete.
4342 (Keyboard Translations): Node deleted.
4343 (Disabling): Delete xref to it.
4344 (Customization Groups): Fix Custom buffer example.
4345 (Hooks): Mention remove-hooks.
4346
43472005-08-17 Luc Teirlinck <teirllm@auburn.edu>
4348
4349 * building.texi (GDB Graphical Interface): Improve filling of menu
4350 item.
4351
43522005-08-18 Nick Roberts <nickrob@snap.net.nz>
4353
4354 * building.texi (GDB Graphical Interface): Use better node names.
4355
43562005-08-14 Richard M. Stallman <rms@gnu.org>
4357
4358 * text.texi (Sentences): Fix xref.
4359
43602005-08-14 Juri Linkov <juri@jurta.org>
4361
4362 * building.texi (Compilation, Grep Searching): Move grep command
4363 headings from `Compilation' to `Grep Searching'.
4364
4365 * dired.texi (Dired and Find):
4366 * maintaining.texi (Tags Search): Replace grep xref to
4367 `Compilation' node with `Grep Searching'.
4368
4369 * files.texi (Comparing Files): Replace xref to `Compilation' with
4370 `Compilation Mode'.
4371
43722005-08-13 Alan Mackenzie <acm@muc.de>
4373
4374 * search.texi (Non-ASCII Isearch): Correct a typo.
4375 (Replacement Commands): Mention query-replace key binding.
4376
43772005-08-11 Richard M. Stallman <rms@gnu.org>
4378
4379 * programs.texi (Options for Comments): Fix xref.
4380
4381 * search.texi (Regexp Backslash, Regexp Example): New nodes split
4382 out of Regexps.
4383
4384 * faq.texi (Using regular expressions): Fix xref.
4385
43862005-08-09 Juri Linkov <juri@jurta.org>
4387
4388 * building.texi (Compilation): Use `itemx' instead of `item'.
4389 (Grep Searching): Simplify phrase.
4390
4391 * display.texi (Standard Faces): Describe vertical-border on
4392 window systems.
4393
4394 * windows.texi (Split Window): Simplify phrase and mention
4395 vertical-border face.
4396
43972005-08-09 Richard M. Stallman <rms@gnu.org>
4398
4399 * files.texi (Comparing Files): Clarify compare-windows.
4400
4401 * calendar.texi (Scroll Calendar): Document < and > in calendar.
4402
44032005-08-09 Juri Linkov <juri@jurta.org>
4404
4405 * info.texi (Help-P): Replace `Prev' with `Previous'.
4406 (Help-M, Help-Xref): Add S-TAB.
4407 (Help-FOO): Update `u' command.
4408 (Help-Xref): Move info about Mouse-2 from `Help-Int'.
4409 Update info about visibility of xref parts.
4410 (Help-Int): Fix `m' command. Rename `Info-last' to
4411 `Info-history-back'. Add `Info-history-forward'.
4412 (Advanced): Fix `g*' and `M-n' commands.
4413 (Info Search): Add `index-apropos' in stand-alone browser.
4414 Add isearch commands.
4415 (Emacs Info Variables): Remove `Info-fontify'.
4416 Add `Info-mode-hook'. Update face names.
4417 Add `Info-fontify-maximum-menu-size',
4418 `Info-fontify-visited-nodes', `Info-isearch-search'.
4419
44202005-08-07 Michael Albinus <michael.albinus@gmx.de>
4421
4422 Sync with Tramp 2.0.50.
4423
4424 * tramp.texi: Use @option{} consequently for method names.
4425 (Inline methods, External transfer methods): Remove references to
4426 Cygwin.
4427 (Issues with Cygwin ssh): Explain trouble with Cygwin's ssh
4428 implementation.
4429
44302005-08-06 Eli Zaretskii <eliz@gnu.org>
4431
4432 * mule.texi (Coding Systems): Rephrase the paragraph about
4433 codepages: no need for "M-x codepage-setup" anymore, except on
4434 MS-DOS.
4435
4436 * msdog.texi (MS-DOS and MULE): Clarify that this section is for
4437 the MS-DOS port only.
4438
44392005-07-30 Eli Zaretskii <eliz@gnu.org>
4440
4441 * makefile.w32-in (info): Don't run multi-install-info.bat.
4442 ($(infodir)/dir): New target, produced by running
4443 multi-install-info.bat.
4444
44452005-07-27 Reiner Steib <Reiner.Steib@gmx.de>
4446
4447 * gnus.texi (Startup Files): Fix name of gnus-site-init-file.
4448 Mention that gnus-init-file is not read when Emacs is invoked with
4449 --no-init-file or -q.
4450
44512005-07-22 Eli Zaretskii <eliz@gnu.org>
4452
4453 * files.texi (Quoted File Names): Add index entry.
4454
44552005-07-19 Carsten Dominik <dominik@science.uva.nl>
4456
4457 * org.texi: Version 3.14.
4458
44592005-07-04 Carsten Dominik <dominik@science.uva.nl>
4460
4461 * org.texi: Version 3.13.
4462
44632005-07-19 Juri Linkov <juri@jurta.org>
4464
4465 * files.texi (Comparing Files): Mention resync for `compare-windows'.
4466
44672005-07-18 Juri Linkov <juri@jurta.org>
4468
4469 * calc.texi (Time Zones, Logical Operations):
4470 * cl.texi (Overview):
4471 * custom.texi (Easy Customization):
4472 * files.texi (Old Versions):
4473 * frames.texi (Wheeled Mice):
4474 * mule.texi (Specify Coding):
4475 * org.texi (TODO types):
4476 * sc.texi (Emacs 18 MUAs):
4477 * speedbar.texi (Top):
4478 * text.texi (Cell Justification):
4479 * trouble.texi (After a Crash):
4480 * url.texi (History):
4481 * xresources.texi (GTK styles):
4482 Delete duplicate duplicate words.
4483
44842005-07-17 Richard M. Stallman <rms@gnu.org>
4485
4486 * frames.texi (Creating Frames): Fix foreground color example.
4487
4488 * custom.texi (Init Examples): Clean up text about conditionals.
4489
44902005-07-16 Richard M. Stallman <rms@gnu.org>
4491
4492 * mini.texi (Completion Commands): Fix command name for ?.
4493
44942005-07-16 Johan Bockgard <bojohan@users.sourceforge.net> (tiny change)
4495
4496 * cl.texi (Type Predicates): Document `atom' type.
4497
44982005-07-16 Eli Zaretskii <eliz@gnu.org>
4499
4500 * display.texi (Standard Faces): Explain that customization of
4501 `menu' face has no effect on w32 and with GTK. Add
4502 cross-references.
4503
4504 * cmdargs.texi (General Variables): Clarify the default location
4505 of $HOME on w32 systems.
4506
45072005-07-15 Jason Rumney <jasonr@gnu.org>
4508
4509 * cmdargs.texi (General Variables): Default HOME on MS Windows has
4510 changed.
4511
45122005-07-08 Kenichi Handa <handa@m17n.org>
4513
4514 * mule.texi (Recognize Coding): Recommend
4515 revert-buffer-with-coding-system instead of revert-buffer.
4516
45172005-07-07 Richard M. Stallman <rms@gnu.org>
4518
4519 * anti.texi (Antinews): Mention mode-line-inverse-video.
4520
4521 * files.texi (Saving): Minor correction about C-x C-w.
4522
4523 * display.texi (Display Custom): Don't mention mode-line-inverse-video.
4524
45252005-07-07 Luc Teirlinck <teirllm@auburn.edu>
4526
4527 * search.texi (Isearch Scroll): Add example of using the
4528 `isearch-scroll' property.
4529 (Slow Isearch): Reference anchor for `baud-rate' instead of entire
4530 `Display Custom' node.
4531 (Regexp Replace): Put text that requires Emacs Lisp knowledge last
4532 and de-emphasize it.
4533 (Other Repeating Search): `occur' currently can not correctly
4534 handle multiline matches. Correct, clarify and update description
4535 of `flush-lines' and `keep-lines'.
4536
4537 * display.texi (Display Custom): Add anchor for `baud-rate'.
4538
45392005-07-07 Richard M. Stallman <rms@gnu.org>
4540
4541 * gnu.texi: Update where to get GNU status; add refs for how to help.
4542 Add footnotes 6 and 7.
4543
45442005-07-04 Lute Kamstra <lute@gnu.org>
4545
4546 Update FSF's address in GPL notices.
4547
4548 * calc.texi (Copying):
4549 * doclicense.texi (GNU Free Documentation License):
4550 * faq.texi (Contacting the FSF):
4551 * mh-e.texi (Copying):
4552 * trouble.texi (Checklist): Update FSF's address.
4553
45542005-07-03 Richard M. Stallman <rms@gnu.org>
4555
4556 * flymake.texi (Example -- Configuring a tool called directly):
4557 Update name of flymake-build-relative-filename.
4558
45592005-06-29 Katsumi Yamaoka <yamaoka@jpl.org>
4560
4561 * gnus.texi (NoCeM): gnus-nocem-verifyer defaults to pgg-verify.
4562
45632005-06-29 Carsten Dominik <dominik@science.uva.nl>
4564
4565 * org.texi: Version 3.12.
4566
45672005-06-24 Richard M. Stallman <rms@gnu.org>
4568
4569 * display.texi (Text Display): Change index entries.
4570
45712005-06-24 Eli Zaretskii <eliz@gnu.org>
4572
4573 * makefile.w32-in (MAKEINFO): Use --force.
4574 (INFO_TARGETS, DVI_TARGETS): Make identical to the lists in
4575 Makefile.in.
4576 (gnus.dvi): Use "..." to quote Sed args, so that it works with
4577 more shells.
4578
45792005-06-23 Richard M. Stallman <rms@gnu.org>
4580
4581 * anti.texi (Antinews): Renamed show-nonbreak-escape to
4582 nobreak-char-display.
4583
4584 * emacs.texi (Top): Update detailed node listing.
4585
4586 * display.texi (Text Display): Renamed show-nonbreak-escape
4587 to nobreak-char-display and no-break-space to nobreak-space.
4588 (Standard Faces): Split up the list of standard faces
4589 and put it in a separate node. Add nobreak-space and
4590 escape-glyph.
4591
4592 * speedbar.texi (Creating a display): Texinfo usage fixes.
4593
4594 * tramp.texi (Customizing Completion, Auto-save and Backup):
4595 Texinfo usage fixes.
4596
45972005-06-23 Lute Kamstra <lute@gnu.org>
4598
4599 * mule.texi (Select Input Method): Fix typo.
4600
46012005-06-23 Kenichi Handa <handa@m17n.org>
4602
4603 * mule.texi (International): List all supported scripts. Adjust
4604 text for that leim is now included in the normal Emacs
4605 distribution.
4606 (Language Environments): List all language environments.
4607 Intlfonts contains fonts for most supported scripts, not all..
4608 (Select Input Method): Refer to C-u C-x = to see how to type to
4609 input a specifc character.
4610 (Recognize Coding): Fix typo, china-iso-8bit -> chinese-iso-8bit.
4611
46122005-06-23 Juanma Barranquero <lekktu@gmail.com>
4613
4614 * building.texi (Grep Searching):
4615 * dired-x.texi (Miscellaneous Commands):
4616 * ediff.texi (Miscellaneous):
4617 * gnus.texi (MIME Commands, Fancy Mail Splitting, Agent Visuals)
4618 (Agent Variables):
4619 * info.texi (Help-Xref):
4620 * message.texi (Message Headers):
4621 * org.texi (Remember):
4622 * reftex.texi (Options (Defining Label Environments)):
4623 (Options (Index Support)):
4624 (Options (Viewing Cross-References)):
4625 (Options (Misc)):
4626 (Changes):
4627 * speedbar.texi (Creating a display):
4628 * tramp.texi (Customizing Completion, Auto-save and Backup):
4629 Texinfo usage fix.
4630
46312005-06-22 Miles Bader <miles@gnu.org>
4632
4633 * display.texi (Faces): Change `vertical-divider' to `vertical-border'.
4634
46352005-06-20 Miles Bader <miles@gnu.org>
4636
4637 * display.texi (Faces): Add `vertical-divider'.
4638
46392005-06-17 Richard M. Stallman <rms@gnu.org>
4640
4641 * text.texi (Adaptive Fill): Minor clarification.
4642
46432005-06-13 Carsten Dominik <dominik@science.uva.nl>
4644
4645 * org.texi: Version 3.11.
4646
46472005-06-12 Jay Belanger <belanger@truman.edu>
4648
4649 * calc.texi (Getting Started): Remove extra menu item.
4650
46512005-06-10 Lute Kamstra <lute@gnu.org>
4652
4653 * emacs.texi (Top): Correct version number.
4654 * anti.texi (Antinews): Correct version number. Use EMACSVER to
4655 refer to the current version of Emacs.
4656
46572005-06-08 Luc Teirlinck <teirllm@auburn.edu>
4658
4659 * files.texi (Log Buffer): Document when there can be more than
4660 one file to be committed.
4661
46622005-06-08 Juri Linkov <juri@jurta.org>
4663
4664 * display.texi (Faces): Add `shadow' face.
4665
46662005-06-07 Masatake YAMATO <jet@gyve.org>
4667
4668 * display.texi (Faces): Write about mode-line-highlight.
4669
46702005-06-06 Richard M. Stallman <rms@gnu.org>
4671
4672 * misc.texi (Printing Package): Explain how to initialize
4673 printing package.
4674
4675 * cmdargs.texi (Action Arguments): Clarify directory default for -l.
4676
46772005-06-05 Chong Yidong <cyd@stupidchicken.com>
4678
4679 * emacs.texi: Rename Hardcopy to Printing.
4680 Make PostScript and PostScript Variables subnodes of it.
4681
4682 * misc.texi (Printing): Rename node from Hardcopy.
4683 Mention menu bar options.
4684 Move PostScript and PostScript Variables to submenu.
4685 (Printing package): New node.
4686
4687 * mark.texi (Using Region): Change Hardcopy xref to Printing.
4688
4689 * dired.texi (Operating on Files): Likewise.
4690
4691 * calendar.texi (Displaying the Diary): Likewise.
4692
4693 * msdog.texi (MS-DOS Printing, MS-DOS Processes): Likewise.
4694
4695 * glossary.texi (Glossary): Likewise.
4696
4697 * frames.texi (Mode Line Mouse): Mention mode-line-highlight
4698 effect.
4699
47002005-06-04 Richard M. Stallman <rms@gnu.org>
4701
4702 * trouble.texi (After a Crash): Polish previous change.
4703
47042005-05-31 Jay Belanger <belanger@truman.edu>
4705
4706 * calc.texi (Notations Used in This Manual): Use @kbd for key
4707 sequence.
4708 (Demonstration of Calc): Mention another way of starting Calc.
4709 (Starting Calc): Mention long name of M-#.
4710 (Embedded Mode Overview): Remove unnecessary instruction.
4711 (Other M-# commands): Rephrase `M-# 0' explanation.
4712 (Basic Embedded Mode): Rewrite discussion of prefix arguments to
4713 reflect current behavior.
4714
47152005-05-30 Jay Belanger <belanger@truman.edu>
4716
4717 * calc.texi (Hooks): Change description of calc-window-hook and
4718 calc-trail-window-hook to match usage.
4719 (Computational Functions): Add more constant-generating functions.
4720 (Customizable Variables): Use defvar.
4721
47222005-05-30 Noah Friedman <friedman@splode.com>
4723
4724 * trouble.texi (After a Crash): Mention emacs-buffer.gdb as a
4725 recovery mechanism.
4726
47272005-05-28 Jay Belanger <belanger@truman.edu>
4728
4729 * calc.texi (Assignments in Embedded Mode): Fix variable name.
4730 (Basic Embedded Mode): Explain behavior of arguments to
4731 calc-embedded-mode.
4732
47332005-05-28 Nick Roberts <nickrob@snap.net.nz>
4734
4735 * building.texi (Other Buffers): SPC toggles display of
4736 floating point registers.
4737
47382005-05-27 Jay Belanger <belanger@truman.edu>
4739
4740 * calc.texi (Queries in Keyboard Macros): Rewrite to reflect
4741 current behavior.
4742
47432005-05-27 Nick Roberts <nickrob@snap.net.nz>
4744
4745 * files.texi (Log Buffer): Merge in description of Log Edit
4746 mode from pcl-cvs.texi.
4747
47482005-05-26 Richard M. Stallman <rms@gnu.org>
4749
4750 * building.texi (Lisp Eval): C-M-x with arg runs Edebug.
4751
47522005-05-25 Jay Belanger <belanger@truman.edu>
4753
4754 * calc.texi: Change Calc version number throughout.
4755 (Keypad Mode): Change location in info output.
4756 (Keypad mode overview): Move picture of keypad.
4757
47582005-05-24 Luc Teirlinck <teirllm@auburn.edu>
4759
4760 * fixit.texi (Spelling): Delete confusing sentence; flyspell is
4761 not enabled by default.
4762 When not on a word, `ispell-word' by default checks the word
4763 before point.
4764
47652005-05-24 Nick Roberts <nickrob@snap.net.nz>
4766
4767 * building.texi (Debugger Operation): Simplify last sentence.
4768
47692005-05-23 Lute Kamstra <lute@gnu.org>
4770
4771 * emacs.texi: Update FSF's address throughout.
4772 (Preface): Use @cite.
4773 (Distrib): Add cross reference to the node "Copying". Mention the
4774 FDL. Don't refer to etc/{FTP,ORDERS}. Mention the sale of
4775 printed manuals.
4776 (Intro): Use @xref for the Emacs Lisp Intro.
4777
47782005-05-21 Jay Belanger <belanger@truman.edu>
4779
4780 * calc.texi (Storing variables): Mention that only most variables
4781 are void to begin with.
4782
47832005-05-21 Kevin Ryde <user42@zip.com.au>
4784
4785 * widget.texi (Basic Types): Update cross ref from "Enabling
4786 Mouse-1 to Follow Links" to "Links and Mouse-1" per recent
4787 lispref/text.texi change.
4788
47892005-05-20 Carsten Dominik <dominik@science.uva.nl>
4790
4791 * org.texi: Version 3.09.
4792
47932005-05-18 Carsten Dominik <dominik@science.uva.nl>
4794
4795 * reftex.texi: Version 4.28.
4796
47972005-05-18 Luc Teirlinck <teirllm@auburn.edu>
4798
4799 * buffers.texi (Select Buffer): Document `C-u M-g M-g'.
4800
4801 * basic.texi (Moving Point): Mention default for `goto-line'.
4802
4803 * programs.texi (Lisp Doc): Eldoc mode shows only the first line
4804 of a variable's docstring.
4805
48062005-05-18 Lute Kamstra <lute@gnu.org>
4807
4808 * maintaining.texi (Overview of Emerge): Add cross reference.
4809 Remove duplication.
4810
4811 * emacs.texi (Top): Update to the current structure of the manual.
4812 * misc.texi (Emacs Server): Add menu description.
4813 * files.texi (Saving): Fix menu.
4814 * custom.texi (Customization): Fix menu.
4815 * mule.texi (International): Fix menu.
4816 * kmacro.texi (Keyboard Macros): Fix menu.
4817
48182005-05-16 Luc Teirlinck <teirllm@auburn.edu>
4819
4820 * display.texi: Various minor changes.
4821 (Faces): Delete text that is repeated in the next section.
4822
48232005-05-16 Nick Roberts <nickrob@snap.net.nz>
4824
4825 * building.texi (Debugger Operation): Mention GUD tooltips are
4826 disabled with GDB in text command mode.
4827
48282005-05-16 Jay Belanger <belanger@truman.edu>
4829
4830 * calc.texi (Storing Variables): Mention `calc-copy-special-constant'.
4831
48322005-05-16 Nick Roberts <nickrob@snap.net.nz>
4833
4834 * building.texi: Replace toolbar with "tool bar" for consistency.
4835 (Compilation Mode): Describe compilation-context-lines
4836 and use of arrow in compilation buffer.
4837 (Debugger Operation): Replace help text with variable's value.
4838
4839 * frames.texi (Tooltips): Replace toolbar with "tool bar" for
4840 consistency.
4841
48422005-05-15 Luc Teirlinck <teirllm@auburn.edu>
4843
4844 * major.texi (Choosing Modes): normal-mode processes the -*- line.
4845 Add xref.
4846
48472005-05-14 Jay Belanger <belanger@truman.edu>
4848
4849 * calc.texi (Default Simplifications): Insert missing ! (logical
4850 not operator).
4851
48522005-05-14 Michael Albinus <michael.albinus@gmx.de>
4853
4854 Sync with Tramp 2.0.49.
4855
48562005-05-14 Luc Teirlinck <teirllm@auburn.edu>
4857
4858 * basic.texi (Moving Point): Mention `M-g g' binding for `goto-line'.
4859 (Position Info): Delete discussion of `goto-line'. It is already
4860 described in `Moving point'.
4861
4862 * mini.texi (Completion Commands): Correct reference.
4863 (Completion Options): Fix typo.
4864
4865 * killing.texi (Deletion): Complete description of `C-x C-o'.
4866
48672005-05-10 Jay Belanger <belanger@truman.edu>
4868
4869 * calc.texi (Default Simplifications): Mention that 0^0 simplifies
4870 to 1.
4871
48722005-05-10 Richard M. Stallman <rms@gnu.org>
4873
4874 * building.texi (Compilation): Clarify recompile's directory choice.
4875
4876 * frames.texi (Tooltips): Cleanups.
4877
4878 * basic.texi (Arguments): Fix punctuation.
4879
48802005-05-09 Luc Teirlinck <teirllm@auburn.edu>
4881
4882 * screen.texi (Menu Bar): The up and down (not left and right)
4883 arrow keys move through a keyboard menu.
4884
48852005-05-08 Luc Teirlinck <teirllm@auburn.edu>
4886
4887 * basic.texi: Various typo and grammar fixes.
4888 (Moving Point): C-a now runs move-beginning-of-line.
4889
48902005-05-08 Nick Roberts <nickrob@snap.net.nz>
4891
4892 * building.texi (Debugger Operation): Describe gud-tooltip-echo-area.
4893
4894 * frames.texi (Tooltips): Describe help tooltips and GUD tooltips
4895 as different animals.
4896
48972005-05-07 Luc Teirlinck <teirllm@auburn.edu>
4898
4899 * frames.texi (Mouse References): Clarify `mouse-1-click-follows-link'.
4900 Correct index entry.
4901
49022005-05-07 Nick Roberts <nickrob@snap.net.nz>
4903
4904 * building.texi (Debugger Operation): Update to reflect changes
4905 in GUD tooltips.
4906
49072005-04-30 Richard M. Stallman <rms@gnu.org>
4908
4909 * files.texi (Compressed Files): Auto Compression normally enabled.
4910
4911 * building.texi (Debugger Operation): Clarify previous change.
4912
49132005-04-29 Carsten Dominik <dominik@science.uva.nl>
4914
4915 * org.texi: Version 3.08, structure reorganized.
4916
49172005-04-28 Nick Roberts <nickrob@snap.net.nz>
4918
4919 * building.texi (Debugger Operation): Add description for
4920 GUD tooltips when program is not running.
4921
49222005-04-26 Luc Teirlinck <teirllm@auburn.edu>
4923
4924 * misc.texi (Shell): Add `Shell Prompts' to menu.
4925 (Shell Mode): Add xref to `Shell Prompts'. Clarify `C-c C-u'
4926 description. Delete remarks moved to new node.
4927 (Shell Prompts): New node.
4928 (History References): Replace remarks moved to `Shell Prompts'
4929 with xref to that node.
4930 (Remote Host): Clarify how to specify the terminal type when
4931 logging in to a different machine.
4932
49332005-04-26 Richard M. Stallman <rms@gnu.org>
4934
4935 * emacs.texi (Top): Update submenus from files.texi.
4936
4937 * files.texi (Filesets): Clarify previous change.
4938
4939 * dired.texi (Misc Dired Features): Clarify previous change.
4940
49412005-04-25 Chong Yidong <cyd@stupidchicken.com>
4942
4943 * ack.texi (Acknowledgments): Delete info about iso-acc.el.
4944
4945 * dired.texi (Misc Dired Features): Document
4946 dired-compare-directories.
4947
4948 * files.texi (Filesets): New node.
4949 (File Conveniences): Document Image mode.
4950
4951 * text.texi (TeX Print): Document tex-compile.
4952
49532005-04-25 Luc Teirlinck <teirllm@auburn.edu>
4954
4955 * frames.texi (Tooltips): Tooltip mode is enabled by default.
4956 Delete redundant reference to tooltip Custom group. It is
4957 referred too again in the next paragraph.
4958
49592005-04-24 Richard M. Stallman <rms@gnu.org>
4960
4961 * ack.texi: Delete info about lazy-lock.el and fast-lock.el.
4962
4963 * faq.texi: Delete info about lazy-lock.el and fast-lock.el.
4964
49652005-04-19 Kim F. Storm <storm@cua.dk>
4966
4967 * building.texi (Compilation Mode): Add M-g M-n and M-g M-p bindings.
4968
49692005-04-18 Lars Hansen <larsh@math.ku.dk>
4970
4971 * misc.texi (Saving Emacs Sessions): Add that "--no-desktop" now
4972 turns off desktop-save-mode.
4973
49742005-04-17 Luc Teirlinck <teirllm@auburn.edu>
4975
4976 * frames.texi (XTerm Mouse): Xterm Mouse mode is no longer enabled
4977 by default in terminals compatible with xterm. Mention that
4978 xterm-mouse-mode is a minor mode and put in pxref to Minor Modes
4979 node.
4980
49812005-04-15 Carsten Dominik <dominik@science.uva.nl>
4982
4983 * org.texi: Update to version 3.06.
4984
49852005-04-13 Lute Kamstra <lute@gnu.org>
4986
4987 * cc-mode.texi: Prevent creating an unnecessary empty cc-mode.ss file.
4988
49892005-04-12 Luc Teirlinck <teirllm@auburn.edu>
4990
4991 * frames.texi (XTerm Mouse): Xterm Mouse mode is now enabled by default.
4992
49932005-04-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
4994
4995 * xresources.texi (Table of Resources): Add cursorBlink.
4996
49972005-04-11 Luc Teirlinck <teirllm@auburn.edu>
4998
4999 * rmail.texi (Rmail Summary Edit): Explain numeric arguments to
5000 `d', `C-d' and `u'.
5001
50022005-04-11 Richard M. Stallman <rms@gnu.org>
5003
5004 * cmdargs.texi (Initial Options): -Q is now --quick, and does less.
5005 (Misc X): Add -D, --basic-display.
5006
5007 * maintaining.texi (Change Log): Correct the description of
5008 the example.
5009
5010 * major.texi (Choosing Modes): Document magic-mode-alist.
5011
50122005-04-10 Thien-Thi Nguyen <ttn@gnu.org>
5013
5014 * cl.texi (Porting Common Lisp): Fix typo.
5015
50162005-04-10 Luc Teirlinck <teirllm@auburn.edu>
5017
5018 * rmail.texi (Rmail Basics): Clarify description of `q' and `b'.
5019 (Rmail Deletion): `C-d' in RMAIL buffer does not accept a numeric arg.
5020 (Rmail Inbox): Give full name of `rmail-primary-inbox-list'.
5021 (Rmail Output): Clarify which statements apply to `o', `C-o' and
5022 `w', respectively.
5023 (Rmail Labels): Mention `l'.
5024 (Rmail Attributes): Correct pxref. Mention `stored' attribute.
5025 (Rmail Summary Edit): Describe `j' and RET.
5026
50272005-04-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
5028
5029 * xresources.texi (Lucid Resources): Add fontSet resource.
5030
50312005-04-06 Katsumi Yamaoka <yamaoka@jpl.org>
5032
5033 * gnus.texi (RSS): Addition.
5034
50352005-04-09 Luc Teirlinck <teirllm@auburn.edu>
5036
5037 * display.texi (Useless Whitespace): `indicate-unused-lines' is
5038 now called `indicate-empty-lines'.
5039
50402005-04-06 Kim F. Storm <storm@cua.dk>
5041
5042 * cmdargs.texi (Initial Options): Add --bare-bones alias for -Q.
5043
50442005-04-04 Luc Teirlinck <teirllm@auburn.edu>
5045
5046 * dired.texi (Dired Visiting): `dired-view-command-alist' has been
5047 deleted.
5048 (Marks vs Flags): Add some convenient key bindings.
5049 (Hiding Subdirectories): Delete redundant and inaccurate sentence.
5050 (Misc Dired Features): Correct and expand description of `w' command.
5051
5052 * frames.texi (XTerm Mouse): Delete apparently false info.
5053 The GNU/Linux console currently does not appear to support
5054 `xterm-mouse-mode'.
5055
50562005-04-04 Jay Belanger <belanger@truman.edu>
5057
5058 * calc.texi: Change Calc version number.
5059 (Customizable variables): Fix description of calc-language-alist.
5060 (Copying): Put in version 2 of GPL.
5061
50622005-04-03 Glenn Morris <gmorris@ast.cam.ac.uk>
5063
5064 * calendar.texi (Diary): Mention shell utility `calendar'.
5065
50662005-04-01 Richard M. Stallman <rms@gnu.org>
5067
5068 * cmdargs.texi (Misc X): Explain horizontal scroll bars don't exist.
5069
50702005-04-01 Jay Belanger <belanger@truman.edu>
5071
5072 * calc.texi (Troubleshooting Commands): Remove comment about
5073 installation.
5074 (Installation): Remove section.
5075 (Customizable Variables): New section.
5076 (Basic Embedded Mode, Customizing Embedded Mode, Graphics)
5077 (Graphical Devices): Add references to Customizable Variables.
5078
50792005-04-01 Lute Kamstra <lute@gnu.org>
5080
5081 * maintaining.texi (Change Log): add-change-log-entry uses
5082 add-log-mailing-address.
5083
50842005-03-31 Luc Teirlinck <teirllm@auburn.edu>
5085
5086 * files.texi (Reverting): Move `auto-revert-check-vc-info' to
5087 `VC Mode Line' and put in an xref to that node.
5088 (VC Mode Line): Move `auto-revert-check-vc-info' here and clarify
5089 its description.
5090
50912005-03-31 Paul Eggert <eggert@cs.ucla.edu>
5092
5093 * calendar.texi (Calendar Systems): Say that the Persian calendar
5094 implemented here is the arithmetical one championed by Birashk.
5095
50962005-03-30 Glenn Morris <gmorris@ast.cam.ac.uk>
5097
5098 * programs.texi (Fortran Motion): Fix previous change.
5099
51002005-03-25 Katsumi Yamaoka <yamaoka@jpl.org>
5101
5102 * emacs-mime.texi (Display Customization): Markup fixes.
5103 (rfc2047): Update.
5104
51052005-03-23 Reiner Steib <Reiner.Steib@gmx.de>
5106
5107 * gnus-faq.texi: Replaced with auto-generated version.
5108
51092005-03-29 Richard M. Stallman <rms@gnu.org>
5110
5111 * mule.texi (Single-Byte Character Support): Reinstall the C-x 8 info.
5112
51132005-03-29 Chong Yidong <cyd@stupidchicken.com>
5114
5115 * text.texi (Refill): Refer to Long Lines Mode.
5116 (Longlines): New node.
5117 (Auto Fill): Don't index "word wrap" here.
5118 (Filling): Add Longlines to menu.
5119
51202005-03-29 Richard M. Stallman <rms@gnu.org>
5121
5122 * xresources.texi: Minor fixes.
5123
5124 * misc.texi (Emacs Server): Fix Texinfo usage.
5125
5126 * emacs.texi (Top): Don't use a real section heading for
5127 "Detailed Node Listing". Fake it instead.
5128
5129 * basic.texi (Position Info): Minor cleanup.
5130
5131 * mule.texi (Input Methods): Minor cleanup.
5132
51332005-03-29 Glenn Morris <gmorris@ast.cam.ac.uk>
5134
5135 * programs.texi (ForIndent Vars): `fortran-if-indent' does other
5136 constructs as well.
5137 (Fortran Motion): Add fortran-end-of-block, fortran-beginning-of-block.
5138
51392005-03-29 Kenichi Handa <handa@m17n.org>
5140
5141 * mule.texi (Input Methods): Refer to the command C-u C-x =.
5142
5143 * basic.texi (Position Info): Update the description about the
5144 command C-u C-x =.
5145
51462005-03-28 Richard M. Stallman <rms@gnu.org>
5147
5148 * emacs.texi (Top): Use @section for the detailed node listing.
5149
5150 * calendar.texi: Minor fixes to previous change.
5151
5152 * programs.texi (Fortran): Small fixes to previous changes.
5153
5154 * emacs.texi (Top): Update list of subnodes of Dired.
5155 Likewise for building.texi.
5156
5157 * files.texi (File Conveniences): Delete Auto Image File mode.
5158
51592005-03-28 Chong Yidong <cyd@stupidchicken.com>
5160
5161 * building.texi (Flymake): New node.
5162
5163 * custom.texi (Function Keys): Document kp- event types and
5164 keypad-setup package.
5165
5166 * dired.texi (Wdired): New node.
5167
5168 * files.texi (File Conveniences): Reorder entries.
5169 Explain how to turn on Auto-image-file mode.
5170 Document Thumbs mode.
5171
5172 * mule.texi (Specify Coding): Document recode-region and
5173 recode-file-name.
5174
5175 * programs.texi (Program Modes): Add Conf mode and DNS mode.
5176
51772005-03-27 Luc Teirlinck <teirllm@auburn.edu>
5178
5179 * commands.texi (Keys): M-o is now a prefix key.
5180
51812005-03-27 Glenn Morris <gmorris@ast.cam.ac.uk>
5182
5183 * programs.texi: Reformat and update copyright years.
5184 (Fortran): Update section.
5185
51862005-03-26 Luc Teirlinck <teirllm@auburn.edu>
5187
5188 * files.texi: Several small changes in addition to:
5189 (Visiting): Change xref for Dialog Boxes to ref.
5190 (Version Headers): Replace references to obsolete var
5191 `vc-header-alist' with `vc-BACKEND-header'.
5192 (Customizing VC): Update value of `vc-handled-backends'.
5193
51942005-03-26 Glenn Morris <gmorris@ast.cam.ac.uk>
5195
5196 * emacs-xtra.texi (Advanced Calendar/Diary Usage): New section;
5197 move here from Emacs Lisp Reference Manual.
5198 * calendar.texi (Calendar/Diary, Diary Commands)
5199 (Special Diary Entries, Importing Diary): Change some xrefs to
5200 point to emacs-xtra rather than elisp.
5201
5202 * emacs-xtra.texi (Calendar Customizing):
5203 Move view-diary-entries-initially, view-calendar-holidays-initially,
5204 mark-diary-entries-in-calendar, mark-holidays-in-calendar to main
5205 Emacs Manual.
5206 (Appt Customizing): Merge entire section into main Emacs Manual.
5207 * calendar.texi (Holidays): Move view-calendar-holidays-initially,
5208 mark-holidays-in-calendar here from emacs-xtra.
5209 (Displaying the Diary): Move view-diary-entries-initially,
5210 mark-diary-entries-in-calendar here from emacs-xtra.
5211 (Appointments): Move appt-display-mode-line,
5212 appt-display-duration, appt-disp-window-function,
5213 appt-delete-window-function here from emacs-xtra.
5214
5215 * calendar.texi: Update and reformat copyright.
5216 Change all @xrefs to the non-printing emacs-xtra to @inforefs.
5217 (Calendar/Diary): Menu now only on Mouse-3, not C-Mouse-3.
5218 (Diary): Refer to `diary-file' rather than ~/diary.
5219 (Diary Commands): Rename node to "Displaying the Diary".
5220 * emacs.texi (Top): Rename "Diary Commands" section.
5221 * misc.texi (Hardcopy): Rename "Diary Commands" xref.
5222
52232005-03-26 Eli Zaretskii <eliz@gnu.org>
5224
5225 * misc.texi (Emacs Server): Fix the command for setting
5226 server-name. Add an xref to Invoking emacsclient.
5227
5228 * help.texi (Help Summary): Clarify when "C-h ." will do something
5229 nontrivial.
5230 (Apropos): Add cindex entry for apropos-sort-by-scores.
5231
5232 * display.texi (Text Display): Add index entries for how no-break
5233 characters are displayed.
5234
52352005-03-26 Stephan Stahl <stahl@eos.franken.de> (tiny change)
5236
5237 * dired-x.texi (Multiple Dired Directories): default-directory was
5238 renamed to dired-default-directory.
5239
52402005-03-26 Eli Zaretskii <eliz@gnu.org>
5241
5242 * files.texi (Visiting): Fix cross-references introduced with the
5243 last change.
5244
5245 * xresources.texi (GTK resources): Fix last change.
5246
52472005-03-26 Jay Belanger <belanger@truman.edu>
5248
5249 * calc.texi (Simplifying Formulas, Rewrite Rules):
5250 Change description of top and bottom of fraction.
5251 (Modulo Forms): Move description of how to create modulo forms to
5252 earlier in the section.
5253 (Fraction Mode): Suggest using : to get a fraction by dividing.
5254 (Basic Arithmetic): Adjust placement of command name.
5255 (Truncating the Stack): Emphasize that "hidden" entries are still
5256 visible.
5257 (Installation): Move discussion of printing manual to "About This
5258 Manual".
5259 (About This Manual): Mention how to print the manual.
5260 (Reporting Bugs): Remove first person.
5261 (Building Vectors): Add algebraic version of append.
5262 (Manipulating Vectors): Fix algebraic version of calc-reverse-vector.
5263 (Grouping Digits): Fix typo.
5264
52652005-03-25 Chong Yidong <cyd@stupidchicken.com>
5266
5267 * xresources.texi (X Resources): GTK options documented too.
5268 (Resources): Clarify meaning of program name.
5269 (Table of Resources): Add visualClass.
5270 (GTK resources): Rewrite.
5271 (GTK widget names, GTK Names in Emacs, GTK styles): Cleanups.
5272
5273 * display.texi (Text Display): Mention non-breaking spaces.
5274
5275 * files.texi (Reverting): Document auto-revert-check-vc-info.
5276
5277 * frames.texi (Mouse Commands): Document
5278 x-mouse-click-focus-ignore-position and mouse-drag-copy-region.
5279
5280 * help.texi (Help Summary): Add `C-h .'.
5281 (Apropos): Apropos accepts a list of search terms.
5282 Document apropos-sort-by-scores.
5283 (Help Echo): Document display-local-help.
5284
5285 * misc.texi (Emacs Server): Document server-name.
5286 (Invoking emacsclient): Document -s option for server names.
5287
5288 * text.texi (Outline Visibility): Introduce "current heading
5289 line" (commands can be called with point on a body line).
5290 Re-order table to follow the sequence of discussion.
5291 hide-body won't hide lines before first header line.
5292 (TeX Mode): Add DocTeX mode.
5293
52942005-03-25 Werner Lemberg <wl@gnu.org>
5295
5296 * calc.texi, cl.texi, gnus.texi, idlwave.texi, reftex.texi:
5297 Replace `legal' with `valid'.
5298
52992005-03-25 Werner Lemberg <wl@gnu.org>
5300
5301 * calc.texi, reftex.texi: Replace `illegal' with `invalid'.
5302
53032005-03-24 Jay Belanger <belanger@truman.edu>
5304
5305 * calc.texi (General Mode Commands)
5306 (Mode Settings in Embedded Mode): Add some explanation of
5307 recording mode settings.
5308
53092005-03-24 Richard M. Stallman <rms@gnu.org>
5310
5311 * mule.texi (Single-Byte Character Support): Delete mention
5312 of iso-acc.el and iso-transl.el.
5313
5314 * calc.texi: Remove praise of non-free software.
5315
5316 * idlwave.texi: Don't say where to get IDL or its non-free manual.
5317 (Installation): Node deleted.
5318
53192005-03-23 Lute Kamstra <lute@gnu.org>
5320
5321 * search.texi (Non-ASCII Isearch): Rename from Non-Ascii Isearch.
5322
53232005-03-23 Richard M. Stallman <rms@gnu.org>
5324
5325 * url.texi (HTTP language/coding): Improve last change.
5326
5327 * search.texi: Delete explicit node pointers.
5328 (Incremental Search): New menu.
5329 (Basic Isearch, Repeat Isearch, Error in Isearch)
5330 (Non-Ascii Isearch, Isearch Yank, Highlight Isearch, Isearch Scroll)
5331 (Slow Isearch): New subnodes.
5332 (Configuring Scrolling): Node deleted.
5333 (Search Case): Doc default-case-fold-search.
5334 (Regexp Replace): Move replace-regexp doc here.
5335
5336 * rmail.texi (Movemail): Put commas inside closequotes.
5337
5338 * picture.texi (Insert in Picture): Document C-c arrow combos.
5339 (Basic Picture): Clarify erasure.
5340
5341 * display.texi (Font Lock): Put commas inside closequotes.
5342
5343 * cmdargs.texi (General Variables): Put commas inside closequotes.
5344
53452005-03-23 Nick Roberts <nickrob@snap.net.nz>
5346
5347 * building.texi (Stack Buffer): Mention reverse contrast for
5348 *selected* frame (might not be current frame).
5349
53502005-03-22 Jay Belanger <belanger@truman.edu>
5351
5352 * calc.texi (Embedded Mode): Add new information on changing
5353 modes.
5354
53552005-03-21 Richard M. Stallman <rms@gnu.org>
5356
5357 * building.texi (Starting GUD): Add bashdb.
5358
53592005-03-20 Chong Yidong <cyd@stupidchicken.com>
5360
5361 * basic.texi (Moving Point): Add M-g M-g binding.
5362 (Undo): Document undo-only.
5363 (Position Info): Document M-g M-g and C-u M-g M-g.
5364
5365 * building.texi (Building): Put Grep Searching after Compilation
5366 Shell.
5367 (Compilation Mode): Document M-n, M-p, M-}, M-{, and C-c C-f bindings.
5368 Document next-error-highlight.
5369 (Grep Searching): Document grep-highlight-matches.
5370 (Lisp Eval): Typing C-x C-e twice prints integers specially.
5371
5372 * calendar.texi (Importing Diary): Rename node from iCalendar.
5373 Document diary-from-outlook.
5374
5375 * dired.texi (Misc Dired Features): Rename node from Misc Dired
5376 Commands.
5377 Mention effect of X drag and drop on Dired buffers.
5378
5379 * files.texi (Visiting): Document large-file-warning-threshold.
5380 Move paragraph on file-selection dialog.
5381 Mention visiting files using X drag and drop.
5382 (Reverting): Mention using Auto-Revert mode to tail files.
5383 Document auto-revert-tail-mode.
5384 (Version Systems): Minor correction.
5385 (Comparing Files): Diff-mode is no longer based on Compilation
5386 mode.
5387 Document compare-ignore-whitespace.
5388 (Misc File Ops): Explain passing a directory to rename-file.
5389 Likewise for copy-file and make-symbolic-link.
5390
5391 * frames.texi (Wheeled Mice): Mouse wheel support on by default.
5392 Document mouse-wheel-progressive speed.
5393
5394 * help.texi (Misc Help): Document numeric argument for C-h i.
5395 Correctly explain the effect of just C-u as argument.
5396
5397 * killing.texi (Deletion): Document numeric argument for
5398 just-one-space.
5399
5400 * mini.texi (Completion): Completion acts on text before point.
5401
5402 * misc.texi (Saving Emacs Sessions): Document desktop-restore-eager.
5403 (Emulation): CUA mode replaces pc-bindings-mode,
5404 pc-selection-mode, and s-region.
5405
5406 * mule.texi (Input Methods): Leim is now built-in.
5407 (Select Input Method): Document quail-show-key.
5408 (Specify Coding): Document revert-buffer-with-coding-system.
5409
5410 * programs.texi (Fortran Motion): Document f90-next-statement,
5411 f90-previous-statement, f90-next-block, f90-previous-block,
5412 f90-end-of-block, and f90-beginning-of-block.
5413
5414 * text.texi (Format Faces): Replace old M-g key prefix with M-o.
5415
5416 * emacs.texi (Acknowledgments): Updated.
5417
5418 * anti.texi: Total rewrite.
5419
54202005-03-20 Michael Albinus <michael.albinus@gmx.de>
5421
5422 Sync with Tramp 2.0.48.
5423
5424 * trampver.texi.in: Replace "Emacs" by "GNU Emacs".
5425
5426 * tramp.texi: Replace "Emacs" by "GNU Emacs". Replace "Linux" by
5427 "GNU/Linux". Change all addresses to .gnu.org.
5428 (Default Method): Offer shortened syntax for "su" and "sudo"
5429 methods.
5430
54312005-03-19 Chong Yidong <cyd@stupidchicken.com>
5432
5433 * ack.texi (Acknowledgments): Update.
5434
54352005-03-19 Eli Zaretskii <eliz@gnu.org>
5436
5437 * anti.texi (Antinews): Refer to Emacs 21.4, not 21.3. Update
5438 copyright years.
5439
54402005-03-14 Nick Roberts <nickrob@snap.net.nz>
5441
5442 * building.texi (Commands of GUD): Move paragraph on setting
5443 breakpoints with mouse to the GDB Graphical Interface node.
5444
54452005-03-07 Richard M. Stallman <rms@gnu.org>
5446
5447 * url.texi: Fix usage of "e.g.".
5448 (HTTP language/coding): Explain the rules for these strings.
5449
5450 * misc.texi (Single Shell, Shell Options): Fix previous change.
5451
5452 * building.texi (Debugger Operation): Update GUD tooltip enable info.
5453
54542005-03-06 Richard M. Stallman <rms@gnu.org>
5455
5456 * building.texi (Starting GUD): Don't explain text vs graphical
5457 GDB here. Just mention it and xref.
5458 Delete "just one debugger process".
5459 (Debugger Operation): Move GUD tooltip info here.
5460 (GUD Tooltips): Node deleted.
5461 (GDB Graphical Interface): Explain the two GDB modes here.
5462
5463 * woman.texi (Introduction): Minor cleanups.
5464
5465 * url.texi (HTTP language/coding): Get rid of "Emacs 21".
5466
5467 * sending.texi (Sending Mail): Minor cleanup.
5468 (Mail Aliases): Explain quoting conventions.
5469 Update key rebinding example.
5470 (Header Editing): C-M-i is like M-TAB.
5471 (Mail Mode Misc): mail-attach-file does not do MIME.
5472
5473 * rmail.texi (Rmail Inbox): Move text from Remote Mailboxes
5474 that really belongs here.
5475 (Remote Mailboxes): Text moved to Rmail Inbox.
5476 (Rmail Display): Mention Mouse-1.
5477 (Movemail): Clarify two movemail versions.
5478 Clarify rmail-movemail-program.
5479
5480 * pcl-cvs.texi (About PCL-CVS): Get rid of "Emacs 21".
5481 (Installation): Node deleted.
5482
5483 * misc.texi (Single Shell): Replace uudecode example with gpg example.
5484 Document async shell commands.
5485 (Shell History): Clarify.
5486 (Shell Ring): Mention C-UP an C-DOWN.
5487 (Shell Options): Add comint-prompt-read-only.
5488 (Invoking emacsclient): Set EDITOR to run Emacs.
5489 (Sorting): No need to explain what region is.
5490 (Saving Emacs Sessions): Fix typo.
5491 (Recursive Edit): Fix punctuation.
5492 (Emulation): Don't mention "PC bindings" which are standard.
5493 (Hyperlinking): Explain Mouse-1 convention here.
5494 (Find Func): Node deleted.
5495
5496 * mh-e.texi (Preface): Get rid of "Emacs 21".
5497
5498 * help.texi (Name Help): Xref to Hyperlinking.
5499
5500 * glossary.texi (Glossary):
5501 Rename "Balance Parentheses" to "Balancing...".
5502 Add "Byte Compilation". Correct "Copyleft".
5503 New xref in "Customization".
5504 Clarify "Current Line", "Echoing", "Fringe", "Frame", "Speedbar".
5505 Add "Graphical Terminal" "Keybinding", "Margin", "Window System".
5506 Rename "Registers" to "Register".
5507 Replace "Selecting" with "Selected Frame",
5508 "Selected Window", and "Selecting a Buffer".
5509
5510 * files.texi (Types of Log File): Explain how projects'
5511 methods can vary.
5512
5513 * eshell.texi (Installation): Delete node (for Emacs 20).
5514
5515 * display.texi (Faces): Delete "Emacs 21".
5516
5517 * custom.texi (Changing a Variable): C-M-i like M-TAB.
5518 * fixit.texi (Spelling): C-M-i like M-TAB.
5519 * mini.texi (Completion Options): C-M-i like M-TAB.
5520 * programs.texi (Symbol Completion): C-M-i like M-TAB.
5521 * text.texi (Text Mode): C-M-i like M-TAB.
5522
5523 * commands.texi (Keys): Mention F1 and F2 in list of prefixes.
5524
5525 * calendar.texi (Specified Dates): Mention `g w'.
5526 (Appointments): appt-activate toggles with no arg.
5527
55282005-03-05 Thien-Thi Nguyen <ttn@gnu.org>
5529
5530 * flymake.texi: Refill and tweak style in @lisp blocks.
5531
55322005-03-05 Juri Linkov <juri@jurta.org>
5533
5534 * cmdargs.texi (Emacs Invocation): Add cindex
5535 "invocation (command line arguments)"
5536 (Misc X): Add -nbc, --no-blinking-cursor.
5537
55382005-03-04 Ulf Jasper <ulf.jasper@web.de>
5539
5540 * calendar.texi (iCalendar): No need to require it now.
5541
55422005-03-03 Reiner Steib <Reiner.Steib@gmx.de>
5543
5544 * gnus.texi (Slow/Expensive Connection): Don't abbreviate "very".
5545
55462005-03-03 Nick Roberts <nickrob@snap.net.nz>
5547
5548 * trouble.texi (Contributing): Mention Savannah. Direct users to
5549 emacs-devel.
5550
55512005-03-01 Glenn Morris <gmorris@ast.cam.ac.uk>
5552
5553 * calendar.texi (Adding to Diary): Mention redrawing of calendar
5554 window.
5555
55562005-03-01 Jay Belanger <belanger@truman.edu>
5557
5558 * calc.texi (Trigonometric and Hyperbolic Functions):
5559 Mention additional functions.
5560 (Algebraic Simplifications): Mention additional simplifications.
5561
55622005-02-27 Richard M. Stallman <rms@gnu.org>
5563
5564 * building.texi (Compilation): Update mode line status info.
5565
55662005-02-27 Matt Hodges <MPHodges@member.fsf.org>
5567
5568 * calendar.texi (General Calendar): Document binding of
5569 scroll-other-window-down.
5570 (Mayan Calendar): Fix earliest date.
5571 (Time Intervals): Document timeclock-change.
5572 Fix timeclock-ask-before-exiting documentation.
5573
55742005-02-26 Kim F. Storm <storm@cua.dk>
5575
5576 * frames.texi (Mouse References):
5577 Add mouse-1-click-in-non-selected-windows.
5578
55792005-02-25 Richard M. Stallman <rms@gnu.org>
5580
5581 * screen.texi (Screen): Explain better about cursors and mode lines;
5582 don't presuppose text terminals.
5583 (Point): Don't assume just one cursor.
5584 Clarify explanation of cursors.
5585 (Echo Area, Menu Bar): Cleanups.
5586
5587 * mini.texi (Minibuffer): Prompts are highlighted.
5588 (Minibuffer Edit): Newline = C-j only on text terminals.
5589 Clarify resize-mini-windows values.
5590 Mention M-PAGEUP and M-PAGEDOWN.
5591 (Completion Commands): Mouse-1 like Mouse-2.
5592 (Minibuffer History): Explain history commands better.
5593 (Repetition): Add xref to Incremental Search.
5594
5595 * mark.texi (Setting Mark): Clarify info about displaying mark.
5596 Clarify explanation of C-@ and C-SPC.
5597 (Transient Mark): Mention Delete Selection mode.
5598 (Marking Objects): Clean up text about extending the region.
5599
5600 * m-x.texi (M-x): One C-g doesn't always go to top level.
5601 No delay before suggest-key-bindings output.
5602
5603 * fixit.texi (Fixit): Mention C-/ for undo.
5604 (Spelling): Mention ESC TAB like M-TAB.
5605 Replacement words with r and R are rechecked.
5606 Say where C-g leaves point. Mention ? as input.
5607
56082005-02-23 Lute Kamstra <lute@gnu.org>
5609
5610 * cmdargs.texi (Initial Options): Add cross reference.
5611
56122005-02-18 Jonathan Yavner <jyavner@member.fsf.org>
5613
5614 * ses.texi: Add concept/function/variable indices (this work was
5615 donated by Brad Collins <brad@chenla.org>, copyright-assignment
5616 papers on file at FSF).
5617
56182005-02-16 Luc Teirlinck <teirllm@auburn.edu>
5619
5620 * emacs.texi (Top): Update menu for splitting of node in
5621 msdog.texi.
5622 * frames.texi (Frames): Update xref for splitting of node in
5623 msdog.texi.
5624 * trouble.texi (Quitting): Ditto.
5625
56262005-02-16 Richard M. Stallman <rms@gnu.org>
5627
5628 * windows.texi (Split Window): Simplify line truncation info
5629 and xref to Display Custom.
5630
5631 * trouble.texi (Quitting): Emergency escape only for text terminal.
5632 (Screen Garbled): C-l for ungarbling is only for text terminal.
5633
5634 * text.texi (Text Mode): ESC TAB alternative for M-TAB.
5635
5636 * sending.texi (Header Editing): ESC TAB alternative for M-TAB.
5637
5638 * programs.texi (Program Modes): Mention Python mode.
5639 (Moving by Defuns): Repeating C-M-h extends region.
5640 (Basic Indent): Clarify.
5641 (Custom C Indent): Clarify.
5642 (Expressions): Repeating C-M-@ extends region.
5643 (Info Lookup): Clarify for C-h S.
5644 (Symbol Completion): ESC TAB alternative for M-TAB.
5645 (Electric C): Clarify.
5646
5647 * emacs.texi (Top): Update display.texi and frames.texi submenu data.
5648
5649 * msdog.texi (MS-DOS Keyboard, MS-DOS Mouse): Split from
5650 MS-DOS Input node.
5651 (MS-DOS Keyboard): Start with explaining DEL and BREAK.
5652 (MS-DOS and MULE): Clarify.
5653 (MS-DOS Processes, Windows Processes): Fix typos.
5654
5655 * major.texi (Choosing Modes): Clarify.
5656
5657 * kmacro.texi (Basic Keyboard Macro): Doc F3, F4.
5658 (Keyboard Macro Step-Edit): Clarify.
5659
5660 * indent.texi (Indentation): Clarifications.
5661
5662 * help.texi (Help): Correct error about C-h in query-replace.
5663 Clarify apropos vs C-h a. Fix how to search in FAQ.
5664 (Key Help): Describe C-h w here.
5665 (Name Help): Minor cleanup. C-h w moved to Key Help.
5666 Clarify the "object" joke.
5667 (Apropos): Clarify. Mouse-1 like Mouse-2.
5668 (Help Mode): Mouse-1 like Mouse-2.
5669
5670 * fixit.texi (Spelling): Mention ESC TAB as alt. for M-TAB.
5671
5672 * display.texi (Display): Reorder menu.
5673 (Faces): Cleanup.
5674 (Font Lock): Cleanup. Mention Options menu.
5675 Delete obsolete text.
5676 (Scrolling): For C-l, don't presume text terminal.
5677 (Horizontal Scrolling): Simplify intro.
5678 (Follow Mode): Clarify.
5679 (Cursor Display): Moved before Display Custom.
5680 (Display Custom): Explain no-redraw-on-reenter is for text terminals.
5681 Doc default-tab-width. Doc line truncation more thoroughly.
5682
5683 * dired.texi (Dired Enter): C-x C-f can run Dired.
5684 (Dired Visiting): Comment out `a' command.
5685 Mouse-1 is like Mouse-2.
5686 (Shell Commands in Dired): ? can be used more than once.
5687
5688 * basic.texi (Continuation Lines): Simplify description of truncation,
5689 and refer to Display Custom for the rest of it.
5690
56912005-02-10 Jay Belanger <belanger@truman.edu>
5692
5693 * calc.texi: Change @LaTeX to La@TeX throughout.
5694 Redefine @expr as @math for TeX output.
5695 Redefine @texline as a no-op for TeX output.
5696 Define @tfn, replace @t by @tfn throughout.
5697
56982005-02-09 Jay Belanger <belanger@truman.edu>
5699
5700 * calc.texi: Add macro for LaTeX for info output.
5701
57022005-02-08 Kim F. Storm <storm@cua.dk>
5703
5704 * texinfo.tex (LaTex): Add def.
5705
57062005-02-06 Jay Belanger <belanger@truman.edu>
5707
5708 * calc.texi (TeX Language Mode): Add mention of LaTeX mode, and
5709 change name to "TeX and LaTeX Language Modes." Mention LaTeX mode
5710 throughout manual.
5711
57122005-02-06 Lute Kamstra <lute@gnu.org>
5713
5714 * basic.texi (Undo): Fix typo.
5715
5716 * cmdargs.texi (Emacs Invocation): Fix typo.
5717
5718 * custom.texi (Init Examples): Fix typo.
5719
5720 * abbrevs.texi (Expanding Abbrevs): Fix typo.
5721
57222005-02-06 Richard M. Stallman <rms@gnu.org>
5723
5724 * regs.texi (Registers): Registers can hold numbers, too.
5725
5726 * killing.texi (Other Kill Commands): Cleanup.
5727 Delete redundant explanation of kill in read-only buffer.
5728 (Yanking): Mention term "copying".
5729 (Accumulating Text): Fix typo.
5730
5731 * entering.texi (Entering Emacs): Update rationale at start.
5732 (Exiting): Treat iconifying on a par with suspension.
5733
5734 * custom.texi (Minor Modes): Fix typo.
5735 (Easy Customization): Fix menu style.
5736 (Variables): Add xref.
5737 (Examining): Setting for future sessions works through .emacs.
5738 (Keymaps): "Text terminals", not "Many".
5739 (Init Rebinding): Explain \C-. Show example of \M-.
5740 Fix minor wording errors.
5741 (Function Keys): Explain vector syntax just once.
5742 (Named ASCII Chars): Clarify history of TAB/C-i connection.
5743 (Init File): Mention .emacs.d directory.
5744 (Init Examples): Add xref.
5745 (Find Init): Mention .emacs.d directory.
5746
5747 * cmdargs.texi (Emacs Invocation): +LINENUM is also an option.
5748 (Action Arguments): Explain which kinds of -l args are found how.
5749 (Initial Options): --batch does not inhibit site-start.
5750 Add xrefs.
5751 (Command Example): Use --batch, not -batch.
5752
5753 * basic.texi (Inserting Text): Cleanup wording.
5754 (Moving Point): Doc PRIOR, PAGEUP, NEXT, PAGEDOWN more systematically.
5755 C-n is not error at end of buffer.
5756 (Undo): Doc C-/ like C-_. Add xrefs.
5757 (Arguments): META key may be labeled ALT.
5758 Peculiar arg meanings are explained in doc strings.
5759
5760 * abbrevs.texi (Expanding Abbrevs): Clarify.
5761
57622005-02-05 Eli Zaretskii <eliz@gnu.org>
5763
5764 * frames.texi (Frame Parameters): Add an xref to the description
5765 of list-colors-display. Add a pointer to the X docs about colors.
5766
5767 * cmdargs.texi (Colors): Mention 16-, 88- and 256-color modes.
5768 Impove docs of list-colors-display.
5769
57702005-02-03 Lute Kamstra <lute@gnu.org>
5771
5772 * frames.texi (Frames, Drag and Drop): Fix typos.
5773
57742005-02-03 Richard M. Stallman <rms@gnu.org>
5775
5776 * windows.texi (Basic Window): Mention color-change in mode line.
5777 (Change Window): Explain dragging vertical boundaries.
5778
5779 * text.texi (Sentences): Clarify.
5780 (Paragraphs): Explain M-a and blank lines.
5781 (Outline Mode): Clarify text and menu.
5782 (Hard and Soft Newlines): Mention use-hard-newlines.
5783
5784 * frames.texi (Frames): Delete unnecessary mention of Windows.
5785 (Mouse Commands): Likewise. Mention xterm mouse support.
5786 (Clipboard): Clarify.
5787 (Mouse References): Mention use of Mouse-1 for following links.
5788 (Menu Mouse Clicks): Clarify.
5789 (Mode Line Mouse): Clarify.
5790 (Drag and Drop): Rewrite.
5791
5792 * fixit.texi (Spelling): Fix typo.
5793
5794 * files.texi (File Names): Clarify.
5795 (Visiting): Update conditions for use of file dialog. Clarify.
5796 (Saving): Doc d as answer in save-some-buffers.
5797 (Remote Files): Clean up the text.
5798
5799 * dired.texi (Misc Dired Commands): Delete dired-marked-files.
5800
5801 * buffers.texi (Select Buffer): Doc next-buffer and prev-buffer.
5802 (List Buffers): Clarify.
5803 (Several Buffers): Doc T command.
5804 (Buffer Convenience): Clarify menu.
5805
5806 * basic.texi (Undo): Clarify last change.
5807
58082005-02-02 Matt Hodges <MPHodges@member.fsf.org>
5809
5810 * fixit.texi (Spelling): Fix typo.
5811
58122005-02-01 Luc Teirlinck <teirllm@auburn.edu>
5813
5814 * basic.texi (Undo): Update description of `undo-outer-limit'.
5815
58162005-02-01 Nick Roberts <nickrob@snap.net.nz>
5817
5818 * building.texi: Update documentation relating to GDB Graphical
5819 Interface.
5820
58212005-01-30 Luc Teirlinck <teirllm@auburn.edu>
5822
5823 * custom.texi (Easy Customization): Adapt menu to node name change.
5824
58252005-01-30 Richard M. Stallman <rms@gnu.org>
5826
5827 * custom.texi (Easy Customization): Defn of "User Option" now
5828 includes faces. Don't say just "option" when talking about variables.
5829 Do say just "options" to mean "anything customizable".
5830 (Specific Customization): Describe `customize-variable',
5831 not `customize-option'.
5832
5833 * glossary.texi (Glossary) <Faces>: Add xref.
5834 <User Option>: Change definition--include faces. Change xref.
5835
5836 * picture.texi (Picture): Mention artist.el.
5837
5838 * sending.texi, screen.texi, programs.texi, misc.texi:
5839 * mini.texi, major.texi, maintaining.texi, macos.texi:
5840 * help.texi, frames.texi, files.texi:
5841 Don't say just "option" when talking about variables.
5842
5843 * display.texi, mule.texi: Don't say just "option" when talking
5844 about variables. Other minor cleanups.
5845
58462005-01-28 Lars Magne Ingebrigtsen <larsi@gnus.org>
5847
5848 * gnus.texi: Some edits based on comments from David Abrahams.
5849
58502005-01-24 Katsumi Yamaoka <yamaoka@jpl.org>
5851
5852 * gnus.texi (RSS): Fix the keystroke.
5853
58542005-01-26 Lute Kamstra <lute@gnu.org>
5855
5856 * cmdargs.texi (Initial Options): Add a cross reference to `Init
5857 File'. Mention the `-Q' option at the `--no-site-file' option.
5858
58592005-01-24 David Kastrup <dak@gnu.org>
5860
5861 * faq.texi: Update AUCTeX version info.
5862
58632005-01-16 Xavier Maillard <zedek@gnu-rox.org> (tiny change)
5864
5865 * gnus-faq.texi ([4.1]): Typo.
5866
58672005-01-22 David Kastrup <dak@gnu.org>
5868
5869 * building.texi (Grep Searching): Mention alias `find-grep' for
5870 `grep-find'.
5871
58722005-01-20 Richard M. Stallman <rms@gnu.org>
5873
5874 * calendar.texi (Time Intervals): Delete special stuff for MS-DOS.
5875
58762005-01-19 Jay Belanger <belanger@truman.edu>
5877
5878 * calc.texi (Keep Arguments): Mention that keeping arguments
5879 doesn't work with keyboard macros.
5880
58812005-01-16 Richard M. Stallman <rms@gnu.org>
5882
5883 * autotype.texi (Autoinserting): Fix small error.
5884
58852005-01-16 Michael Albinus <michael.albinus@gmx.de>
5886
5887 Sync with Tramp 2.0.47.
5888
5889 * tramp.texi (Compilation): New section, describing compilation of
5890 remote files.
5891
58922005-01-15 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5893
5894 * rmail.texi (Movemail): Explain differences
5895 between standard and mailutils versions of movemail.
5896 Describe command line and configuration options introduced
5897 with the latter.
5898 Explain the notion of mailbox URL, provide examples and
5899 cross-references to mailutils documentation.
5900 Describe various methods of specifying mailbox names,
5901 user names and user passwords for rmail.
5902 (Remote Mailboxes): New section. Describe
5903 how movemail handles remote mailboxes. Describe configuration
5904 options used to control its behavior.
5905 (Other Mailbox Formats): Explain handling of various mailbox
5906 formats.
5907
59082005-01-13 Richard M. Stallman <rms@gnu.org>
5909
5910 * commands.texi (Commands): Clarification.
5911
59122005-01-11 Richard M. Stallman <rms@gnu.org>
5913
5914 * programs.texi (Multi-line Indent): Fix previous change.
5915 (Fortran Autofill): Simplify description of fortran-auto-fill-mode.
5916
59172005-01-11 Kim F. Storm <storm@cua.dk>
5918
5919 * widget.texi (Basic Types): Add :follow-link keyword.
5920
59212005-01-09 Jay Belanger <belanger@truman.edu>
5922
5923 * calc.texi (Basic Commands): Describe new behavior of calc-reset.
5924
59252005-01-08 Richard M. Stallman <rms@gnu.org>
5926
5927 * display.texi (Faces): isearch-lazy-highlight-face renamed to
5928 lazy-highlight.
5929
5930 * search.texi (Query Replace): Mention faces query-replace
5931 and lazy-highlight.
5932 (Incremental Search): Update isearch highlighting info.
5933
59342005-01-08 Jay Belanger <belanger@truman.edu>
5935
5936 * calc.texi: Change throughout to reflect new default value of
5937 calc-settings-file.
5938
59392005-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
5940
5941 * message.texi (Reply): `message-reply-to-function' should return
5942 a list. Suggested by ARISAWA Akihiro <ari@mbf.ocn.co.jp>.
5943
59442005-01-06 Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp> (tiny change)
5945
5946 * faq.texi (Changing load-path): Fix typo.
5947
59482005-01-05 Jay Belanger <belanger@truman.edu>
5949
5950 * calc.texi (Programming Tutorial): Replace kbd command by
5951 appropriate characters for a keyboard macro.
5952
59532005-01-04 Jay Belanger <belanger@truman.edu>
5954
5955 * calc.texi (Basic Tutorial, Programming Tutorial): Remove caveats
5956 for Lucid Emacs.
5957 (Programming Tutorial): Mention that the user needs to be in the
5958 right mode to compute some functions.
5959
59602005-01-04 Richard M. Stallman <rms@gnu.org>
5961
5962 * custom.texi (Saving Customizations): Minor improvement.
5963
59642005-01-04 Jay Belanger <belanger@truman.edu>
5965
5966 * calc.texi (Rewrite rules): Remove an exercise (on 0^0) which is
5967 no longer applicable.
5968
59692005-01-03 Luc Teirlinck <teirllm@auburn.edu>
5970
5971 * custom.texi (Saving Customizations): Emacs no longer loads
5972 `custom-file' after .emacs. No longer mention customizing through
5973 Custom.
5974
59752005-01-01 Jay Belanger <belanger@truman.edu>
5976
5977 * calc.texi (Programming Tutorial): Changed description of how to
5978 edit keyboard macros to match current behavior.
5979
59802005-01-01 Andreas Schwab <schwab@suse.de>
5981
5982 * killing.texi (Graphical Kill): Move up under node Killing,
5983 change @section to @subsection.
5984
59852005-01-01 Richard M. Stallman <rms@gnu.org>
5986
5987 * custom.texi (Face Customization): Mention hex color specs.
5988
5989 * emacs.texi (Top): Update Killing submenu.
5990
5991 * killing.texi (Killing): Reorganize section.
5992 No more TeX-only text; put the node command at start of chapter.
5993 But the first section heading is used only in TeX.
5994 Rewrite the text to read better in this mode.
5995 (Graphical Kill): New subnode gets some of the text that
5996 used to be in the first section.
5997
59982004-12-31 Richard M. Stallman <rms@gnu.org>
5999
6000 * dired.texi (Shell Commands in Dired): Delete the ? example.
6001
6002 * display.texi (Scrolling): Correct scroll-preserve-screen-position.
6003
6004 * files.texi (Saving): Describe new require-final-newline features
6005 and mode-require-final-newline.
6006
60072004-12-31 Jay Belanger <belanger@truman.edu>
6008
6009 * calc.texi: Mention C-cC-c as the way to finish editing throughout.
6010
60112004-12-29 Richard M. Stallman <rms@gnu.org>
6012
6013 * custom.texi (File Variables): Clarify previous change.
6014
60152004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6016
6017 * frames.texi (Dialog Boxes): Mention Gtk+ 2.6 also, as that version is
6018 out now.
6019
60202004-12-27 Richard M. Stallman <rms@gnu.org>
6021
6022 * Makefile.in (MAKEINFO): Specify --force.
6023
6024 * basic.texi (Moving Point): C-e now runs move-end-of-line.
6025 (Undo): Doc undo-outer-limit.
6026
60272004-12-20 Jay Belanger <belanger@truman.edu>
6028
6029 * calc.texi (Types Tutorial): Emphasize that you can't divide by
6030 zero.
6031
60322004-12-17 Luc Teirlinck <teirllm@auburn.edu>
6033
6034 * cc-mode.texi (Text Filling and Line Breaking): Put period after
6035 @xref.
6036 (Font Locking): Avoid @strong{Note:}.
6037
60382004-12-17 Michael Albinus <michael.albinus@gmx.de>
6039
6040 Sync with Tramp 2.0.46.
6041
6042 * tramp.texi (bottom): Add arch-tag. It was lost, somehow.
6043
60442004-12-16 Luc Teirlinck <teirllm@auburn.edu>
6045
6046 * url.texi: Correct typos.
6047 (Retrieving URLs): @var{nil}->@code{nil}.
6048 (HTTP language/coding, mailto): Replace "GNU Emacs Manual" with
6049 the standard "The GNU Emacs Manual" in fifth argument of @xref's.
6050 (Dealing with HTTP documents): @inforef->@xref.
6051
60522004-12-15 Juri Linkov <juri@jurta.org>
6053
6054 * mark.texi (Transient Mark, Mark Ring): M-< and other
6055 movement commands don't set mark in Transient Mark mode
6056 if mark is active.
6057
60582004-12-15 Jay Belanger <belanger@truman.edu>
6059
6060 * calc.texi: Consistently capitalized all mode names.
6061 (Answers to Exercises): Mention that an answer can be a fraction
6062 when in Fraction mode.
6063
60642004-12-13 Jay Belanger <belanger@truman.edu>
6065
6066 * calc.texi: Fix some TeX definitions.
6067
60682004-12-12 Juri Linkov <juri@jurta.org>
6069
6070 * misc.texi (FFAP): Add C-x C-r, C-x C-v, C-x C-d,
6071 C-x 4 r, C-x 4 d, C-x 5 r, C-x 5 d.
6072
6073 * dired.texi (Dired Navigation): Add @r{(Dired)} to M-g.
6074 (Misc Dired Commands): Add @r{(Dired)} to w.
6075
60762004-12-12 Juri Linkov <juri@jurta.org>
6077
6078 * mark.texi (Marking Objects): Marking commands also extend the
6079 region when mark is active in Transient Mark mode.
6080
60812004-12-09 Luc Teirlinck <teirllm@auburn.edu>
6082
6083 * reftex.texi (Imprint): Remove erroneous @value's.
6084
60852004-12-08 Luc Teirlinck <teirllm@auburn.edu>
6086
6087 * custom.texi (Saving Customizations): Emacs only loads the custom
6088 file automatically after the init file in version 22.1 or later.
6089 Adapt text and examples to this fact.
6090
6091 * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, $(infodir)/org)
6092 (org.dvi, $(infodir)/url, url.dvi, clean): Add org and url manuals.
6093
60942004-12-08 Jay Belanger <belanger@truman.edu>
6095
6096 * calc.texi (Starting Calc): Remove comment about installation.
6097 (Keypad Mode Overview): Remove comment about Emacs 19 support.
6098
60992004-12-08 Luc Teirlinck <teirllm@auburn.edu>
6100
6101 * url.texi: Update @setfilename.
6102 (Getting Started): No need to worry about Gnus versions.
6103 (Dealing with HTTP documents): Use @inforef.
6104
6105 * org.texi: Fix @direntry file name.
6106
61072004-12-07 Luc Teirlinck <teirllm@auburn.edu>
6108
6109 * frames.texi (Scroll Bars): The option `scroll-bar-mode' has to
6110 be set through Custom. Otherwise, it has no effect.
6111
61122004-12-07 Stefan <monnier@iro.umontreal.ca>
6113
6114 * url.texi: New file.
6115
6116 * Makefile.in (INFO_TARGETS, DVI_TARGETS, ../info/url, url.dvi): Add it.
6117
61182004-12-06 Jay Belanger <belanger@truman.edu>
6119
6120 * calc.texi (Using Calc): Remove paragraph about installation.
6121
61222004-12-06 Jay Belanger <belanger@truman.edu>
6123
6124 * calc.texi: Use more Texinfo macros and less TeX defs.
6125 Remove @refill's.
6126
61272004-12-06 Richard M. Stallman <rms@gnu.org>
6128
6129 * org.texi: New file.
6130
61312004-12-05 Richard M. Stallman <rms@gnu.org>
6132
6133 * cmdargs.texi, doclicense.texi, xresources.texi, emacs.texi:
6134 * entering.texi: Rename Command Line to Emacs Invocation.
6135
6136 * Makefile.in (org.dvi, ../info/org): New targets.
6137 (INFO_TARGETS): Add ../info/org.
6138 (DVI_TARGETS): Add org.dvi.
6139 (maintainer-clean): Remove the info files in the info dir.
6140
6141 * misc.texi (Term Mode): Correcty describe C-c.
6142
6143 * custom.texi (Easy Customization): Move up to section level,
6144 before Variables. Avoid using the term "variable"; say "option".
6145 New initial explanation.
6146 (Variables): In initial explanation, connect "variable" to the
6147 already-explained "user option".
6148
6149 * emacs.texi (Top): Fix ref to Command Line.
6150 Move reference to Easy Customization.
6151
6152 * xresources.texi (X Resources): Fix From link.
6153
6154 * doclicense.texi (GNU Free Documentation License): Fix To link.
6155
6156 * entering.texi (Entering Emacs): Fix xref, now to Command Line.
6157
6158 * cmdargs.texi (Command Line): Node renamed from Command Arguments.
6159
61602004-12-03 Richard M. Stallman <rms@gnu.org>
6161
6162 * cmdargs.texi (Initial Options): Clarify batch mode i/o.
6163
61642004-12-01 Luc Teirlinck <teirllm@auburn.edu>
6165
6166 * kmacro.texi: Several small changes in addition to the following.
6167 (Keyboard Macro Ring): Describe behavior of `C-x C-k C-k' when
6168 defining a keyboard macro.
6169 Mention `kmacro-ring-max'.
6170 (Keyboard Macro Counter): Clarify description of
6171 `kmacro-insert-counter', `kmacro-set-counter',
6172 `kmacro-add-counter' and `kmacro-set-format'.
6173
61742004-11-29 Reiner Steib <Reiner.Steib@gmx.de>
6175
6176 * custom.texi (File Variables): Add `unibyte' and make it more
6177 clear that `unibyte' and `coding' are special. Suggested by Simon
6178 Krahnke <overlord@gmx.li>.
6179
6180 * mule.texi (Enabling Multibyte): Refer to File Variables.
6181 Suggested by Simon Krahnke <overlord@gmx.li>.
6182
61832004-11-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6184
6185 * frames.texi (Dialog Boxes): Rename use-old-gtk-file-dialog to
6186 x-use-old-gtk-file-dialog.
6187
61882004-11-26 Eli Zaretskii <eliz@gnu.org>
6189
6190 * idlwave.texi: Fix the setfilename directive to put the produced
6191 file in ../info.
6192 (Continued Statement Indentation): Resurrect Jan D.'s change from
6193 2004-11-03 that was lost when a newer version of idlwave.texi was
6194 imported.
6195
61962004-11-20 Richard M. Stallman <rms@gnu.org>
6197
6198 * text.texi (Fill Prefix): M-q doesn't apply fill prefix to first line.
6199
62002004-11-09 Lars Brinkhoff <lars@nocrew.org>
6201
6202 * building.texi (Lisp Eval): Delete hyphen in section name.
6203
62042004-11-19 Thien-Thi Nguyen <ttn@gnu.org>
6205
6206 * files.texi (Old Versions):
6207 No longer document annotation as "CVS only".
6208
62092004-11-10 Andre Spiegel <spiegel@gnu.org>
6210
6211 * files.texi (Version Control): Rewrite the introduction about
6212 version systems, mentioning the new ones that we support. Thanks
6213 to Alex Ott, Karl Fogel, Stefan Monnier, and David Kastrup for
6214 suggestions.
6215
62162004-12-08 Reiner Steib <Reiner.Steib@gmx.de>
6217
6218 * gnus-faq.texi ([5.1]): Added missing bracket.
6219
6220 * gnus.texi (Filtering Spam Using The Spam ELisp Package): Index
6221 `spam-initialize'.
6222
62232004-11-22 Reiner Steib <Reiner.Steib@gmx.de>
6224
6225 * message.texi (Various Message Variables): Mention that all mail
6226 file variables are derived from `message-directory'.
6227
6228 * gnus.texi (Splitting Mail): Clarify bogus group.
6229
62302004-11-02 Katsumi Yamaoka <yamaoka@jpl.org>
6231
6232 * emacs-mime.texi (Encoding Customization): Fix
6233 mm-coding-system-priorities entry.
6234
62352004-11-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6236
6237 * frames.texi (Dialog Boxes):
6238 * idlwave.texi (Continued Statement Indentation):
6239 * reftex.texi (Options (Index Support)):
6240 (Displaying and Editing the Index, Table of Contents):
6241 * speedbar.texi (Creating a display, Major Display Modes): Replace
6242 non-nil with non-@code{nil}.
6243
62442004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6245
6246 * frames.texi (Dialog Boxes): Document use-old-gtk-file-dialog.
6247
62482004-10-23 Eli Zaretskii <eliz@gnu.org>
6249
6250 * text.texi (Text Based Tables, Table Definition)
6251 (Table Creation, Table Recognition, Cell Commands)
6252 (Cell Justification, Row Commands, Column Commands)
6253 (Fixed Width Mode, Table Conversion, Measuring Tables)
6254 (Table Misc): New nodes, documenting the Table Mode.
6255
62562004-10-21 Jay Belanger <belanger@truman.edu>
6257
6258 * calc.texi (Algebraic-Style Calculations): Removed a comment.
6259
62602004-10-19 Jason Rumney <jasonr@gnu.org>
6261
6262 * makefile.w32-in (info): Change order of arguments to makeinfo.
6263
62642004-10-19 Ulf Jasper <ulf.jasper@web.de>
6265
6266 * calendar.texi (iCalendar): Update for package changes.
6267
62682004-10-18 Luc Teirlinck <teirllm@auburn.edu>
6269
6270 * calc.texi (Reporting Bugs): Double up `@'.
6271
62722004-10-18 Jay Belanger <belanger@truman.edu>
6273
6274 * calc.texi (Reporting Bugs): Changed the address that bugs
6275 should be sent to.
6276
62772004-10-15 Reiner Steib <Reiner.Steib@gmx.de>
6278
6279 * gnus.texi (New Features): Add 5.11.
6280
6281 * message.texi (Resending): Remove wrong default value.
6282
6283 * gnus.texi (Mail Source Specifiers): Describe possible problems
6284 of `pop3-leave-mail-on-server'. Add `pop3-movemail' and
6285 `pop3-leave-mail-on-server' to the index.
6286
62872004-10-15 Katsumi Yamaoka <yamaoka@jpl.org>
6288
6289 * message.texi (Canceling News): Add how to set a password.
6290
62912004-10-12 Jay Belanger <belanger@truman.edu>
6292
6293 * calc.texi (Help Commands): Changed the descriptions of
6294 calc-describe-function and calc-describe-variable to match their
6295 current behavior.
6296
62972004-10-12 Reiner Steib <Reiner.Steib@gmx.de>
6298
6299 * gnus-faq.texi ([5.9]): Improve code for reply-in-news.
6300
63012004-10-12 Michael Albinus <michael.albinus@gmx.de>
6302
6303 Sync with Tramp 2.0.45.
6304
6305 * tramp.texi (Frequently Asked Questions): Comment paragraph about
6306 plink link. The URL is outdated. Originator contacted for
6307 clarification.
6308
63092004-10-10 Juri Linkov <juri@jurta.org>
6310
6311 * gnus.texi (Top, Marking Articles): Join two menus in one node
6312 because a node can have only one menu.
6313
63142004-10-09 Luc Teirlinck <teirllm@auburn.edu>
6315
6316 * files.texi (Misc File Ops): View mode is a minor mode.
6317
63182004-10-09 Juri Linkov <juri@jurta.org>
6319
6320 * gnus.texi (Fancy Mail Splitting): Remove backslash in the
6321 example of nnmail-split-fancy.
6322
63232004-10-08 Glenn Morris <gmorris@ast.cam.ac.uk>
6324
6325 * calendar.texi (iCalendar): Style changes.
6326
63272004-10-07 Luc Teirlinck <teirllm@auburn.edu>
6328
6329 * search.texi (Regexps): The regexp described in the example is no
6330 longer stored in the variable `sentence-end'.
6331
63322004-10-06 Karl Berry <karl@gnu.org>
6333
6334 * info.texi (@kbd{1}--@kbd{9}): No space around --, for
6335 consistency with other uses of dashes.
6336
63372004-10-06 Nick Roberts <nickrob@snap.net.nz>
6338
6339 * building.texi (Starting GUD): Note that multiple debugging
6340 sessions requires `gdb --fullname'.
6341
63422004-10-05 Ulf Jasper <ulf.jasper@web.de>
6343
6344 * calendar.texi (iCalendar): New section for a new package.
6345
63462004-10-05 Karl Berry <karl@gnu.org>
6347
6348 * info.texi: Consistently use --- throughout, periods at end of
6349 menu descriptions, and a couple typos.
6350
63512004-10-05 Luc Teirlinck <teirllm@auburn.edu>
6352
6353 * text.texi: Various small changes in addition to the following.
6354 (Text): Replace xref for autotype with inforef.
6355 (Sentences): Explain nil value for `sentence-end'.
6356 (Paragraphs): Update default values for `paragraph-start' and
6357 `paragraph-separate'.
6358 (Text Mode): Correct description of Text mode's effect on the
6359 syntax table.
6360 (Outline Visibility): `hide-other' does not hide top level headings.
6361 `selective-display-ellipses' no longer has an effect on Outline mode.
6362 (TeX Misc): Add missing @cindex.
6363 Replace xref for RefTeX with inforef.
6364 (Requesting Formatted Text): The variable
6365 `enriched-fill-after-visiting' no longer exists.
6366 (Editing Format Info): Update names of menu items and commands.
6367 (Format Faces): Mention special effect of specifying the default face.
6368 Describe inheritance of text properties.
6369 Correct description of `fixed' face.
6370 (Format Indentation): Correct description of effect of setting
6371 margins. Mention `set-left-margin' and `set-right-margin'.
6372 (Format Justification): Update names of menu items.
6373 `set-justification-full' is now bound to `M-j b'.
6374 Mention that `default-justification' is a per buffer variable.
6375 (Format Properties): Update name of menu item.
6376 (Forcing Enriched Mode): `format-decode-buffer' automatically
6377 turns on Enriched mode if the buffer is in text/enriched format.
6378
63792004-10-05 Emilio C. Lopes <eclig@gmx.net>
6380
6381 * calendar.texi (From Other Calendar): Add calendar-goto-iso-week.
6382
63832004-09-28 Kim F. Storm <storm@cua.dk>
6384
6385 * display.texi (Display Custom) <indicate-buffer-boundaries>:
6386 Align with new functionality.
6387
63882004-09-26 Jesper Harder <harder@ifa.au.dk>
6389
6390 * sieve.texi (Manage Sieve API): nil -> @code{nil}.
6391 * pgg.texi (User Commands, Backend methods): Do.
6392 * gnus.texi: Markup fixes.
6393 (Setting Process Marks): Fix `M P a' entry.
6394 * emacs-mime.texi: Fixes.
6395
63962004-09-23 Reiner Steib <Reiner.Steib@gmx.de>
6397
6398 * gnus-faq.texi ([5.12]): Fix code example for FQDN in Message-Ids
6399 again.
6400 Use 5.10 instead of 5.10.0.
6401
64022004-09-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6403
6404 * gnus.texi (Summary Mail Commands): S D e.
6405
64062004-09-20 Raymond Scholz <ray-2004@zonix.de> (tiny change)
6407
6408 * gnus.texi (Misc Article): Refer to `Summary Buffer Mode Line' in
6409 the gnus-article-mode-line-format section.
6410
64112004-09-20 Helmut Waitzmann <Helmut.Waitzmann@web.de> (tiny change)
6412
6413 * gnus.texi (Various Summary Stuff): Fix the documentation for
6414 gnus-newsgroup-variables.
6415
64162004-09-20 Reiner Steib <Reiner.Steib@gmx.de>
6417
6418 * gnus.texi (MIME Commands): Added
6419 gnus-mime-display-multipart-as-mixed,
6420 gnus-mime-display-multipart-alternative-as-mixed,
6421 gnus-mime-display-multipart-related-as-mixed.
6422 (Mail Source Customization): Clarify `mail-source-directory'.
6423 (Splitting Mail): Mention gnus-group-find-new-groups.
6424 (SpamOracle): Fixed typo.
6425
6426 * gnus-faq.texi: Untabify.
6427 ([6.3]): nnir.el is in contrib directory.
6428
6429 * message.texi (News Headers): Clarify how a unique ID is created.
6430
6431 * gnus.texi (Batching Agents): Fixed typo in example. Reported
6432 by Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp>.
6433
64342004-09-20 Andre Srinivasan <andre@e2open.com>
6435
6436 * gnus.texi (Group Parameters): Added more on hooks. (Small
6437 change.)
6438
64392004-09-20 Florian Weimer <fw@deneb.enyo.de>
6440
6441 * gnus.texi (Charsets): Point to relevant section in emacs-mime.
6442
64432004-09-22 Luc Teirlinck <teirllm@auburn.edu>
6444
6445 * display.texi (Display Custom): Remove stray `@end defvar'.
6446
64472004-09-23 Kim F. Storm <storm@cua.dk>
6448
6449 * display.texi (Display Custom): Add `overflow-newline-into-fringe',
6450 `indicate-buffer-boundaries' and `default-indicate-buffer-boundaries'.
6451
64522004-09-22 Jay Belanger <belanger@truman.edu>
6453
6454 * calc.texi (Vectors as Lists): Added a warning that the tutorial
6455 might be hidden during part of the session.
6456
64572004-09-20 Jay Belanger <belanger@truman.edu>
6458
6459 * calc.texi (Notations Used in This Manual): Put in an earlier
6460 mention that DEL could be called Backspace.
6461
64622004-09-20 Richard M. Stallman <rms@gnu.org>
6463
6464 * custom.texi (Hooks): Explain using setq to clear out a hook.
6465 (File Variables): Explain multiline string constants.
6466 (Non-ASCII Rebinding): Explain when you need to update
6467 non-ASCII char codes in .emacs.
6468
6469 * building.texi (Compilation): Explain how to make a silent
6470 subprocess that won't be terminated. Explain compilation-environment.
6471
64722004-09-13 Kim F. Storm <storm@cua.dk>
6473
6474 * mini.texi (Repetition): Rename isearch-resume-enabled to
6475 isearch-resume-in-command-history and change default to disabled.
6476
64772004-09-10 Simon Josefsson <jas@extundo.com>
6478
6479 * gnus.texi (IMAP): Add example. Suggested and partially written
6480 by Steinar Bang <sb@dod.no>.
6481
64822004-09-10 Teodor Zlatanov <tzz@lifelogs.com>
6483
6484 * gnus.texi (IMAP): Add comments about imaps synonym to imap in
6485 netrc syntax.
6486
64872004-09-10 Teodor Zlatanov <tzz@lifelogs.com>
6488
6489 * gnus.texi (Spam ELisp Package Sequence of Events): Some clarifications.
6490 (Spam ELisp Package Global Variables): More clarifications.
6491
64922004-09-10 Teodor Zlatanov <tzz@lifelogs.com>
6493
6494 * gnus.texi (Spam ELisp Package Filtering of Incoming Mail):
6495 Mention spam-split does not modify incoming mail.
6496
64972004-09-10 Teodor Zlatanov <tzz@lifelogs.com>
6498
6499 * gnus.texi (Spam ELisp Package Sequence of Events): Fix typo.
6500
65012004-09-10 Eli Zaretskii <eliz@gnu.org>
6502
6503 * Makefile.in (../info/gnus, gnus.dvi): Depend on gnus-faq.texi.
6504
65052004-09-09 Kim F. Storm <storm@cua.dk>
6506
6507 * kmacro.texi (Save Keyboard Macro): Replace `name-last-kbd-macro'
6508 with new `kmacro-name-last-macro'.
6509
65102004-09-09 Reiner Steib <Reiner.Steib@gmx.de>
6511
6512 * makefile.w32-in (sieve, pgg): Use $(infodir).
6513
65142004-09-08 Juri Linkov <juri@jurta.org>
6515
6516 * mini.texi (Minibuffer History): Add `history-delete-duplicates'.
6517
65182004-09-08 Dhruva Krishnamurthy <dhruva.krishnamurthy@gmail.com> (tiny change)
6519
6520 * makefile.w32-in: Fix PGG and Sieve entries.
6521
65222004-09-03 Juri Linkov <juri@jurta.org>
6523
6524 * search.texi (Incremental Search): Update wording for M-%.
6525
65262004-09-02 Luc Teirlinck <teirllm@auburn.edu>
6527
6528 * killing.texi (Killing): Correct description of kill commands in
6529 read-only buffer.
6530
65312004-09-02 Teodor Zlatanov <tzz@lifelogs.com>
6532
6533 * building.texi (Compilation Mode): Add a paragraph about rules
6534 for finding the compilation buffer for `next-error'.
6535
6536 * search.texi (Other Repeating Search): Mention that Occur mode
6537 supports the next-error functionality.
6538
65392004-09-02 Juri Linkov <juri@jurta.org>
6540
6541 * search.texi (Regexp Replace): Add missing backslash to \footnote.
6542
65432004-08-31 Luc Teirlinck <teirllm@auburn.edu>
6544
6545 * kmacro.texi (Basic Keyboard Macro):
6546 `apply-macro-to-region-lines' now operates on all lines that begin
6547 in the region, rather than on all complete lines in the region.
6548
65492004-08-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6550
6551 * frames.texi (Drag and drop): Add documentation about
6552 x-dnd-test-function and x-dnd-known-types.
6553
65542004-08-30 Luc Teirlinck <teirllm@auburn.edu>
6555
6556 * indent.texi: Various minor changes in addition to:
6557 (Indentation Commands): Correct description of `indent-relative'.
6558 (Tab Stops): <TAB> is no longer bound to `tab-to-tab-stop' in Text
6559 mode. The *Tab Stops* buffer uses Overwrite Mode.
6560 (Just Spaces): `tabify' converts sequences of at least two spaces
6561 to tabs.
6562
65632004-08-28 Eli Zaretskii <eliz@gnu.org>
6564
6565 * faq.texi (Emacs for MS-DOS): Update URLs for the MS-DOS port of
6566 Emacs and related programs.
6567
65682004-08-27 Luc Teirlinck <teirllm@auburn.edu>
6569
6570 * frames.texi (Secondary Selection): Setting the secondary
6571 selection with M-Drag-Mouse-1 does not alter the kill ring,
6572 setting it with M-Mouse-1 and M-Mouse-3 does.
6573 (Mode Line Mouse): C-Mouse-2 on scroll bar now also works for
6574 toolkit scroll bars.
6575 (Scroll Bars): Ditto.
6576
6577 * windows.texi (Basic Window): When using a window system, the value
6578 of point in a non-selected window is indicated by a hollow box.
6579 (Split Window): Side by side windows are separated by a scroll bar,
6580 if scroll bars are used.
6581 C-Mouse-2 on scroll bar now also works for toolkit scroll bars.
6582 (Change Window): Correct Mouse-2 vs Mouse-3 mess-up.
6583 (Window Convenience): Update bindings for `winner-undo' and
6584 `winner-redo'.
6585
6586 * ack.texi (Acknowledgments): Use `@unnumbered'.
6587 * misc.texi : Adapt sectioning in Info to the node structure.
6588 (Invoking emacsclient): Make "Invoking emacsclient" a subsection
6589 of "Using Emacs as a Server".
6590 * building.texi (Building): Interchange nodes (for correct numbering).
6591 * programs.texi (Programs): Interchange nodes (for correct numbering).
6592 * killing.texi, entering.texi, commands.texi: Adapt sectioning in
6593 Info to the node structure.
6594 * emacs.texi: Make "GNU GENERAL PUBLIC LICENSE" an appendix.
6595 Rearrange order of nodes and sections such that both "GNU GENERAL
6596 PUBLIC LICENSE" and "GNU Free Documentation License" appear at the
6597 end, as appropriate for appendices.
6598 (Acknowledgments): Put inside @iftex instead of @ifnotinfo.
6599 Use `@unnumberedsec'.
6600 * trouble.texi: Adapt sectioning in Info to the node structure.
6601 Adapt node pointers to change in emacs.texi.
6602 * cmdargs.texi, doclicense.texi: Adapt node pointers.
6603
66042004-08-27 Richard M. Stallman <rms@gnu.org>
6605
6606 * faq.texi: Fix texinfo usage, esp. doublequotes.
6607 (Difference between Emacs and XEmacs): Some clarification.
6608
6609 * faq.texi (Difference between Emacs and XEmacs):
6610 Explain not to contrast XEmacs with GNU Emacs.
6611
66122004-08-26 Richard M. Stallman <rms@gnu.org>
6613
6614 * faq.texi (Difference between Emacs and XEmacs): Rewrite.
6615
66162004-08-25 Kenichi Handa <handa@m17n.org>
6617
6618 * custom.texi (Non-ASCII Rebinding): Fix and simplify the
6619 description for unibyte mode.
6620
66212004-08-23 Luc Teirlinck <teirllm@auburn.edu>
6622
6623 * display.texi (Font Lock): Correct invalid (for hardcopy) @xref.
6624
6625 * search.texi (Regexps): Correct cryptic (in hardcopy) @ref.
6626 (Configuring Scrolling): Correct invalid (for hardcopy) @xref.
6627 (Regexp Replace): Standardize reference to hardcopy Elisp Manual
6628 in @pxref.
6629
66302004-08-22 Luc Teirlinck <teirllm@auburn.edu>
6631
6632 * kmacro.texi (Keyboard Macro Counter, Keyboard Macro Step-Edit):
6633 Change section names.
6634
66352004-08-22 David Kastrup <dak@gnu.org>
6636
6637 * reftex.texi (AUCTeX): Update links, section name.
6638
6639 * faq.texi (Calc): Update availability (included in 22.1).
6640 (AUCTeX): Update availability, information, versions, description.
6641
66422004-08-21 Luc Teirlinck <teirllm@auburn.edu>
6643
6644 * kmacro.texi (Keyboard Macro Ring): Rename section.
6645 Emacs treats the head of the macro ring as the `last keyboard macro'.
6646 (Keyboard Macro Counter): Minor change.
6647 (Save Keyboard Macro): Some clarifications.
6648 (Edit Keyboard Macro): Rename section.
6649
6650 * buffers.texi (Buffers): Maximum buffer size is now 256M on
6651 32-bit machines.
6652 (Several Buffers): Clarify which buffer is selected if `2' is
6653 pressed in the Buffer Menu.
6654 Auto Revert mode can be used to update the Buffer Menu
6655 automatically.
6656
66572004-08-21 Eli Zaretskii <eliz@gnu.org>
6658
6659 * help.texi (Misc Help): Add an index entry for finding an Info
6660 manual by its file name.
6661
66622004-08-20 Luc Teirlinck <teirllm@auburn.edu>
6663
6664 * files.texi (Backup Deletion): Correct description of
6665 `delete-old-versions'.
6666 (Time Stamps): `time-stamp' needs to be added to `before-save-hook'.
6667 (Auto Save Files): Recommend `auto-save-mode' to reenable
6668 auto-saving, rather than the abbreviation `auto-save'.
6669
66702004-08-17 Luc Teirlinck <teirllm@auburn.edu>
6671
6672 * emacs.texi (Top): Mention "cutting" and "pasting" as synonyms
6673 for "killing" and "yanking" in main menu.
6674
66752004-08-16 Richard M. Stallman <rms@gnu.org>
6676
6677 * killing.texi (Yanking, Killing): Minor cleanups.
6678
6679 * mark.texi (Momentary Mark): Minor cleanups.
6680
66812004-08-15 Kenichi Handa <handa@etl.go.jp>
6682
6683 * custom.texi (Non-ASCII Rebinding):
6684 C-q always inserts the right code to pass to global-set-key.
6685
66862004-08-14 Eli Zaretskii <eliz@gnu.org>
6687
6688 * Makefile.in (../info/tramp, tramp.dvi): Depend on trampver.texi.
6689
66902004-08-13 Luc Teirlinck <teirllm@auburn.edu>
6691
6692 * regs.texi (RegNumbers): Mention `C-x r i' binding for
6693 `insert-register', instead of `C-x r g' binding, for consistency.
6694
66952004-08-12 Luc Teirlinck <teirllm@auburn.edu>
6696
6697 * fixit.texi (Spelling): Fix typo.
6698
66992004-08-11 Luc Teirlinck <teirllm@auburn.edu>
6700
6701 * help.texi (Help): Fix Texinfo usage.
6702
67032004-08-11 Martin Stjernholm <bug-cc-mode@gnu.org>
6704
6705 * cc-mode.texi: Various updates for CC Mode 5.30.9.
6706
67072004-08-10 Michael Albinus <michael.albinus@gmx.de>
6708
6709 Sync with Tramp 2.0.44.
6710
67112004-08-05 Lars Hansen <larsh@math.ku.dk>
6712
6713 * widget.texi (User Interface): Update how to separate the
6714 editable field of an editable-field widget from other widgets.
6715 (Programming Example): Add text after field.
6716
67172004-07-24 Richard M. Stallman <rms@gnu.org>
6718
6719 * text.texi (Paragraphs): Update how paragraphs are separated
6720 and the default for paragraph-separate.
6721
6722 * search.texi (Regexp Replace): Further update text for new
6723 replacement operators.
6724
67252004-08-31 Katsumi Yamaoka <yamaoka@jpl.org>
6726
6727 * emacs-mime.texi (Encoding Customization): Add a note to the
6728 mm-content-transfer-encoding-defaults entry.
6729 (rfc2047): Update.
6730
6731 * gnus.texi (Article Highlighting): Add
6732 gnus-cite-ignore-quoted-from.
6733 (POP before SMTP): New node.
6734 (Posting Styles): Addition.
6735 (Splitting Mail): Add nnmail-split-lowercase-expanded.
6736 (Fancy Mail Splitting): Ditto.
6737 (X-Face): Add gnus-x-face.
6738
67392004-08-30 Reiner Steib <Reiner.Steib@gmx.de>
6740
6741 * emacs-mime.texi, gnus-faq.texi, gnus.texi, message.texi,
6742 * pgg.texi, sieve.texi: Use @copying and @insertcopying.
6743
67442004-08-22 Reiner Steib <Reiner.Steib@gmx.de>
6745
6746 * gnus.texi (Mail Source Specifiers): Describe
6747 `pop3-leave-mail-on-server'.
6748
67492004-08-02 Reiner Steib <Reiner.Steib@gmx.de>
6750
6751 * Makefile.in, makefile.w32-in: Added PGG and Sieve files.
6752
6753 * pgg.texi, sieve.texi: Import from the v5_10 branch of the Gnus
6754 repository. Change setfilename.
6755
6756 * emacs-mime.texi, gnus-faq.texi, gnus.texi, message.texi: Ditto.
6757
67582004-07-18 Luc Teirlinck <teirllm@auburn.edu>
6759
6760 * emacs-xtra.texi (Subdir switches): Dired does not remember the
6761 `R' switch.
6762
6763 * dired.texi (Dired Updating): `k' only deletes inserted
6764 subdirectories from the Dired buffer if a prefix argument was given.
6765
6766 * search.texi (Regexps): Delete redundant definition of `symbol' in
6767 description of `\_>'. It already occurs in the description of `\_<'.
6768
67692004-07-02 Juri Linkov <juri@jurta.org>
6770
6771 * pcl-cvs.texi (Viewing differences): Add `d r'.
6772
67732004-07-01 Juri Linkov <juri@jurta.org>
6774
6775 * search.texi (Incremental Search): Add C-M-w, C-M-y, M-%, C-M-%, M-e.
6776 (Regexp Search): Add M-r.
6777
67782004-06-30 Luc Teirlinck <teirllm@auburn.edu>
6779
6780 * makefile.w32-in (EMACSSOURCES): Remove emacs-xtra.
6781
67822004-06-29 Jesper Harder <harder@ifa.au.dk>
6783
6784 * ses.texi, viper.texi, search.texi, flymake.texi, faq.texi:
6785 * eshell.texi, ediff.texi, calendar.texi: Markup fixes.
6786
67872004-06-25 Richard M. Stallman <rms@gnu.org>
6788
6789 * search.texi (Regexp Replace): Rewrite description of \# \, and \?.
6790
67912004-06-25 David Kastrup <dak@gnu.org>
6792
6793 * search.texi (Regexp Replace): Some typo corrections and
6794 rearrangement.
6795
67962004-06-24 David Kastrup <dak@gnu.org>
6797
6798 * search.texi (Unconditional Replace): Use replace-string instead
6799 of query-replace in example.
6800 (Regexp Replace): Add explanations for `\,', `\#' and `\?'
6801 sequences.
6802 (Query Replace): Correct explanation of `^' which does not use
6803 the mark stack.
6804
68052004-06-21 Nick Roberts <nickrob@gnu.org>
6806
6807 * misc.texi (Shell History Copying): Document comint-insert-input.
6808 (Shell Ring): Describe comint-dynamic-list-input-ring here.
6809
68102004-06-21 Karl Berry <karl@gnu.org>
6811
6812 * info.texi (Top): Mention that only Emacs has mouse support.
6813 (Getting Started): Mention this in a few other places.
6814
68152004-06-20 Jesper Harder <harder@ifa.au.dk>
6816
6817 * msdog.texi (Text and Binary, MS-DOS Printing): Use m-dash.
6818 * custom.texi (Customization): Do.
6819 * anti.texi (Antinews): Do.
6820 * abbrevs.texi (Defining Abbrevs): Do.
6821
6822 * programs.texi (Info Lookup): Fix keybinding for
6823 info-lookup-symbol.
6824
68252004-06-16 Juanma Barranquero <lektu@terra.es>
6826
6827 * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, EMACSSOURCES):
6828 Add emacs-xtra.
6829 ($(infodir)/emacs-xtra, emacs-xtra.dvi): New dependencies.
6830 (clean): Add emacs-xtra and flymake. Remove redundancies.
6831
68322004-06-15 Luc Teirlinck <teirllm@auburn.edu>
6833
6834 * Makefile.in (INFO_TARGETS, DVI_TARGETS, ../info/emacs-xtra):
6835 Add emacs-xtra.
6836 * emacs-xtra.texi: New file.
6837
68382004-06-14 Luc Teirlinck <teirllm@auburn.edu>
6839
6840 * dired.texi (Dired Enter): Mention conditions on `ls' switches.
6841 (Dired and Find): Mention differences with ordinary Dired buffers.
6842
68432004-06-13 Luc Teirlinck <teirllm@auburn.edu>
6844
6845 * autotype.texi (Copyrights, Timestamps): Recommend
6846 `before-save-hook' instead of `write-file-functions'.
6847
68482004-06-13 Richard M. Stallman <rms@gnu.org>
6849
6850 * custom.texi (Init Syntax): Explain about vars that do special
6851 things when set with setq or with Custom.
6852 (Init Examples): Add line-number-mode example.
6853
68542004-06-13 Lars Hansen <larsh@math.ku.dk>
6855
6856 * dired-x.texi (dired-mark-omitted): Update keybinding.
6857
68582004-06-12 Juri Linkov <juri@jurta.org>
6859
6860 * dired.texi (Operating on Files): Add dired-do-touch.
6861
68622004-06-10 Kim F. Storm <storm@cua.dk>
6863
6864 * pcl-cvs.texi (Viewing differences): Add 'd y'.
6865
68662004-06-10 Juri Linkov <juri@jurta.org>
6867
6868 * building.texi (Lisp Eval): Add C-M-x on defface.
6869
68702004-06-08 Luc Teirlinck <teirllm@auburn.edu>
6871
6872 * files.texi (Reverting): Auto-Revert mode and
6873 Global Auto-Revert mode no longer revert remote files.
6874
68752004-06-05 Lars Hansen <larsh@math.ku.dk>
6876
6877 * dired-x.texi (variable dired-omit-mode): Rename from
6878 dired-omit-files-p.
6879 (function dired-omit-mode): Rename from dired-omit-toggle.
6880 Call dired-omit-mode rather than set dired-omit-files-p.
6881 (dired-mark-omitted): Describe command.
6882
68832004-05-29 Michael Albinus <michael.albinus@gmx.de>
6884
6885 Version 2.0.41 of Tramp released.
6886
68872004-05-29 Juanma Barranquero <lektu@terra.es>
6888
6889 * makefile.w32-in (../info/flymake, flymake.dvi): New targets.
6890 (INFO_TARGETS, DVI_TARGETS): Add Flymake.
6891
68922004-05-29 Richard M. Stallman <rms@gnu.org>
6893
6894 * custom.texi (Init File): Two dashes start --no-site-file.
6895
6896 * cl.texi (Top): Call this chapter `Introduction'.
6897 (Overview): In TeX, no section heading here.
6898
6899 * cc-mode.texi: Put commas after i.e. and e.g. Minor cleanups.
6900
69012004-05-29 Alan Mackenzie <acm@muc.de>
6902
6903 * programs.texi: Update for CC Mode 5.30 and incidental amendments.
6904 ("AWK"): Is consistently thus spelt throughout.
6905 (AWK, Pike): Document as "C-like modes".
6906 (@kbd{M-j}): Document as alternative to @kbd{C-M-j}.
6907 (M-x man): Supersedes M-x manual-entry.
6908 Add numerous index entries. Correct "ESC a/e" to "M-a/e".
6909
6910 ("Comments in C"): Delete node; the info is in CC Mode manual.
6911 (c-comment-only-line-offset): Remove description.
6912
6913 (C-c ., C-c C-c): Describe new C Mode bindings.
6914
6915 (C-u TAB, indent-code-rigidly, c-indent-exp, c-tab-always-indent)
6916 (@dfn{Style}, c-default-style, comment-column, comment-padding)
6917 (c-up-conditional, c-beginning-of-statement, c-end-of-statement):
6918 Amend definitions.
6919
6920 (c-beginning-of-defun, c-end-of-defun, c-context-line-break):
6921 Describe functions.
6922
6923 (c-comment-start-regexp, c-hanging-comment-ender-p)
6924 (c-hanging-comment-starter-p): Remove obsolete definitions.
6925
6926 * emacs.texi: Remove the menu entry "Comments in C".
6927
69282004-05-29 Eli Zaretskii <eliz@gnu.org>
6929
6930 * Makefile.in (../info/flymake, flymake.dvi): New targets.
6931 (INFO_TARGETS, DVI_TARGETS): Add Flymake.
6932
69332004-05-29 Pavel Kobiakov <pk_at_work@yahoo.com>
6934
6935 * flymake.texi: New file.
6936
69372004-05-28 Simon Josefsson <jas@extundo.com>
6938
6939 * smtpmail.texi (Authentication): Improve STARTTLS discussion.
6940
69412004-05-27 Luc Teirlinck <teirllm@auburn.edu>
6942
6943 * dired.texi (Dired and Find): `find-ls-option' does not apply to
6944 `M-x locate'.
6945
69462004-05-16 Karl Berry <karl@gnu.org>
6947
6948 * emacs.texi (ack.texi) [@ifnottex]: Change condition; with @ifinfo,
6949 makeinfo --html fails.
6950 * help.texi (Help Summary) [@ifnottex]: Likewise.
6951
69522004-05-13 Nick Roberts <nickrob@gnu.org>
6953
6954 * building.texi (GDB Graphical Interface): Update and describe
6955 layout first.
6956
69572004-05-07 Kai Grossjohann <kai@emptydomain.de>
6958
6959 Version 2.0.40 of Tramp released.
6960
69612004-04-25 Michael Albinus <Michael.Albinus@alcatel.de>
6962
6963 Complete rework, based on review by Karl Berry <karl@gnu.org>.
6964
6965 * tramp.texi (Auto-save and Backup): Explain exploitation of new
6966 variables `tramp-backup-directory-alist' and
6967 `tramp-bkup-backup-directory-info'.
6968 (Overview, Connection types)
6969 (External transfer methods, Default Method)
6970 (Windows setup hints): Remove restriction of password entering
6971 with external methods.
6972 (Auto-save and Backup): Make file name example
6973 (X)Emacs neutral. In case of XEmacs, `bkup-backup-directory-info'
6974 and `auto-save-directory' must be used.
6975 (Frequently Asked Questions): Use "MS Windows NT/2000/XP" (not
6976 only "NT"). Remove doubled entry "What kinds of systems does
6977 @tramp{} work on".
6978 (tramp): Macro removed.
6979 (Obtaining Tramp): Flag removed from title.
6980 (all): "tramp-" and "-" removed from flag names. Flags `tramp'
6981 and `trampver' used properly. Flag `tramp-inst' replaced by
6982 `installchapter'. Installation related text adapted.
6983
69842004-05-04 Jason Rumney <jasonr@gnu.org>
6985
6986 * makefile.w32-in: Revert last change.
6987
69882004-05-03 Jason Rumney <jasonr@gnu.org>
6989
6990 * makefile.w32-in (MULTI_INSTALL_INFO, ENVADD): Use forward slashes.
6991
69922004-04-28 Masatake YAMATO <jet@gyve.org>
6993
6994 * widget.texi (Programming Example): Remove overlays.
6995
69962004-04-27 Jesper Harder <harder@ifa.au.dk>
6997
6998 * faq.texi, viper.texi, dired-x.texi, autotype.texi: lisp -> Lisp.
6999
70002004-04-23 Juanma Barranquero <lektu@terra.es>
7001
7002 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
7003
70042004-04-18 Juri Linkov <juri@jurta.org>
7005
7006 * fixit.texi (Spelling): Remove file extension from ispell xref.
7007
70082004-04-15 Kim F. Storm <storm@cua.dk>
7009
7010 * cmdargs.texi (Initial Options): Add -Q.
7011
70122004-04-05 Kim F. Storm <storm@cua.dk>
7013
7014 * custom.texi (File Variables): Add safe-local-eval-forms.
7015
70162004-04-05 Jesper Harder <harder@ifa.au.dk>
7017
7018 * info.texi (Info Search): Add info-apropos.
7019
70202004-04-02 Luc Teirlinck <teirllm@auburn.edu>
7021
7022 * files.texi (Reverting): Correct description of revert-buffer's
7023 handling of point.
7024
70252004-03-22 Juri Linkov <juri@jurta.org>
7026
7027 * emacs.texi (Top): Add `Misc X'.
7028
7029 * faq.texi, trouble.texi: Fix help key bindings.
7030
7031 * glossary.texi: Improve references.
7032
7033 * help.texi: Sync keywords with finder.el.
7034
7035 * mini.texi (Completion): Add description for menu items.
7036
7037 * misc.texi (Browse-URL, FFAP): Add information about keywords.
7038
7039 * sending.texi (Mail Methods): Fix xref to Message manual.
7040
70412004-03-17 Luc Teirlinck <teirllm@auburn.edu>
7042
7043 * info.texi (Advanced): Replace @unnumberedsubsec by @subheading
7044 (as suggested by Karl Berry). Update information about colored
7045 stars in menus. Add new subheading describing M-n.
7046
70472004-03-12 Richard M. Stallman <rms@gnu.org>
7048
7049 * cl.texi (Top): Rename top node's title.
7050
7051 * buffers.texi (Misc Buffer): Add index entry for rename-uniquely.
7052
70532004-03-08 Karl Berry <karl@gnu.org>
7054
7055 * info.texi: \input texinfo.tex instead of just texinfo, to avoid
7056 problems making the texinfo distribution.
7057
70582004-03-04 Richard M. Stallman <rms@gnu.org>
7059
7060 * search.texi (Regexps): Explain that ^ and $ have their
7061 special meanings only in certain contexts.
7062
7063 * programs.texi (Expressions): Doc C-M-SPC as alias for C-M-@.
7064
7065 * mule.texi (Specify Coding): Doc C-x RET F.
7066
7067 * buffers.texi (Misc Buffer): Explain use of M-x rename-uniquely
7068 for multiple compile and grep buffers.
7069 (Indirect Buffers): Don't recommand clone-indirect-buffer
7070 for multiple compile and grep buffers.
7071
70722004-02-29 Simon Josefsson <jas@extundo.com>
7073
7074 * smtpmail.texi (Authentication): Changed the list of supported
7075 authentication mechanisms from CRAM-MD5, PLAIN and LOGIN-MD5 to
7076 CRAM-MD5 and LOGIN, tiny patch from Andreas Voegele
7077 <voegelas@gmx.net>.
7078
70792004-02-29 Juanma Barranquero <lektu@terra.es>
7080
7081 * makefile.w32-in (mostlyclean, clean, maintainer-clean):
7082 Use $(DEL) instead of rm, and ignore exit code.
7083
70842004-02-29 Kai Grossjohann <kgrossjo@eu.uu.net>
7085
7086 Tramp version 2.0.39 released.
7087
70882004-02-29 Michael Albinus <Michael.Albinus@alcatel.de>
7089
7090 * tramp.texi (Customizing Completion): Explain new functions
7091 `tramp-parse-shostkeys' and `tramp-parse-sknownhosts'.
7092 (all): Savannah URLs unified to "http://savannah.nongnu.org".
7093 (Top): Refer to Savannah mailing list as the major one. Mention
7094 older mailing lists in HTML mode only.
7095 (Auto-save and Backup): Add auto-save. Based on wording of Kai.
7096 (Frequently Asked Questions): Remote hosts must not be Unix-like
7097 for "smb" method.
7098 (Password caching): New node.
7099 (External transfer methods): Refer to password caching for "smb"
7100 method.
7101
71022004-02-23 Nick Roberts <nick@nick.uklinux.net>
7103
7104 * building.texi (Watch Expressions): Update.
7105
71062004-02-21 Juri Linkov <juri@jurta.org>
7107
7108 * cmdargs.texi (Action Arguments): Add alias --find-file. Add
7109 --directory, --help, --version. Move text about command-line-args
7110 to Command Arguments.
7111 (Initial Options): Add @cindex for --script. Fix @cindex for -q.
7112 Add --no-desktop. Add alias --no-multibyte, --no-unibyte.
7113 (Window Size X): Join -g and --geometry. Add @cindex.
7114 (Borders X): Fix @cindex for -ib. Add @cindex for -bw.
7115 (Title X): Remove alias -title.
7116 (Misc X): New node.
7117
71182004-02-17 Karl Berry <karl@gnu.org>
7119
7120 * info.texi (Help-Int): Mention the new line number feature.
7121
71222004-02-15 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
7123
7124 * frames.texi (Drag and drop): Add Motif to list of supported
7125 protocols.
7126
71272004-02-14 Jonathan Yavner <jyavner@member.fsf.org>
7128
7129 * ses.texi (Advanced Features): New functionality for
7130 ses-set-header-row (defaults to current row unless C-u used).
7131 (Acknowledgements): Add Stefan Monnier.
7132
71332004-02-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
7134
7135 * frames.texi (Drag and drop): New section.
7136
71372004-01-24 Richard M. Stallman <rms@gnu.org>
7138
7139 * emacs.texi (Acknowledgments): Renamed from Acknowledgements.
7140 Include it only @ifnotinfo. Patch the preceding and following
7141 node headers to point to each other.
7142
71432004-01-11 Glenn Morris <gmorris@ast.cam.ac.uk>
7144
7145 * calendar.texi (Appointments): Update section.
7146
71472003-12-29 Kevin Ryde <user42@zip.com.au>
7148
7149 * viper.texi (Vi Macros): Fix reference to the Emacs manual.
7150
7151 * programs.texi (C Modes): Fix the xref.
7152
71532003-12-23 Nick Roberts <nick@nick.uklinux.net>
7154
7155 * building.texi (Watch Expressions): Update.
7156 (Commands of GUD): Include use of toolbar + breakpoints set from
7157 fringe/margin.
7158
71592003-12-03 Andre Spiegel <spiegel@gnu.org>
7160
7161 * files.texi: Say how to disable VC. Suggested by Alan Mackenzie
7162 <acm@muc.de>.
7163
71642003-11-30 Kai Grossjohann <kai.grossjohann@gmx.net>
7165
7166 Tramp version 2.0.38 released.
7167
7168 * tramp.texi (Remote shell setup): Warn of environment variables
7169 FRUMPLE if user frumple exists. Suggested by Sven Gabriel
7170 <sven.gabriel@imk.fzk.de>.
7171 (Configuration): Tramp now chooses base64/uuencode
7172 automatically. Update wording accordingly.
7173 (Top): More description for the `Default Method' menu entry.
7174 (Default Method): Use @code, not @var, for Lisp variables.
7175 (Default Method): New subsection `Which method is the right one
7176 for me?' Suggested by Christian Kirsch.
7177 (Configuration): Pointer to new subsection added.
7178 (Default Method): Too many "use" in one sentence.
7179 Rephrase. Reported by Christian Kirsch.
7180 (Filename Syntax): Old `su' example is probably a left-over from
7181 the sm/su method naming. Replace with `ssh', instead.
7182 (External transfer methods, Auto-save and Backup):
7183 Typo fixes.
7184
71852003-11-02 Michael Albinus <Michael.Albinus@alcatel.de>
7186
7187 * tramp.texi (all): Harmonize all occurences of @tramp{}.
7188 (Top): Mention japanese manual only if flag `jamanual' is set.
7189 Insert section `Japanese manual' in menu.
7190
71912003-11-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
7192
7193 * frames.texi (Dialog Boxes): Add use-file-dialog.
7194
71952003-11-26 Thien-Thi Nguyen <ttn@gnu.org>
7196
7197 * eshell.texi (Known Problems): Add doc item.
7198
71992003-11-22 Martin Stjernholm <bug-cc-mode@gnu.org>
7200
7201 * ack.texi: Note that Alan Mackenzie contributed the AWK support
7202 in CC Mode.
7203
72042003-11-22 Martin Stjernholm <bug-cc-mode@gnu.org>
7205
7206 * cc-mode.texi: Update for CC Mode 5.30.
7207
7208 Note: Please refrain from doing purely cosmetic changes like
7209 removing trailing whitespace in this manual; it clobbers cvs
7210 merging for no good reason.
7211
72122003-11-02 Jesper Harder <harder@ifa.au.dk> (tiny change)
7213
7214 * man/ack.texi, man/basic.texi, man/cmdargs.texi:
7215 * man/commands.texi, man/custom.texi, man/display.texi:
7216 * man/ediff.texi, man/emacs.texi, man/faq.texi, man/files.texi:
7217 * man/frames.texi, man/glossary.texi, man/killing.texi:
7218 * man/macos.texi, man/mark.texi, man/misc.texi, man/msdog.texi:
7219 * man/mule.texi, man/rmail.texi, man/search.texi:
7220 * man/sending.texi, man/text.texi, man/tramp.texi:
7221 * man/trouble.texi, man/vip.texi, man/viper.texi, man/widget.texi:
7222 * man/woman.texi: Replace @sc{ascii} and ASCII with @acronym{ASCII}.
7223
72242003-11-01 Alan Mackenzie <acm@muc.de>
7225
7226 * search.texi (Scrolling During Incremental Search): Document a
7227 new scrolling facility in isearch mode.
7228
72292003-10-26 Karl Berry <karl@gnu.org>
7230
7231 * info.texi (Info Search): Echo area, not echo are. From Debian
7232 diff.
7233
72342003-10-26 Per Abrahamsen <abraham@dina.kvl.dk>
7235
7236 * widget.texi (Defining New Widgets): Document new beavior of
7237 :buttons and :children keywords.
7238
72392003-10-22 Miles Bader <miles@gnu.org>
7240
7241 * Makefile.in (info): Move before $(top_srcdir)/info.
7242
72432003-10-22 Nick Roberts <nick@nick.uklinux.net>
7244
7245 * building.texi (Watch Expressions): Update section on data display
7246 to reflect code changes (GDB Graphical Interface).
7247
72482003-10-17 Thien-Thi Nguyen <ttn@gnu.org>
7249
7250 * tramp.texi (Inline methods): Small grammar fix.
7251 (External transfer methods): Likewise.
7252
72532003-10-13 Richard M. Stallman <rms@gnu.org>
7254
7255 * xresources.texi (GTK resources): Clean up previous change.
7256
72572003-10-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
7258
7259 * xresources.texi (GTK resources): Add a note that some themes
7260 disallow customizations. Add scroll theme example.
7261
72622003-10-08 Nick Roberts <nick@nick.uklinux.net>
7263
7264 * speedbar.texi: Remove paragraph for GUD that is no longer true.
7265
72662003-10-06 Luc Teirlinck <teirllm@auburn.edu>
7267
7268 * texinfo.tex: Replace `%' in arch tagline by @ignore.
7269
72702003-09-30 Richard M. Stallman <rms@gnu.org>
7271
7272 * dired-x.texi (Miscellaneous Commands): Delete M-g, w, T.
7273
7274 * widget.texi (User Interface): Fix typos.
7275
7276 * pcl-cvs.texi, cl.texi, woman.texi, ediff.texi: Fix @strong{Note:}.
7277
7278 * cmdargs.texi (General Variables): Remove MAILRC envvar.
7279
7280 * misc.texi (Saving Emacs Sessions): Shorten the section,
7281 collapsing back into one node.
7282
72832003-09-30 Lars Hansen <larsh@math.ku.dk>
7284
7285 * misc.texi: Section "Saving Emacs Sessions" rewritten.
7286
72872003-09-29 Jan Dj,Ad(Brv. <jan.h.d@swipnet.se>
7288
7289 * xresources.texi (GTK names in Emacs): Correct typo.
7290
72912003-09-29 Thien-Thi Nguyen <ttn@gnu.org>
7292
7293 * pcl-cvs.texi (Selected Files): Fix typo.
7294
72952003-09-24 Luc Teirlinck <teirllm@mail.auburn.edu>
7296
7297 * cmdargs.texi (Font X): Mention new default font. More
7298 fully describe long font names, wildcard patterns and the
7299 problems involved. (Result of discussion on emacs-devel.)
7300
73012003-09-22 Luc Teirlinck <teirllm@mail.auburn.edu>
7302
7303 * emacs.texi (Acknowledgements): Correct typo.
7304
73052003-09-22 Richard M. Stallman <rms@gnu.org>
7306
7307 * dired.texi (Misc Dired Commands): New node.
7308 (Dired Navigation): Add dired-goto-file.
7309
7310 * files.texi (File Aliases, Misc File Ops): Add @cindex entries.
7311
7312 * emacs.texi (Acknowledgements): New node, split from Distribution.
7313
7314 * cmdargs.texi (Action Arguments): -f reads interactive args.
7315
73162003-09-21 Karl Berry <karl@gnu.org>
7317
7318 * info.texi (] and [ commands): No period at end of section title.
7319
73202003-09-08 Lute Kamstra <lute@gnu.org>
7321
7322 * screen.texi (Mode Line): Say that POS comes before LINE.
7323 Mention `size-indication-mode'.
7324 * display.texi (Optional Mode Line): Document
7325 `size-indication-mode'.
7326 * basic.texi (Position Info): Mention `size-indication-mode'.
7327
73282003-09-07 Luc Teirlinck <teirllm@mail.auburn.edu>
7329
7330 * xresources.texi (Resources): Refer to `editres' man page.
7331 (Lucid Resources): Update defaults. Expand description of
7332 `shadowThickness'.
7333
73342003-09-04 Miles Bader <miles@gnu.org>
7335
7336 * Makefile.in (top_srcdir): New variable.
7337 ($(top_srcdir)/info): New rule.
7338 (info): Depend on it.
7339
73402003-09-03 Peter Runestig <peter@runestig.com>
7341
7342 * makefile.w32-in: New file.
7343
73442003-08-29 Richard M. Stallman <rms@gnu.org>
7345
7346 * misc.texi (Saving Emacs Sessions): Correct previous change.
7347
73482003-08-26 Per Abrahamsen <abraham@dina.kvl.dk>
7349
7350 * widget.texi (User Interface): Explain the need of static text
7351 around an editable field.
7352
73532003-08-19 Luc Teirlinck <teirllm@mail.auburn.edu>
7354
7355 * widget.texi (Basic Types): The argument to `:help-echo' can now
7356 be a form that evaluates to a string.
7357
7358 * emacs.texi (Top): Update menu to reflect new Keyboard Macros chapter.
7359 (Intro): Include kmacro.texi after fixit.texi instead of after
7360 custom.texi. (As suggested by Kim Storm.)
7361
73622003-08-18 Luc Teirlinck <teirllm@mail.auburn.edu>
7363
7364 * fixit.texi (Fixit): Update `Next' pointer.
7365 * files.texi (Files): Update `Previous' pointer.
7366 * kmacro.texi (Keyboard Macros): Remove redundant node and section.
7367 * emacs.texi (Intro): Include kmacro.texi after custom.texi.
7368 (Suggested by Kim Storm.)
7369 * Makefile (EMACSSOURCES): Add kmacro.texi. (Suggested by Kim Storm.)
7370
73712003-08-18 Kim F. Storm <storm@cua.dk>
7372
7373 * kmacro.texi: New file describing enhanced keyboard macro
7374 functionality. Replaces old description in custom.texi.
7375
7376 * custom.texi (Customization): Add xref to Keyboard Macros chapter.
7377 (Keyboard Macros): Move to new kmacro.texi file.
7378
7379 * emacs.texi (Keyboard Macros): Reference new keyboard macro topics.
7380
7381 * calc.texi (Queries in Macros): Update xref to keyboard macro query.
7382
73832003-08-17 Edward M. Reingold <reingold@emr.cs.iit.edu>
7384
7385 * calendar.texi (Specified Dates): Add `calendar-goto-day-of-year'.
7386
73872003-08-17 Alex Schroeder <alex@gnu.org>
7388
7389 * misc.texi (Saving Emacs Sessions): Manual M-x desktop-save not
7390 required.
7391
73922003-08-16 Richard M. Stallman <rms@gnu.org>
7393
7394 * dired-x.texi (Shell Command Guessing): Explain *.
7395
73962003-08-16 Chunyu Wang <spr@db.cs.hit.edu.cn> (tiny change)
7397
7398 * pcl-cvs.texi (Log Edit Mode): Fix key binding for
7399 log-edit-insert-changelog.
7400
74012003-08-05 Richard M. Stallman <rms@gnu.org>
7402
7403 * programs.texi (Lisp Indent): Don't describe
7404 lisp-indent-function property here. Use xref to Lisp Manual.
7405
74062003-08-03 Karl Berry <karl@gnu.org>
7407
7408 * info.texi: Need @contents.
7409
74102003-08-03 Glenn Morris <gmorris@ast.cam.ac.uk>
7411
7412 * calendar.texi (Date Formats): Document changed behaviour of
7413 abbreviations.
7414
74152003-07-24 Markus Rost <rost@math.ohio-state.edu>
7416
7417 * buffers.texi (List Buffers): Fix previous change.
7418
74192003-07-20 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
7420
7421 Tramp version 2.0.36 released.
7422
7423 * tramp.texi (Remote shell setup): Explain about problems with
7424 non-Bourne commands in ~/.profile and ~/.shrc.
7425
74262003-07-13 Markus Rost <rost@math.ohio-state.edu>
7427
7428 * buffers.texi (List Buffers): Adjust to new format of *Buffer
7429 List*.
7430
74312003-07-07 Luc Teirlinck <teirllm@mail.auburn.edu>
7432
7433 * info.texi (Help-Inv, Help-M, Help-Xref): Update following
7434 renaming of `vis-mode' to `visible-mode'.
7435
7436 * display.texi (Font Lock): Fix typo.
7437
74382003-07-07 Richard M. Stallman <rms@gnu.org>
7439
7440 * display.texi (Font Lock): Add xref for format info on
7441 font-lock-remove-keywords.
7442
7443 * building.texi (Compilation): Document what happens with asynch
7444 children of compiler process.
7445
7446 * help.texi (Library Keywords): Use @multitable.
7447
74482003-07-04 Luc Teirlinck <teirllm@mail.auburn.edu>
7449
7450 * info.texi (Top, Help-Small-Screen): Remove accidentally added
7451 next, prev and up pointers.
7452
74532003-07-02 Luc Teirlinck <teirllm@mail.auburn.edu>
7454
7455 * info.texi (Help): Mention existence of Emacs and stand-alone
7456 Info at the very beginning of the tutorial.
7457 (Help-Inv): New node.
7458 (Help-]): New node.
7459 (Help-M): Systematically point out the differences between default
7460 Emacs and stand-alone versions. Delete second menu.
7461 (Help-Xref): Systematically point out the differences between
7462 default Emacs and stand-alone versions.
7463 (Help-Int): Change `l' example.
7464 (Expert Info): Fix typos.
7465 (Emacs Info Variables): Mention `Info-hide-note-references' and
7466 new default for `Info-scroll-prefer-subnodes'.
7467
74682003-06-17 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
7469
7470 Version 2.0.35 of Tramp released.
7471
7472 * tramp.texi: From Michael Albinus <Michael.Albinus@alcatel.de>:
7473 (Inline methods): Add methods `remsh' and `plink1'.
7474 (External transfer methods): Add method `remcp'.
7475 (Multi-hop Methods): Add method `remsh'.
7476 Small patch from Adrian Aichner <adrian@xemacs.org>:
7477 Fix minor typos.
7478 (Concept Index): Added to make manual searchable via
7479 `Info-index'.
7480 (Version Control): Add cindex entry.
7481
74822003-06-04 Richard M. Stallman <rms@gnu.org>
7483
7484 * programs.texi (Expressions): Delete C-M-DEL.
7485
7486 * misc.texi (Shell Options): Clarify comint-scroll-show-maximum-output.
7487 comint-move-point-for-output renamed from
7488 comint-scroll-to-bottom-on-output.
7489
7490 * custom.texi (Init Rebinding): Replace previous change with xref.
7491 (Non-ASCII Rebinding): Explain that issue more briefly here.
7492
74932003-05-28 Richard M. Stallman <rms@gnu.org>
7494
7495 * indent.texi (Indentation): Condense, simplify, clarify prev change.
7496
74972003-05-28 Nick Roberts <nick@nick.uklinux.net>
7498
7499 * building.texi (GDB Graphical Interface): New node.
7500 (Rewritten somewhat by RMS.)
7501
75022003-05-28 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
7503
7504 * custom.texi (Init Rebinding): Xref Non-ASCII Rebinding, for
7505 non-English letters. Explain how to set coding systems correctly
7506 and how to include the right coding cookie in the file.
7507
75082003-05-24 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
7509
7510 * trampver.texi: Version 2.0.34 released.
7511
75122003-05-22 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
7513
7514 * indent.texi (Indentation): Explain the concepts.
7515 (Just Spaces): Explain why preventing tabs for indentation might
7516 be useful.
7517
75182003-05-03 Glenn Morris <gmorris@ast.cam.ac.uk>
7519
7520 * faq.texi: Improve previous changes.
7521
75222003-05-02 Glenn Morris <gmorris@ast.cam.ac.uk>
7523
7524 * faq.texi: Update copyright and maintenance details.
7525 Update some package URLs, versions, and maintainers.
7526 Remove many references to the Emacs Lisp Archive.
7527
75282003-04-23 Simon Josefsson <jas@extundo.com>
7529
7530 * smtpmail.texi: Fix license (the invariant sections mentioned has
7531 never been part of the smtp manual). Align info dir entry with
7532 other emacs packages.
7533
75342003-04-16 Richard M. Stallman <rms@gnu.org>
7535
7536 * search.texi (Regexps): Ref to Lisp manual for more regexp features.
7537
75382003-04-08 Michael Albinus <Michael.Albinus@alcatel.de>
7539
7540 * tramp.texi: Version 2.0.33 released.
7541 Remove installation chapter. Remove XEmacs specifics.
7542
75432003-03-29 Richard M. Stallman <rms@gnu.org>
7544
7545 * tramp.texi (Top): Undo the previous renaming.
7546 (emacs-other-name, emacs-other-dir, emacs-other-file-name): Delete.
7547
75482003-03-29 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
7549
7550 * Makefile.in (../info/tramp): Compile Emacs, instead of XEmacs,
7551 version of manual.
7552
7553 * tramp.texi (Auto-save and Backup): New node.
7554
75552003-03-29 Michael Albinus <Michael.Albinus@alcatel.de>
7556
7557 * tramp.texi (Top): Include trampver.texi. Rename "Emacs" to "GNU
7558 Emacs" in order to have better differentiation to "XEmacs".
7559 `emacs-other-name', `emacs-other-dir' and `emacs-other-file-name'
7560 are new macros in order to point to the other Emacs flavor where
7561 appropriate. In info case, point to node `Installation' in order
7562 to explain how to generate the other way. In html case, make a
7563 link to the other html file.
7564 (Obtaining TRAMP): Added a paragraph saying to perform `autoconf'
7565 after CVS checkout/update.
7566 (Installation): Completely rewritten.
7567 (Installation parameters, Load paths): New sections under
7568 `Installation'.
7569
75702003-02-28 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de>
7571
7572 * tramp.texi: Version 2.0.30 released.
7573 Replace word "path" with "localname" where used as a component of
7574 a Tramp file name.
7575
75762003-02-28 Michael Albinus <Michael.Albinus@alcatel.de>
7577
7578 * tramp.texi (Frequently Asked Questions): `tramp-chunksize'
7579 introduced.
7580 (Installation): Explain what to do if files from the tramp/contrib
7581 directory are needed.
7582
75832003-02-23 Alex Schroeder <alex@emacswiki.org>
7584
7585 * smtpmail.texi (How Mail Works): New.
7586
75872003-02-22 Alex Schroeder <alex@emacswiki.org>
7588
7589 * cmdargs.texi (General Variables): Document SMTPSERVER.
7590
7591 * smtpmail.texi: New file.
7592
7593 * sending.texi: Remove SMTP node.
7594 (Mail Sending): Describe `send-mail-function'. Link to SMTP
7595 library.
7596
7597 * Makefile.in: Build SMTP manual.
7598
75992003-02-22 Alex Schroeder <alex@emacswiki.org>
7600
7601 * sending.texi (Sending via SMTP): Explain MTA/MUA.
7602
76032003-02-22 Simon Josefsson <jas@extundo.com>
7604
7605 * sending.texi (Mail Methods): Add node about SMTP.
7606
76072003-02-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
7608
7609 * xresources.texi (GTK names in Emacs): Add emacs-toolbar - GtkToolbar.
7610
76112003-02-05 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de>
7612
7613 * tramp.texi: Version 2.0.29 released.
7614 (Installation): In Emacs, use M-x texinfo-format-buffer RET, not
7615 M-x makeinfo-buffer RET. Reported by gebser@ameritech.net.
7616
76172003-02-01 Michael Albinus <Michael.Albinus@alcatel.de>
7618
7619 * tramp.texi (Frequently Asked Questions): Explain a workaround if
7620 another package loads accidently Ange-FTP.
7621
76222003-01-24 Michael Albinus <Michael.Albinus@alcatel.de>
7623
7624 * tramp.texi (Customizing Completion): Add function
7625 `tramp-parse-sconfig'. Change example of
7626 `tramp-set-completion-function', because parsing of ssh config
7627 files looks more natural.
7628
76292003-02-01 Kevin Ryde <user42@zip.com.au>
7630
7631 * glossary.texi (Glossary): Correction to cl cross reference.
7632
76332003-01-20 Richard M. Stallman <rms@gnu.org>
7634
7635 * killing.texi (Rectangles): Document C-x c r.
7636
76372003-01-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
7638
7639 * xresources.texi (GTK resources): New node.
7640 (GTK widget names): New node.
7641 (GTK names in Emacs): New node.
7642 (GTK styles): New node.
7643
76442003-01-15 ShengHuo ZHU <zsh@cs.rochester.edu>
7645
7646 * gnus.texi: Do not use `path' in several locations.
7647
76482003-01-09 Francesco Potort,Al(B <pot@gnu.org>
7649
7650 * maintaining.texi (Create Tags Table): Add reference to the new
7651 `etags --help --lang=LANG' option.
7652
76532002-12-26 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de>
7654
7655 * tramp.texi (External transfer methods): New method `smb'. From
7656 Michael Albinus.
7657
76582002-11-05 Karl Berry <karl@gnu.org>
7659
7660 * info.texi (Info-fontify): Reorder face list to avoid bad line
7661 breaks.
7662
76632002-10-06 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
7664
7665 * tramp.texi: Move @copying to standard place. Use
7666 @insertcopying.
7667
76682002-10-02 Karl Berry <karl@gnu.org>
7669
7670 * (ada-mode.texi autotype.texi calc.texi cc-mode.texi cl.texi
7671 dired-x.texi ebrowse.texi ediff.texi emacs-mime.texi emacs.texi
7672 eshell.texi eudc.texi faq.texi forms.texi idlwave.texi info.texi
7673 message.texi mh-e.texi pcl-cvs.texi reftex.texi sc.texi ses.texi
7674 speedbar.texi vip.texi viper.texi widget.texi woman.texi):
7675 Per rms, update all manuals to use @copying instead of @ifinfo.
7676 Also use @ifnottex instead of @ifinfo around the top node, where
7677 needed for the sake of the HTML output.
7678 (The Gnus manual is not fixed since it's not clear to me how it
7679 works; and the Tramp manual already uses @copying, although in an
7680 unusual way. All others were changed.)
7681
76822002-09-10 Jonathan Yavner <jyavner@engineer.com>
7683
7684 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add SES.
7685 (../info/ses, ses.dvi): New targets.
7686 * ses.texi: New file.
7687
76882002-09-06 Pavel Jan,Am(Bk <Pavel@Janik.cz>
7689
7690 * texinfo.tex: Update to texinfo 4.2.
7691
76922002-08-27 Carsten Dominik <dominik@sand.science.uva.nl>
7693
7694 * reftex.texi: Update to RefTeX 4.19.
7695
76962002-06-17 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
7697
7698 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add Tramp.
7699 (../info/tramp, tramp.dvi): New targets.
7700
77012002-01-04 Eli Zaretskii <eliz@is.elta.co.il>
7702
7703 * Makefile.in (DVI_TARGETS): Add calc.dvi.
7704 (calc.dvi): Uncomment.
7705
77062001-12-20 Eli Zaretskii <eliz@is.elta.co.il>
7707
7708 * Makefile.in (EMACSSOURCES): Update the list of Emacs manual
7709 source files.
7710
77112001-11-16 Eli Zaretskii <eliz@is.elta.co.il>
7712
7713 * Makefile.in (emacsman): New target.
7714
77152001-11-07 Eli Zaretskii <eliz@is.elta.co.il>
7716
7717 * Makefile.in (INFO_TARGETS): Add ../info/calc.
7718 (../info/calc): New target.
7719
77202001-10-20 Gerd Moellmann <gerd@gnu.org>
7721
7722 * (Version 21.1 released.)
7723
77242001-10-05 Gerd Moellmann <gerd@gnu.org>
7725
7726 * Branch for 21.1.
7727
77282001-04-14 Eli Zaretskii <eliz@is.elta.co.il>
7729
7730 * Makefile.in (../info/info): Use an explicit -o switch to
7731 makeinfo.
7732
77332001-03-05 Gerd Moellmann <gerd@gnu.org>
7734
7735 * Makefile.in (mostlyclean, maintainer-clean): Delete more files.
7736
77372000-12-20 Eli Zaretskii <eliz@is.elta.co.il>
7738
7739 * Makefile.in (../info/idlwave): Use --no-split.
7740
77412000-12-14 Dave Love <fx@gnu.org>
7742
7743 * Makefile.in (mostlyclean): Remove gnustmp.*
7744 (gnus.dvi): Change rule to remove @latex stuff.
7745
77462000-10-19 Eric M. Ludlam <zappo@ultranet.com>
7747
7748 * Makefile.in (Speedbar): Add build targets for speedbar.texi.
7749
77502000-10-13 John Wiegley <johnw@gnu.org>
7751
7752 * Makefile.in: Add build targets for eshell.texi.
7753
77542000-09-25 Gerd Moellmann <gerd@gnu.org>
7755
7756 * Makefile.in: Remove/comment speedbar stuff.
7757
77582000-09-22 Dave Love <fx@gnu.org>
7759
7760 * Makefile.in: Add emacs-mime.
7761
77622000-08-08 Eli Zaretskii <eliz@is.elta.co.il>
7763
7764 * Makefile.in (INFO_TARGETS): Add ../info/woman.
7765 (DVI_TARGETS): Add woman.dvi.
7766 (../info/woman, woman.dvi): New targets.
7767
77682000-05-31 Stefan Monnier <monnier@cs.yale.edu>
7769
7770 * .cvsignore (*.tmp): New entry. Seems to be used for @macro.
7771
7772 * pcl-cvs.texi: New file.
7773 * Makefile.in (INFO_TARGETS, DVI_TARGETS: Add pcl-cvs.
7774 (../info/pcl-cvs, pcl-cvs.dvi): New targets.
7775
77762000-05-11 Gerd Moellmann <gerd@gnu.org>
7777
7778 * Makefile.in (INFO_TARGETS): Add info/ebrowse.
7779 (../info/ebrowse, ebrowse.dvi): New targets.
7780
77812000-01-13 Gerd Moellmann <gerd@gnu.org>
7782
7783 * Makefile.in (INFO_TARGETS): Add eudc.
7784 (DVI_TARGETS): Add eudc.dvi.
7785 (../info/eudc, eudc.dvi): New targets.
7786
77872000-01-05 Eli Zaretskii <eliz@is.elta.co.il>
7788
7789 * Makefile.in (INFO_TARGETS): Rename emacs-faq to efaq (for
7790 compatibility with 8+3 filesystems).
7791 (../info/efaq): Rename from emacs-faq.
7792
77932000-01-03 Eli Zaretskii <eliz@is.elta.co.il>
7794
7795 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add idlwave.
7796 (../info/idlwave, idlwave.dvi): New targets.
7797
77981999-10-23 Dave Love <fx@gnu.org>
7799
7800 * Makefile.in: Use autotype.texi.
7801
78021999-10-12 Stefan Monnier <monnier@cs.yale.edu>
7803
7804 * Makefile.in (faq): Use ../info/emacs-faq.info (as specified in the
7805 faq.texi file) rather than ../info/faq.
7806
78071999-10-07 Gerd Moellmann <gerd@gnu.org>
7808
7809 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add ada-mode.
7810 (../info/ada-mode, ada-mode.dvi): New targets.
7811
78121999-09-01 Dave Love <fx@gnu.org>
7813
7814 * Makefile.in: Add faq.
7815
78161999-07-12 Richard Stallman <rms@gnu.org>
7817
7818 * Version 20.4 released.
7819
78201998-12-04 Markus Rost <rost@delysid.gnu.org>
7821
7822 * Makefile.in (INFO_TARGETS): Delete customize.info.
7823 (DVI_TARGETS): Delete customize.dvi.
7824 (../info/customize, customize.dvi): Targets deleted.
7825
78261998-08-19 Richard Stallman <rms@psilocin.ai.mit.edu>
7827
7828 * Version 20.3 released.
7829
78301998-05-06 Richard Stallman <rms@psilocin.gnu.org>
7831
7832 * Makefile.in (EMACSSOURCES): Add mule.texi.
7833 Add msdog.texi, ack.texi. Remove gnu1.texi.
7834
78351998-04-06 Andreas Schwab <schwab@gnu.org>
7836
7837 * Makefile.in (ENVADD): Enviroment vars to pass to texi2dvi. Use
7838 it in dvi targets.
7839 (../etc/GNU): Change to $(srcdir) first.
7840
78411998-03-11 Carsten Dominik <cd@delysid.gnu.org>
7842
7843 * reftex.texi: Update for RefTeX version 3.22.
7844
78451998-02-08 Richard Stallman <rms@psilocin.gnu.org>
7846
7847 * Makefile.in (reftex.dvi, ../info/reftex): New targets.
7848 (INFO_TARGETS, DVI_TARGETS): Add the new targets.
7849
78501997-09-23 Paul Eggert <eggert@twinsun.com>
7851
7852 * Makefile.in: Merge changes mistakenly made to `Makefile'.
7853 (INFO_TARGETS): Change ../info/custom to ../info/customize.
7854 (../info/customize): Rename from ../info/custom.
7855 (../info/viper, viper.dvi): Remove dependency on viper-cmd.texi.
7856
78571997-09-19 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
7858
7859 * Version 20.2 released.
7860
78611997-09-15 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
7862
7863 * Version 20.1 released.
7864
78651997-08-24 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
7866
7867 * Makefile (../info/customize, customize.dvi): New targets.
7868 (INFO_TARGETS): Add ../info/customize.
7869 (DVI_TARGETS): Add customize.dvi.
7870
78711997-07-10 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
7872
7873 * Makefile (../info/viper, viper.dvi): Delete viper-cmd.texi dep.
7874
78751996-08-11 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
7876
7877 * Version 19.33 released.
7878
78791996-07-31 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
7880
7881 * Version 19.32 released.
7882
78831996-06-27 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
7884
7885 * Makefile.in: Add rules for the Message manual.
7886
78871996-06-26 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
7888
7889 * gnus.texi: New version.
7890
7891 * message.texi: New manual.
7892
78931996-06-20 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
7894
7895 * Makefile.in (All info targets): cd $(srcdir) to do the work.
7896
78971996-06-19 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
7898
7899 * Makefile.in (All info targets): Specify $(srcdir) in input files.
7900 Specify -I option.
7901 (All dvi targets): Set the TEXINPUTS variable.
7902
79031996-05-25 Karl Heuer <kwzh@gnu.ai.mit.edu>
7904
7905 * Version 19.31 released.
7906
79071996-01-07 Richard Stallman <rms@whiz-bang.gnu.ai.mit.edu>
7908
7909 * Makefile.in (../info/ccmode): Rename from ../info/cc-mode.
7910 (INFO_TARGETS): Use new name. This avoids name conflict on MSDOS.
7911
79121995-11-29 Richard Stallman <rms@mole.gnu.ai.mit.edu>
7913
7914 * Makefile.in (../info/cc-mode, cc-mode.dvi): New targets.
7915 (INFO_TARGETS): Add ../info/cc-mode.
7916 (DVI_TARGETS): Add cc-mode.dvi.
7917
79181995-11-24 Richard Stallman <rms@mole.gnu.ai.mit.edu>
7919
7920 * Version 19.30 released.
7921
79221995-11-04 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
7923
7924 * gnus.texi: New file.
7925
79261995-11-04 Erik Naggum <erik@naggum.no>
7927
7928 * gnus.texi: File deleted.
7929
79301995-11-02 Stephen Gildea <gildea@stop.mail-abuse.org>
7931
7932 * mh-e.texi: "Function Index" -> "Command Index" to work with
7933 Emacs 19.30 C-h C-k support of separately-documented commands.
7934
79351995-06-26 Richard Stallman <rms@mole.gnu.ai.mit.edu>
7936
7937 * Makefile.in (../info/ediff, ediff.dvi): New targets.
7938 (INFO_TARGETS, DVI_TARGETS): Add those new targets.
7939
79401995-04-24 Richard Stallman <rms@mole.gnu.ai.mit.edu>
7941
7942 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add viper targets.
7943 (../info/viper, viper.dvi): New targets.
7944
79451995-04-20 Kevin Rodgers <kevinr@ihs.com>
7946
7947 * dired-x.texi (Installation): Change the example to set
7948 buffer-local variables like dired-omit-files-p in
7949 dired-mode-hook.
7950
79511995-04-17 Richard Stallman <rms@mole.gnu.ai.mit.edu>
7952
7953 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add mh-e targets.
7954 (../info/mh-e, mh-e.dvi): New targets.
7955
79561995-02-07 Richard Stallman <rms@pogo.gnu.ai.mit.edu>
7957
7958 * Makefile.in (maintainer-clean): Rename from realclean.
7959
79601994-11-23 Richard Stallman <rms@mole.gnu.ai.mit.edu>
7961
7962 * Makefile.in: New file.
7963 * Makefile: File deleted.
7964
79651994-11-19 Richard Stallman <rms@mole.gnu.ai.mit.edu>
7966
7967 * Makefile (TEXINDEX_OBJS): Variable deleted.
7968 (texindex, texindex.o, getopt.o): Rules deleted.
7969 All deps on texindex deleted.
7970 (distclean): Don't delete texindex.
7971 (mostlyclean): Don't delete *.o.
7972 * texindex.c, getopt.c: Files deleted.
7973
79741994-09-07 Richard Stallman <rms@mole.gnu.ai.mit.edu>
7975
7976 * Version 19.26 released.
7977
79781994-07-02 Richard Stallman (rms@gnu.ai.mit.edu)
7979
7980 * Makefile (EMACSSOURCES): Exclude undo.texi.
7981
79821994-05-30 Richard Stallman (rms@mole.gnu.ai.mit.edu)
7983
7984 * Version 19.25 released.
7985
79861994-05-23 Richard Stallman (rms@mole.gnu.ai.mit.edu)
7987
7988 * Version 19.24 released.
7989
79901994-05-16 Richard Stallman (rms@mole.gnu.ai.mit.edu)
7991
7992 * Version 19.23 released.
7993
79941994-04-17 Richard Stallman (rms@mole.gnu.ai.mit.edu)
7995
7996 * Makefile: Delete spurious tab.
7997
79981994-02-16 Richard Stallman (rms@mole.gnu.ai.mit.edu)
7999
8000 * Makefile (.SUFFIXES): New rule.
8001
80021994-01-15 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8003
8004 * Makefile (dired-x.dvi, ../info/dired-x): New targets.
8005 (INFO_TARGETS, DVI_TARGETS): Add the new targets.
8006
80071994-01-08 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8008
8009 * Makefile (../info/sc): Rename frin sc.info.
8010 (../info/cl): Likewise.
8011 (INFO_TARGETS): Use new names.
8012
80131993-12-04 Richard Stallman (rms@srarc2)
8014
8015 * getopt.c: New file.
8016 * Makefile (TEXINDEX_OBJS): Use getopt.o in this dir, not ../lib-src.
8017 (getopt.o): New rule.
8018 (dvi): Don't depend on texindex.
8019 (emacs.dvi, cl.dvi, forms.dvi, vip.dvi, gnus.dvi, sc.dvi):
8020 Depend on texindex.
8021
80221993-12-03 Richard Stallman (rms@srarc2)
8023
8024 * Makefile (../info/sc.info): Rename from ../info/sc.
8025 (TEXI2DVI): New variable.
8026 (emacs.dvi, cl.dvi forms.dvi, sc.dvi, vip.dvi, gnus.dvi, info.dvi):
8027 Add explicit commands.
8028 (TEXINDEX_OBJS): Delete duplicate getopt.o.
8029
80301993-11-27 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8031
8032 * Version 19.22 released.
8033
80341993-11-18 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8035
8036 * Makefile (TEXINDEX_OBJS): Delete spurious period.
8037
80381993-11-16 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8039
8040 * Version 19.21 released.
8041
80421993-11-15 Paul Eggert (eggert@twinsun.com)
8043
8044 * man/Makefile (../info/cl.info): Rename from ../info/cl.
8045
80461993-11-15 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8047
8048 * Makefile (../etc/GNU): New target.
8049 (EMACSSOURCES): Add gnu1.texi.
8050
80511993-11-14 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8052
8053 * Makefile (realclean): Don't delete the Info files.
8054
80551993-10-25 Brian Fox (bfox@albert.gnu.ai.mit.edu)
8056
8057 * forms.texi: Fix forms.texi so that it will format correctly.
8058 Add missing `@end iftex', fix bad reference.
8059
8060 * info.texi, info-stn.texi: New files implement texinfo version of
8061 `info' file.
8062
8063 * frames.texi (Creating Frames): Mention `C-x 5' instead of `C-x
8064 4' where appropriate.
8065
80661993-10-20 Brian Fox (bfox@ai.mit.edu)
8067
8068 * Makefile: Fix targets for texindex, new info.texi files.
8069 * info-stnd.texi: New file implements info for standalone info
8070 reader.
8071 * info.texi: Update to include recent changes to "../info/info".
8072 New source file for ../info/info; includes info-stnd.texi.
8073
8074 * texindex.c: Include "../src/config.h" if building in emacs.
8075
8076 * Makefile: Change all files to FILENAME.texi, force all targets
8077 to be FILENAME, not FILENAME.info. This changes sc.texinfo,
8078 vip.texinfo, forms.texinfo, cl.texinfo.
8079 Add target to build texindex.c, defining `emacs'.
8080
8081 * forms.texi: Install new file to match version 2.3 of forms.el.
8082
80831993-08-14 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8084
8085 * Version 19.19 released.
8086
80871993-08-10 Simon Leinen (simon@lia.di.epfl.ch)
8088
8089 * sc.texinfo: Fix info file name.
8090
8091 * Makefile (info): Add gnus and sc.
8092 (dvi): Add gnus.dvi and sc.dvi.
8093 (../info/sc, sc.dvi): New targets.
8094
80951993-08-08 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8096
8097 * Version 19.18 released.
8098
80991993-07-20 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8100
8101 * Makefile: Fix source file names of the separate manuals.
8102 (gnus.dvi, ../info/gnus): New targets.
8103
81041993-07-18 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8105
8106 * Version 19.17 released.
8107
81081993-07-10 Richard Stallman (rms@mole.gnu.ai.mit.edu)
8109
8110 * split-man: Fix typos in last change.
8111
81121993-07-06 Jim Blandy (jimb@geech.gnu.ai.mit.edu)
8113
8114 * Version 19.16 released.
8115
81161993-06-19 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
8117
8118 * version 19.15 released.
8119
81201993-06-18 Jim Blandy (jimb@geech.gnu.ai.mit.edu)
8121
8122 * Makefile (distclean): It's rm, not rf.
8123
81241993-06-17 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
8125
8126 * Version 19.14 released.
8127
81281993-06-16 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
8129
8130 * Makefile: New file.
8131
81321993-06-08 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
8133
8134 * Version 19.13 released.
8135
81361993-05-27 Jim Blandy (jimb@geech.gnu.ai.mit.edu)
8137
8138 * Version 19.9 released.
8139
81401993-05-25 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
8141
8142 * Version 19.8 released.
8143
81441993-05-25 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
8145
8146 * cmdargs.texi: Document the -i, -itype, and -iconic options.
8147
8148 * trouble.texi: It's `enable-flow-control-on', not
8149 `evade-flow-control-on'.
8150
81511993-05-24 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
8152
8153 * display.texi: Document standard-display-european.
8154
81551993-05-22 Jim Blandy (jimb@geech.gnu.ai.mit.edu)
8156
8157 * Version 19.7 released.
8158
8159 * emacs.texi: Add a sentence to the top menu mentioning the
8160 specific version of Emacs this manual applies to.
8161
81621993-04-25 Eric S. Raymond (eric@mole.gnu.ai.mit.edu)
8163
8164 * basic.texi: Document next-line-add-lines variable used to
8165 implement down-arrow.
8166
8167 * killing.texi: Document kill-whole-line.
8168
81691993-04-18 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
8170
8171 * text.texi: Update unix TeX ordering information.
8172
81731993-03-26 Eric S. Raymond (eric@geech.gnu.ai.mit.edu)
8174
8175 * news.texi: Mention fill-rectangle in keybinding list.
8176
8177 * killing.texi: Document fill-rectangle.
8178
81791993-03-17 Eric S. Raymond (eric@mole.gnu.ai.mit.edu)
8180
8181 * vc.texi: Bring the docs up to date with VC 5.2.
8182
81831992-01-10 Eric S. Raymond (eric@mole.gnu.ai.mit.edu)
8184
8185 * emacs.tex: Mention blackbox and gomoku under Amusements.
8186 Assembler mode is now mentioned and appropriately indexed
8187 under Programming Modes.
8188
81891991-02-15 Robert J. Chassell (bob@wookumz.ai.mit.edu)
8190
8191 * emacs.tex: Update TeX ordering information.
8192
81931990-08-30 David Lawrence (tale@pogo.ai.mit.edu)
8194
8195 * gnus.texinfo: New file. Removed installation instructions.
8196
81971990-06-26 David Lawrence (tale@geech)
8198
8199 * emacs.tex: Note that completion-ignored-extensions is not used
8200 to filter out names when all completions are displayed in
8201 *Completions*.
8202
82031990-05-25 Richard Stallman (rms@sugar-bombs.ai.mit.edu)
8204
8205 * texindex.tex: If USG, include sys/types.h and sys/fcntl.h.
8206
82071990-03-21 Jim Kingdon (kingdon@pogo.ai.mit.edu)
8208
8209 * emacs.tex: Add @findex grep.
8210
82111989-01-17 Robert J. Chassell (bob@rice-chex.ai.mit.edu)
8212
8213 * texinfo.tex: Change spelling of `\sc' font to `\smallcaps' and
8214 then define `\sc' as the command for smallcaps in Texinfo. This
8215 means that the @sc command will produce small caps. bfox has
8216 made the corresponding change to makeinfo and texinfm.el.
8217
82181988-08-16 Robert J. Chassell (bob@frosted-flakes.ai.mit.edu)
8219
8220 * emacs.tex: Correct two typos. No other changes before
8221 Version 19 will be made.
8222
8223 * vip.texinfo: Remove menu entry Adding Lisp Code in node
8224 Customization since the menu entry did not point to anything.
8225 Also add an @finalout command to remove overfull hboxes from the
8226 printed output.
8227
8228 * cl.texinfo: Add @bye, \input line and @settitle to file.
8229 This file is clearly intended to be a chapter of some other work,
8230 but the other work does not yet exist.
8231
82321988-07-25 Robert J. Chassell (bob@frosted-flakes.ai.mit.edu)
8233
8234 * texinfo.texinfo: Three typos corrected.
8235
82361988-05-23 Robert J. Chassell (bob@frosted-flakes.ai.mit.edu)
8237
8238 * emacs.tex: Update information for obtaining TeX distribution from the
8239 University of Washington.
8240
8241;; Local Variables:
8242;; coding: iso-2022-7bit
8243;; fill-column: 79
8244;; add-log-time-zone-rule: t
8245;; End:
8246
8247 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
8248 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
8249
8250 This file is part of GNU Emacs.
8251
8252 GNU Emacs is free software; you can redistribute it and/or modify
8253 it under the terms of the GNU General Public License as published by
8254 the Free Software Foundation; either version 3, or (at your option)
8255 any later version.
8256
8257 GNU Emacs is distributed in the hope that it will be useful,
8258 but WITHOUT ANY WARRANTY; without even the implied warranty of
8259 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8260 GNU General Public License for more details.
8261
8262 You should have received a copy of the GNU General Public License
8263 along with GNU Emacs; see the file COPYING. If not, write to the
8264 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
8265 Boston, MA 02110-1301, USA.
8266
8267;;; arch-tag: f1d62776-3ed5-4811-9d96-267252577dbd
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in
new file mode 100644
index 00000000000..00088b74b51
--- /dev/null
+++ b/doc/emacs/Makefile.in
@@ -0,0 +1,368 @@
1#### Makefile for the Emacs Manual and other documentation.
2
3# Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4# 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
5
6# This file is part of GNU Emacs.
7
8# GNU Emacs is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 3, or (at your option)
11# any later version.
12
13# GNU Emacs is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17
18# You should have received a copy of the GNU General Public License
19# along with GNU Emacs; see the file COPYING. If not, write to
20# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21# Boston, MA 02110-1301, USA.
22
23# Where to find the source code. $(srcdir) will be the man
24# subdirectory of the source tree. This is
25# set by the configure script's `--srcdir' option.
26srcdir=@srcdir@
27top_srcdir=@top_srcdir@
28
29# Tell make where to find source files; this is needed for the makefiles.
30VPATH=@srcdir@
31
32
33# The makeinfo program is part of the Texinfo distribution.
34# Use --force so that it generates output even if there are errors.
35MAKEINFO = makeinfo --force
36INFO_TARGETS = ../info/emacs ../info/ccmode ../info/cl \
37 ../info/dired-x ../info/ediff ../info/forms ../info/gnus \
38 ../info/message ../info/sieve ../info/pgg ../info/emacs-mime \
39 ../info/info ../info/mh-e ../info/reftex \
40 ../info/sc ../info/vip ../info/viper ../info/widget \
41 ../info/efaq ../info/ada-mode ../info/autotype ../info/calc \
42 ../info/idlwave ../info/eudc ../info/ebrowse ../info/pcl-cvs \
43 ../info/woman ../info/eshell ../info/org ../info/url \
44 ../info/speedbar ../info/tramp ../info/ses ../info/smtpmail \
45 ../info/flymake ../info/newsticker ../info/rcirc ../info/erc
46DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \
47 ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \
48 gnus.dvi message.dvi sieve.dvi pgg.dvi mh-e.dvi \
49 reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \
50 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \
51 pcl-cvs.dvi woman.dvi eshell.dvi org.dvi url.dvi \
52 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \
53 newsticker.dvi emacs-xtra.dvi rcirc.dvi erc.dvi
54INFOSOURCES = info.texi
55
56# The following rule does not work with all versions of `make'.
57.SUFFIXES: .texi .dvi
58.texi.dvi:
59 texi2dvi $<
60
61TEXI2DVI = texi2dvi
62ENVADD = TEXINPUTS="$(srcdir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)"
63
64EMACS_XTRA=\
65 $(srcdir)/arevert-xtra.texi \
66 $(srcdir)/cal-xtra.texi \
67 $(srcdir)/dired-xtra.texi \
68 $(srcdir)/picture-xtra.texi \
69 $(srcdir)/emerge-xtra.texi \
70 $(srcdir)/vc-xtra.texi \
71 $(srcdir)/vc1-xtra.texi \
72 $(srcdir)/vc2-xtra.texi \
73 $(srcdir)/fortran-xtra.texi \
74 $(srcdir)/msdog-xtra.texi
75
76EMACSSOURCES= \
77 ${srcdir}/emacs.texi \
78 ${srcdir}/doclicense.texi \
79 ${srcdir}/gpl.texi \
80 ${srcdir}/screen.texi \
81 ${srcdir}/commands.texi \
82 ${srcdir}/entering.texi \
83 ${srcdir}/basic.texi \
84 ${srcdir}/mini.texi \
85 ${srcdir}/m-x.texi \
86 ${srcdir}/help.texi \
87 ${srcdir}/mark.texi \
88 ${srcdir}/killing.texi \
89 ${srcdir}/regs.texi \
90 ${srcdir}/display.texi \
91 ${srcdir}/search.texi \
92 ${srcdir}/fixit.texi \
93 ${srcdir}/files.texi \
94 ${srcdir}/buffers.texi \
95 ${srcdir}/windows.texi \
96 ${srcdir}/frames.texi \
97 ${srcdir}/mule.texi \
98 ${srcdir}/major.texi \
99 ${srcdir}/indent.texi \
100 ${srcdir}/text.texi \
101 ${srcdir}/programs.texi \
102 ${srcdir}/building.texi \
103 ${srcdir}/maintaining.texi \
104 ${srcdir}/abbrevs.texi \
105 ${srcdir}/sending.texi \
106 ${srcdir}/rmail.texi \
107 ${srcdir}/dired.texi \
108 ${srcdir}/calendar.texi \
109 ${srcdir}/misc.texi \
110 ${srcdir}/custom.texi \
111 ${srcdir}/trouble.texi \
112 ${srcdir}/cmdargs.texi \
113 ${srcdir}/xresources.texi \
114 ${srcdir}/anti.texi \
115 ${srcdir}/macos.texi \
116 ${srcdir}/msdog.texi \
117 ${srcdir}/gnu.texi \
118 ${srcdir}/glossary.texi \
119 ${srcdir}/ack.texi \
120 ${srcdir}/kmacro.texi \
121 $(EMACS_XTRA)
122
123info: $(top_srcdir)/info $(INFO_TARGETS)
124
125$(top_srcdir)/info:
126 mkdir $@
127
128dvi: $(DVI_TARGETS)
129
130# Note that all the Info targets build the Info files
131# in srcdir. There is no provision for Info files
132# to exist in the build directory.
133# In a distribution of Emacs, the Info files should be up to date.
134
135# The following target uses an explicit -o switch to work around
136# the @setfilename directive in info.texi, which is required for
137# the Texinfo distribution.
138
139../info/info: ${INFOSOURCES}
140 cd $(srcdir); $(MAKEINFO) --no-split info.texi -o $@
141
142info.dvi: ${INFOSOURCES}
143 $(ENVADD) $(TEXI2DVI) ${srcdir}/info.texi
144
145../info/emacs: ${EMACSSOURCES}
146 cd $(srcdir); $(MAKEINFO) emacs.texi
147
148emacs.dvi: ${EMACSSOURCES}
149 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi
150
151# This target is here so you could easily get the list of the *.texi
152# files which belong to the Emacs manual (as opposed to the separate
153# manuals for CL, CC Mode, Ebrowse, etc.). With this target, you can
154# say things like "grep foo `make emacsman`".
155emacsman:
156 @echo $(EMACSSOURCES)
157
158../info/ccmode: cc-mode.texi
159 cd $(srcdir); $(MAKEINFO) cc-mode.texi
160cc-mode.dvi: cc-mode.texi
161 $(ENVADD) $(TEXI2DVI) ${srcdir}/cc-mode.texi
162
163../info/ada-mode: ada-mode.texi
164 cd $(srcdir); $(MAKEINFO) ada-mode.texi
165ada-mode.dvi: ada-mode.texi
166 $(ENVADD) $(TEXI2DVI) ${srcdir}/ada-mode.texi
167
168../info/pcl-cvs: pcl-cvs.texi
169 cd $(srcdir); $(MAKEINFO) pcl-cvs.texi
170pcl-cvs.dvi: pcl-cvs.texi
171 $(ENVADD) $(TEXI2DVI) ${srcdir}/pcl-cvs.texi
172
173../info/eshell: eshell.texi
174 cd $(srcdir); $(MAKEINFO) eshell.texi
175eshell.dvi: eshell.texi
176 $(ENVADD) $(TEXI2DVI) ${srcdir}/eshell.texi
177
178../info/cl: cl.texi
179 cd $(srcdir); $(MAKEINFO) cl.texi
180cl.dvi: cl.texi
181 $(ENVADD) $(TEXI2DVI) ${srcdir}/cl.texi
182
183../info/dired-x: dired-x.texi
184 cd $(srcdir); $(MAKEINFO) dired-x.texi
185dired-x.dvi: dired-x.texi
186 $(ENVADD) $(TEXI2DVI) ${srcdir}/dired-x.texi
187
188../info/ediff: ediff.texi
189 cd $(srcdir); $(MAKEINFO) ediff.texi
190ediff.dvi: ediff.texi
191 $(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi
192
193emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA)
194 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi
195
196../info/forms: forms.texi
197 cd $(srcdir); $(MAKEINFO) forms.texi
198forms.dvi: forms.texi
199 $(ENVADD) $(TEXI2DVI) ${srcdir}/forms.texi
200
201# gnus/message/emacs-mime/sieve/pgg are part of Gnus:
202../info/gnus: gnus.texi gnus-faq.texi
203 cd $(srcdir); $(MAKEINFO) gnus.texi
204gnus.dvi: gnus.texi gnus-faq.texi
205 sed -e '/@iflatex/,/@end iflatex/d' ${srcdir}/gnus.texi > gnustmp.texi
206 $(ENVADD) $(TEXI2DVI) gnustmp.texi
207 cp gnustmp.dvi $*.dvi
208 rm gnustmp.*
209
210../info/message: message.texi
211 cd $(srcdir); $(MAKEINFO) message.texi
212message.dvi: message.texi
213 $(ENVADD) $(TEXI2DVI) ${srcdir}/message.texi
214
215../info/sieve: sieve.texi
216 cd $(srcdir); $(MAKEINFO) sieve.texi
217sieve.dvi: sieve.texi
218 $(ENVADD) $(TEXI2DVI) ${srcdir}/sieve.texi
219
220../info/emacs-mime: emacs-mime.texi
221 cd $(srcdir); $(MAKEINFO) --enable-encoding emacs-mime.texi
222emacs-mime.dvi: emacs-mime.texi
223 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-mime.texi
224
225../info/pgg: pgg.texi
226 cd $(srcdir); $(MAKEINFO) pgg.texi
227pgg.dvi: pgg.texi
228 $(ENVADD) $(TEXI2DVI) ${srcdir}/pgg.texi
229
230../info/mh-e: mh-e.texi
231 cd $(srcdir); $(MAKEINFO) mh-e.texi
232mh-e.dvi: mh-e.texi
233 $(ENVADD) $(TEXI2DVI) ${srcdir}/mh-e.texi
234
235../info/reftex: reftex.texi
236 cd $(srcdir); $(MAKEINFO) reftex.texi
237reftex.dvi: reftex.texi
238 $(ENVADD) $(TEXI2DVI) ${srcdir}/reftex.texi
239
240../info/sc: sc.texi
241 cd $(srcdir); $(MAKEINFO) sc.texi
242sc.dvi: sc.texi
243 $(ENVADD) $(TEXI2DVI) ${srcdir}/sc.texi
244
245../info/vip: vip.texi
246 cd $(srcdir); $(MAKEINFO) vip.texi
247vip.dvi: vip.texi
248 $(ENVADD) $(TEXI2DVI) ${srcdir}/vip.texi
249
250../info/viper: viper.texi
251 cd $(srcdir); $(MAKEINFO) viper.texi
252viper.dvi: viper.texi
253 $(ENVADD) $(TEXI2DVI) ${srcdir}/viper.texi
254
255../info/widget: widget.texi
256 cd $(srcdir); $(MAKEINFO) widget.texi
257widget.dvi: widget.texi
258 $(ENVADD) $(TEXI2DVI) ${srcdir}/widget.texi
259
260../info/efaq: faq.texi
261 cd $(srcdir); $(MAKEINFO) faq.texi
262faq.dvi: faq.texi
263 $(ENVADD) $(TEXI2DVI) ${srcdir}/faq.texi
264
265../etc/GNU: gnu1.texi gnu.texi
266 cd $(srcdir) && makeinfo --no-headers -o ../etc/GNU gnu1.texi
267
268../info/autotype: autotype.texi
269 cd $(srcdir); $(MAKEINFO) autotype.texi
270autotype.dvi: autotype.texi
271 $(ENVADD) $(TEXI2DVI) ${srcdir}/autotype.texi
272
273../info/calc: calc.texi
274 cd $(srcdir); $(MAKEINFO) calc.texi
275
276calc.dvi: calc.texi
277 $(ENVADD) $(TEXI2DVI) ${srcdir}/calc.texi
278
279# This is produced with --no-split to avoid making files whose
280# names clash on DOS 8+3 filesystems
281../info/idlwave: idlwave.texi
282 cd $(srcdir); $(MAKEINFO) --no-split idlwave.texi
283idlwave.dvi: idlwave.texi
284 $(ENVADD) $(TEXI2DVI) ${srcdir}/idlwave.texi
285
286../info/eudc: eudc.texi
287 cd $(srcdir); $(MAKEINFO) eudc.texi
288eudc.dvi: eudc.texi
289 $(ENVADD) $(TEXI2DVI) ${srcdir}/eudc.texi
290
291../info/ebrowse: ebrowse.texi
292 cd $(srcdir); $(MAKEINFO) ebrowse.texi
293ebrowse.dvi: ebrowse.texi
294 $(ENVADD) $(TEXI2DVI) ${srcdir}/ebrowse.texi
295
296../info/woman: woman.texi
297 cd $(srcdir); $(MAKEINFO) woman.texi
298woman.dvi: woman.texi
299 $(ENVADD) $(TEXI2DVI) ${srcdir}/woman.texi
300
301../info/org: org.texi
302 cd $(srcdir); $(MAKEINFO) org.texi
303org.dvi: org.texi
304 $(ENVADD) $(TEXI2DVI) ${srcdir}/org.texi
305
306../info/url: url.texi
307 cd $(srcdir); $(MAKEINFO) url.texi
308url.dvi: url.texi
309 $(ENVADD) $(TEXI2DVI) ${srcdir}/url.texi
310
311../info/speedbar: speedbar.texi
312 cd $(srcdir); $(MAKEINFO) speedbar.texi
313speedbar.dvi: speedbar.texi
314 $(ENVADD) $(TEXI2DVI) ${srcdir}/speedbar.texi
315
316../info/tramp: tramp.texi trampver.texi
317 cd $(srcdir); $(MAKEINFO) -D emacs tramp.texi
318tramp.dvi: tramp.texi trampver.texi
319 $(ENVADD) $(TEXI2DVI) ${srcdir}/tramp.texi
320
321../info/ses: ses.texi
322 cd $(srcdir); $(MAKEINFO) ses.texi
323ses.dvi: ses.texi
324 $(ENVADD) $(TEXI2DVI) ${srcdir}/ses.texi
325
326../info/smtpmail: smtpmail.texi
327 cd $(srcdir); $(MAKEINFO) smtpmail.texi
328smtpmail.dvi: smtpmail.texi
329 $(ENVADD) $(TEXI2DVI) ${srcdir}/smtpmail.texi
330
331../info/flymake: flymake.texi
332 cd $(srcdir); $(MAKEINFO) flymake.texi
333flymake.dvi: flymake.texi
334 $(ENVADD) $(TEXI2DVI) ${srcdir}/flymake.texi
335
336../info/newsticker: newsticker.texi
337 cd $(srcdir); $(MAKEINFO) newsticker.texi
338newsticker.dvi: newsticker.texi
339 $(ENVADD) $(TEXI2DVI) ${srcdir}/newsticker.texi
340
341../info/rcirc: rcirc.texi
342 cd $(srcdir); $(MAKEINFO) rcirc.texi
343rcirc.dvi: rcirc.texi
344 $(ENVADD) $(TEXI2DVI) ${srcdir}/rcirc.texi
345
346../info/erc: erc.texi
347 cd $(srcdir); $(MAKEINFO) erc.texi
348erc.dvi: erc.texi
349 $(ENVADD) $(TEXI2DVI) ${srcdir}/erc.texi
350
351mostlyclean:
352 rm -f *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.*
353
354clean: mostlyclean
355 rm -f *.dvi
356
357distclean: clean
358
359maintainer-clean: distclean
360 rm -f *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc
361 for file in $(INFO_TARGETS); do rm -f $${file}*; done
362
363
364# Formerly this directory had texindex.c and getopt.c in it
365# and this makefile built them to make texindex.
366# That caused trouble because this is run entirely in the source directory.
367# Since we expect to get texi2dvi from elsewhere,
368# it is ok to expect texindex from elsewhere also.
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi
new file mode 100644
index 00000000000..585e28318e7
--- /dev/null
+++ b/doc/emacs/abbrevs.texi
@@ -0,0 +1,457 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, 2003,
3@c 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Abbrevs
6@chapter Abbrevs
7@cindex abbrevs
8@cindex expansion (of abbrevs)
9
10 A defined @dfn{abbrev} is a word which @dfn{expands}, if you insert
11it, into some different text. Abbrevs are defined by the user to expand
12in specific ways. For example, you might define @samp{foo} as an abbrev
13expanding to @samp{find outer otter}. Then you could insert
14@samp{find outer otter } into the buffer by typing @kbd{f o o
15@key{SPC}}.
16
17 A second kind of abbreviation facility is called @dfn{dynamic abbrev
18expansion}. You use dynamic abbrev expansion with an explicit command
19to expand the letters in the buffer before point by looking for other
20words in the buffer that start with those letters. @xref{Dynamic
21Abbrevs}.
22
23 ``Hippie'' expansion generalizes abbreviation expansion.
24@xref{Hippie Expand, , Hippie Expansion, autotype, Features for
25Automatic Typing}.
26
27@menu
28* Abbrev Concepts:: Fundamentals of defined abbrevs.
29* Defining Abbrevs:: Defining an abbrev, so it will expand when typed.
30* Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion.
31* Editing Abbrevs:: Viewing or editing the entire list of defined abbrevs.
32* Saving Abbrevs:: Saving the entire list of abbrevs for another session.
33* Dynamic Abbrevs:: Abbreviations for words already in the buffer.
34* Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling.
35@end menu
36
37@node Abbrev Concepts
38@section Abbrev Concepts
39
40 An @dfn{abbrev} is a word which has been defined to @dfn{expand} into
41a specified @dfn{expansion}. When you insert a word-separator character
42following the abbrev, that expands the abbrev---replacing the abbrev
43with its expansion. For example, if @samp{foo} is defined as an abbrev
44expanding to @samp{find outer otter}, then you can insert @samp{find
45outer otter.} into the buffer by typing @kbd{f o o .}.
46
47@findex abbrev-mode
48@vindex abbrev-mode
49@cindex Abbrev mode
50@cindex mode, Abbrev
51 Abbrevs expand only when Abbrev mode (a minor mode) is enabled.
52Disabling Abbrev mode does not cause abbrev definitions to be forgotten,
53but they do not expand until Abbrev mode is enabled again. The command
54@kbd{M-x abbrev-mode} toggles Abbrev mode; with a numeric argument, it
55turns Abbrev mode on if the argument is positive, off otherwise.
56@xref{Minor Modes}. @code{abbrev-mode} is also a variable; Abbrev mode is
57on when the variable is non-@code{nil}. The variable @code{abbrev-mode}
58automatically becomes local to the current buffer when it is set.
59
60 Abbrevs can have @dfn{mode-specific} definitions, active only in one major
61mode. Abbrevs can also have @dfn{global} definitions that are active in
62all major modes. The same abbrev can have a global definition and various
63mode-specific definitions for different major modes. A mode-specific
64definition for the current major mode overrides a global definition.
65
66 You can define abbrevs interactively during the editing session. You
67can also save lists of abbrev definitions in files for use in later
68sessions. Some users keep extensive lists of abbrevs that they load
69in every session.
70
71@node Defining Abbrevs
72@section Defining Abbrevs
73
74@table @kbd
75@item C-x a g
76Define an abbrev, using one or more words before point as its expansion
77(@code{add-global-abbrev}).
78@item C-x a l
79Similar, but define an abbrev specific to the current major mode
80(@code{add-mode-abbrev}).
81@item C-x a i g
82Define a word in the buffer as an abbrev (@code{inverse-add-global-abbrev}).
83@item C-x a i l
84Define a word in the buffer as a mode-specific abbrev
85(@code{inverse-add-mode-abbrev}).
86@item M-x define-global-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET}
87Define @var{abbrev} as an abbrev expanding into @var{exp}.
88@item M-x define-mode-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET}
89Define @var{abbrev} as a mode-specific abbrev expanding into @var{exp}.
90@item M-x kill-all-abbrevs
91Discard all abbrev definitions, leaving a blank slate.
92@end table
93
94@kindex C-x a g
95@findex add-global-abbrev
96 The usual way to define an abbrev is to enter the text you want the
97abbrev to expand to, position point after it, and type @kbd{C-x a g}
98(@code{add-global-abbrev}). This reads the abbrev itself using the
99minibuffer, and then defines it as an abbrev for one or more words before
100point. Use a numeric argument to say how many words before point should be
101taken as the expansion. For example, to define the abbrev @samp{foo} as
102mentioned above, insert the text @samp{find outer otter} and then type
103@kbd{C-u 3 C-x a g f o o @key{RET}}.
104
105 An argument of zero to @kbd{C-x a g} means to use the contents of the
106region as the expansion of the abbrev being defined.
107
108@kindex C-x a l
109@findex add-mode-abbrev
110 The command @kbd{C-x a l} (@code{add-mode-abbrev}) is similar, but
111defines a mode-specific abbrev. Mode-specific abbrevs are active only in a
112particular major mode. @kbd{C-x a l} defines an abbrev for the major mode
113in effect at the time @kbd{C-x a l} is typed. The arguments work the same
114as for @kbd{C-x a g}.
115
116@kindex C-x a i g
117@findex inverse-add-global-abbrev
118@kindex C-x a i l
119@findex inverse-add-mode-abbrev
120 If the abbrev text itself is already in the buffer, you can use the
121commands @kbd{C-x a i g} (@code{inverse-add-global-abbrev}) and
122@kbd{C-x a i l} (@code{inverse-add-mode-abbrev}) to define it as an
123abbrev by specify the expansion in the minibuffer. These commands are
124called ``inverse'' because they invert the meaning of the two text
125strings they use (one from the buffer and one read with the
126minibuffer).
127
128@findex define-mode-abbrev
129@findex define-global-abbrev
130 You can define an abbrev without inserting either the abbrev or its
131expansion in the buffer using the command @code{define-global-abbrev}.
132It reads two arguments---the abbrev, and its expansion. The command
133@code{define-mode-abbrev} does likewise for a mode-specific abbrev.
134
135 To change the definition of an abbrev, just define a new definition.
136When the abbrev has a prior definition, the abbrev definition commands
137ask for confirmation before replacing it.
138
139@findex kill-all-abbrevs
140 To remove an abbrev definition, give a negative argument to the
141abbrev definition command: @kbd{C-u - C-x a g} or @kbd{C-u - C-x a l}.
142The former removes a global definition, while the latter removes a
143mode-specific definition. @kbd{M-x kill-all-abbrevs} removes all
144abbrev definitions, both global and local.
145
146@node Expanding Abbrevs
147@section Controlling Abbrev Expansion
148
149 When Abbrev mode is enabled, an abbrev expands whenever it is
150present in the buffer just before point and you type a self-inserting
151whitespace or punctuation character (@key{SPC}, comma, etc.@:). More
152precisely, any character that is not a word constituent expands an
153abbrev, and any word-constituent character can be part of an abbrev.
154The most common way to use an abbrev is to insert it and then insert a
155punctuation or whitespace character to expand it.
156
157@vindex abbrev-all-caps
158 Abbrev expansion preserves case; thus, @samp{foo} expands into @samp{find
159outer otter}; @samp{Foo} into @samp{Find outer otter}, and @samp{FOO} into
160@samp{FIND OUTER OTTER} or @samp{Find Outer Otter} according to the
161variable @code{abbrev-all-caps} (setting it non-@code{nil} specifies
162@samp{FIND OUTER OTTER}).
163
164 These commands are used to control abbrev expansion:
165
166@table @kbd
167@item M-'
168Separate a prefix from a following abbrev to be expanded
169(@code{abbrev-prefix-mark}).
170@item C-x a e
171@findex expand-abbrev
172Expand the abbrev before point (@code{expand-abbrev}).
173This is effective even when Abbrev mode is not enabled.
174@item M-x expand-region-abbrevs
175Expand some or all abbrevs found in the region.
176@end table
177
178@kindex M-'
179@findex abbrev-prefix-mark
180 You may wish to expand an abbrev and attach a prefix to the expansion;
181for example, if @samp{cnst} expands into @samp{construction}, you might want
182to use it to enter @samp{reconstruction}. It does not work to type
183@kbd{recnst}, because that is not necessarily a defined abbrev. What
184you can do is use the command @kbd{M-'} (@code{abbrev-prefix-mark}) in
185between the prefix @samp{re} and the abbrev @samp{cnst}. First, insert
186@samp{re}. Then type @kbd{M-'}; this inserts a hyphen in the buffer to
187indicate that it has done its work. Then insert the abbrev @samp{cnst};
188the buffer now contains @samp{re-cnst}. Now insert a non-word character
189to expand the abbrev @samp{cnst} into @samp{construction}. This
190expansion step also deletes the hyphen that indicated @kbd{M-'} had been
191used. The result is the desired @samp{reconstruction}.
192
193 If you actually want the text of the abbrev in the buffer, rather than
194its expansion, you can accomplish this by inserting the following
195punctuation with @kbd{C-q}. Thus, @kbd{foo C-q ,} leaves @samp{foo,} in
196the buffer, not expanding it.
197
198@findex unexpand-abbrev
199 If you expand an abbrev by mistake, you can undo the expansion and
200bring back the abbrev itself by typing @kbd{C-_} to undo (@pxref{Undo}).
201This also undoes the insertion of the non-word character that expanded
202the abbrev. If the result you want is the terminating non-word
203character plus the unexpanded abbrev, you must reinsert the terminating
204character, quoting it with @kbd{C-q}. You can also use the command
205@kbd{M-x unexpand-abbrev} to cancel the last expansion without
206deleting the terminating character.
207
208@findex expand-region-abbrevs
209 @kbd{M-x expand-region-abbrevs} searches through the region for defined
210abbrevs, and for each one found offers to replace it with its expansion.
211This command is useful if you have typed in text using abbrevs but forgot
212to turn on Abbrev mode first. It may also be useful together with a
213special set of abbrev definitions for making several global replacements at
214once. This command is effective even if Abbrev mode is not enabled.
215
216 Expanding any abbrev first runs the hook @code{pre-abbrev-expand-hook}
217(@pxref{Hooks}).
218
219@need 1500
220@node Editing Abbrevs
221@section Examining and Editing Abbrevs
222
223@table @kbd
224@item M-x list-abbrevs
225Display a list of all abbrev definitions. With a numeric argument, list
226only local abbrevs.
227@item M-x edit-abbrevs
228Edit a list of abbrevs; you can add, alter or remove definitions.
229@end table
230
231@findex list-abbrevs
232 The output from @kbd{M-x list-abbrevs} looks like this:
233
234@example
235@var{various other tables@dots{}}
236(lisp-mode-abbrev-table)
237"dk" 0 "define-key"
238(global-abbrev-table)
239"dfn" 0 "definition"
240@end example
241
242@noindent
243(Some blank lines of no semantic significance, and some other abbrev
244tables, have been omitted.)
245
246 A line containing a name in parentheses is the header for abbrevs in a
247particular abbrev table; @code{global-abbrev-table} contains all the global
248abbrevs, and the other abbrev tables that are named after major modes
249contain the mode-specific abbrevs.
250
251 Within each abbrev table, each nonblank line defines one abbrev. The
252word at the beginning of the line is the abbrev. The number that
253follows is the number of times the abbrev has been expanded. Emacs
254keeps track of this to help you see which abbrevs you actually use, so
255that you can eliminate those that you don't use often. The string at
256the end of the line is the expansion.
257
258 Some abbrevs are marked with @samp{(sys)}. These ``system'' abbrevs
259(@pxref{Abbrevs,,, elisp, The Emacs Lisp Reference Manual}) are
260pre-defined by various modes, and are not saved to your abbrev file.
261To disable a ``system'' abbrev, define an abbrev of the same name that
262expands to itself, and save it to your abbrev file.
263
264@findex edit-abbrevs
265@kindex C-c C-c @r{(Edit Abbrevs)}
266 @kbd{M-x edit-abbrevs} allows you to add, change or kill abbrev
267definitions by editing a list of them in an Emacs buffer. The list has
268the same format described above. The buffer of abbrevs is called
269@samp{*Abbrevs*}, and is in Edit-Abbrevs mode. Type @kbd{C-c C-c} in
270this buffer to install the abbrev definitions as specified in the
271buffer---and delete any abbrev definitions not listed.
272
273 The command @code{edit-abbrevs} is actually the same as
274@code{list-abbrevs} except that it selects the buffer @samp{*Abbrevs*}
275whereas @code{list-abbrevs} merely displays it in another window.
276
277@node Saving Abbrevs
278@section Saving Abbrevs
279
280 These commands allow you to keep abbrev definitions between editing
281sessions.
282
283@table @kbd
284@item M-x write-abbrev-file @key{RET} @var{file} @key{RET}
285Write a file @var{file} describing all defined abbrevs.
286@item M-x read-abbrev-file @key{RET} @var{file} @key{RET}
287Read the file @var{file} and define abbrevs as specified therein.
288@item M-x quietly-read-abbrev-file @key{RET} @var{file} @key{RET}
289Similar but do not display a message about what is going on.
290@item M-x define-abbrevs
291Define abbrevs from definitions in current buffer.
292@item M-x insert-abbrevs
293Insert all abbrevs and their expansions into current buffer.
294@end table
295
296@findex write-abbrev-file
297 @kbd{M-x write-abbrev-file} reads a file name using the minibuffer and
298then writes a description of all current abbrev definitions into that
299file. This is used to save abbrev definitions for use in a later
300session. The text stored in the file is a series of Lisp expressions
301that, when executed, define the same abbrevs that you currently have.
302
303@findex read-abbrev-file
304@findex quietly-read-abbrev-file
305@vindex abbrev-file-name
306 @kbd{M-x read-abbrev-file} reads a file name using the minibuffer
307and then reads the file, defining abbrevs according to the contents of
308the file. The function @code{quietly-read-abbrev-file} is similar
309except that it does not display a message in the echo area; you cannot
310invoke it interactively, and it is used primarily in the @file{.emacs}
311file. If either of these functions is called with @code{nil} as the
312argument, it uses the file name specified in the variable
313@code{abbrev-file-name}, which is by default @code{"~/.abbrev_defs"}.
314That file is your standard abbrev definition file, and Emacs loads
315abbrevs from it automatically when it starts up.
316
317@vindex save-abbrevs
318 Emacs will offer to save abbrevs automatically if you have changed
319any of them, whenever it offers to save all files (for @kbd{C-x s} or
320@kbd{C-x C-c}). It saves them in the file specified by
321@code{abbrev-file-name}. This feature can be inhibited by setting the
322variable @code{save-abbrevs} to @code{nil}.
323
324@findex insert-abbrevs
325@findex define-abbrevs
326 The commands @kbd{M-x insert-abbrevs} and @kbd{M-x define-abbrevs} are
327similar to the previous commands but work on text in an Emacs buffer.
328@kbd{M-x insert-abbrevs} inserts text into the current buffer after point,
329describing all current abbrev definitions; @kbd{M-x define-abbrevs} parses
330the entire current buffer and defines abbrevs accordingly.
331
332@node Dynamic Abbrevs
333@section Dynamic Abbrev Expansion
334
335 The abbrev facility described above operates automatically as you
336insert text, but all abbrevs must be defined explicitly. By contrast,
337@dfn{dynamic abbrevs} allow the meanings of abbreviations to be
338determined automatically from the contents of the buffer, but dynamic
339abbrev expansion happens only when you request it explicitly.
340
341@kindex M-/
342@kindex C-M-/
343@findex dabbrev-expand
344@findex dabbrev-completion
345@table @kbd
346@item M-/
347Expand the word in the buffer before point as a @dfn{dynamic abbrev},
348by searching in the buffer for words starting with that abbreviation
349(@code{dabbrev-expand}).
350
351@item C-M-/
352Complete the word before point as a dynamic abbrev
353(@code{dabbrev-completion}).
354@end table
355
356@vindex dabbrev-limit
357 For example, if the buffer contains @samp{does this follow } and you
358type @kbd{f o M-/}, the effect is to insert @samp{follow} because that
359is the last word in the buffer that starts with @samp{fo}. A numeric
360argument to @kbd{M-/} says to take the second, third, etc.@: distinct
361expansion found looking backward from point. Repeating @kbd{M-/}
362searches for an alternative expansion by looking farther back. After
363scanning all the text before point, it searches the text after point.
364The variable @code{dabbrev-limit}, if non-@code{nil}, specifies how far
365away in the buffer to search for an expansion.
366
367@vindex dabbrev-check-all-buffers
368 After scanning the current buffer, @kbd{M-/} normally searches other
369buffers, unless you have set @code{dabbrev-check-all-buffers} to
370@code{nil}.
371
372@vindex dabbrev-ignored-buffer-regexps
373 For finer control over which buffers to scan, customize the variable
374@code{dabbrev-ignored-buffer-regexps}. Its value is a list of regular
375expressions. If a buffer's name matches any of these regular
376expressions, dynamic abbrev expansion skips that buffer.
377
378 A negative argument to @kbd{M-/}, as in @kbd{C-u - M-/}, says to
379search first for expansions after point, then other buffers, and
380consider expansions before point only as a last resort. If you repeat
381the @kbd{M-/} to look for another expansion, do not specify an
382argument. Repeating @kbd{M-/} cycles through all the expansions after
383point and then the expansions before point.
384
385 After you have expanded a dynamic abbrev, you can copy additional
386words that follow the expansion in its original context. Simply type
387@kbd{@key{SPC} M-/} for each additional word you want to copy. The
388spacing and punctuation between words is copied along with the words.
389
390 The command @kbd{C-M-/} (@code{dabbrev-completion}) performs
391completion of a dynamic abbrev. Instead of trying the possible
392expansions one by one, it finds all of them, then inserts the text
393that they have in common. If they have nothing in common, @kbd{C-M-/}
394displays a list of completions, from which you can select a choice in
395the usual manner. @xref{Completion}.
396
397 Dynamic abbrev expansion is completely independent of Abbrev mode; the
398expansion of a word with @kbd{M-/} is completely independent of whether
399it has a definition as an ordinary abbrev.
400
401@node Dabbrev Customization
402@section Customizing Dynamic Abbreviation
403
404 Normally, dynamic abbrev expansion ignores case when searching for
405expansions. That is, the expansion need not agree in case with the word
406you are expanding.
407
408@vindex dabbrev-case-fold-search
409 This feature is controlled by the variable
410@code{dabbrev-case-fold-search}. If it is @code{t}, case is ignored in
411this search; if it is @code{nil}, the word and the expansion must match
412in case. If the value of @code{dabbrev-case-fold-search} is
413@code{case-fold-search}, which is true by default, then the variable
414@code{case-fold-search} controls whether to ignore case while searching
415for expansions.
416
417@vindex dabbrev-case-replace
418 Normally, dynamic abbrev expansion preserves the case pattern
419@emph{of the dynamic abbrev you are expanding}, by converting the
420expansion to that case pattern.
421
422@vindex dabbrev-case-fold-search
423 The variable @code{dabbrev-case-replace} controls whether to
424preserve the case pattern of the dynamic abbrev. If it is @code{t},
425the dynamic abbrev's case pattern is preserved in most cases; if it is
426@code{nil}, the expansion is always copied verbatim. If the value of
427@code{dabbrev-case-replace} is @code{case-replace}, which is true by
428default, then the variable @code{case-replace} controls whether to
429copy the expansion verbatim.
430
431 However, if the expansion contains a complex mixed case pattern, and
432the dynamic abbrev matches this pattern as far as it goes, then the
433expansion is always copied verbatim, regardless of those variables.
434Thus, for example, if the buffer contains
435@code{variableWithSillyCasePattern}, and you type @kbd{v a M-/}, it
436copies the expansion verbatim including its case pattern.
437
438@vindex dabbrev-abbrev-char-regexp
439 The variable @code{dabbrev-abbrev-char-regexp}, if non-@code{nil},
440controls which characters are considered part of a word, for dynamic expansion
441purposes. The regular expression must match just one character, never
442two or more. The same regular expression also determines which
443characters are part of an expansion. The value @code{nil} has a special
444meaning: dynamic abbrevs are made of word characters, but expansions are
445made of word and symbol characters.
446
447@vindex dabbrev-abbrev-skip-leading-regexp
448 In shell scripts and makefiles, a variable name is sometimes prefixed
449with @samp{$} and sometimes not. Major modes for this kind of text can
450customize dynamic abbrev expansion to handle optional prefixes by setting
451the variable @code{dabbrev-abbrev-skip-leading-regexp}. Its value
452should be a regular expression that matches the optional prefix that
453dynamic abbrev expression should ignore.
454
455@ignore
456 arch-tag: 638e0079-9540-48ec-9166-414083e16445
457@end ignore
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
new file mode 100644
index 00000000000..d5dbf1ae8ca
--- /dev/null
+++ b/doc/emacs/ack.texi
@@ -0,0 +1,1574 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
3@c 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@c
6@node Acknowledgments, Screen, Concept Index, Top
7@unnumbered Acknowledgments
8
9Many people have contributed code included in the Free Software
10Foundation's distribution of GNU Emacs. To show our appreciation for
11their public spirit, we list here in alphabetical order those who have
12written substantial portions.
13
14@c We should list here anyone who has contributed a new package,
15@c and anyone who has made major enhancements in Emacs
16@c that many users would notice and consider important.
17
18@itemize @bullet
19@item
20Per Abrahamsen wrote the customization buffer facilities, as well as
21@file{double.el} for typing accented characters not normally available
22from the keyboard, @file{xt-mouse.el} which handles mouse commands
23through Xterm, @file{gnus-cus.el} which implements customization
24commands for Gnus, @file{gnus-cite.el}, a citation-parsing facility
25for news articles and @file{cpp.el} which hides or highlights parts of
26C programs according to preprocessor conditionals.
27
28@item
29Tomas Abrahamsson wrote @file{artist.el}, a package for producing @acronym{ASCII}
30art with a mouse or with keyboard keys.
31
32@item
33Jay K.@: Adams wrote @file{jka-compr.el}, providing automatic
34decompression and recompression for compressed files.
35
36@item
37Ralf Angeli wrote @file{scroll-lock.el}, a minor mode which keeps the
38point vertically fixed by scrolling the window when moving up and down
39in the buffer.
40
41@item
42Joe Arceneaux wrote the original text property implementation, and
43implemented support for X11.
44
45@item
46Miles Bader wrote @file{image-file.el}, support code for visiting
47image files, @file{minibuf-eldef.el}, a minor mode whereby the default
48value is shown in the minibuffer prompt only when appropriate, and
49@file{button.el}, the library that implements clickable buttons.
50
51@item
52David Bakhash wrote @file{strokes.el}, a mode for controlling Emacs by
53moving the mouse in particular patterns.
54
55@item
56Eli Barzilay wrote @file{calculator.el}, a desktop calculator for
57Emacs.
58
59@item
60Steven L.@: Baur wrote
61@c If earcon.el actually works with Emacs 21, it isn't useful for lack
62@c of sound files. -- fx
63@c @file{earcon.el}, a facility for sound effects
64@c for email and news messages,
65@file{footnote.el} which lets you include
66footnotes in email messages, and @file{gnus-audio.el} which provides
67sound effects for Gnus.
68
69@item
70Alexander L. Belikoff, Sergey Berezin, David Edmondson, Andreas
71Fuchs, Mario Lang, Gergely Nagy, Michael Olson, and Alex Schroeder
72contributed ERC, an advanced Internet Relay Chat client.
73
74@item
75Boaz Ben-Zvi wrote @file{profile.el}, to time Emacs Lisp functions.
76
77@item
78Anna M. Bigatti wrote @file{cal-html.el}, which produces HTML calendars.
79
80@item
81Ray Blaak wrote @file{delphi.el}, a major mode for editing Delphi
82(Object Pascal) source code.
83
84@item
85Jim Blandy wrote Emacs 19's input system, brought its configuration and
86build process up to the GNU coding standards, and contributed to the
87frame support and multi-face support. Jim also wrote @file{tvi970.el},
88terminal support for the TeleVideo 970 terminals.
89
90@item
91Per Bothner wrote @file{term.el}, a terminal emulator in an Emacs
92buffer.
93
94@item
95Terrence M.@: Brannon wrote @file{landmark.el}, a neural-network robot
96that learns landmarks.
97
98@item
99Frank Bresz wrote @file{diff.el}, a program to display @code{diff}
100output.
101
102@item
103Peter Breton implemented:
104
105@itemize @minus
106@item
107@file{dirtrack} which does better tracking of directory changes in shell
108buffers,
109@item
110@file{filecache.el} which records which directories your files are in,
111@item
112@file{locate.el} which interfaces to the @code{locate} command,
113@item
114@file{find-lisp.el}, an Emacs Lisp emulation of the @code{find} program,
115@item
116@file{net-utils.el}, and
117@item
118the ``generic mode'' feature.
119@end itemize
120
121@item
122Emmanuel Briot wrote @file{xml.el}, an XML parser for Emacs.
123
124@item
125Kevin Broadey wrote @file{foldout.el}, providing folding extensions to
126Emacs's outline modes.
127
128@c @item
129@c Vincent Broman wrote @file{ada.el}, a mode for editing Ada code
130@c (since replaced by @file{ada-mode.el}).
131
132@item
133David M.@: Brown wrote @file{array.el}, for editing arrays and other
134tabular data.
135
136@item
137W@l{}odek Bzyl and Ryszard Kubiak wrote @file{ogonek.el}, a package for
138changing the encoding of Polish characters.
139
140@item
141Bill Carpenter provided @file{feedmail.el}, a package for massaging
142outgoing mail messages and sending them through various popular mailers.
143
144@item
145Per Cederqvist and Inge Wallin wrote @file{ewoc.el}, an Emacs widget for
146manipulating object collections.
147
148@item
149Hans Chalupsky wrote @file{advice.el}, an overloading mechanism for
150Emacs Lisp functions, and @file{trace.el}, a tracing facility for Emacs
151Lisp.
152
153@item
154Chris Chase and Carsten Dominik wrote @file{idlwave.el}, an editing mode
155for IDL and WAVE CL.
156
157@item
158Bob Chassell wrote @file{texnfo-upd.el} and @file{makeinfo.el}, modes
159and utilities for working with Texinfo files; and @file{page-ext.el},
160commands for extended page handling.
161
162@item
163Andrew Choi wrote the Macintosh support code, and contributed
164@file{mac-win.el}, support for the Mac window system.
165
166@item
167James Clark wrote @file{sgml-mode.el}, a mode for editing SGML
168documents, and contributed to Emacs's dumping procedures.
169
170@item
171Mike Clarkson wrote @file{edt.el}, an emulation of DEC's EDT editor.
172
173@item
174Glynn Clements provided @file{gamegrid.el} and a couple of games that
175use it, Snake and Tetris.
176
177@item
178Georges Brun-Cottan and Stefan Monnier wrote @file{easy-mmode.el}, a
179package for easy definition of major and minor modes.
180
181@item
182Andrew Csillag wrote M4 mode (@file{m4-mode.el}).
183
184@item
185Doug Cutting and Jamie Zawinski wrote @file{disass.el}, a disassembler
186for compiled Emacs Lisp code.
187
188@item
189Mathias Dahl wrote @file{image-dired.el}, a package for viewing image
190files as ``thumbnails.''
191
192@item
193Michael DeCorte wrote @file{emacs.csh}, a C-shell script that starts a
194new Emacs job, or restarts a paused Emacs if one exists.
195
196@item
197Gary Delp wrote @file{mailpost.el}, an interface between RMAIL and the
198@file{/usr/uci/post} mailer.
199
200@item
201Matthieu Devin wrote @file{delsel.el}, a package to make newly-typed
202text replace the current selection.
203
204@item
205Eric Ding contributed @file{goto-addr.el},
206
207@item
208Jan Dj@"{a}rv added support for the GTK+ toolkit and X drag-and-drop.
209
210@item
211Carsten Dominik wrote @file{reftex.el}, a package for setting up
212labels and cross-references in La@TeX{} documents, and @file{org.el},
213a mode for maintaining notes, todo lists, and project planning.
214
215@item
216Scott Draves wrote @file{tq.el}, help functions for maintaining
217transaction queues between Emacs and its subprocesses.
218
219@item
220Benjamin Drieu wrote @file{pong.el}, an implementation of the classical
221pong game.
222
223@item
224Viktor Dukhovni wrote support for dumping under SunOS version 4.
225
226@item
227John Eaton co-wrote Octave mode.
228
229@item
230Rolf Ebert co-wrote Ada mode (@file{ada-mode.el}).
231
232@item
233Stephen Eglen implemented @file{mspools.el}, for use with Procmail,
234which tells you which mail folders have mail waiting in them, and
235@file{iswitchb.el}, a feature for incremental reading and completion of
236buffer names.
237
238@item
239Torbj@"orn
240Einarsson contributed the Fortran 90 mode (@file{f90.el}).
241
242@item
243Tsugutomo Enami co-wrote the support for international character sets.
244
245@item
246Hans Henrik Eriksen wrote @file{simula.el}, a mode for editing SIMULA 87
247code.
248
249@item
250Michael Ernst wrote @file{reposition.el}, a command for recentering a
251function's source code and preceding comment on the screen.
252
253@item
254Ata Etemadi wrote @file{cdl.el}, functions for working with Common Data
255Language source code.
256
257@item
258Frederick Farnbach implemented @file{morse.el}, which converts text to
259Morse code.
260
261@item
262Oscar Figueiredo wrote EUDC, the Emacs Unified Directory Client, which
263is an interface to directory servers via LDAP, CCSO PH/QI, or BBDB; and
264@file{ldap.el}, the LDAP client interface.
265
266@item
267Fred Fish wrote the support for dumping COFF executable files.
268
269@item
270Karl Fogel wrote:
271
272@itemize @minus
273@item
274@file{bookmark.el}, for creating named placeholders, saving them and
275jumping to them later,
276@item
277@file{mail-hist.el}, a history mechanism for outgoing mail messages, and
278@item
279@file{saveplace.el}, for preserving point's location in files between
280editing sessions.
281@end itemize
282
283@item
284Gary Foster wrote @file{crisp.el}, the emulation for CRiSP and Brief
285editors, and @file{scroll-lock.el} (now @file{scroll-all.el}) a mode
286for scrolling several buffers together.
287
288@item
289Noah Friedman wrote @file{rlogin.el}, an interface to Rlogin,
290@file{type-break.el}, which reminds you to take periodic breaks from
291typing, and @code{eldoc-mode}, a mode to show the defined parameters or
292the doc string for the Lisp function near point. With Roland McGrath,
293he wrote @file{rsz-mini.el}, a minor mode to automatically resize the
294minibuffer to fit the text it contains.
295
296@item
297Keith Gabryelski wrote @file{hexl.el}, a mode for editing binary files.
298
299@item
300Kevin Gallagher rewrote and enhanced the EDT emulation, and wrote
301@file{flow-ctrl.el}, a package for coping with unsuppressible XON/XOFF
302flow control.
303
304@item
305Kevin Gallo added multiple-frame support for Windows NT and wrote
306@file{w32-win.el}, support functions for the MS-Windows window system.
307
308@item
309Juan Le@'{o}n Lahoz Garc@'{i}a wrote @file{wdired.el}, a package for
310performing file operations by directly editing Dired buffers.
311
312@item
313Howard Gayle wrote:
314
315@itemize @minus
316@item
317the C and lisp code for display tables and case tables,
318@item
319@file{rot13.el}, a command to display the plain-text form of a buffer
320encoded with the Caesar cipher,
321@item
322@file{case-table.el}, code to extend the character set and support case
323tables,
324@item
325much of the support for the ISO-8859 European character sets (which
326includes @file{iso-ascii.el}, @file{iso-insert.el}, @file{iso-swed.el},
327@file{latin-1.el}, @file{iso-syntax.el}, @file{iso-transl.el},
328@file{swedish.el}), and
329@item
330@file{vt100-led.el}, a package for controlling the LED's on
331VT100-compatible terminals.
332@end itemize
333
334@item
335Stephen Gildea made the Emacs quick reference card, and made many
336contributions for @file{time-stamp.el}, a package for maintaining
337last-change time stamps in files.
338
339@item
340Julien Gilles wrote @file{gnus-ml.el}, a mailing list minor mode for
341Gnus.
342
343@item
344David Gillespie wrote:
345
346@itemize @minus
347@item
348The Common Lisp compatibility packages,
349@item
350@code{Calc}, an advanced calculator and mathematical tool,
351@item
352@file{complete.el}, a partial completion mechanism, and
353@item
354@file{edmacro.el}, a package for editing keyboard macros.
355@end itemize
356
357@item
358Bob Glickstein contributed the @file{sregex.el} feature, a facility for
359writing regexps using a Lisp-like syntax.
360
361@item
362Boris Goldowsky wrote:
363
364@itemize @minus
365@item
366@file{avoid.el}, a package to keep the mouse cursor out of the way of
367the text cursor,
368@item
369@file{shadowfile.el}, a package for keeping identical copies of files in
370more than one place,
371@item
372@file{format.el}, a package for reading and writing files in various
373formats,
374@item
375@file{enriched.el}, a package for saving text properties in files, and
376@item
377@file{facemenu.el}, a package for specifying faces.
378@end itemize
379
380@item
381Michelangelo Grigni wrote @file{ffap.el} which visits a file,
382taking the file name from the buffer.
383
384@item
385Odd Gripenstam wrote @file{dcl-mode.el} for editing DCL command files.
386
387@item
388Kai Gro@ss{}johann and Michael Albinus wrote the Tramp package, which
389provides transparent remote file editing using rcp, ssh, ftp, and other
390network protocols.
391
392@item
393Michael Gschwind wrote @file{iso-cvt.el}, a package to convert between
394the ISO 8859-1 character set and the notations for non-@acronym{ASCII}
395characters used by @TeX{} and net tradition, and @file{latin-2.el}, code
396which sets up case-conversion and syntax tables for the ISO Latin-2
397character set.
398
399@item
400Henry Guillaume wrote @file{find-file.el}, a package to visit files
401related to the currently visited file.
402
403@item
404Doug Gwyn wrote the portable @code{alloca} implementation.
405
406@item
407Ken'ichi Handa implemented most of the support for international
408character sets, and wrote @file{isearch-x.el}, a facility for searching
409non-@acronym{ASCII} text. Together with Naoto Takahashi, he wrote
410@file{quail.el}, a simple input facility for typing non-@acronym{ASCII} text from
411an @acronym{ASCII} keyboard. Ken'ichi also wrote @file{ps-bdf.el}, a BDF font
412support for printing non-@acronym{ASCII} text on a PostScript printer.
413
414@item
415Chris Hanson wrote @file{netuname.el}, a package to use HP-UX's Remote
416File Access facility from Emacs.
417
418@item
419Jesper Harder wrote @file{yenc.el}, for decoding yenc encoded messages.
420
421@item
422K. Shane Hartman wrote:
423
424@itemize @minus
425@item
426@file{chistory.el} and @file{echistory.el}, packages for browsing
427command history lists,
428@item
429@file{electric.el} and @file{helper.el}, providing an alternative
430command loop and appropriate help facilities,
431@item
432@file{emacsbug.el}, a package for reporting Emacs bugs,
433@item
434@file{picture.el}, a mode for editing @acronym{ASCII} pictures, and
435@item
436@file{view.el}, a package for perusing files and buffers without editing
437them.
438@end itemize
439
440@item
441John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el},
442which provide alternative mouse-based editing and scrolling features.
443
444@item
445Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation
446format of Unicode.
447
448@item
449Markus Heritsch co-wrote Ada mode (@file{ada-mode.el}).
450
451@item
452Karl Heuer wrote the original blessmail script, implemented the
453@code{intangible} text property, and rearranged the structure of the
454@code{Lisp_Object} type to allow for more data bits.
455
456@item
457Manabu Higashida ported Emacs to MS-DOS.
458
459@item
460Anders Holst wrote @file{hippie-exp.el}, a versatile completion and
461expansion package.
462
463@item
464Kurt Hornik co-wrote Octave mode.
465
466@item
467Tom Houlder wrote @file{mantemp.el}, which generates manual C@t{++}
468template instantiations.
469
470@item
471Joakim Hove wrote @file{html2text.el}, a html to plain text converter.
472@item
473Denis Howe wrote @file{browse-url.el}, a package for invoking a WWW
474browser to display a URL.
475
476@item
477Lars Magne Ingebrigtsen did a major redesign of the Gnus news-reader and
478wrote many of its parts.
479
480@item
481Andrew Innes contributed extensively to the MS-Windows support.
482
483@item
484Seiichiro Inoue improved Emacs's XIM support.
485
486@item
487Ulf Jasper wrote @file{icalendar.el}, a package for converting Emacs
488diary entries to and from the iCalendar format, and
489@file{newsticker.el}, an RSS and Atom based Newsticker.
490
491@item
492Kyle Jones wrote @file{life.el}, a package to play Conway's ``life'' game,
493and @file{mldrag.el}, a package which allows the user to resize windows
494by dragging mode lines and vertical window separators with the mouse.
495
496@item
497Terry Jones wrote @file{shadow.el}, a package for finding potential
498load-path problems when some Lisp file ``shadows'' another.
499
500@item
501Simon Josefsson wrote:
502
503@itemize @minus
504@item
505@file{dns-mode.el}, an editing mode for Domain Name System master files,
506@item
507@file{flow-fill.el}, a package for interpreting RFC2646 formatted text
508in messages,
509@item
510@file{fringe.el}, a package for customizing the fringe,
511@item
512@file{imap.el}, an Emacs Lisp library for talking to IMAP servers,
513@item
514@file{nnimap}, the IMAP back-end for Gnus, and
515@item
516@file{rfc2104.el}, a hashed message authentication facility.
517@end itemize
518
519@item
520Arne J@o{}rgensen wrote @file{latexenc.el}, a package to
521automatically guess the correct coding system in LaTeX files.
522
523@item
524Tomoji Kagatani implemented @file{smtpmail.el}, used for sending out
525mail with SMTP.
526
527@item
528David Kaufman wrote @file{yow.c}, an essential utility program for the
529hopelessly pinheaded.
530
531@item
532Henry Kautz wrote @file{bib-mode.el}, a mode for maintaining
533bibliography databases compatible with @code{refer} (the @code{troff}
534version) and @code{lookbib}, and @file{refbib.el}, a package to convert
535those databases to the format used by the LaTeX text formatting package.
536
537@item
538Taichi Kawabata added support for Devanagari script and the Indian
539languages.
540
541@item
542Howard Kaye wrote @file{sort.el}, commands to sort text in Emacs
543buffers.
544
545@item
546Michael Kifer wrote @file{ediff.el}, an interactive interface to the
547@command{diff}, @command{patch}, and @command{merge} programs, and
548Viper, the newest emulation for VI.
549
550@item
551Richard King wrote the first version of @file{userlock.el} and
552@file{filelock.c}, which provide simple support for multiple users
553editing the same file. He also wrote the initial version of
554@file{uniquify.el}, a facility to make buffer names unique by adding
555parts of the file's name to the buffer name.
556@c We're not using his backquote.el any more.
557
558@item
559Peter Kleiweg wrote @file{ps-mode.el}, a major mode for editing
560PostScript files and running a PostScript interpreter interactively from
561within Emacs.
562
563@item
564Pavel Kobiakov wrote @file{flymake.el}, a minor mode for performing
565on-the-fly syntax checking.
566
567@item
568Larry K.@: Kolodney wrote @file{cvtmail.c}, a program to convert the mail
569directories used by Gosling Emacs into RMAIL format.
570
571@item
572David M.@: Koppelman wrote @file{hi-lock.el}, a minor mode for
573interactive automatic highlighting of parts of the buffer text.
574
575@item
576Koseki Yoshinori wrote @file{iimage.el}, a minor mode for displaying
577inline images.
578
579@item
580Robert Krawitz wrote the original @file{xmenu.c}, part of Emacs's pop-up
581menu support.
582
583@item
584Sebastian Kremer wrote Emacs 19's @code{dired-mode}, with contributions
585by Lawrence R.@: Dodd. He also wrote @file{ls-lisp.el}, a Lisp emulation
586of the @code{ls} command for platforms which don't have @code{ls} as a
587standard program.
588
589@item
590Geoff Kuenning wrote Emacs 19's @file{ispell.el}, based on work by Ken
591Stevens and others.
592
593@item
594David K@ringaccent{a}gedal wrote @file{tempo.el}, providing support for
595easy insertion of boilerplate text and other common constructions.
596
597@item
598Daniel LaLiberte wrote:
599
600@itemize @minus
601@item
602@file{edebug.el}, a source-level debugger for Emacs Lisp,
603@item
604@file{cl-specs.el}, specifications to help @code{edebug} debug code
605written using David Gillespie's Common Lisp support,
606@item
607@file{cust-print.el}, a customizable package for printing lisp objects,
608@item
609@file{eval-reg.el}, a re-implementation of @code{eval-region} in Emacs
610Lisp, and
611@item
612@file{isearch.el}, Emacs's incremental search minor mode.
613@end itemize
614
615@item
616James R.@: Larus wrote @file{mh-e.el}, an interface to the MH mail system.
617
618@item
619Vinicius Jose Latorre wrote the Emacs printing facilities, as well as:
620
621@itemize @minus
622@item
623@code{ps-print}, a package for pretty-printing Emacs buffers to
624PostScript printers,
625@item
626@file{delim-col.el}, a package to arrange text into columns,
627@item
628@file{ebnf2ps.el}, a package that translates EBNF grammar to a syntactic
629chart that can be printed to a PostScript printer.
630@end itemize
631
632@item
633Frederic Lepied contributed @file{expand.el}, which uses the abbrev
634mechanism for inserting programming constructs.
635
636@item
637Peter Liljenberg wrote @file{elint.el}, a Lint-style code checker for
638Emacs Lisp programs.
639
640@item
641Lars Lindberg wrote @file{msb.el}, which provides more flexible menus
642for buffer selection, and rewrote @file{dabbrev.el}.
643
644@item
645Anders Lindgren wrote @file{autorevert.el}, a package for automatically
646reverting files visited by Emacs that were changed on disk;
647@file{cwarn.el}, a package to highlight suspicious C and C@t{++}
648constructs; and @file{follow.el}, a minor mode to synchronize windows
649that show the same buffer.
650
651@item
652Thomas Link wrote @file{filesets.el}, a package for handling sets of
653files.
654
655@item
656Dave Love wrote much of the code dealing with Unicode support and
657Latin-N unification. He added support for many coding systems,
658including those in @file{code-pages.el} and the various UTF-7 and
659UTF-16 coding systems. He also wrote:
660
661@itemize @minus
662@item
663@code{autoarg-mode}, a global minor mode whereby digit keys supply
664prefix arguments, and @code{autoarg-kp-mode} which redefines the keypad
665numeric keys to digit arguments,
666@item
667@file{autoconf.el}, a mode for editing Autoconf @file{configure.in}
668files,
669@item
670@file{cfengine.el}, a mode for editing Cfengine files,
671@item
672@file{elide-head.el}, a package for eliding boilerplate text, such as
673copyright notices, from file headers,
674@item
675@file{hl-line.el}, a package that provides a minor mode for highlighting
676the line in the current window on which point is,
677@item
678@file{latin-8.el} and @file{latin-9.el}, code which sets up
679case-conversion and syntax tables for the ISO Latin-8 and Latin-9
680character sets,
681@item
682@file{latin1-disp.el}, a package that lets you display ISO 8859
683characters on Latin-1 terminals by setting up appropriate display
684tables,
685@item
686@file{python.el}, a major mode for the Python programming language.
687@item
688@file{refill.el}, a mode for automatic paragraph refilling, akin to
689typical word processors,
690@item
691@file{smiley-ems.el}, a facility for displaying smiley faces, and
692@item
693@file{tool-bar.el}, a mode to control the display of the Emacs tool bar.
694@end itemize
695
696@item
697Eric Ludlam wrote the Speedbar package and the following packages:
698
699@itemize @minus
700@item
701@file{checkdoc.el}, for checking doc strings in Emacs Lisp programs,
702@item
703@file{dframe.el}, providing dedicatd frame support modes, and
704@item
705@file{ezimage.el}, a generalized way to place images over text.
706@end itemize
707
708@item
709Alan Mackenzie wrote the integrated AWK support in CC Mode.
710
711@item
712Christopher J.@: Madsen wrote @file{decipher.el}, a package for cracking
713simple substitution ciphers.
714
715@item
716Neil M.@: Mager wrote @file{appt.el}, functions to notify users of their
717appointments. It finds appointments recorded in the diary files
718generated by Edward M.@: Reingold's @code{calendar} package.
719
720@item
721Ken Manheimer wrote @file{allout.el}, a mode for manipulating and
722formatting outlines, and @file{icomplete.el}, which provides incremental
723completion feedback in the minibuffer.
724
725@item
726Bill Mann wrote @file{perl-mode.el}, a mode for editing Perl code.
727
728@item
729Brian Marick and Daniel LaLiberte wrote @file{hideif.el}, support for
730hiding selected code within C @code{#ifdef} clauses.
731
732@item
733Simon Marshall wrote @file{regexp-opt.el}, which generates a regular
734expression from a list of strings. He also extended @file{comint.el},
735originally written by Olin Shivers.
736
737@item
738Bengt Martensson, Marc Shapiro, Mike Newton, Aaron Larson, and Stefan
739Schoef, wrote @file{bibtex.el}, a mode for editing Bib@TeX{}
740bibliography files.
741
742@item
743Charlie Martin wrote @file{autoinsert.el}, which provides automatic
744mode-sensitive insertion of text into new files.
745
746@item
747Thomas May wrote @file{blackbox.el}, a version of the traditional
748blackbox game.
749
750@item
751Roland McGrath wrote:
752
753@itemize @minus
754@item
755@file{compile.el}, a package for running compilations in a buffer, and
756then visiting the locations reported in error messages,
757@item
758@file{etags.el}, a package for jumping to function definitions and
759searching or replacing in all the files mentioned in a @file{TAGS} file,
760@item
761@file{find-dired.el}, for using @code{dired} commands on output from the
762@code{find} program, with Sebastian Kremer,
763@item
764@file{map-ynp.el}, a general purpose boolean question-asker,
765@item
766@file{autoload.el}, providing semi-automatic maintenance of autoload
767files, and
768@item
769@file{upd-copyr.el}, providing semi-automatic maintenance of copyright
770notices in source code.
771@end itemize
772
773@item
774David Megginson wrote @file{derived.el}, which allows one to define new
775major modes by inheriting key bindings and commands from existing major
776modes.
777
778@item
779Will Mengarini wrote @file{repeat.el}, a command to repeat the preceding
780command with its arguments.
781
782@item
783Wayne Mesard wrote @file{hscroll.el} which does horizontal scrolling
784automatically.
785
786@item
787Brad Miller wrote @file{gnus-gl.el}, a Gnus interface for GroupLens.
788
789@item
790Richard Mlynarik wrote:
791
792@itemize @minus
793@item
794@file{cl-indent.el}, a package for indenting Common Lisp code,
795@item
796@file{ebuff-menu.el}, an ``electric'' browser for buffer listings,
797@item
798@file{ehelp.el}, bindings for browsing help screens,
799@item
800@file{rfc822.el}, a parser for E-mail addresses in the RFC-822 format,
801used in mail messages and news articles,
802@item
803@file{terminal.el}, a terminal emulator for Emacs subprocesses, and
804@item
805@file{yow.el}, an essential utility (try @kbd{M-x yow}).
806@end itemize
807
808@item
809Gerd Moellmann was the Emacs maintainer from the beginning of Emacs 21
810development until the release of 21.1. He wrote:
811
812@itemize @minus
813@item
814the new display engine for Emacs 21,
815@item
816the asynchronous timers facility (@file{atimer.c}),
817@item
818the @code{ebrowse} C@t{++} browser,
819@item
820@file{jit-lock.el}, the Just-In-Time font-lock support mode,
821@item
822@file{tooltip.el}, a package for displaying tooltips, and
823@item
824@file{authors.el} package for maintaining the @file{AUTHORS} files.
825@end itemize
826
827@item
828Stefan Monnier added support for Arch, Subversion, and Meta-CVS to VC,
829and re-wrote much of the Emacs server to use the built-in networking
830primitives. He also wrote:
831
832@itemize @minus
833@item
834@code{PCL-CVS}, a directory-level front end to the CVS version control
835system,
836@item
837@file{reveal.el}, a minor mode for automatically revealing invisible
838text,
839@item
840@file{smerge-mode.el}, a minor mode for resolving @code{diff3}
841conflicts, and
842@item
843@file{diff-mode.el}, a mode for viewing and editing context diffs.
844@end itemize
845
846@item
847Morioka Tomohiko wrote several packages for MIME support in Gnus and
848elsewhere.
849
850@item
851Sen Nagata wrote @file{crm.el}, a package for reading multiple strings
852with completion, and @file{rfc2368.el}, support for @code{mailto:}
853URLs.
854
855@item
856Erik Naggum wrote the time-conversion functions. He also wrote
857@file{disp-table.el}, a package for dealing with display tables,
858@file{latin-4.el} and @file{latin-5.el}, code which sets up
859case-conversion and syntax tables for the ISO Latin-4 and Latin-5
860character sets, @file{mailheader.el}, a package for parsing email
861headers, and @file{parse-time.el}, a package for parsing time strings.
862
863@item
864Thomas Neumann and Eric Raymond wrote @file{makefile.el} (now
865@file{make-mode.el}), a mode for editing makefiles.
866
867@item
868Thien-Thi Nguyen and Dan Nicolaescu wrote @file{hideshow.el}, a minor
869mode for selectively displaying blocks of text.
870
871@item
872Dan Nicolaescu wrote @file{romanian.el}, support for editing Romanian
873text, and @file{iris-ansi.el}, support for running Emacs on SGI's
874@code{xwsh} and @code{winterm} terminal emulators.
875
876@item
877Jurgen Nickelsen wrote @file{ws-mode.el}, providing WordStar emulation.
878
879@item
880Hrvoje Niksic wrote @file{savehist.el}, for saving the minibuffer
881history between Emacs sessions.
882
883@item
884Jeff Norden wrote @file{kermit.el}, a package to help the Kermit
885dialup communications program run comfortably in an Emacs shell buffer.
886
887@item
888Andrew Norman wrote @file{ange-ftp.el}, providing transparent FTP
889support.
890
891@item
892Alexandre Oliva wrote @file{gnus-mlspl.el}, a group params-based mail
893splitting mechanism.
894
895@item
896Takaaki Ota wrote @file{table.el}, a package for creating and editing
897embedded text-based tables.
898
899@item
900Pieter E.@: J.@: Pareit wrote @file{mixal-mode.el}, an editing mode for
901the MIX assembly language.
902
903@item
904David Pearson contributed @file{quickurl.el}, a simple method of
905inserting a URL into the current buffer based on text at point;
906@file{5x5.el}, a game to fill all squares on the field.
907
908@item
909Jeff Peck wrote:
910
911@itemize @minus
912@item
913@file{emacstool.c}, support for running Emacs under SunView/Sun Windows,
914@item
915@file{sun.el}, key bindings for sunterm keys,
916@item
917@file{sun-curs.el}, cursor definitions for Sun Windows, and
918@item
919@file{sun-fns.el} and @file{sun-mouse.el}, providing mouse support for
920Sun Windows.
921@end itemize
922
923@item
924Damon Anton Permezel wrote @file{hanoi.el}, an animated demonstration of
925the ``Towers of Hanoi'' puzzle.
926
927@item
928William M.@: Perry wrote @file{mailcap.el}, a MIME media types
929configuration facility, @file{mwheel.el}, a package for supporting
930mouse wheels, and the URL package.
931
932@item
933Per Persson wrote @file{gnus-vm.el}, the VM interface for Gnus.
934
935@item
936Jens Petersen wrote @file{find-func.el}, which makes it easy to find
937the source code for an Emacs Lisp function or variable.
938
939@item
940Daniel Pfeiffer wrote:
941
942@itemize @minus
943@item
944@file{conf-mode.el}, a major mode for editing configuration files,
945@item
946@file{copyright.el}, a package for updating copyright notices in files,
947@item
948@file{executable.el}, a package for executing interpreter scripts,
949@item
950@file{sh-script.el}, a mode for editing shell scripts,
951@item
952@file{skeleton.el}, implementing a concise language for writing
953statement skeletons, and
954@item
955@file{two-column.el}, a minor mode for simultaneous two-column editing.
956@end itemize
957
958Daniel also rewrote @file{apropos.el}, originally written by Joe Wells,
959and, together with Jim Blandy, co-authored @file{wyse50.el}, support for
960Wyse 50 terminals.
961
962@item
963Richard L.@: Pieri wrote @file{pop3.el}, a Post Office Protocol (RFC
9641460) interface for Emacs.
965
966@item
967Fred Pierresteguy and Paul Reilly made Emacs work with X Toolkit
968widgets.
969
970@item
971Christian Plaunt wrote @file{soundex.el}, an implementation of the
972Soundex algorithm for comparing English words by their pronunciation.
973
974@item
975David Ponce wrote:
976
977@itemize @minus
978@item
979@file{recentf.el}, a package that puts a menu of recently visited
980files in the Emacs menu bar,
981@item
982@file{ruler-mode.el}, a minor mode for displaying a ruler in the
983header line, and
984@item
985@file{tree-widget.el}, a package to display hierarchical data structures.
986@end itemize
987
988@item
989Francesco A.@: Potorti wrote @file{cmacexp.el}, providing a command which
990runs the C preprocessor on a region of a file and displays the results.
991He also expanded and redesigned the @code{etags} program.
992
993@item
994Michael D.@: Prange and Steven A.@: Wood wrote @file{fortran.el}, a mode for
995editing FORTRAN code.
996@c We're not distributing his tex-mode.el anymore; we're using Ed Reingold's.
997
998@item
999Mukesh Prasad contributed @file{vmsproc.el}, a facility for running
1000asynchronous subprocesses on VMS.
1001
1002@item
1003Marko Rahamaa wrote @file{latin-3.el}, code which sets up
1004case-conversion and syntax tables for the ISO Latin-3 character set.
1005
1006@item
1007Ashwin Ram wrote @file{refer.el}, commands to look up references in
1008bibliography files by keyword.
1009
1010@item
1011Eric S.@: Raymond wrote:
1012
1013@itemize @minus
1014@item
1015@file{vc.el}, an interface to the RCS and SCCS source code version
1016control systems, with Paul Eggert,
1017@item
1018@file{gud.el}, a package for running source-level debuggers like GDB
1019and SDB in Emacs,
1020@item
1021@file{asm-mode.el}, a mode for editing assembly language code,
1022@item
1023@file{AT386.el}, terminal support package for IBM's AT keyboards,
1024@item
1025@file{cookie1.el}, support for ``fortune-cookie'' programs like
1026@file{yow.el} and @file{spook.el},
1027@item
1028@file{finder.el}, a package for finding Emacs Lisp packages by keyword
1029and topic,
1030@item
1031@file{keyswap.el}, code to swap the @key{BS} and @key{DEL} keys,
1032@item
1033@file{loadhist.el}, functions for loading and unloading Emacs features,
1034@item
1035@file{lisp-mnt.el}, functions for working with the special headers used
1036in Emacs Lisp library files, and
1037@item
1038code to set and make use of the @code{load-history} lisp variable, which
1039records the source file from which each lisp function loaded into Emacs
1040came.
1041@end itemize
1042
1043@item
1044Edward M.@: Reingold wrote the extensive calendar and diary support (try
1045@kbd{M-x calendar}), with contributions from Stewart Clamen, Nachum
1046Dershowitz, Paul Eggert, Steve Fisk, Michael Kifer, and Lara Rios. Andy
1047Oram contributed to its documentation. Reingold has also contributed to
1048@file{tex-mode.el}, a mode for editing @TeX{} files, as have William
1049F.@: Schelter, Dick King, Stephen Gildea, Michael Prange, and Jacob Gore.
1050
1051@item
1052David Reitter wrote @file{mailclient.el} which can send mail via the
1053system's designated mail client.
1054
1055@item
1056Alex Rezinsky contributed @file{which-func.el}, a mode that shows the
1057name of the current function in the mode line.
1058
1059@item
1060Rob Riepel contributed @file{tpu-edt.el} and its associated files,
1061providing an emulation of the VMS TPU text editor emulating the VMS EDT
1062editor, and @file{vt-control.el}, providing some control functions for
1063the DEC VT line of terminals.
1064
1065@item
1066Nick Roberts wrote @file{gdb-ui.el}, the graphical user interface to
1067GDB.
1068
1069@item
1070Roland B.@: Roberts contributed much of the VMS support distributed with
1071Emacs 19, along with Joseph M.@: Kelsey, and @file{vms-pmail.el}, support
1072for using Emacs within VMS MAIL.
1073
1074@item
1075John Robinson wrote @file{bg-mouse.el}, support for the mouse on the BBN
1076Bitgraph terminal.
1077
1078@item
1079Danny Roozendaal implemented @file{handwrite.el}, which converts text
1080into ``handwriting.''
1081
1082@item
1083William Rosenblatt wrote @file{float.el}, implementing a floating-point
1084numeric type using Lisp cons cells and integers.
1085
1086@item
1087Guillermo J.@: Rozas wrote @file{scheme.el}, a mode for editing Scheme and
1088DSSSL code, and @file{fakemail.c}, an interface to the System V mailer.
1089
1090@item
1091Ivar Rummelhoff provided @file{winner.el}, which records
1092recent window configurations so you can move back to them.
1093
1094@item
1095Jason Rumney has ported the Emacs 21 display engine to MS-Windows, and
1096contributed extensively to the MS-Windows port of Emacs.
1097
1098@item
1099Wolfgang Rupprecht contributed Emacs 19's floating-point support
1100(including @file{float-sup.el} and @file{floatfns.c}), and
1101@file{sup-mouse.el}, support for the Supdup mouse on lisp machines.
1102
1103@item
1104Kevin Ryde wrote @file{info-xref.el}, a library for checking
1105references in Info files.
1106
1107@item
1108James B.@: Salem and Brewster Kahle wrote @file{completion.el}, providing
1109dynamic word completion.
1110
1111@item
1112Masahiko Sato wrote @file{vip.el}, an emulation of the VI editor.
1113
1114@item
1115Holger Schauer wrote @file{fortune.el}, a package for using fortune in
1116message signatures.
1117
1118@item
1119William Schelter wrote @file{telnet.el}, support for @code{telnet}
1120sessions within Emacs.
1121
1122@item
1123Ralph Schleicher contributed @file{battery.el}, a package for displaying
1124laptop computer battery status, and @file{info-look.el}, a package for
1125looking up Info documentation for symbols in the buffer.
1126
1127@item
1128Michael Schmidt and Tom Perrine wrote @file{modula2.el}, a mode for
1129editing Modula-2 code, based on work by Mick Jordan and Peter Robinson.
1130
1131@item
1132Ronald S.@: Schnell wrote @file{dunnet.el}, a text adventure game.
1133
1134@item
1135Philippe Schnoebelen wrote @file{gomoku.el}, a Go Moku game played
1136against Emacs, and @file{mpuz.el}, a multiplication puzzle.
1137
1138@item
1139Jan Schormann wrote @file{solitaire.el}, an Emacs Lisp implementation of
1140the Solitaire game.
1141
1142@item
1143Alex Schroeder wrote @file{ansi-color.el}, a package for translating
1144ANSI color escape sequences to Emacs faces, and @file{sql.el}, a package
1145for interactively running an SQL interpreter in an Emacs buffer.
1146
1147@item
1148Randal Schwartz wrote @file{pp.el}, a pretty-printer for lisp objects.
1149
1150@item
1151Oliver Seidel wrote @file{todo-mode.el}, a package for maintaining
1152@file{TODO} list files.
1153
1154@item
1155Manuel Serrano contributed the Flyspell package that does spell checking
1156as you type.
1157
1158@item
1159Hovav Shacham wrote @file{windmove.el}, a set of commands for selecting
1160windows based on their geometrical position on the frame.
1161
1162@item
1163Stanislav Shalunov wrote @file{uce.el}, for responding to unsolicited
1164commercial email.
1165
1166@item
1167Richard Sharman contributed @file{hilit-chg.el}, which uses colors
1168to show recent editing changes.
1169
1170@item
1171Olin Shivers wrote:
1172
1173@itemize @minus
1174@item
1175@file{comint.el}, a library for modes running interactive command-line-
1176oriented subprocesses,
1177@item
1178@file{cmuscheme.el}, for running inferior Scheme processes,
1179@item
1180@file{inf-lisp.el}, for running inferior Lisp process, and
1181@item
1182@file{shell.el}, for running inferior shells.
1183@end itemize
1184
1185@item
1186Espen Skoglund wrote @file{pascal.el}, a mode for editing Pascal code.
1187
1188@item
1189Rick Sladkey wrote @file{backquote.el}, a lisp macro for creating
1190mostly-constant data.
1191
1192@item
1193Lynn Slater wrote @file{help-macro.el}, a macro for writing interactive
1194help for key bindings.
1195
1196@item
1197Chris Smith wrote @file{icon.el}, a mode for editing Icon code.
1198
1199@item
1200David Smith wrote @file{ielm.el}, a mode for interacting with the Emacs
1201Lisp interpreter as a subprocess.
1202
1203@item
1204Paul D.@: Smith wrote @file{snmp-mode.el}.
1205
1206@item
1207William Sommerfeld wrote @file{scribe.el}, a mode for editing Scribe
1208files, and @file{server.el}, a package allowing programs to send files
1209to an extant Emacs job to be edited.
1210
1211@item
1212Andre Spiegel made many contributions to the Emacs Version Control
1213package, and in particular made it support multiple back ends.
1214
1215@item
1216Michael Staats wrote @file{pc-select.el}, which rebinds keys for
1217selecting regions to follow many other systems.
1218
1219@item
1220Richard Stallman invented Emacs, and then wrote:
1221
1222@itemize @minus
1223@item
1224@file{easymenu.el}, a facility for defining Emacs menus,
1225@item
1226@file{menu-bar.el}, the Emacs menu bar support code,
1227@item
1228@file{paren.el}, a package to make matching parentheses stand out in
1229color, and
1230@item
1231most of the rest of Emacs code.
1232@end itemize
1233
1234@item
1235Sam Steingold wrote @file{gulp.el}, a facility for asking package
1236maintainers for updated versions of their packages via e-mail, and
1237@file{midnight.el}, a package for running a command every midnight.
1238
1239@item
1240Ake Stenhoff and Lars Lindberg wrote @file{imenu.el}, a framework for
1241browsing indices made from buffer contents.
1242
1243@item
1244Peter Stephenson contributed @file{vcursor.el}, which implements a
1245``virtual cursor'' that you can move with the keyboard and use for
1246copying text.
1247
1248@item
1249Ken Stevens wrote the initial version of @file{ispell.el} and maintains
1250that package since Ispell 3.1 release.
1251
1252@item
1253Jonathan Stigelman wrote @file{hilit19.el}, a package providing
1254automatic highlighting in source code buffers, mail readers, and other
1255contexts.
1256
1257@item
1258Kim F.@: Storm made many improvements to the Emacs display engine,
1259process support, and networking support. He also wrote:
1260
1261@itemize @minus
1262@item
1263@file{bindat.el}, a package for encoding and decoding binary data.
1264@item
1265@file{cua.el}, which allows Emacs to emulate the standard CUA key
1266bindings.
1267@item
1268@file{ido.el}, a package for selecting buffers and files quickly.
1269@item
1270@file{kmacro.el}, the keyboard macro facility.
1271@end itemize
1272
1273@item
1274Martin Stjernholm co-authored CC Mode, a major editing mode for C,
1275C@t{++}, Objective-C, Java, Pike, CORBA IDL, and AWK code.
1276
1277@item
1278Steve Strassman did not write @file{spook.el}, and even if he did, he
1279really didn't mean for you to use it in an anarchistic way.
1280
1281@item
1282Olaf Sylvester wrote @file{bs.el}, a package for manipulating Emacs
1283buffers.
1284
1285@item
1286Tibor @v{S}imko and Milan Zamazal wrote @file{slovak.el}, support for
1287editing text in Slovak language.
1288
1289@item
1290Naoto Takahashi wrote @file{utf-8.el}, support for encoding and
1291decoding UTF-8 data.
1292
1293@item
1294Luc Teirlinck wrote @file{help-at-pt.el}, providing local help through
1295the keyboard.
1296
1297@item
1298Jean-Philippe Theberge wrote @file{thumbs.el}, a package for viewing
1299image files as ``thumbnails.''
1300
1301@item
1302Jens T.@: Berger Thielemann wrote @file{word-help.el}, which is
1303part of the basis for @file{info-look.el}.
1304
1305@item
1306Spencer Thomas wrote the original @file{dabbrev.el}, providing a command
1307which completes the partial word before point, based on other nearby
1308words for which it is a prefix. He also wrote the original dumping
1309support.
1310
1311@item
1312Jim Thompson wrote @file{ps-print.el}, which converts
1313Emacs text to PostScript.
1314
1315@item
1316Tom Tromey and Chris Lindblad wrote @file{tcl.el}, a major mode for
1317editing Tcl/Tk source files and running a Tcl interpreter as an Emacs
1318subprocess.
1319
1320@item
1321Eli Tziperman wrote @file{rmail-spam-filter.el}, a spam filter for RMAIL.
1322@item
1323Daiki Ueno wrote @file{starttls.el}, support for Transport Layer
1324Security protocol, and the PGG package adding GnuPG and PGP support.
1325
1326@item
1327Masanobu Umeda wrote:
1328
1329@itemize @minus
1330@item
1331GNUS, a feature-full reader for Usenet news,
1332@item
1333@file{prolog.el}, a mode for editing Prolog code,
1334@item
1335@file{rmailsort.el}, a package for sorting messages in RMAIL folders,
1336@item
1337@file{metamail.el}, an interface to the Metamail program,
1338@item
1339@file{gnus-kill.el}, the Kill File mode for Gnus,
1340@item
1341@file{gnus-mh.el}, an mh-e interface for Gnus,
1342@item
1343@file{gnus-msg.el}, a mail and post interface for Gnus,
1344@item
1345@file{tcp.el}, emulation of the @code{open-network-stream} function for
1346some Emacs configurations which lack it, and
1347@item
1348@file{timezone.el}, providing functions for dealing with time zones.
1349@end itemize
1350
1351@item
1352Rajesh Vaidheeswarran wrote @file{whitespace.el}, a package that
1353detects and cleans up excess whitespace in a file.
1354
1355@item
1356Neil W.@: Van Dyke wrote @file{webjump.el}, a ``hot links'' package.
1357
1358@item
1359Didier Verna contributed @file{rect.el}, a package of functions for
1360operations on rectangle regions of text.
1361
1362@item
1363Ulrik Vieth implemented @file{meta-mode.el}, for editing MetaFont code.
1364
1365@item
1366Geoffrey Voelker wrote the Windows NT support. He also wrote
1367@file{dos-w32.el}, functions shared by the MS-DOS and MS-Windows ports
1368of Emacs, and @file{w32-fns.el}, MS-Windows specific support functions.
1369
1370@item
1371Johan Vromans wrote @file{forms.el} and its associated files, a
1372mode for filling in forms.
1373
1374@item
1375Colin Walters wrote @file{ibuffer.el}, a Dired-like major mode for
1376operating on buffers.
1377
1378@item
1379Barry Warsaw wrote:
1380
1381@itemize @minus
1382@item
1383@file{assoc.el}, a set of utility functions for working with association
1384lists,
1385@item
1386@file{cc-mode.el}, a major mode for editing C, C@t{++}, and Java code,
1387based on earlier work by Dave Detlefs, Stewart Clamen, and Richard
1388Stallman,
1389@item
1390@file{elp.el}, a new profiler for Emacs Lisp programs.
1391@item
1392@file{man.el}, a mode for reading UNIX manual pages,
1393@item
1394@file{regi.el}, providing an AWK-like functionality for use in lisp
1395programs,
1396@item
1397@file{reporter.el}, providing customizable bug reporting for lisp
1398packages, and
1399@item
1400@file{supercite.el}, a minor mode for quoting sections of mail messages
1401and news articles.
1402@end itemize
1403
1404@item
1405Morten Welinder introduced face support into the MS-DOS port of Emacs,
1406and also wrote:
1407
1408@itemize @minus
1409@item
1410@file{desktop.el}, facilities for saving some of Emacs's state between
1411sessions,
1412@item
1413@file{timer.el}, the Emacs facility to run commands at a given time or
1414frequency, or when Emacs is idle, and its C-level support code,
1415@item
1416@file{pc-win.el}, the MS-DOS ``window-system'' support,
1417@item
1418@file{internal.el}, an ``internal terminal'' emulator for the MS-DOS
1419port of Emacs,
1420@item
1421@file{arc-mode.el}, the mode for editing compressed archives,
1422@item
1423@file{s-region.el}, commands for setting the region using the shift key
1424and motion commands, and
1425@item
1426@file{dos-fns.el}, functions for use under MS-DOS.
1427@end itemize
1428
1429He also helped port Emacs to MS-DOS.
1430
1431@item
1432Joseph Brian Wells wrote:
1433
1434@itemize @minus
1435@item
1436@file{apropos.el}, a command to find commands, functions, and variables
1437whose names contain matches for a regular expression,
1438@item
1439@file{resume.el}, support for processing command-line arguments after
1440resuming a suspended Emacs job, and
1441@item
1442@file{mail-extr.el}, a package for extracting names and addresses from
1443mail headers, with contributions from Jamie Zawinski.
1444@end itemize
1445
1446@item
1447Rodney Whitby and Reto Zimmermann wrote @file{vhdl-mode.el}, a major
1448mode for editing VHDL source code.
1449
1450@item
1451John Wiegley wrote @file{align.el}, a set of commands for aligning text
1452according to regular-expression based rules; @file{timeclock.el}, a
1453package for keeping track of time spent on projects;
1454@file{pcomplete.el}, a programmable completion facility; and
1455@code{eshell}, a command shell implemented entirely in Emacs Lisp.
1456
1457@item
1458Ed Wilkinson wrote @file{b2m.c}, a program to convert mail files from
1459RMAIL format to Unix @code{mbox} format.
1460
1461@item
1462Mike Williams wrote @file{mouse-sel.el}, providing enhanced mouse
1463selection, and @file{thingatpt.el}, a library of functions for finding
1464the ``thing'' (word, line, s-expression) containing point.
1465
1466@item
1467Bill Wohler wrote the Emacs interface to the MH mail system.
1468
1469@item
1470Dale R.@: Worley wrote @file{emerge.el}, a package for interactively
1471merging two versions of a file.
1472
1473@item
1474Francis J.@: Wright wrote @code{WoMan}, a package for browsing
1475manual pages without the @code{man} command.
1476
1477@item
1478Tom Wurgler wrote @file{emacs-lock.el}, which makes it harder
1479to exit with valuable buffers unsaved.
1480
1481@item
1482Masatake Yamato wrote @file{ld-script.el}, an editing mode for GNU
1483linker scripts, and contributed subword handling in CC mode.
1484
1485@item
1486Jonathan Yavner wrote @file{testcover.el}, a package for keeping track
1487of the testing status of Emacs Lisp code, and the SES spreadsheet
1488package.
1489
1490@item
1491Ryan Yeske wrote @file{rcirc.el} a simple Internet Relay Chat client.
1492@item
1493Ilya Zakharevich and Bob Olson contributed @file{cperl-mode.el}, a major
1494mode for editing Perl code. Ilya Zakharevich also wrote @file{tmm.el},
1495a mode for accessing the Emacs menu bar on a text-mode terminal.
1496
1497@item
1498Milan Zamazal wrote @file{czech.el}, support for editing Czech text,
1499@file{glasses.el}, a package for easier reading of source code which
1500uses illegible identifier names such as @code{cantReadThisVariable}, and
1501@file{tildify.el}, commands for adding hard spaces to text, @TeX{}, and
1502SGML/HTML files.
1503
1504@item
1505Victor Zandy contributed @file{zone.el}, a package for people who like
1506to zone out in front of Emacs.
1507
1508@item
1509Eli Zaretskii made many standard Emacs features work on MS-DOS. He also
1510wrote @file{tty-colors.el}, which implements transparent mapping of X
1511colors to tty colors, and (together with Kenichi Handa)
1512@file{codepage.el}, a package for editing text encoded in DOS/Windows
1513code pages.
1514
1515@item
1516Jamie Zawinski wrote:
1517
1518@itemize @minus
1519@item
1520Emacs 19's optimizing byte compiler, with Hallvard Furuseth,
1521@item
1522much of the support for faces and X selections,
1523@item
1524@file{mailabbrev.el}, a package providing automatic expansion of mail
1525aliases, and
1526@item
1527@file{tar-mode.el}, providing simple viewing and editing commands for
1528tar files.
1529@end itemize
1530
1531@item
1532Andrew Zhilin created the Emacs icons used beginning with Emacs 22.
1533
1534@item
1535Shenghuo Zhu wrote:
1536
1537@itemize @minus
1538@item
1539@file{binhex.el}, a package for reading and writing binhex files,
1540@item
1541@file{mm-partial.el}, message/partial support for MIME messages,
1542@item
1543@file{rfc1843.el}, an HZ decoding package,
1544@item
1545@file{uudecode.el}, an Emacs Lisp decoder for uuencoded data,
1546@item
1547@file{webmail.el}, an interface to Web mail.
1548@end itemize
1549
1550@item
1551Ian T.@: Zimmerman wrote @file{gametree.el}.
1552
1553@item
1554Neal Ziring and Felix S.@: T.@: Wu wrote @file{vi.el}, an emulation of the
1555VI text editor.
1556
1557@item
1558Detlev Zundel wrote @file{re-builder.el}, a package for building regexps
1559with visual feedback.
1560
1561@end itemize
1562
1563Others too numerous to mention have reported and fixed bugs, and added
1564features to many parts of Emacs. (Many are mentioned in the
1565@file{ChangeLog} files which are summarized in the file @file{AUTHORS}
1566in the distribution.) We thank them for their generosity as well.
1567
1568This list intended to mention every contributor of a major package or
1569feature we currently distribute; if you know of someone we have omitted,
1570please report that as a manual bug.
1571
1572@ignore
1573 arch-tag: bb1d0fa4-0240-4992-b5d4-8602d1e3d4ba
1574@end ignore
diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi
new file mode 100644
index 00000000000..ebff1c7677f
--- /dev/null
+++ b/doc/emacs/anti.texi
@@ -0,0 +1,306 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4
5@node Antinews, Mac OS, X Resources, Top
6@appendix Emacs 21 Antinews
7
8 For those users who live backwards in time, here is information about
9downgrading to Emacs version 21.4. We hope you will enjoy the greater
10simplicity that results from the absence of many Emacs @value{EMACSVER}
11features.
12
13@itemize @bullet
14
15@item
16The buffer position and line number are now displayed at the end of
17the mode line, where they can be more easily seen.
18
19@item
20The mode line of the selected window is no longer displayed with a
21special face. All mode lines are created equal. Meanwhile, you can
22use the variable @code{mode-line-inverse-video} to control whether
23mode lines are highlighted at all---@code{nil} means don't highlight
24them.
25
26@item
27Clicking on a link with the left mouse button (@kbd{mouse-1}) will
28always set point at the position clicked, instead of following the
29link. If you want to follow the link, use the middle mouse button
30(@kbd{mouse-2}).
31
32@item
33Emacs is tired of X droppings. If you drop a file or a piece of text
34onto an Emacs window, nothing will happen.
35
36@item
37On an xterm, even if you enable Xterm Mouse mode, Emacs provides a
38more convincing simulation of a text terminal by not responding to
39mouse clicks on the mode line, header line, or display margin.
40
41@item
42For simplicity, windows always have fringes. We wouldn't want to
43in-fringe anyone's windows. Likewise, horizontal scrolling always
44works in the same automatic way.
45
46@item
47The horizontal-bar cursor shape has been removed.
48
49@item
50If command line arguments are given, Emacs will not display a splash
51screen, so that you can immediately get on with your editing. The
52command-line option @samp{--no-splash} is therefore obsolete, and has
53been removed.
54
55@item
56These command line options have also been removed: @samp{--color},
57@samp{--fullwidth}, @samp{--fullheight}, @samp{--fullscreen},
58@samp{--no-blinking-cursor}, @samp{--no-desktop}, and @samp{-Q}.
59
60@item
61The @samp{--geometry} option applies only to the initial frame, and
62the @samp{-f} option will not read arguments for interactive
63functions.
64
65@item
66We have standardized on one location for the user init file: the file
67named @file{.emacs} in your home directory. Emacs will not look for
68the init file in @file{~/.emacs.d/init.el}. Similarly, don't try
69putting @file{.emacs_SHELL} as @file{init_SHELL.sh} in
70@file{~/.emacs.d}; Emacs won't find it.
71
72@item
73Emacs will not read @file{~/.abbrev_defs} automatically. If you want
74to load abbrev definitions from a file, you must always do so
75explicitly.
76
77@item
78When you are logged in as root, all files now give you writable
79buffers, reflecting the fact that you can write any files.
80
81@item
82The maximum size of buffers and integer variables has been halved. On
8332-bit machines, the maximum buffer size is now 128 megabytes.
84
85@item
86An unquoted @samp{$} in a file name is now an error, if the following
87name is not recognized as an environment variable. Thus,
88the file name @file{foo$bar} would probably be an error. Meanwhile,
89the @code{setenv} command does not expand @samp{$} at all.
90
91@item
92If a single command accumulates too much undo information, Emacs never
93discards it. If Emacs runs out of memory as a result, it will handle
94this by crashing.
95
96@item
97Many commands have been removed from the menus or rearranged.
98
99@item
100The @kbd{C-h} (help) subcommands have been rearranged---especially
101those that display specific files. Type @kbd{C-h C-h} to see a list
102of these commands; that will show you what is different.
103
104@item
105The @kbd{C-h v} and @kbd{C-h f} commands no longer show a hyperlink to
106the C source code, even if it is available. If you want to find the
107source code, grep for it.
108
109@item
110The apropos commands will not accept a list of words to match, in
111order to encourage you to be more specific. Also, the user option
112@code{apropos-sort-by-scores} has been removed.
113
114@item
115The minibuffer prompt is now displayed using the default face.
116The colon is enough to show you what part is the prompt.
117
118@item
119Minibuffer completion commands always complete the entire minibuffer
120contents, just as if you had typed them at the end of the minibuffer,
121no matter where point is actually located.
122
123@item
124The command @code{backward-kill-sexp} is now bound to @kbd{C-M-delete}
125and @kbd{C-M-backspace}. Be careful when using these key sequences!
126It may shut down your X server, or reboot your operating system.
127
128@item
129Commands to set the mark at a place away from point, including
130@kbd{M-@@}, @kbd{M-h}, etc., don't do anything special when you repeat
131them. In most cases, typing these commands multiple times is
132equivalent to typing them once. @kbd{M-h} ignores numeric arguments.
133
134@item
135The user option @code{set-mark-command-repeat-pop} has been removed.
136
137@item
138@kbd{C-@key{SPC} C-@key{SPC}} has no special meaning--it just sets the
139mark twice. Neither does @kbd{C-u C-x C-x}, which simply exchanges
140point and mark like @kbd{C-x C-x}.
141
142@item
143The function @code{sentence-end} has been eliminated in favor of a
144more straightforward approach: directly setting the variable
145@code{sentence-end}. For example, to end each sentence with a single
146space, use
147
148@lisp
149(setq sentence-end "[.?!][]\"')@}]*\\($\\|[ \t]\\)[ \t\n]*")
150@end lisp
151
152@item
153The variable @code{fill-nobreak-predicate} is no longer customizable,
154and it can only hold a single function.
155
156@item
157Nobreak spaces and hyphens are displayed just like normal characters,
158and the user option @code{nobreak-char-display} has been removed.
159
160@item
161@kbd{C-w} in an incremental search always grabs an entire word
162into the search string. More precisely, it grabs text through
163the next end of a word.
164
165@item
166Yanking now preserves all text properties that were in the killed
167text. The variable @code{yank-excluded-properties} has been removed.
168
169@item
170Occur mode, Info mode, and Comint-derived modes now control
171fontification in their own way, and @kbd{M-x font-lock-mode} has
172nothing to do with it. To control fontification in Info mode, use the
173variable @code{Info-fontify}.
174
175@item
176@samp{M-x shell} is now completely standard in regard to scrolling
177behavior. It no longer has the option of scrolling the input line to
178the bottom of the window the way a text terminal running a shell does.
179
180@item
181The Grep package has been merged with Compilation mode. Many
182grep-specific commands and user options have thus been eliminated.
183Also, @kbd{M-x grep} never tries the GNU grep @samp{-H} option,
184and instead silently appends @file{/dev/null} to the command line.
185
186@item
187In Dired's @kbd{!} command, @samp{*} and @samp{?} now
188cause substitution of the file names wherever they appear---not
189only when they are surrounded by whitespace.
190
191@item
192When a file is managed with version control, the command @kbd{C-x C-q}
193(whose general meaning is to make a buffer read-only or writable) now
194does so by checking the file in or out. Checking the file out makes
195the buffer writable; checking it in makes the buffer read-only.
196
197You can still use @kbd{C-x v v} to do these operations if you wish;
198its meaning is unchanged. If you want to control the buffer's
199read-only flag without performing any version control operation,
200use @kbd{M-x toggle-read-only}.
201
202@item
203SGML mode does not handle XML syntax, and does not have indentation
204support.
205
206@item
207Many Info mode commands have been removed. Incremental search in Info
208searches only the current node.
209
210@item
211Many @code{etags} features for customizing parsing using regexps
212have been removed.
213
214@item
215The Emacs server now runs a small C program called @file{emacsserver},
216rather than trying to handle everything in Emacs Lisp. Now there can
217only be one Emacs server running at a time. The @code{server-mode}
218command and @code{server-name} user option have been eliminated.
219
220@item
221The @file{emacsclient} program no longer accepts the @samp{--eval},
222@samp{--display} and @samp{--server-file} command line options, and
223can only establish local connections using Unix domain sockets.
224
225@item
226The command @code{quail-show-key}, for showing how to input a
227character, has been removed.
228
229@item
230The default value of @code{keyboard-coding-system} is always
231@code{nil}, regardless of your locale settings. If you want some
232other value, set it yourself.
233
234@item
235Unicode support and unification between Latin-@var{n} character sets
236have been removed. Cutting and pasting X selections does not support
237``extended segments'', so there are certain coding systems it cannot
238handle.
239
240@item
241The input methods for Emacs are included in a separate distribution
242called ``Leim.'' To use this, you must extract the Leim tar file on
243top of the Emacs distribution, into the same directory, before you
244build Emacs.
245
246@item
247The following input methods have been eliminated: belarusian,
248bulgarian-bds, bulgarian-phonetic, chinese-sisheng, croatian, dutch,
249georgian, latin-alt-postfix, latin-postfix, latin-prefix,
250latvian-keyboard, lithuanian-numeric, lithuanian-keyboard,
251malayalam-inscript, rfc1345, russian-computer, sgml, slovenian,
252tamil-inscript ucs, ukrainian-computer, vietnamese-telex, and welsh.
253
254@item
255The following language environments have been eliminated: Belarusian,
256Bulgarian, Chinese-EUC-TW, Croatian, French, Georgian, Italian,
257Latin-6, Latin-7, Latvian, Lithuanian, Malayalam, Russian, Russian,
258Slovenian, Swedish, Tajik, Tamil, UTF-8, Ukrainian, Ukrainian, Welsh,
259and Windows-1255.
260
261@item
262The @code{code-pages} library, which contained various 8-bit coding
263systems, has been removed.
264
265@item
266The Kmacro package has been replaced with a simple and elegant
267keyboard macro system. Use @kbd{C-x (} to start a new keyboard macro,
268@kbd{C-x )} to end the macro, and @kbd{C-x e} to execute the last
269macro. Use @kbd{M-x name-last-kbd-macro} to name the most recently
270defined macro.
271
272@item
273Emacs no longer displays your breakpoints in the source buffer, so you
274have to remember where you left them. It can be difficult to inspect
275the state of your debugged program from the command line, so Emacs
276tries to demonstrate this in the GUD buffer.
277
278@item
279The Calc, CUA, Ibuffer, Ido, Password, Printing, Reveal,
280Ruler-mode, SES, Table, Tramp, and URL packages have been removed.
281The Benchmark, Cfengine, Conf, Dns, Flymake, Python, Thumbs, and
282Wdired modes have also been removed.
283
284@item
285The Emacs Lisp Reference Manual and the Introduction to Programming in
286Emacs Lisp are now distributed separately, not in the Emacs
287distribution.
288
289@item
290On MS Windows, there is no longer any support for tooltips, images,
291sound, different mouse pointer shapes, or pointing devices with more
292than 3 buttons. If you want these features, consider switching to
293another operating system. But even if you don't want these features,
294you should still switch---for freedom's sake.
295
296@item
297Emacs will not use Unicode for clipboard operations on MS Windows.
298
299@item
300To keep up with decreasing computer memory capacity and disk space, many
301other functions and files have been eliminated in Emacs 21.4.
302@end itemize
303
304@ignore
305 arch-tag: 32932bd9-46f5-41b2-8a0e-fb0cc4caeb29
306@end ignore
diff --git a/doc/emacs/arevert-xtra.texi b/doc/emacs/arevert-xtra.texi
new file mode 100644
index 00000000000..c2b1ddc2ffe
--- /dev/null
+++ b/doc/emacs/arevert-xtra.texi
@@ -0,0 +1,191 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Autorevert
8@section Auto Reverting non-file Buffers
9
10Normally Global Auto Revert Mode only reverts file buffers. There are
11two ways to auto-revert certain non-file buffers: enabling Auto Revert
12Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting
13@code{global-auto-revert-non-file-buffers} to @code{t}. The latter
14enables Auto Reverting for all types of buffers for which it is
15implemented, that is, for the types of buffers listed in the menu
16below.
17
18Like file buffers, non-file buffers should normally not revert while
19you are working on them, or while they contain information that might
20get lost after reverting. Therefore, they do not revert if they are
21``modified''. This can get tricky, because deciding when a non-file
22buffer should be marked modified is usually more difficult than for
23file buffers.
24
25Another tricky detail is that, for efficiency reasons, Auto Revert
26often does not try to detect all possible changes in the buffer, only
27changes that are ``major'' or easy to detect. Hence, enabling
28auto-reverting for a non-file buffer does not always guarantee that
29all information in the buffer is up to date and does not necessarily
30make manual reverts useless.
31
32At the other extreme, certain buffers automatically auto-revert every
33@code{auto-revert-interval} seconds. (This currently only applies to
34the Buffer Menu.) In this case, Auto Revert does not print any
35messages while reverting, even when @code{auto-revert-verbose} is
36non-@code{nil}.
37
38The details depend on the particular types of buffers and are
39explained in the corresponding sections.
40
41@menu
42* Auto Reverting the Buffer Menu::
43* Auto Reverting Dired::
44* Supporting additional buffers::
45@end menu
46
47@node Auto Reverting the Buffer Menu
48@subsection Auto Reverting the Buffer Menu
49
50If auto-reverting of non-file buffers is enabled, the Buffer Menu
51automatically reverts every @code{auto-revert-interval} seconds,
52whether there is a need for it or not. (It would probably take longer
53to check whether there is a need than to actually revert.)
54
55If the Buffer Menu inappropriately gets marked modified, just revert
56it manually using @kbd{g} and auto-reverting will resume. However, if
57you marked certain buffers to get deleted or to be displayed, you have
58to be careful, because reverting erases all marks. The fact that
59adding marks sets the buffer's modified flag prevents Auto Revert from
60automatically erasing the marks.
61
62@node Auto Reverting Dired
63@subsection Auto Reverting Dired buffers
64
65Auto-reverting Dired buffers currently works on GNU or Unix style
66operating systems. It may not work satisfactorily on some other
67systems.
68
69Dired buffers only auto-revert when the file list of the buffer's main
70directory changes. They do not auto-revert when information about a
71particular file changes or when inserted subdirectories change. To be
72sure that @emph{all} listed information is up to date, you have to
73manually revert using @kbd{g}, @emph{even} if auto-reverting is
74enabled in the Dired buffer. Sometimes, you might get the impression
75that modifying or saving files listed in the main directory actually
76does cause auto-reverting. This is because making changes to a file,
77or saving it, very often causes changes in the directory itself, for
78instance, through backup files or auto-save files. However, this is
79not guaranteed.
80
81If the Dired buffer is marked modified and there are no changes you
82want to protect, then most of the time you can make auto-reverting
83resume by manually reverting the buffer using @kbd{g}. There is one
84exception. If you flag or mark files, you can safely revert the
85buffer. This will not erase the flags or marks (unless the marked
86file has been deleted, of course). However, the buffer will stay
87modified, even after reverting, and auto-reverting will not resume.
88This is because, if you flag or mark files, you may be working on the
89buffer and you might not want the buffer to change without warning.
90If you want auto-reverting to resume in the presence of marks and
91flags, mark the buffer non-modified using @kbd{M-~}. However, adding,
92deleting or changing marks or flags will mark it modified again.
93
94Remote Dired buffers are not auto-reverted. Neither are Dired buffers
95for which you used shell wildcards or file arguments to list only some
96of the files. @samp{*Find*} and @samp{*Locate*} buffers do not
97auto-revert either.
98
99@node Supporting additional buffers
100@subsection Adding Support for Auto-Reverting additional Buffers.
101
102This section is intended for Elisp programmers who would like to add
103support for auto-reverting new types of buffers.
104
105To support auto-reverting the buffer must first of all have a
106@code{revert-buffer-function}. @xref{Definition of
107revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
108
109In addition, it @emph{must} have a @code{buffer-stale-function}.
110
111@defvar buffer-stale-function
112The value of this variable is a function to check whether a non-file
113buffer needs reverting. This should be a function with one optional
114argument @var{noconfirm}. The function should return non-@code{nil}
115if the buffer should be reverted. The buffer is current when this
116function is called.
117
118While this function is mainly intended for use in auto-reverting, it
119could be used for other purposes as well. For instance, if
120auto-reverting is not enabled, it could be used to warn the user that
121the buffer needs reverting. The idea behind the @var{noconfirm}
122argument is that it should be @code{t} if the buffer is going to be
123reverted without asking the user and @code{nil} if the function is
124just going to be used to warn the user that the buffer is out of date.
125In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
126If the function is only going to be used for auto-reverting, you can
127ignore the @var{noconfirm} argument.
128
129If you just want to automatically auto-revert every
130@code{auto-revert-interval} seconds, use:
131
132@example
133(set (make-local-variable 'buffer-stale-function)
134 #'(lambda (&optional noconfirm) 'fast))
135@end example
136
137@noindent
138in the buffer's mode function.
139
140The special return value @samp{fast} tells the caller that the need
141for reverting was not checked, but that reverting the buffer is fast.
142It also tells Auto Revert not to print any revert messages, even if
143@code{auto-revert-verbose} is non-@code{nil}. This is important, as
144getting revert messages every @code{auto-revert-interval} seconds can
145be very annoying. The information provided by this return value could
146also be useful if the function is consulted for purposes other than
147auto-reverting.
148@end defvar
149
150Once the buffer has a @code{revert-buffer-function} and a
151@code{buffer-stale-function}, several problems usually remain.
152
153The buffer will only auto-revert if it is marked unmodified. Hence,
154you will have to make sure that various functions mark the buffer
155modified if and only if either the buffer contains information that
156might be lost by reverting or there is reason to believe that the user
157might be inconvenienced by auto-reverting, because he is actively
158working on the buffer. The user can always override this by manually
159adjusting the modified status of the buffer. To support this, calling
160the @code{revert-buffer-function} on a buffer that is marked
161unmodified should always keep the buffer marked unmodified.
162
163It is important to assure that point does not continuously jump around
164as a consequence of auto-reverting. Of course, moving point might be
165inevitable if the buffer radically changes.
166
167You should make sure that the @code{revert-buffer-function} does not
168print messages that unnecessarily duplicate Auto Revert's own messages
169if @code{auto-revert-verbose} is @code{t} and effectively override a
170@code{nil} value for @code{auto-revert-verbose}. Hence, adapting a
171mode for auto-reverting often involves getting rid of such messages.
172This is especially important for buffers that automatically
173auto-revert every @code{auto-revert-interval} seconds.
174
175Also, you may want to update the documentation string of
176@code{global-auto-revert-non-file-buffers}.
177
178@ifinfo
179Finally, you should add a node to this chapter's menu. This node
180@end ifinfo
181@ifnotinfo
182Finally, you should add a section to this chapter. This section
183@end ifnotinfo
184should at the very least make clear whether enabling auto-reverting
185for the buffer reliably assures that all information in the buffer is
186completely up to date (or will be after @code{auto-revert-interval}
187seconds).
188
189@ignore
190 arch-tag: 2983e613-a272-45f6-9593-3010ad7f865e
191@end ignore
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
new file mode 100644
index 00000000000..333985e4a4a
--- /dev/null
+++ b/doc/emacs/basic.texi
@@ -0,0 +1,776 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Basic, Minibuffer, Exiting, Top
6@chapter Basic Editing Commands
7
8@kindex C-h t
9@findex help-with-tutorial
10 Here we explain the basics of how to enter text, make corrections,
11and save the text in a file. If this material is new to you, we
12suggest you first run the Emacs learn-by-doing tutorial, by typing
13@kbd{Control-h t} inside Emacs. (@code{help-with-tutorial}).
14
15 To clear and redisplay the screen, type @kbd{C-l} (@code{recenter}).
16
17@menu
18
19* Inserting Text:: Inserting text by simply typing it.
20* Moving Point:: Moving the cursor to the place where you want to
21 change something.
22* Erasing:: Deleting and killing text.
23* Basic Undo:: Undoing recent changes in the text.
24* Files: Basic Files. Visiting, creating, and saving files.
25* Help: Basic Help. Asking what a character does.
26* Blank Lines:: Making and deleting blank lines.
27* Continuation Lines:: How Emacs displays lines too wide for the screen.
28* Position Info:: What page, line, row, or column is point on?
29* Arguments:: Numeric arguments for repeating a command N times.
30* Repeating:: Repeating the previous command quickly.
31@end menu
32
33@node Inserting Text
34@section Inserting Text
35
36@cindex insertion
37@cindex graphic characters
38 Typing printing characters inserts them into the text you are
39editing. It inserts them into the buffer at the cursor; more
40precisely, it inserts them at @dfn{point}, but the cursor normally
41shows where point is. @xref{Point}.
42
43 Insertion moves the cursor forward, and the following text moves
44forward with the cursor. If the text in the buffer is @samp{FOOBAR},
45with the cursor before the @samp{B}, and you type @kbd{XX}, you get
46@samp{FOOXXBAR}, with the cursor still before the @samp{B}.
47
48 To @dfn{delete} text you have just inserted, use the large key
49labeled @key{DEL}, @key{BACKSPACE} or @key{DELETE} which is a short
50distance above the @key{RET} or @key{ENTER} key. Regardless of the
51label on that key, Emacs thinks of it as @key{DEL}, and that's what we
52call it in this manual. @key{DEL} is the key you normally use outside
53Emacs to erase the last character that you typed.
54
55 The @key{DEL} key deletes the character @emph{before} the cursor.
56As a consequence, the cursor and all the characters after it move
57backwards. If you type a printing character and then type @key{DEL},
58they cancel out.
59
60 On most computers, Emacs sets up @key{DEL} automatically. In some
61cases, especially with text-only terminals, Emacs may guess wrong. If
62the key that ought to erase the last character doesn't do it in Emacs,
63see @ref{DEL Does Not Delete}.
64
65 Most PC keyboards have both a @key{BACKSPACE} key a little ways
66above @key{RET} or @key{ENTER}, and a @key{DELETE} key elsewhere. On
67these keyboards, Emacs tries to set up @key{BACKSPACE} as @key{DEL}.
68The @key{DELETE} key deletes ``forwards'' like @kbd{C-d} (see below),
69which means it deletes the character underneath the cursor (after
70point).
71
72@kindex RET
73@cindex newline
74 To end a line and start typing a new one, type @key{RET}. (This
75key may be labeled @key{RETURN} or @key{ENTER}, but in Emacs we call
76it @key{RET}.) This inserts a newline character in the buffer. If
77point is at the end of the line, this creates a new blank line after
78it. If point is in the middle of a line, the effect is to split that
79line. Typing @key{DEL} when the cursor is at the beginning of a line
80deletes the preceding newline character, thus joining the line with
81the one before it.
82
83 Emacs can split lines automatically when they become too long, if
84you turn on a special minor mode called @dfn{Auto Fill} mode.
85@xref{Filling}, for Auto Fill mode and other methods of @dfn{filling}
86text.
87
88 If you prefer printing characters to replace (overwrite) existing
89text, rather than shove it to the right, you should enable Overwrite
90mode, a minor mode. @xref{Minor Modes}.
91
92@cindex quoting
93@kindex C-q
94@findex quoted-insert
95 Only printing characters and @key{SPC} insert themselves in Emacs.
96Other characters act as editing commands and do not insert themselves.
97These include control characters, and characters with codes above 200
98octal. If you need to insert one of these characters in the buffer,
99you must @dfn{quote} it by typing the character @kbd{Control-q}
100(@code{quoted-insert}) first. (This character's name is normally
101written @kbd{C-q} for short.) There are two ways to use
102@kbd{C-q}:
103
104@itemize @bullet
105@item
106@kbd{C-q} followed by any non-graphic character (even @kbd{C-g})
107inserts that character.
108
109@item
110@kbd{C-q} followed by a sequence of octal digits inserts the character
111with the specified octal character code. You can use any number of
112octal digits; any non-digit terminates the sequence. If the
113terminating character is @key{RET}, it serves only to terminate the
114sequence. Any other non-digit terminates the sequence and then acts
115as normal input---thus, @kbd{C-q 1 0 1 B} inserts @samp{AB}.
116
117The use of octal sequences is disabled in ordinary non-binary
118Overwrite mode, to give you a convenient way to insert a digit instead
119of overwriting with it.
120@end itemize
121
122@cindex 8-bit character codes
123@noindent
124When multibyte characters are enabled, if you specify a code in the
125range 0200 through 0377 octal, @kbd{C-q} assumes that you intend to
126use some ISO 8859-@var{n} character set, and converts the specified
127code to the corresponding Emacs character code. @xref{Enabling
128Multibyte}. You select @emph{which} of the ISO 8859 character sets to
129use through your choice of language environment (@pxref{Language
130Environments}).
131
132@vindex read-quoted-char-radix
133To use decimal or hexadecimal instead of octal, set the variable
134@code{read-quoted-char-radix} to 10 or 16. If the radix is greater than
13510, some letters starting with @kbd{a} serve as part of a character
136code, just like digits.
137
138A numeric argument tells @kbd{C-q} how many copies of the quoted
139character to insert (@pxref{Arguments}).
140
141@findex newline
142@findex self-insert
143 Customization information: @key{DEL} in most modes runs the command
144@code{delete-backward-char}; @key{RET} runs the command
145@code{newline}, and self-inserting printing characters run the command
146@code{self-insert}, which inserts whatever character you typed. Some
147major modes rebind @key{DEL} to other commands.
148
149@node Moving Point
150@section Changing the Location of Point
151
152@cindex arrow keys
153@cindex moving point
154@cindex movement
155@cindex cursor motion
156@cindex moving the cursor
157 To do more than insert characters, you have to know how to move point
158(@pxref{Point}). The simplest way to do this is with arrow keys, or by
159clicking the left mouse button where you want to move to.
160
161 There are also control and meta characters for cursor motion. Some
162are equivalent to the arrow keys (it is faster to use these control
163keys than move your hand over to the arrow keys). Others do more
164sophisticated things.
165
166@kindex C-a
167@kindex C-e
168@kindex C-f
169@kindex C-b
170@kindex C-n
171@kindex C-p
172@kindex M->
173@kindex M-<
174@kindex M-r
175@kindex LEFT
176@kindex RIGHT
177@kindex UP
178@kindex DOWN
179@findex move-beginning-of-line
180@findex move-end-of-line
181@findex forward-char
182@findex backward-char
183@findex next-line
184@findex previous-line
185@findex beginning-of-buffer
186@findex end-of-buffer
187@findex goto-char
188@findex goto-line
189@findex move-to-window-line
190@table @kbd
191@item C-a
192Move to the beginning of the line (@code{move-beginning-of-line}).
193@item C-e
194Move to the end of the line (@code{move-end-of-line}).
195@item C-f
196Move forward one character (@code{forward-char}). The right-arrow key
197does the same thing.
198@item C-b
199Move backward one character (@code{backward-char}). The left-arrow
200key has the same effect.
201@item M-f
202Move forward one word (@code{forward-word}).
203@item M-b
204Move backward one word (@code{backward-word}).
205@item C-n
206Move down one line vertically (@code{next-line}). This command
207attempts to keep the horizontal position unchanged, so if you start in
208the middle of one line, you move to the middle of the next. The
209down-arrow key does the same thing.
210@item C-p
211Move up one line, vertically (@code{previous-line}). The up-arrow key
212has the same effect. This command preserves position within the line,
213like @kbd{C-n}.
214@item M-r
215Move point to left margin, vertically centered in the window
216(@code{move-to-window-line}). Text does not move on the screen.
217A numeric argument says which screen line to place point on, counting
218downward from the top of the window (zero means the top line). A
219negative argument counts lines up from the bottom (@minus{}1 means the
220bottom line).
221@item M-<
222Move to the top of the buffer (@code{beginning-of-buffer}). With
223numeric argument @var{n}, move to @var{n}/10 of the way from the top.
224@xref{Arguments}, for more information on numeric arguments.@refill
225@item M->
226Move to the end of the buffer (@code{end-of-buffer}).
227@item C-v
228@itemx @key{PAGEDOWN}
229@itemx @key{PRIOR}
230Scroll the display one screen forward, and move point if necessary to
231put it on the screen (@code{scroll-up}). This doesn't always move
232point, but it is commonly used to do so. If your keyboard has a
233@key{PAGEDOWN} or @key{PRIOR} key, it does the same thing.
234
235Scrolling commands are described further in @ref{Scrolling}.
236@item M-v
237@itemx @key{PAGEUP}
238@itemx @key{NEXT}
239Scroll one screen backward, and move point if necessary to put it on
240the screen (@code{scroll-down}). This doesn't always move point, but
241it is commonly used to do so. If your keyboard has a @key{PAGEUP} or
242@key{NEXT} key, it does the same thing.
243@item M-x goto-char
244Read a number @var{n} and move point to buffer position @var{n}.
245Position 1 is the beginning of the buffer.
246@item M-g M-g
247@itemx M-g g
248@itemx M-x goto-line
249Read a number @var{n} and move point to the beginning of line number
250@var{n}. Line 1 is the beginning of the buffer. If point is on or
251just after a number in the buffer, and you type @key{RET} with the
252minibuffer empty, that number is used for @var{n}.
253@item C-x C-n
254@findex set-goal-column
255@kindex C-x C-n
256Use the current column of point as the @dfn{semipermanent goal column}
257for @kbd{C-n} and @kbd{C-p} (@code{set-goal-column}). When a
258semipermanent goal column is in effect, those commands always try to
259move to this column, or as close as possible to it, after moving
260vertically. The goal column remains in effect until canceled.
261@item C-u C-x C-n
262Cancel the goal column. Henceforth, @kbd{C-n} and @kbd{C-p} try to
263preserve the horizontal position, as usual.
264@end table
265
266@vindex track-eol
267 If you set the variable @code{track-eol} to a non-@code{nil} value,
268then @kbd{C-n} and @kbd{C-p}, when starting at the end of the line, move
269to the end of another line. Normally, @code{track-eol} is @code{nil}.
270@xref{Variables}, for how to set variables such as @code{track-eol}.
271
272@vindex next-line-add-newlines
273 @kbd{C-n} normally stops at the end of the buffer when you use it on
274the last line of the buffer. However, if you set the variable
275@code{next-line-add-newlines} to a non-@code{nil} value, @kbd{C-n} on
276the last line of a buffer creates an additional line at the end and
277moves down into it.
278
279@node Erasing
280@section Erasing Text
281
282@table @kbd
283@item @key{DEL}
284Delete the character before point (@code{delete-backward-char}).
285@item C-d
286Delete the character after point (@code{delete-char}).
287@item @key{DELETE}
288@itemx @key{BACKSPACE}
289One of these keys, whichever is the large key above the @key{RET} or
290@key{ENTER} key, deletes the character before point---it is @key{DEL}.
291If @key{BACKSPACE} is @key{DEL}, and your keyboard also has @key{DELETE},
292then @key{DELETE} deletes forwards, like @kbd{C-d}.
293@item C-k
294Kill to the end of the line (@code{kill-line}).
295@item M-d
296Kill forward to the end of the next word (@code{kill-word}).
297@item M-@key{DEL}
298Kill back to the beginning of the previous word
299(@code{backward-kill-word}).
300@end table
301
302@cindex killing characters and lines
303@cindex deleting characters and lines
304@cindex erasing characters and lines
305 You already know about the @key{DEL} key which deletes the character
306before point (that is, before the cursor). Another key, @kbd{Control-d}
307(@kbd{C-d} for short), deletes the character after point (that is, the
308character that the cursor is on). This shifts the rest of the text on
309the line to the left. If you type @kbd{C-d} at the end of a line, it
310joins that line with the following line.
311
312 To erase a larger amount of text, use the @kbd{C-k} key, which
313erases (kills) a line at a time. If you type @kbd{C-k} at the
314beginning or middle of a line, it kills all the text up to the end of
315the line. If you type @kbd{C-k} at the end of a line, it joins that
316line with the following line.
317
318 @xref{Killing}, for more flexible ways of killing text.
319
320@node Basic Undo
321@section Undoing Changes
322
323 Emacs records a list of changes made in the buffer text, so you can
324you can undo recent changes, as far as the records go.
325Usually each editing command makes a separate entry in the undo
326records, but sometimes an entry covers just part of a command, and
327very simple commands may be grouped.
328
329@table @kbd
330@item C-x u
331Undo one entry of the undo records---usually, one command worth
332(@code{undo}).
333@item C-_
334@itemx C-/
335The same.
336@end table
337
338 The command @kbd{C-x u} (or @kbd{C-_} or @kbd{C-/}) is how you undo.
339Normally this command undoes the last change, and moves point back to
340where it was before the change.
341
342 If you repeat @kbd{C-x u} (or its aliases), each repetition undoes
343another, earlier change, back to the limit of the undo information
344available. If all recorded changes have already been undone, the undo
345command displays an error message and does nothing.
346
347 The undo command applies only to changes in the buffer; you can't
348use it to undo mere cursor motion. However, some cursor motion
349commands set the mark, so if you use these commands from time to time,
350you can move back to the neighborhoods you have moved through by
351popping the mark ring (@pxref{Mark Ring}).
352
353@node Basic Files
354@section Files
355
356 Text that you insert in an Emacs buffer lasts only as long as the
357Emacs session. To keep any text permanently you must put it in a
358@dfn{file}. Files are named units of text which are stored by the
359operating system for you to retrieve later by name. To use the
360contents of a file in any way, you must specify the file name. That
361includes editing the file with Emacs.
362
363 Suppose there is a file named @file{test.emacs} in your home
364directory. To begin editing this file in Emacs, type
365
366@example
367C-x C-f test.emacs @key{RET}
368@end example
369
370@noindent
371Here the file name is given as an @dfn{argument} to the command @kbd{C-x
372C-f} (@code{find-file}). That command uses the @dfn{minibuffer} to
373read the argument, and you type @key{RET} to terminate the argument
374(@pxref{Minibuffer}).
375
376 Emacs obeys this command by @dfn{visiting} the file: it creates a
377buffer, it copies the contents of the file into the buffer, and then
378displays the buffer for editing. If you alter the text, you can
379@dfn{save} the new text in the file by typing @kbd{C-x C-s}
380(@code{save-buffer}). This copies the altered buffer contents back
381into the file @file{test.emacs}, making them permanent. Until you
382save, the changed text exists only inside Emacs, and the file
383@file{test.emacs} is unaltered.
384
385 To create a file, just visit it with @kbd{C-x C-f} as if it already
386existed. This creates an empty buffer, in which you can insert the
387text you want to put in the file. Emacs actually creates the file the
388first time you save this buffer with @kbd{C-x C-s}.
389
390 To learn more about using files in Emacs, see @ref{Files}.
391
392@node Basic Help
393@section Help
394
395@cindex getting help with keys
396 If you forget what a key does, you can find out with the Help
397character, which is @kbd{C-h} (or @key{F1}, which is an alias for
398@kbd{C-h}). Type @kbd{C-h k} followed by the key of interest; for
399example, @kbd{C-h k C-n} tells you what @kbd{C-n} does. @kbd{C-h} is
400a prefix key; @kbd{C-h k} is just one of its subcommands (the command
401@code{describe-key}). The other subcommands of @kbd{C-h} provide
402different kinds of help. Type @kbd{C-h} twice to get a description of
403all the help facilities. @xref{Help}.
404
405@node Blank Lines
406@section Blank Lines
407
408@cindex inserting blank lines
409@cindex deleting blank lines
410 Here are special commands and techniques for inserting and deleting
411blank lines.
412
413@table @kbd
414@item C-o
415Insert one or more blank lines after the cursor (@code{open-line}).
416@item C-x C-o
417Delete all but one of many consecutive blank lines
418(@code{delete-blank-lines}).
419@end table
420
421@kindex C-o
422@kindex C-x C-o
423@cindex blank lines
424@findex open-line
425@findex delete-blank-lines
426 To insert a new line of text before an existing line,
427type the new line of text, followed by @key{RET}.
428However, it may be easier to see what you are doing if you first make a
429blank line and then insert the desired text into it. This is easy to do
430using the key @kbd{C-o} (@code{open-line}), which inserts a newline
431after point but leaves point in front of the newline. After @kbd{C-o},
432type the text for the new line. @kbd{C-o F O O} has the same effect as
433@w{@kbd{F O O @key{RET}}}, except for the final location of point.
434
435 You can make several blank lines by typing @kbd{C-o} several times, or
436by giving it a numeric argument specifying how many blank lines to make.
437@xref{Arguments}, for how. If you have a fill prefix, the @kbd{C-o}
438command inserts the fill prefix on the new line, if typed at the
439beginning of a line. @xref{Fill Prefix}.
440
441 The easy way to get rid of extra blank lines is with the command
442@kbd{C-x C-o} (@code{delete-blank-lines}). @kbd{C-x C-o} in a run of
443several blank lines deletes all but one of them. @kbd{C-x C-o} on a
444lone blank line deletes that one. When point is on a nonblank line,
445@kbd{C-x C-o} deletes all following blank lines (if any).
446
447@node Continuation Lines
448@section Continuation Lines
449
450@cindex continuation line
451@cindex wrapping
452@cindex line wrapping
453@cindex fringes, and continuation lines
454 When a text line is too long to fit in one screen line, Emacs
455displays it on two or more screen lines. This is called
456@dfn{continuation} or @dfn{line wrapping}. On graphical displays,
457Emacs indicates line wrapping with small bent arrows in the left and
458right window fringes. On text-only terminals, Emacs displays a
459@samp{\} character at the right margin of a screen line if it is not
460the last in its text line. This @samp{\} character says that the
461following screen line is not really a new text line.
462
463 When line wrapping occurs just before a character that is wider than one
464column, some columns at the end of the previous screen line may be
465``empty.'' In this case, Emacs displays additional @samp{\}
466characters in the ``empty'' columns before the @samp{\}
467character that indicates continuation.
468
469 Continued lines can be difficult to read, since lines can break in
470the middle of a word. If you prefer, you can make Emacs insert a
471newline automatically when a line gets too long, by using Auto Fill
472mode. Or enable Long Lines mode, which ensures that wrapping only
473occurs between words. @xref{Filling}.
474
475@cindex truncation
476@cindex line truncation, and fringes
477 Emacs can optionally @dfn{truncate} long lines---this means
478displaying just one screen line worth, and the rest of the long line
479does not appear at all. @samp{$} in the last column or a small
480straight arrow in the window's right fringe indicates a truncated
481line.
482
483 @xref{Line Truncation}, for more about line truncation,
484and other variables that control how text is displayed.
485
486@node Position Info
487@section Cursor Position Information
488
489 Here are commands to get information about the size and position of
490parts of the buffer, and to count lines.
491
492@table @kbd
493@item M-x what-page
494Display the page number of point, and the line number within that page.
495@item M-x what-line
496Display the line number of point in the whole buffer.
497@item M-x line-number-mode
498@itemx M-x column-number-mode
499Toggle automatic display of the current line number or column number.
500@xref{Optional Mode Line}.
501@item M-=
502Display the number of lines in the current region (@code{count-lines-region}).
503@xref{Mark}, for information about the region.
504@item C-x =
505Display the character code of character after point, character position of
506point, and column of point (@code{what-cursor-position}).
507@item M-x hl-line-mode
508Enable or disable highlighting of the current line. @xref{Cursor
509Display}.
510@item M-x size-indication-mode
511Toggle automatic display of the size of the buffer.
512@xref{Optional Mode Line}.
513@end table
514
515@findex what-page
516@findex what-line
517@cindex line number commands
518@cindex location of point
519@cindex cursor location
520@cindex point location
521 @kbd{M-x what-line} displays the current line number
522in the echo area. You can also see the current line number in the
523mode line; see @ref{Mode Line}; but if you narrow the buffer, the
524line number in the mode line is relative to the accessible portion
525(@pxref{Narrowing}). By contrast, @code{what-line} shows both the
526line number relative to the narrowed region and the line number
527relative to the whole buffer.
528
529 @kbd{M-x what-page} counts pages from the beginning of the file, and
530counts lines within the page, showing both numbers in the echo area.
531@xref{Pages}.
532
533@kindex M-=
534@findex count-lines-region
535 Use @kbd{M-=} (@code{count-lines-region}) to displays the number of
536lines in the region (@pxref{Mark}). @xref{Pages}, for the command
537@kbd{C-x l} which counts the lines in the current page.
538
539@kindex C-x =
540@findex what-cursor-position
541 The command @kbd{C-x =} (@code{what-cursor-position}) shows what
542cursor's column position, and other information about point and the
543character after it. It displays a line in the echo area that looks
544like this:
545
546@smallexample
547Char: c (99, #o143, #x63) point=28062 of 36168 (78%) column=53
548@end smallexample
549
550 The four values after @samp{Char:} describe the character that follows
551point, first by showing it and then by giving its character code in
552decimal, octal and hex. For a non-@acronym{ASCII} multibyte character, these are
553followed by @samp{file} and the character's representation, in hex, in
554the buffer's coding system, if that coding system encodes the character
555safely and with a single byte (@pxref{Coding Systems}). If the
556character's encoding is longer than one byte, Emacs shows @samp{file ...}.
557
558 However, if the character displayed is in the range 0200 through
5590377 octal, it may actually stand for an invalid UTF-8 byte read from
560a file. In Emacs, that byte is represented as a sequence of 8-bit
561characters, but all of them together display as the original invalid
562byte, in octal code. In this case, @kbd{C-x =} shows @samp{part of
563display ...} instead of @samp{file}.
564
565 @samp{point=} is followed by the position of point expressed as a
566character count. The start of the buffer is position 1, one character
567later is position 2, and so on. The next, larger, number is the total
568number of characters in the buffer. Afterward in parentheses comes
569the position expressed as a percentage of the total size.
570
571 @samp{column=} is followed by the horizontal position of point, in
572columns from the left edge of the window.
573
574 If the buffer has been narrowed, making some of the text at the
575beginning and the end temporarily inaccessible, @kbd{C-x =} displays
576additional text describing the currently accessible range. For example, it
577might display this:
578
579@smallexample
580Char: C (67, #o103, #x43) point=252 of 889 (28%) <231-599> column=0
581@end smallexample
582
583@noindent
584where the two extra numbers give the smallest and largest character
585position that point is allowed to assume. The characters between those
586two positions are the accessible ones. @xref{Narrowing}.
587
588 If point is at the end of the buffer (or the end of the accessible
589part), the @w{@kbd{C-x =}} output does not describe a character after
590point. The output might look like this:
591
592@smallexample
593point=36169 of 36168 (EOB) column=0
594@end smallexample
595
596@cindex character set of character at point
597@cindex font of character at point
598@cindex text properties at point
599@cindex face at point
600 @w{@kbd{C-u C-x =}} displays the following additional information about a
601character.
602
603@itemize @bullet
604@item
605The character set name, and the codes that identify the character
606within that character set; @acronym{ASCII} characters are identified
607as belonging to the @code{ascii} character set.
608
609@item
610The character's syntax and categories.
611
612@item
613The character's encodings, both internally in the buffer, and externally
614if you were to save the file.
615
616@item
617What keys to type to input the character in the current input method
618(if it supports the character).
619
620@item
621If you are running Emacs on a graphical display, the font name and
622glyph code for the character. If you are running Emacs on a text-only
623terminal, the code(s) sent to the terminal.
624
625@item
626The character's text properties (@pxref{Text Properties,,,
627elisp, the Emacs Lisp Reference Manual}), including any non-default
628faces used to display the character, and any overlays containing it
629(@pxref{Overlays,,, elisp, the same manual}).
630@end itemize
631
632 Here's an example showing the Latin-1 character A with grave accent,
633in a buffer whose coding system is @code{iso-latin-1}, whose
634terminal coding system is @code{iso-latin-1} (so the terminal actually
635displays the character as @samp{@`A}), and which has font-lock-mode
636(@pxref{Font Lock}) enabled:
637
638@smallexample
639 character: @`A (2240, #o4300, #x8c0, U+00C0)
640 charset: latin-iso8859-1
641 (Right-Hand Part of Latin Alphabet 1@dots{}
642 code point: #x40
643 syntax: w which means: word
644 category: l:Latin
645 to input: type "`A" with latin-1-prefix
646buffer code: #x81 #xC0
647 file code: #xC0 (encoded by coding system iso-latin-1)
648 display: terminal code #xC0
649
650There are text properties here:
651 fontified t
652@end smallexample
653
654@node Arguments
655@section Numeric Arguments
656@cindex numeric arguments
657@cindex prefix arguments
658@cindex arguments to commands
659
660 In mathematics and computer usage, @dfn{argument} means
661``data provided to a function or operation.'' You can give any Emacs
662command a @dfn{numeric argument} (also called a @dfn{prefix argument}).
663Some commands interpret the argument as a repetition count. For
664example, @kbd{C-f} with an argument of ten moves forward ten characters
665instead of one. With these commands, no argument is equivalent to an
666argument of one. Negative arguments tell most such commands to move or
667act in the opposite direction.
668
669@kindex M-1
670@kindex M-@t{-}
671@findex digit-argument
672@findex negative-argument
673 If your terminal keyboard has a @key{META} key (labeled @key{ALT} on
674PC keyboards), the easiest way to specify a numeric argument is to
675type digits and/or a minus sign while holding down the @key{META} key.
676For example,
677
678@example
679M-5 C-n
680@end example
681
682@noindent
683moves down five lines. The characters @kbd{Meta-1}, @kbd{Meta-2},
684and so on, as well as @kbd{Meta--}, do this because they are keys bound
685to commands (@code{digit-argument} and @code{negative-argument}) that
686are defined to set up an argument for the next command.
687@kbd{Meta--} without digits normally means @minus{}1. Digits and
688@kbd{-} modified with Control, or Control and Meta, also specify numeric
689arguments.
690
691@kindex C-u
692@findex universal-argument
693 You can also specify a numeric argument by typing @kbd{C-u}
694(@code{universal-argument}) followed by the digits. The advantage of
695@kbd{C-u} is that you can type the digits without modifier keys; thus,
696@kbd{C-u} works on all terminals. For a negative argument, type a
697minus sign after @kbd{C-u}. A minus sign without digits normally
698means @minus{}1.
699
700 @kbd{C-u} alone has the special meaning of
701``four times'': it multiplies the argument for the next command by
702four. @kbd{C-u C-u} multiplies it by sixteen. Thus, @kbd{C-u C-u
703C-f} moves forward sixteen characters. This is a good way to move
704forward ``fast,'' since it moves about 1/5 of a line in the usual size
705screen. Other useful combinations are @kbd{C-u C-n}, @kbd{C-u C-u
706C-n} (move down a good fraction of a screen), @kbd{C-u C-u C-o} (make
707``a lot'' of blank lines), and @kbd{C-u C-k} (kill four lines).
708
709 Some commands care whether there is an argument, but ignore its
710value. For example, the command @kbd{M-q} (@code{fill-paragraph})
711fills text; with an argument, it justifies the text as well.
712(@xref{Filling}, for more information on @kbd{M-q}.) Plain @kbd{C-u}
713is a handy way of providing an argument for such commands.
714
715 Some commands use the value of the argument as a repeat count, but do
716something peculiar when there is no argument. For example, the command
717@kbd{C-k} (@code{kill-line}) with argument @var{n} kills @var{n} lines,
718including their terminating newlines. But @kbd{C-k} with no argument is
719special: it kills the text up to the next newline, or, if point is right at
720the end of the line, it kills the newline itself. Thus, two @kbd{C-k}
721commands with no arguments can kill a nonblank line, just like @kbd{C-k}
722with an argument of one. (@xref{Killing}, for more information on
723@kbd{C-k}.)
724
725 A few commands treat a plain @kbd{C-u} differently from an ordinary
726argument. A few others may treat an argument of just a minus sign
727differently from an argument of @minus{}1. These unusual cases are
728described when they come up; they exist to make an individual command
729more convenient, and they are documented in that command's
730documentation string.
731
732 You can use a numeric argument before a self-inserting character to
733insert multiple copies of it. This is straightforward when the
734character is not a digit; for example, @kbd{C-u 6 4 a} inserts 64
735copies of the character @samp{a}. But this does not work for
736inserting digits; @kbd{C-u 6 4 1} specifies an argument of 641. You
737can separate the argument from the digit to insert with another
738@kbd{C-u}; for example, @kbd{C-u 6 4 C-u 1} does insert 64 copies of
739the character @samp{1}.
740
741 We use the term ``prefix argument'' as well as ``numeric argument,''
742to emphasize that you type these argument before the command, and to
743distinguish them from minibuffer arguments that come after the
744command.
745
746@node Repeating
747@section Repeating a Command
748@cindex repeating a command
749
750 Many simple commands, such as those invoked with a single key or
751with @kbd{M-x @var{command-name} @key{RET}}, can be repeated by
752invoking them with a numeric argument that serves as a repeat count
753(@pxref{Arguments}). However, if the command you want to repeat
754prompts for input, or uses a numeric argument in another way, that
755method won't work.
756
757@kindex C-x z
758@findex repeat
759 The command @kbd{C-x z} (@code{repeat}) provides another way to repeat
760an Emacs command many times. This command repeats the previous Emacs
761command, whatever that was. Repeating a command uses the same arguments
762that were used before; it does not read new arguments each time.
763
764 To repeat the command more than once, type additional @kbd{z}'s: each
765@kbd{z} repeats the command one more time. Repetition ends when you
766type a character other than @kbd{z}, or press a mouse button.
767
768 For example, suppose you type @kbd{C-u 2 0 C-d} to delete 20
769characters. You can repeat that command (including its argument) three
770additional times, to delete a total of 80 characters, by typing @kbd{C-x
771z z z}. The first @kbd{C-x z} repeats the command once, and each
772subsequent @kbd{z} repeats it once again.
773
774@ignore
775 arch-tag: cda8952a-c439-41c1-aecf-4bc0d6482956
776@end ignore
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
new file mode 100644
index 00000000000..b43d72b1067
--- /dev/null
+++ b/doc/emacs/buffers.texi
@@ -0,0 +1,665 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Buffers, Windows, Files, Top
6@chapter Using Multiple Buffers
7
8@cindex buffers
9 The text you are editing in Emacs resides in an object called a
10@dfn{buffer}. Each time you visit a file, a buffer is created to hold the
11file's text. Each time you invoke Dired, a buffer is created to hold the
12directory listing. If you send a message with @kbd{C-x m}, a buffer named
13@samp{*mail*} is used to hold the text of the message. When you ask for a
14command's documentation, that appears in a buffer called @samp{*Help*}.
15
16@cindex selected buffer
17@cindex current buffer
18 At any time, one and only one buffer is @dfn{current}. It is also
19called the @dfn{selected buffer}. Often we say that a command operates on
20``the buffer'' as if there were only one; but really this means that the
21command operates on the current buffer (most commands do).
22
23 When Emacs has multiple windows, each window has its own chosen
24buffer and displays it; at any time, only one of the windows is
25selected, and its chosen buffer is the current buffer. Each window's
26mode line normally displays the name of the window's chosen buffer
27(@pxref{Windows}).
28
29 Each buffer has a name, which can be of any length, and you can select
30any buffer by giving its name. Most buffers are made by visiting files,
31and their names are derived from the files' names. But you can also create
32an empty buffer with any name you want. A newly started Emacs has a buffer
33named @samp{*scratch*} which can be used for evaluating Lisp expressions in
34Emacs. The distinction between upper and lower case matters in buffer
35names.
36
37 Each buffer records individually what file it is visiting, whether it is
38modified, and what major mode and minor modes are in effect in it
39(@pxref{Major Modes}). Any Emacs variable can be made @dfn{local to} a
40particular buffer, meaning its value in that buffer can be different from
41the value in other buffers. @xref{Locals}.
42
43@cindex buffer size, maximum
44 A buffer's size cannot be larger than some maximum, which is defined
45by the largest buffer position representable by the @dfn{Emacs integer}
46data type. This is because Emacs tracks buffer positions using that
47data type. For 32-bit machines, the largest buffer size is 256
48megabytes.
49
50@menu
51* Select Buffer:: Creating a new buffer or reselecting an old one.
52* List Buffers:: Getting a list of buffers that exist.
53* Misc Buffer:: Renaming; changing read-onlyness; copying text.
54* Kill Buffer:: Killing buffers you no longer need.
55* Several Buffers:: How to go through the list of all buffers
56 and operate variously on several of them.
57* Indirect Buffers:: An indirect buffer shares the text of another buffer.
58* Buffer Convenience:: Convenience and customization features for
59 buffer handling.
60@end menu
61
62@node Select Buffer
63@section Creating and Selecting Buffers
64@cindex change buffers
65@cindex switch buffers
66
67@table @kbd
68@item C-x b @var{buffer} @key{RET}
69Select or create a buffer named @var{buffer} (@code{switch-to-buffer}).
70@item C-x 4 b @var{buffer} @key{RET}
71Similar, but select @var{buffer} in another window
72(@code{switch-to-buffer-other-window}).
73@item C-x 5 b @var{buffer} @key{RET}
74Similar, but select @var{buffer} in a separate frame
75(@code{switch-to-buffer-other-frame}).
76@item C-x @key{LEFT}
77Select the previous buffer in the list of existing buffers.
78@item C-x @key{RIGHT}
79Select the next buffer in the list of existing buffers.
80@item C-u M-g M-g
81@itemx C-u M-g g
82Read a number @var{n} and move to line @var{n} in the most recently
83selected buffer other than the current buffer.
84@end table
85
86@kindex C-x b
87@findex switch-to-buffer
88 To select the buffer named @var{bufname}, type @kbd{C-x b @var{bufname}
89@key{RET}}. This runs the command @code{switch-to-buffer} with argument
90@var{bufname}. You can use completion to enter the buffer
91name (@pxref{Completion}). An empty argument to @kbd{C-x b}
92specifies the buffer that was current most recently among those not
93now displayed in any window.
94
95@kindex C-x @key{LEFT}
96@kindex C-x @key{RIGHT}
97@findex next-buffer
98@findex previous-buffer
99 For conveniently switching between a few buffers, use the commands
100@kbd{C-x @key{LEFT}} and @kbd{C-x @key{RIGHT}}. @kbd{C-x @key{RIGHT}}
101(@code{previous-buffer}) selects the previous buffer (following the order
102of most recent selection in the current frame), while @kbd{C-x @key{LEFT}}
103(@code{next-buffer}) moves through buffers in the reverse direction.
104
105@kindex C-x 4 b
106@findex switch-to-buffer-other-window
107@vindex even-window-heights
108 To select a buffer in a window other than the current one, type
109@kbd{C-x 4 b @var{bufname} @key{RET}}. This runs the command
110@code{switch-to-buffer-other-window} which displays the buffer
111@var{bufname} in another window. By default, if displaying the buffer
112causes two vertically adjacent windows to be displayed, the heights of
113those windows are evened out; to countermand that and preserve the
114window configuration, set the variable @code{even-window-heights} to
115@code{nil}.
116
117@kindex C-x 5 b
118@findex switch-to-buffer-other-frame
119 Similarly, @kbd{C-x 5 b @var{buffer} @key{RET}} runs the command
120@code{switch-to-buffer-other-frame} which selects a buffer in another
121frame.
122
123@vindex display-buffer-reuse-frames
124 You can control how certain buffers are handled by these commands by
125customizing the variables @code{special-display-buffer-names},
126@code{special-display-regexps}, @code{same-window-buffer-names}, and
127@code{same-window-regexps}. See @ref{Force Same Window}, and
128@ref{Special Buffer Frames}, for more about these variables. In
129addition, if the value of @code{display-buffer-reuse-frames} is
130non-@code{nil}, and the buffer you want to switch to is already
131displayed in some frame, Emacs will just raise that frame.
132
133 Most buffers are created by visiting files, or by Emacs commands that
134want to display some text, but you can also create a buffer explicitly
135by typing @kbd{C-x b @var{bufname} @key{RET}}. This makes a new, empty
136buffer that is not visiting any file, and selects it for editing. Such
137buffers are used for making notes to yourself. If you try to save one,
138you are asked for the file name to use. The new buffer's major mode is
139determined by the value of @code{default-major-mode} (@pxref{Major
140Modes}).
141
142 Note that @kbd{C-x C-f}, and any other command for visiting a file,
143can also be used to switch to an existing file-visiting buffer.
144@xref{Visiting}.
145
146 @kbd{C-u M-g M-g}, that is @code{goto-line} with a prefix argument
147of just @kbd{C-u}, reads a number @var{n} using the minibuffer,
148selects the most recently selected buffer other than the current
149buffer in another window, and then moves point to the beginning of
150line number @var{n} in that buffer. This is mainly useful in a buffer
151that refers to line numbers in another buffer: if point is on or just
152after a number, @code{goto-line} uses that number as the default for
153@var{n}. Note that prefix arguments other than just @kbd{C-u} behave
154differently. @kbd{C-u 4 M-g M-g} goes to line 4 in the @emph{current}
155buffer, without reading a number from the minibuffer. (Remember that
156@kbd{M-g M-g} without prefix argument reads a number @var{n} and then
157moves to line number @var{n} in the current buffer.)
158
159 Emacs uses buffer names that start with a space for internal purposes.
160It treats these buffers specially in minor ways---for example, by
161default they do not record undo information. It is best to avoid using
162such buffer names yourself.
163
164@node List Buffers
165@section Listing Existing Buffers
166
167@table @kbd
168@item C-x C-b
169List the existing buffers (@code{list-buffers}).
170@end table
171
172@cindex listing current buffers
173@kindex C-x C-b
174@findex list-buffers
175 To display a list of existing buffers, type @kbd{C-x C-b}. Each
176line in the list shows one buffer's name, major mode and visited file.
177The buffers are listed in the order that they were current; the
178buffers that were current most recently come first.
179
180 @samp{*} in the first field of a line indicates the buffer is
181``modified.'' If several buffers are modified, it may be time to save
182some with @kbd{C-x s} (@pxref{Save Commands}). @samp{%} indicates a
183read-only buffer. @samp{.} marks the current buffer. Here is an
184example of a buffer list:@refill
185
186@smallexample
187CRM Buffer Size Mode File
188. * .emacs 3294 Emacs-Lisp ~/.emacs
189 % *Help* 101 Help
190 search.c 86055 C ~/cvs/emacs/src/search.c
191 % src 20959 Dired by name ~/cvs/emacs/src/
192 * *mail* 42 Mail
193 % HELLO 1607 Fundamental ~/cvs/emacs/etc/HELLO
194 % NEWS 481184 Outline ~/cvs/emacs/etc/NEWS
195 *scratch* 191 Lisp Interaction
196 * *Messages* 1554 Fundamental
197@end smallexample
198
199@noindent
200Note that the buffer @samp{*Help*} was made by a help request; it is
201not visiting any file. The buffer @code{src} was made by Dired on the
202directory @file{~/cvs/emacs/src/}. You can list only buffers that are
203visiting files by giving the command a prefix argument, as in
204@kbd{C-u C-x C-b}.
205
206 @code{list-buffers} omits buffers whose names begin with a space,
207unless they visit files: such buffers are used internally by Emacs.
208
209@need 2000
210@node Misc Buffer
211@section Miscellaneous Buffer Operations
212
213@table @kbd
214@item C-x C-q
215Toggle read-only status of buffer (@code{toggle-read-only}).
216@item M-x rename-buffer @key{RET} @var{name} @key{RET}
217Change the name of the current buffer.
218@item M-x rename-uniquely
219Rename the current buffer by adding @samp{<@var{number}>} to the end.
220@item M-x view-buffer @key{RET} @var{buffer} @key{RET}
221Scroll through buffer @var{buffer}.
222@end table
223
224@kindex C-x C-q
225@vindex buffer-read-only
226@cindex read-only buffer
227 A buffer can be @dfn{read-only}, which means that commands to change
228its contents are not allowed. The mode line indicates read-only
229buffers with @samp{%%} or @samp{%*} near the left margin. Read-only
230buffers are usually made by subsystems such as Dired and Rmail that
231have special commands to operate on the text; also by visiting a file
232whose access control says you cannot write it.
233
234@findex toggle-read-only
235 If you wish to make changes in a read-only buffer, use the command
236@kbd{C-x C-q} (@code{toggle-read-only}). It makes a read-only buffer
237writable, and makes a writable buffer read-only. This
238works by setting the variable @code{buffer-read-only}, which has a local
239value in each buffer and makes the buffer read-only if its value is
240non-@code{nil}. If you have files under version control, you may find
241it convenient to bind @kbd{C-x C-q} to @code{vc-toggle-read-only}
242instead. Then, typing @kbd{C-x C-q} not only changes the read-only
243flag, but it also checks the file in or out. @xref{Version
244Control}.
245
246@findex rename-buffer
247 @kbd{M-x rename-buffer} changes the name of the current buffer. You
248specify the new name as a minibuffer argument; there is no default.
249If you specify a name that is in use for some other buffer, an error
250happens and no renaming is done.
251
252@findex rename-uniquely
253 @kbd{M-x rename-uniquely} renames the current buffer to a similar
254name with a numeric suffix added to make it both different and unique.
255This command does not need an argument. It is useful for creating
256multiple shell buffers: if you rename the @samp{*shell*} buffer, then
257do @kbd{M-x shell} again, it makes a new shell buffer named
258@samp{*shell*}; meanwhile, the old shell buffer continues to exist
259under its new name. This method is also good for mail buffers,
260compilation buffers, and most Emacs features that create special
261buffers with particular names. (With some of these features, such as
262@kbd{M-x compile}, @kbd{M-x grep} an @kbd{M-x info}, you need to
263switch to some other buffer before using the command, in order for it
264to make a different buffer.)
265
266@findex view-buffer
267 @kbd{M-x view-buffer} is much like @kbd{M-x view-file} (@pxref{Misc
268File Ops}) except that it examines an already existing Emacs buffer.
269View mode provides commands for scrolling through the buffer
270conveniently but not for changing it. When you exit View mode with
271@kbd{q}, that switches back to the buffer (and the position) which was
272previously displayed in the window. Alternatively, if you exit View
273mode with @kbd{e}, the buffer and the value of point that resulted from
274your perusal remain in effect.
275
276 The commands @kbd{M-x append-to-buffer} and @kbd{M-x insert-buffer}
277can be used to copy text from one buffer to another. @xref{Accumulating
278Text}.
279
280@node Kill Buffer
281@section Killing Buffers
282
283@cindex killing buffers
284 If you continue an Emacs session for a while, you may accumulate a
285large number of buffers. You may then find it convenient to @dfn{kill}
286the buffers you no longer need. On most operating systems, killing a
287buffer releases its space back to the operating system so that other
288programs can use it. Here are some commands for killing buffers:
289
290@table @kbd
291@item C-x k @var{bufname} @key{RET}
292Kill buffer @var{bufname} (@code{kill-buffer}).
293@item M-x kill-some-buffers
294Offer to kill each buffer, one by one.
295@end table
296
297@findex kill-buffer
298@findex kill-some-buffers
299@kindex C-x k
300
301 @kbd{C-x k} (@code{kill-buffer}) kills one buffer, whose name you
302specify in the minibuffer. The default, used if you type just
303@key{RET} in the minibuffer, is to kill the current buffer. If you
304kill the current buffer, another buffer becomes current: one that was
305current in the recent past but is not displayed in any window now. If
306you ask to kill a file-visiting buffer that is modified (has unsaved
307editing), then you must confirm with @kbd{yes} before the buffer is
308killed.
309
310 The command @kbd{M-x kill-some-buffers} asks about each buffer, one by
311one. An answer of @kbd{y} means to kill the buffer. Killing the current
312buffer or a buffer containing unsaved changes selects a new buffer or asks
313for confirmation just like @code{kill-buffer}.
314
315 The buffer menu feature (@pxref{Several Buffers}) is also convenient
316for killing various buffers.
317
318@vindex kill-buffer-hook
319 If you want to do something special every time a buffer is killed, you
320can add hook functions to the hook @code{kill-buffer-hook} (@pxref{Hooks}).
321
322@findex clean-buffer-list
323 If you run one Emacs session for a period of days, as many people do,
324it can fill up with buffers that you used several days ago. The command
325@kbd{M-x clean-buffer-list} is a convenient way to purge them; it kills
326all the unmodified buffers that you have not used for a long time. An
327ordinary buffer is killed if it has not been displayed for three days;
328however, you can specify certain buffers that should never be killed
329automatically, and others that should be killed if they have been unused
330for a mere hour.
331
332@cindex Midnight mode
333@vindex midnight-mode
334@vindex midnight-hook
335 You can also have this buffer purging done for you, every day at
336midnight, by enabling Midnight mode. Midnight mode operates each day at
337midnight; at that time, it runs @code{clean-buffer-list}, or whichever
338functions you have placed in the normal hook @code{midnight-hook}
339(@pxref{Hooks}).
340
341 To enable Midnight mode, use the Customization buffer to set the
342variable @code{midnight-mode} to @code{t}. @xref{Easy Customization}.
343
344@node Several Buffers
345@section Operating on Several Buffers
346@cindex buffer menu
347
348 The @dfn{buffer-menu} facility is like a ``Dired for buffers''; it allows
349you to request operations on various Emacs buffers by editing an Emacs
350buffer containing a list of them. You can save buffers, kill them
351(here called @dfn{deleting} them, for consistency with Dired), or display
352them.
353
354@table @kbd
355@item M-x buffer-menu
356Begin editing a buffer listing all Emacs buffers.
357@item M-x buffer-menu-other-window.
358Similar, but do it in another window.
359@end table
360
361@findex buffer-menu
362@findex buffer-menu-other-window
363 The command @code{buffer-menu} writes a list of all Emacs
364buffers@footnote{Buffers which don't visit files and whose names begin
365with a space are omitted: these are used internally by Emacs.} into the
366buffer @samp{*Buffer List*}, and selects that buffer in Buffer Menu
367mode.
368
369 The buffer is read-only, and can be
370changed only through the special commands described in this section.
371The usual Emacs cursor motion commands can be used in the @samp{*Buffer
372List*} buffer. The following commands apply to the buffer described on
373the current line.
374
375@table @kbd
376@item d
377Request to delete (kill) the buffer, then move down. The request
378shows as a @samp{D} on the line, before the buffer name. Requested
379deletions take place when you type the @kbd{x} command.
380@item C-d
381Like @kbd{d} but move up afterwards instead of down.
382@item s
383Request to save the buffer. The request shows as an @samp{S} on the
384line. Requested saves take place when you type the @kbd{x} command.
385You may request both saving and deletion for the same buffer.
386@item x
387Perform previously requested deletions and saves.
388@item u
389Remove any request made for the current line, and move down.
390@item @key{DEL}
391Move to previous line and remove any request made for that line.
392@end table
393
394 The @kbd{d}, @kbd{C-d}, @kbd{s} and @kbd{u} commands to add or remove
395flags also move down (or up) one line. They accept a numeric argument
396as a repeat count.
397
398 These commands operate immediately on the buffer listed on the current
399line:
400
401@table @kbd
402@item ~
403Mark the buffer ``unmodified.'' The command @kbd{~} does this
404immediately when you type it.
405@item %
406Toggle the buffer's read-only flag. The command @kbd{%} does
407this immediately when you type it.
408@item t
409Visit the buffer as a tags table. @xref{Select Tags Table}.
410@end table
411
412 There are also commands to select another buffer or buffers:
413
414@table @kbd
415@item q
416Quit the buffer menu---immediately display the most recent formerly
417visible buffer in its place.
418@item @key{RET}
419@itemx f
420Immediately select this line's buffer in place of the @samp{*Buffer
421List*} buffer.
422@item o
423Immediately select this line's buffer in another window as if by
424@kbd{C-x 4 b}, leaving @samp{*Buffer List*} visible.
425@item C-o
426Immediately display this line's buffer in another window, but don't
427select the window.
428@item 1
429Immediately select this line's buffer in a full-screen window.
430@item 2
431Immediately set up two windows, with this line's buffer selected in
432one, and the previously current buffer (aside from the buffer
433@samp{*Buffer List*}) displayed in the other.
434@item b
435Bury the buffer listed on this line.
436@item m
437Mark this line's buffer to be displayed in another window if you exit
438with the @kbd{v} command. The request shows as a @samp{>} at the
439beginning of the line. (A single buffer may not have both a delete
440request and a display request.)
441@item v
442Immediately select this line's buffer, and also display in other windows
443any buffers previously marked with the @kbd{m} command. If you have not
444marked any buffers, this command is equivalent to @kbd{1}.
445@end table
446
447 There is also a command that affects the entire buffer list:
448
449@table @kbd
450@item T
451Delete, or reinsert, lines for non-file buffers. This command toggles
452the inclusion of such buffers in the buffer list.
453@end table
454
455 What @code{buffer-menu} actually does is create and switch to a
456suitable buffer, and turn on Buffer Menu mode in it. Everything else
457described above is implemented by the special commands provided in
458Buffer Menu mode. One consequence of this is that you can switch from
459the @samp{*Buffer List*} buffer to another Emacs buffer, and edit
460there. You can reselect the @samp{*Buffer List*} buffer later, to
461perform the operations already requested, or you can kill it, or pay
462no further attention to it.
463
464 The list in the @samp{*Buffer List*} buffer looks exactly like the
465buffer list described in @ref{List Buffers}, because they really are
466the same. The only difference between @code{buffer-menu} and
467@code{list-buffers} is that @code{buffer-menu} switches to the
468@samp{*Buffer List*} buffer in the selected window;
469@code{list-buffers} displays the same buffer in another window. If
470you run @code{list-buffers} (that is, type @kbd{C-x C-b}) and select
471the buffer list manually, you can use all of the commands described
472here.
473
474 Normally, the buffer @samp{*Buffer List*} is not updated
475automatically when buffers are created and killed; its contents are
476just text. If you have created, deleted or renamed buffers, the way
477to update @samp{*Buffer List*} to show what you have done is to type
478@kbd{g} (@code{revert-buffer}). You can make this happen regularly
479every @code{auto-revert-interval} seconds if you enable Auto Revert
480mode in this buffer, as long as it is not marked modified. Global
481Auto Revert mode applies to the @samp{*Buffer List*} buffer only if
482@code{global-auto-revert-non-file-buffers} is non-@code{nil}.
483@iftex
484@inforef{Autorevert,, emacs-xtra}, for details.
485@end iftex
486@ifnottex
487@xref{Autorevert, global-auto-revert-non-file-buffers}, for details.
488@end ifnottex
489
490
491 The command @code{buffer-menu-other-window} works the same as
492@code{buffer-menu}, except that it displays the buffers list in
493another window.
494
495@node Indirect Buffers
496@section Indirect Buffers
497@cindex indirect buffer
498@cindex base buffer
499
500 An @dfn{indirect buffer} shares the text of some other buffer, which
501is called the @dfn{base buffer} of the indirect buffer. In some ways it
502is the analogue, for buffers, of a symbolic link between files.
503
504@table @kbd
505@findex make-indirect-buffer
506@item M-x make-indirect-buffer @key{RET} @var{base-buffer} @key{RET} @var{indirect-name} @key{RET}
507Create an indirect buffer named @var{indirect-name} whose base buffer
508is @var{base-buffer}.
509@findex clone-indirect-buffer
510@item M-x clone-indirect-buffer @key{RET}
511Create an indirect buffer that is a twin copy of the current buffer.
512@item C-x 4 c
513@kindex C-x 4 c
514@findex clone-indirect-buffer-other-window
515Create an indirect buffer that is a twin copy of the current buffer, and
516select it in another window (@code{clone-indirect-buffer-other-window}).
517@end table
518
519 The text of the indirect buffer is always identical to the text of its
520base buffer; changes made by editing either one are visible immediately
521in the other. But in all other respects, the indirect buffer and its
522base buffer are completely separate. They have different names,
523different values of point, different narrowing, different markers,
524different major modes, and different local variables.
525
526 An indirect buffer cannot visit a file, but its base buffer can. If
527you try to save the indirect buffer, that actually works by saving the
528base buffer. Killing the base buffer effectively kills the indirect
529buffer, but killing an indirect buffer has no effect on its base buffer.
530
531 One way to use indirect buffers is to display multiple views of an
532outline. @xref{Outline Views}.
533
534 A quick and handy way to make an indirect buffer is with the command
535@kbd{M-x clone-indirect-buffer}. It creates and selects an indirect
536buffer whose base buffer is the current buffer. With a numeric
537argument, it prompts for the name of the indirect buffer; otherwise it
538uses the name of the current buffer, with a @samp{<@var{n}>} suffix
539added. @kbd{C-x 4 c} (@code{clone-indirect-buffer-other-window})
540works like @kbd{M-x clone-indirect-buffer}, but it selects the new
541buffer in another window.
542
543 The more general way to make an indirect buffer is with the command
544@kbd{M-x make-indirect-buffer}. It creates an indirect buffer from
545buffer @var{base-buffer}, under the name @var{indirect-name}. It
546prompts for both @var{base-buffer} and @var{indirect-name} using the
547minibuffer.
548
549@node Buffer Convenience
550@section Convenience Features and Customization of Buffer Handling
551
552 This section describes several modes and features that make it more
553convenient to switch between buffers.
554
555@menu
556* Uniquify:: Making buffer names unique with directory parts.
557* Iswitchb:: Switching between buffers with substrings.
558* Buffer Menus:: Configurable buffer menu.
559@end menu
560
561@node Uniquify
562@subsection Making Buffer Names Unique
563
564@cindex unique buffer names
565@cindex directories in buffer names
566 When several buffers visit identically-named files, Emacs must give
567the buffers distinct names. The usual method for making buffer names
568unique adds @samp{<2>}, @samp{<3>}, etc. to the end of the buffer
569names (all but one of them).
570
571@vindex uniquify-buffer-name-style
572 Other methods work by adding parts of each file's directory to the
573buffer name. To select one, customize the variable
574@code{uniquify-buffer-name-style} (@pxref{Easy Customization}).
575
576 To begin with, the @code{forward} naming method includes part of the
577file's directory name at the beginning of the buffer name; using this
578method, buffers visiting the files @file{/u/rms/tmp/Makefile} and
579@file{/usr/projects/zaphod/Makefile} would be named
580@samp{tmp/Makefile} and @samp{zaphod/Makefile}, respectively (instead
581of @samp{Makefile} and @samp{Makefile<2>}).
582
583 In contrast, the @code{post-forward} naming method would call the
584buffers @samp{Makefile|tmp} and @samp{Makefile|zaphod}, and the
585@code{reverse} naming method would call them @samp{Makefile\tmp} and
586@samp{Makefile\zaphod}. The nontrivial difference between
587@code{post-forward} and @code{reverse} occurs when just one directory
588name is not enough to distinguish two files; then @code{reverse} puts
589the directory names in reverse order, so that @file{/top/middle/file}
590becomes @samp{file\middle\top}, while @code{post-forward} puts them in
591forward order after the file name, as in @samp{file|top/middle}.
592
593 Which rule to follow for putting the directory names in the buffer
594name is not very important if you are going to @emph{look} at the
595buffer names before you type one. But as an experienced user, if you
596know the rule, you won't have to look. And then you may find that one
597rule or another is easier for you to remember and apply quickly.
598
599@node Iswitchb
600@subsection Switching Between Buffers using Substrings
601
602@findex iswitchb-mode
603@cindex Iswitchb mode
604@cindex mode, Iswitchb
605@kindex C-x b @r{(Iswitchb mode)}
606@kindex C-x 4 b @r{(Iswitchb mode)}
607@kindex C-x 5 b @r{(Iswitchb mode)}
608@kindex C-x 4 C-o @r{(Iswitchb mode)}
609
610 Iswitchb global minor mode provides convenient switching between
611buffers using substrings of their names. It replaces the normal
612definitions of @kbd{C-x b}, @kbd{C-x 4 b}, @kbd{C-x 5 b}, and @kbd{C-x
6134 C-o} with alternative commands that are somewhat ``smarter.''
614
615 When one of these commands prompts you for a buffer name, you can
616type in just a substring of the name you want to choose. As you enter
617the substring, Iswitchb mode continuously displays a list of buffers
618that match the substring you have typed.
619
620 At any time, you can type @key{RET} to select the first buffer in
621the list. So the way to select a particular buffer is to make it the
622first in the list. There are two ways to do this. You can type more
623of the buffer name and thus narrow down the list, excluding unwanted
624buffers above the desired one. Alternatively, you can use @kbd{C-s}
625and @kbd{C-r} to rotate the list until the desired buffer is first.
626
627 @key{TAB} while entering the buffer name performs completion on the
628string you have entered, based on the displayed list of buffers.
629
630 To enable Iswitchb mode, type @kbd{M-x iswitchb-mode}, or customize
631the variable @code{iswitchb-mode} to @code{t} (@pxref{Easy
632Customization}).
633
634@node Buffer Menus
635@subsection Customizing Buffer Menus
636
637@findex bs-show
638@cindex buffer list, customizable
639@table @kbd
640@item M-x bs-show
641Make a list of buffers similarly to @kbd{M-x list-buffers} but
642customizable.
643@end table
644
645 @kbd{M-x bs-show} pops up a buffer list similar to the one normally
646displayed by @kbd{C-x C-b} but which you can customize. If you prefer
647this to the usual buffer list, you can bind this command to @kbd{C-x
648C-b}. To customize this buffer list, use the @code{bs} Custom group
649(@pxref{Easy Customization}).
650
651@findex msb-mode
652@cindex mode, MSB
653@cindex MSB mode
654@cindex buffer menu
655@findex mouse-buffer-menu
656@kindex C-Down-Mouse-1
657 MSB global minor mode (``MSB'' stands for ``mouse select buffer'')
658provides a different and customizable mouse buffer menu which you may
659prefer. It replaces the bindings of @code{mouse-buffer-menu},
660normally on @kbd{C-Down-Mouse-1}, and the menu bar buffer menu. You
661can customize the menu in the @code{msb} Custom group.
662
663@ignore
664 arch-tag: 08c43460-f4f4-4b43-9cb5-1ea9ad991695
665@end ignore
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
new file mode 100644
index 00000000000..62e5f7b4316
--- /dev/null
+++ b/doc/emacs/building.texi
@@ -0,0 +1,1440 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Building, Maintaining, Programs, Top
6@chapter Compiling and Testing Programs
7@cindex building programs
8@cindex program building
9@cindex running Lisp functions
10
11 The previous chapter discusses the Emacs commands that are useful for
12making changes in programs. This chapter deals with commands that assist
13in the larger process of compiling and testing programs.
14
15@menu
16* Compilation:: Compiling programs in languages other
17 than Lisp (C, Pascal, etc.).
18* Compilation Mode:: The mode for visiting compiler errors.
19* Compilation Shell:: Customizing your shell properly
20 for use in the compilation buffer.
21* Grep Searching:: Searching with grep.
22* Flymake:: Finding syntax errors on the fly.
23* Debuggers:: Running symbolic debuggers for non-Lisp programs.
24* Executing Lisp:: Various modes for editing Lisp programs,
25 with different facilities for running
26 the Lisp programs.
27* Libraries: Lisp Libraries. Creating Lisp programs to run in Emacs.
28* Eval: Lisp Eval. Executing a single Lisp expression in Emacs.
29* Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer.
30* External Lisp:: Communicating through Emacs with a separate Lisp.
31@end menu
32
33@node Compilation
34@section Running Compilations under Emacs
35@cindex inferior process
36@cindex make
37@cindex compilation errors
38@cindex error log
39
40 Emacs can run compilers for noninteractive languages such as C and
41Fortran as inferior processes, feeding the error log into an Emacs buffer.
42It can also parse the error messages and show you the source lines where
43compilation errors occurred.
44
45@table @kbd
46@item M-x compile
47Run a compiler asynchronously under Emacs, with error messages going to
48the @samp{*compilation*} buffer.
49@item M-x recompile
50Invoke a compiler with the same command as in the last invocation of
51@kbd{M-x compile}.
52@item M-x kill-compilation
53Kill the running compilation subprocess.
54@end table
55
56@findex compile
57 To run @code{make} or another compilation command, do @kbd{M-x
58compile}. This command reads a shell command line using the minibuffer,
59and then executes the command in an inferior shell, putting output in
60the buffer named @samp{*compilation*}. The current buffer's default
61directory is used as the working directory for the execution of the
62command; normally, therefore, the compilation happens in this
63directory.
64
65@vindex compile-command
66 The default for the compilation command is normally @samp{make -k},
67which is correct most of the time for nontrivial programs.
68(@xref{Top,, Make, make, GNU Make Manual}.) If you have done @kbd{M-x
69compile} before, the default each time is the command you used the
70previous time. @code{compile} stores this command in the variable
71@code{compile-command}, so setting that variable specifies the default
72for the next use of @kbd{M-x compile}. If a file specifies a file
73local value for @code{compile-command}, that provides the default when
74you type @kbd{M-x compile} in that file's buffer. @xref{File
75Variables}.
76
77 Starting a compilation displays the buffer @samp{*compilation*} in
78another window but does not select it. The buffer's mode line tells
79you whether compilation is finished, with the word @samp{run},
80@samp{signal} or @samp{exit} inside the parentheses. You do not have
81to keep this buffer visible; compilation continues in any case. While
82a compilation is going on, the string @samp{Compiling} appears in the
83mode lines of all windows. When this string disappears, the
84compilation is finished.
85
86 If you want to watch the compilation transcript as it appears, switch
87to the @samp{*compilation*} buffer and move point to the end of the
88buffer. When point is at the end, new compilation output is inserted
89above point, which remains at the end. If point is not at the end of
90the buffer, it remains fixed while more compilation output is added at
91the end of the buffer.
92
93@cindex compilation buffer, keeping point at end
94@vindex compilation-scroll-output
95 If you set the variable @code{compilation-scroll-output} to a
96non-@code{nil} value, then the compilation buffer always scrolls to
97follow output as it comes in.
98
99@findex recompile
100 To rerun the last compilation with the same command, type @kbd{M-x
101recompile}. This automatically reuses the compilation command from
102the last invocation of @kbd{M-x compile}. It also reuses the
103@samp{*compilation*} buffer and starts the compilation in its default
104directory, which is the directory in which the previous compilation
105was started.
106
107 When the compiler process terminates, for whatever reason, the mode
108line of the @samp{*compilation*} buffer changes to say @samp{exit}
109(followed by the exit code, @samp{[0]} for a normal exit), or
110@samp{signal} (if a signal terminated the process), instead of
111@samp{run}.
112
113@findex kill-compilation
114 Starting a new compilation also kills any compilation already
115running in @samp{*compilation*}, as the buffer can only handle one
116compilation at any time. However, @kbd{M-x compile} asks for
117confirmation before actually killing a compilation that is running.
118You can also kill the compilation process with @kbd{M-x
119kill-compilation}.
120
121 If you want to run two compilations at once, you should start the
122first one, then rename the @samp{*compilation*} buffer (perhaps using
123@code{rename-uniquely}; @pxref{Misc Buffer}), and start the other
124compilation. That will create a new @samp{*compilation*} buffer.
125
126 Emacs does not expect a compiler process to launch asynchronous
127subprocesses; if it does, and they keep running after the main
128compiler process has terminated, Emacs may kill them or their output
129may not arrive in Emacs. To avoid this problem, make the main process
130wait for its subprocesses to finish. In a shell script, you can do this
131using @samp{$!} and @samp{wait}, like this:
132
133@example
134(sleep 10; echo 2nd)& pid=$! # @r{Record pid of subprocess}
135echo first message
136wait $pid # @r{Wait for subprocess}
137@end example
138
139 If the background process does not output to the compilation buffer,
140so you only need to prevent it from being killed when the main
141compilation process terminates, this is sufficient:
142
143@example
144nohup @var{command}; sleep 1
145@end example
146
147@vindex compilation-environment
148 You can control the environment passed to the compilation command
149with the variable @code{compilation-environment}. Its value is a list
150of environment variable settings; each element should be a string of
151the form @code{"@var{envvarname}=@var{value}"}. These environment
152variable settings override the usual ones.
153
154@node Compilation Mode
155@section Compilation Mode
156
157@cindex Compilation mode
158@cindex mode, Compilation
159 The @samp{*compilation*} buffer uses a special major mode,
160Compilation mode, whose main feature is to provide a convenient way to
161visit the source line corresponding to an error message. These
162commands are also available in other special buffers that list
163locations in files, including those made by @kbd{M-x grep} and
164@kbd{M-x occur}.
165
166@table @kbd
167@item M-g M-n
168@itemx M-g n
169@itemx C-x `
170Visit the locus of the next error message or match.
171@item M-g M-p
172@itemx M-g p
173Visit the locus of the previous error message or match.
174@item @key{RET}
175Visit the locus of the error message that point is on.
176This command is used in the compilation buffer.
177@item Mouse-2
178Visit the locus of the error message that you click on.
179@item M-n
180Find and highlight the locus of the next error message, without
181selecting the source buffer.
182@item M-p
183Find and highlight the locus of the previous error message, without
184selecting the source buffer.
185@item M-@}
186Move point to the next error for a different file than the current
187one.
188@item M-@{
189Move point to the previous error for a different file than the current
190one.
191@item C-c C-f
192Toggle Next Error Follow minor mode, which makes cursor motion in the
193compilation buffer produce automatic source display.
194@end table
195
196@findex compile-goto-error
197 You can visit the source for any particular error message by moving
198point in the @samp{*compilation*} buffer to that error message and
199typing @key{RET} (@code{compile-goto-error}). Alternatively, you can
200click @kbd{Mouse-2} on the error message; you need not switch to the
201@samp{*compilation*} buffer first.
202
203@kindex M-g M-n
204@kindex M-g n
205@kindex C-x `
206@findex next-error
207@vindex next-error-highlight
208 To parse the compiler error messages sequentially, type @kbd{C-x `}
209(@code{next-error}). The character following the @kbd{C-x} is the
210backquote or ``grave accent,'' not the single-quote. This command is
211available in all buffers, not just in @samp{*compilation*}; it
212displays the next error message at the top of one window and source
213location of the error in another window. It also temporarily
214highlights the relevant source line, for a period controlled by the
215variable @code{next-error-highlight}.
216
217 The first time @w{@kbd{C-x `}} is used after the start of a compilation,
218it moves to the first error's location. Subsequent uses of @kbd{C-x
219`} advance down to subsequent errors. If you visit a specific error
220message with @key{RET} or @kbd{Mouse-2}, subsequent @w{@kbd{C-x `}}
221commands advance from there. When @w{@kbd{C-x `}} gets to the end of the
222buffer and finds no more error messages to visit, it fails and signals
223an Emacs error. @w{@kbd{C-u C-x `}} starts scanning from the beginning of
224the compilation buffer, and goes to the first error's location.
225
226@vindex compilation-skip-threshold
227 By default, @w{@kbd{C-x `}} skips less important messages. The variable
228@code{compilation-skip-threshold} controls this. If its value is 2,
229@w{@kbd{C-x `}} skips anything less than error, 1 skips anything less
230than warning, and 0 doesn't skip any messages. The default is 1.
231
232 When the window has a left fringe, an arrow in the fringe points to
233the current message in the compilation buffer. The variable
234@code{compilation-context-lines} controls the number of lines of
235leading context to display before the current message. Going to an
236error message location scrolls the @samp{*compilation*} buffer to put
237the message that far down from the top. The value @code{nil} is
238special: if there's a left fringe, the window doesn't scroll at all
239if the message is already visible. If there is no left fringe,
240@code{nil} means display the message at the top of the window.
241
242 If you're not in the compilation buffer when you run
243@code{next-error}, Emacs will look for a buffer that contains error
244messages. First, it looks for one displayed in the selected frame,
245then for one that previously had @code{next-error} called on it, and
246then at the current buffer. Finally, Emacs looks at all the remaining
247buffers. @code{next-error} signals an error if it can't find any such
248buffer.
249
250@vindex compilation-error-regexp-alist
251@vindex grep-regexp-alist
252 To parse messages from the compiler, Compilation mode uses the
253variable @code{compilation-error-regexp-alist} which lists various
254formats of error messages and tells Emacs how to extract the source file
255and the line number from the text of a message. If your compiler isn't
256supported, you can tailor Compilation mode to it by adding elements to
257that list. A similar variable @code{grep-regexp-alist} tells Emacs how
258to parse output of a @code{grep} command.
259
260@findex compilation-next-error
261@findex compilation-previous-error
262@findex compilation-next-file
263@findex compilation-previous-file
264 Compilation mode also redefines the keys @key{SPC} and @key{DEL} to
265scroll by screenfuls, and @kbd{M-n} (@code{compilation-next-error})
266and @kbd{M-p} (@code{compilation-previous-error}) to move to the next
267or previous error message. You can also use @kbd{M-@{}
268(@code{compilation-next-file} and @kbd{M-@}}
269(@code{compilation-previous-file}) to move up or down to an error
270message for a different source file.
271
272@cindex Next Error Follow mode
273@findex next-error-follow-minor-mode
274 You can type @kbd{C-c C-f} to toggle Next Error Follow mode. In
275this minor mode, ordinary cursor motion in the compilation buffer
276automatically updates the source buffer. For instance, moving the
277cursor to the next error message causes the location of that error to
278be displayed immediately.
279
280 The features of Compilation mode are also available in a minor mode
281called Compilation Minor mode. This lets you parse error messages in
282any buffer, not just a normal compilation output buffer. Type @kbd{M-x
283compilation-minor-mode} to enable the minor mode. This defines the keys
284@key{RET} and @kbd{Mouse-2}, as in the Compilation major mode.
285
286 Compilation minor mode works in any buffer, as long as the contents
287are in a format that it understands. In an Rlogin buffer (@pxref{Remote
288Host}), Compilation minor mode automatically accesses remote source
289files by FTP (@pxref{File Names}).
290
291@node Compilation Shell
292@section Subshells for Compilation
293
294 Emacs uses a shell to run the compilation command, but specifies the
295option for a noninteractive shell. This means, in particular, that
296the shell should start with no prompt. If you find your usual shell
297prompt making an unsightly appearance in the @samp{*compilation*}
298buffer, it means you have made a mistake in your shell's init file by
299setting the prompt unconditionally. (This init file's name may be
300@file{.bashrc}, @file{.profile}, @file{.cshrc}, @file{.shrc}, or
301various other things, depending on the shell you use.) The shell init
302file should set the prompt only if there already is a prompt. Here's
303how to do it in bash:
304
305@example
306if [ "$@{PS1+set@}" = set ]
307then PS1=@dots{}
308fi
309@end example
310
311@noindent
312And here's how to do it in csh:
313
314@example
315if ($?prompt) set prompt = @dots{}
316@end example
317
318 There may well be other things that your shell's init file
319ought to do only for an interactive shell. You can use the same
320method to conditionalize them.
321
322 The MS-DOS ``operating system'' does not support asynchronous
323subprocesses; to work around this lack, @kbd{M-x compile} runs the
324compilation command synchronously on MS-DOS. As a consequence, you must
325wait until the command finishes before you can do anything else in
326Emacs.
327@iftex
328@inforef{MS-DOS,,emacs-xtra}.
329@end iftex
330@ifnottex
331@xref{MS-DOS}.
332@end ifnottex
333
334@node Grep Searching
335@section Searching with Grep under Emacs
336
337 Just as you can run a compiler from Emacs and then visit the lines
338with compilation errors, you can also run @code{grep} and then visit
339the lines on which matches were found. This works by treating the
340matches reported by @code{grep} as if they were ``errors.'' The
341buffer of matches uses Grep mode, which is a variant of Compilation
342mode (@pxref{Compilation Mode}).
343
344@table @kbd
345@item M-x grep
346@item M-x lgrep
347Run @code{grep} asynchronously under Emacs, with matching lines
348listed in the buffer named @samp{*grep*}.
349@item M-x grep-find
350@itemx M-x find-grep
351@itemx M-x rgrep
352Run @code{grep} via @code{find}, with user-specified arguments, and
353collect output in the buffer named @samp{*grep*}.
354@item M-x kill-grep
355Kill the running @code{grep} subprocess.
356@end table
357
358@findex grep
359 To run @code{grep}, type @kbd{M-x grep}, then enter a command line
360that specifies how to run @code{grep}. Use the same arguments you
361would give @code{grep} when running it normally: a @code{grep}-style
362regexp (usually in single-quotes to quote the shell's special
363characters) followed by file names, which may use wildcards. If you
364specify a prefix argument for @kbd{M-x grep}, it finds the tag
365(@pxref{Tags}) in the buffer around point, and puts that into the
366default @code{grep} command.
367
368 Your command need not simply run @code{grep}; you can use any shell
369command that produces output in the same format. For instance, you
370can chain @code{grep} commands, like this:
371
372@example
373grep -nH -e foo *.el | grep bar | grep toto
374@end example
375
376 The output from @code{grep} goes in the @samp{*grep*} buffer. You
377can find the corresponding lines in the original files using @w{@kbd{C-x
378`}}, @key{RET}, and so forth, just like compilation errors.
379
380 Some grep programs accept a @samp{--color} option to output special
381markers around matches for the purpose of highlighting. You can make
382use of this feature by setting @code{grep-highlight-matches} to
383@code{t}. When displaying a match in the source buffer, the exact
384match will be highlighted, instead of the entire source line.
385
386@findex grep-find
387@findex find-grep
388 The command @kbd{M-x grep-find} (also available as @kbd{M-x
389find-grep}) is similar to @kbd{M-x grep}, but it supplies a different
390initial default for the command---one that runs both @code{find} and
391@code{grep}, so as to search every file in a directory tree. See also
392the @code{find-grep-dired} command, in @ref{Dired and Find}.
393
394@findex lgrep
395@findex rgrep
396 The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep}
397(recursive grep) are more user-friendly versions of @code{grep} and
398@code{grep-find}, which prompt separately for the regular expression
399to match, the files to search, and the base directory for the search.
400Case sensitivity of the search is controlled by the
401current value of @code{case-fold-search}.
402
403These commands build the shell commands based on the variables
404@code{grep-template} (for @code{lgrep}) and @code{grep-find-template}
405(for @code{rgrep}).
406
407The files to search can use aliases defined in the variable
408@code{grep-files-aliases}.
409
410Subdirectories listed in the variable
411@code{grep-find-ignored-directories} such as those typically used by
412various version control systems, like CVS and arch, are automatically
413skipped by @code{rgrep}.
414
415@node Flymake
416@section Finding Syntax Errors On The Fly
417@cindex checking syntax
418
419 Flymake mode is a minor mode that performs on-the-fly syntax
420checking for many programming and markup languages, including C, C++,
421Perl, HTML, and @TeX{}/La@TeX{}. It is somewhat analogous to Flyspell
422mode, which performs spell checking for ordinary human languages in a
423similar fashion (@pxref{Spelling}). As you edit a file, Flymake mode
424runs an appropriate syntax checking tool in the background, using a
425temporary copy of the buffer. It then parses the error and warning
426messages, and highlights the erroneous lines in the buffer. The
427syntax checking tool used depends on the language; for example, for
428C/C++ files this is usually the C compiler. Flymake can also use
429build tools such as @code{make} for checking complicated projects.
430
431 To activate Flymake mode, type @kbd{M-x flymake-mode}. You can move
432to the errors spotted by Flymake mode with @kbd{M-x
433flymake-goto-next-error} and @kbd{M-x flymake-goto-prev-error}. To
434display any error messages associated with the current line, use
435@kbd{M-x flymake-display-err-menu-for-current-line}.
436
437 For more details about using Flymake, see @ref{Top, Flymake,
438Flymake, flymake, The Flymake Manual}.
439
440@node Debuggers
441@section Running Debuggers Under Emacs
442@cindex debuggers
443@cindex GUD library
444@cindex GDB
445@cindex DBX
446@cindex SDB
447@cindex XDB
448@cindex Perldb
449@cindex JDB
450@cindex PDB
451
452@c Do you believe in GUD?
453The GUD (Grand Unified Debugger) library provides an interface to
454various symbolic debuggers from within Emacs. We recommend the
455debugger GDB, which is free software, but GUD can also run DBX, SDB or
456XDB. GUD can also serve as an interface to Perl's debugging mode, the
457Python debugger PDB, and to JDB, the Java Debugger.
458@xref{Debugging,, The Lisp Debugger, elisp, the Emacs Lisp Reference
459Manual}, for information on debugging Emacs Lisp programs.
460
461@menu
462* Starting GUD:: How to start a debugger subprocess.
463* Debugger Operation:: Connection between the debugger and source buffers.
464* Commands of GUD:: Key bindings for common commands.
465* GUD Customization:: Defining your own commands for GUD.
466* GDB Graphical Interface:: An enhanced mode that uses GDB features to
467 implement a graphical debugging environment through
468 Emacs.
469@end menu
470
471@node Starting GUD
472@subsection Starting GUD
473
474 There are several commands for starting a debugger, each corresponding
475to a particular debugger program.
476
477@table @kbd
478@item M-x gdb @key{RET} @var{file} @key{RET}
479@findex gdb
480Run GDB as a subprocess of Emacs. By default, this uses an IDE-like
481graphical interface; see @ref{GDB Graphical Interface}. Only GDB
482works with the graphical interface.
483
484@item M-x dbx @key{RET} @var{file} @key{RET}
485@findex dbx
486Run DBX as a subprocess of Emacs. Since Emacs does not implement a
487graphical interface for DBX, communication with DBX works by typing
488commands in the GUD interaction buffer. The same is true for all
489the other supported debuggers.
490
491@item M-x xdb @key{RET} @var{file} @key{RET}
492@findex xdb
493@vindex gud-xdb-directories
494Similar, but run XDB. Use the variable
495@code{gud-xdb-directories} to specify directories to search for source
496files.
497
498@item M-x sdb @key{RET} @var{file} @key{RET}
499@findex sdb
500Similar, but run SDB.
501
502 Some versions of SDB do not mention source file names in their
503messages. When you use them, you need to have a valid tags table
504(@pxref{Tags}) in order for GUD to find functions in the source code.
505If you have not visited a tags table or the tags table doesn't list one
506of the functions, you get a message saying @samp{The sdb support
507requires a valid tags table to work}. If this happens, generate a valid
508tags table in the working directory and try again.
509
510@item M-x perldb @key{RET} @var{file} @key{RET}
511@findex perldb
512Run the Perl interpreter in debug mode to debug @var{file}, a Perl program.
513
514@item M-x jdb @key{RET} @var{file} @key{RET}
515@findex jdb
516Run the Java debugger to debug @var{file}.
517
518@item M-x pdb @key{RET} @var{file} @key{RET}
519@findex pdb
520Run the Python debugger to debug @var{file}.
521@end table
522
523 Each of these commands takes one argument: a command line to invoke
524the debugger. In the simplest case, specify just the name of the
525executable file you want to debug. You may also use options that the
526debugger supports. However, shell wildcards and variables are not
527allowed. GUD assumes that the first argument not starting with a
528@samp{-} is the executable file name.
529
530Tramp provides a facility to debug programs on remote hosts.
531@xref{Running a debugger on a remote host, Running a debugger on a remote host,, tramp, The Tramp Manual}.
532@c Running a debugger on a remote host
533
534@node Debugger Operation
535@subsection Debugger Operation
536
537@cindex fringes, and current execution line in GUD
538 Generally when you run a debugger with GUD, the debugger uses an Emacs
539buffer for its ordinary input and output. This is called the GUD
540buffer. Input and output from the program you are debugging also use
541this buffer. We call this @dfn{text command mode}. The GDB Graphical
542Interface can use further buffers (@pxref{GDB Graphical Interface}).
543
544 The debugger displays the source files of the program by visiting
545them in Emacs buffers. An arrow in the left fringe indicates the
546current execution line.@footnote{On a text-only terminal, the arrow
547appears as @samp{=>} and overlays the first two text columns.} Moving
548point in this buffer does not move the arrow. The arrow is not part
549of the file's text; it appears only on the screen.
550
551 You can start editing these source files at any time in the buffers
552that display them. If you do modify a source file, keep in mind that
553inserting or deleting lines will throw off the arrow's positioning;
554GUD has no way of figuring out which line corresponded before your
555changes to the line number in a debugger message. Also, you'll
556typically have to recompile and restart the program for your changes
557to be reflected in the debugger's tables.
558
559@cindex tooltips with GUD
560@vindex tooltip-gud-modes
561@vindex gud-tooltip-mode
562@vindex gud-tooltip-echo-area
563 The Tooltip facility (@pxref{Tooltips}) provides support for GUD@.
564You activate this feature by turning on the minor mode
565@code{gud-tooltip-mode}. Then you can display a variable's value in a
566tooltip simply by pointing at it with the mouse. This operates in the
567GUD buffer and in source buffers with major modes in the list
568@code{gud-tooltip-modes}. If the variable @code{gud-tooltip-echo-area}
569is non-@code{nil} then the variable's value is displayed in the echo
570area. When debugging a C program using the GDB Graphical Interface, you
571can also display macro definitions associated with an identifier when
572the program is not executing.
573
574 GUD tooltips are disabled when you use GDB in text command mode
575(@pxref{GDB Graphical Interface}), because displaying an expression's
576value in GDB can sometimes expand a macro and result in a side effect
577that interferes with the program's operation. The GDB graphical
578interface supports GUD tooltips and assures they will not cause side
579effects.
580
581@node Commands of GUD
582@subsection Commands of GUD
583
584 The GUD interaction buffer uses a variant of Shell mode, so the
585Emacs commands of Shell mode are available (@pxref{Shell Mode}). All
586the usual commands for your debugger are available, and you can use
587the Shell mode history commands to repeat them. If you wish, you can
588control your debugger process entirely through this buffer.
589
590 GUD mode also provides commands for setting and clearing
591breakpoints, for selecting stack frames, and for stepping through the
592program. These commands are available both in the GUD buffer and
593globally, but with different key bindings. It also has its own tool
594bar from which you can invoke the more common commands by clicking on
595the appropriate icon. This is particularly useful for repetitive
596commands like @code{gud-next} and @code{gud-step}, and allows you to
597keep the GUD buffer hidden.
598
599 The breakpoint commands are normally used in source file buffers,
600because that is the easiest way to specify where to set or clear the
601breakpoint. Here's the global command to set a breakpoint:
602
603@table @kbd
604@item C-x @key{SPC}
605@kindex C-x SPC
606Set a breakpoint on the source line that point is on.
607@end table
608
609@kindex C-x C-a @r{(GUD)}
610 Here are the other special commands provided by GUD@. The keys
611starting with @kbd{C-c} are available only in the GUD interaction
612buffer. The key bindings that start with @kbd{C-x C-a} are available
613in the GUD interaction buffer and also in source files. Some of these
614commands are not available to all the supported debuggers.
615
616@table @kbd
617@item C-c C-l
618@kindex C-c C-l @r{(GUD)}
619@itemx C-x C-a C-l
620@findex gud-refresh
621Display in another window the last line referred to in the GUD
622buffer (that is, the line indicated in the last location message).
623This runs the command @code{gud-refresh}.
624
625@item C-c C-s
626@kindex C-c C-s @r{(GUD)}
627@itemx C-x C-a C-s
628@findex gud-step
629Execute a single line of code (@code{gud-step}). If the line contains
630a function call, execution stops after entering the called function.
631
632@item C-c C-n
633@kindex C-c C-n @r{(GUD)}
634@itemx C-x C-a C-n
635@findex gud-next
636Execute a single line of code, stepping across entire function calls
637at full speed (@code{gud-next}).
638
639@item C-c C-i
640@kindex C-c C-i @r{(GUD)}
641@itemx C-x C-a C-i
642@findex gud-stepi
643Execute a single machine instruction (@code{gud-stepi}).
644
645@item C-c C-p
646@kindex C-c C-p @r{(GUD)}
647@itemx C-x C-a C-p
648@findex gud-print
649Evaluate the expression at point (@code{gud-print}). If Emacs
650does not print the exact expression that you want, mark it as a region
651first.
652
653@need 3000
654@item C-c C-r
655@kindex C-c C-r @r{(GUD)}
656@itemx C-x C-a C-r
657@findex gud-cont
658Continue execution without specifying any stopping point. The program
659will run until it hits a breakpoint, terminates, or gets a signal that
660the debugger is checking for (@code{gud-cont}).
661
662@need 1000
663@item C-c C-d
664@kindex C-c C-d @r{(GUD)}
665@itemx C-x C-a C-d
666@findex gud-remove
667Delete the breakpoint(s) on the current source line, if any
668(@code{gud-remove}). If you use this command in the GUD interaction
669buffer, it applies to the line where the program last stopped.
670
671@item C-c C-t
672@kindex C-c C-t @r{(GUD)}
673@itemx C-x C-a C-t
674@findex gud-tbreak
675Set a temporary breakpoint on the current source line, if any
676(@code{gud-tbreak}). If you use this command in the GUD interaction
677buffer, it applies to the line where the program last stopped.
678
679@item C-c <
680@kindex C-c < @r{(GUD)}
681@itemx C-x C-a <
682@findex gud-up
683Select the next enclosing stack frame (@code{gud-up}). This is
684equivalent to the GDB command @samp{up}.
685
686@item C-c >
687@kindex C-c > @r{(GUD)}
688@itemx C-x C-a >
689@findex gud-down
690Select the next inner stack frame (@code{gud-down}). This is
691equivalent to the GDB command @samp{down}.
692
693@item C-c C-u
694@kindex C-c C-u @r{(GUD)}
695@itemx C-x C-a C-u
696@findex gud-until
697Continue execution to the current line (@code{gud-until}). The
698program will run until it hits a breakpoint, terminates, gets a signal
699that the debugger is checking for, or reaches the line on which the
700cursor currently sits.
701
702@item C-c C-f
703@kindex C-c C-f @r{(GUD)}
704@itemx C-x C-a C-f
705@findex gud-finish
706Run the program until the selected stack frame returns or
707stops for some other reason (@code{gud-finish}).
708@end table
709
710 If you are using GDB, these additional key bindings are available:
711
712@table @kbd
713@item C-x C-a C-j
714@kindex C-x C-a C-j @r{(GUD)}
715@findex gud-jump
716Only useful in a source buffer, @code{gud-jump} transfers the
717program's execution point to the current line. In other words, the
718next line that the program executes will be the one where you gave the
719command. If the new execution line is in a different function from
720the previously one, GDB prompts for confirmation since the results may
721be bizarre. See the GDB manual entry regarding @code{jump} for
722details.
723
724@item @key{TAB}
725@kindex TAB @r{(GUD)}
726@findex gud-gdb-complete-command
727With GDB, complete a symbol name (@code{gud-gdb-complete-command}).
728This key is available only in the GUD interaction buffer.
729@end table
730
731 These commands interpret a numeric argument as a repeat count, when
732that makes sense.
733
734 Because @key{TAB} serves as a completion command, you can't use it to
735enter a tab as input to the program you are debugging with GDB.
736Instead, type @kbd{C-q @key{TAB}} to enter a tab.
737
738@node GUD Customization
739@subsection GUD Customization
740
741@vindex gdb-mode-hook
742@vindex dbx-mode-hook
743@vindex sdb-mode-hook
744@vindex xdb-mode-hook
745@vindex perldb-mode-hook
746@vindex pdb-mode-hook
747@vindex jdb-mode-hook
748 On startup, GUD runs one of the following hooks: @code{gdb-mode-hook},
749if you are using GDB; @code{dbx-mode-hook}, if you are using DBX;
750@code{sdb-mode-hook}, if you are using SDB; @code{xdb-mode-hook}, if you
751are using XDB; @code{perldb-mode-hook}, for Perl debugging mode;
752@code{pdb-mode-hook}, for PDB; @code{jdb-mode-hook}, for JDB. You can
753use these hooks to define custom key bindings for the debugger
754interaction buffer. @xref{Hooks}.
755
756 Here is a convenient way to define a command that sends a particular
757command string to the debugger, and set up a key binding for it in the
758debugger interaction buffer:
759
760@findex gud-def
761@example
762(gud-def @var{function} @var{cmdstring} @var{binding} @var{docstring})
763@end example
764
765 This defines a command named @var{function} which sends
766@var{cmdstring} to the debugger process, and gives it the documentation
767string @var{docstring}. You can then use the command @var{function} in any
768buffer. If @var{binding} is non-@code{nil}, @code{gud-def} also binds
769the command to @kbd{C-c @var{binding}} in the GUD buffer's mode and to
770@kbd{C-x C-a @var{binding}} generally.
771
772 The command string @var{cmdstring} may contain certain
773@samp{%}-sequences that stand for data to be filled in at the time
774@var{function} is called:
775
776@table @samp
777@item %f
778The name of the current source file. If the current buffer is the GUD
779buffer, then the ``current source file'' is the file that the program
780stopped in.
781
782@item %l
783The number of the current source line. If the current buffer is the GUD
784buffer, then the ``current source line'' is the line that the program
785stopped in.
786
787@item %e
788In transient-mark-mode the text in the region, if it is active.
789Otherwise the text of the C lvalue or function-call expression at or
790adjacent to point.
791
792@item %a
793The text of the hexadecimal address at or adjacent to point.
794
795@item %p
796The numeric argument of the called function, as a decimal number. If
797the command is used without a numeric argument, @samp{%p} stands for the
798empty string.
799
800If you don't use @samp{%p} in the command string, the command you define
801ignores any numeric argument.
802
803@item %d
804The name of the directory of the current source file.
805
806@item %c
807Fully qualified class name derived from the expression surrounding point
808(jdb only).
809@end table
810
811@node GDB Graphical Interface
812@subsection GDB Graphical Interface
813
814 By default, the command @code{gdb} starts GDB using a graphical
815interface, using Emacs windows for display program state information.
816In effect, this makes Emacs into an IDE (interactive development
817environment). With it, you do not need to use textual GDB commands;
818you can control the debugging session with the mouse. For example,
819you can click in the fringe of a source buffer to set a breakpoint
820there, or on a stack frame in the stack buffer to select that frame.
821
822 This mode requires telling GDB that its ``screen size'' is
823unlimited, so it sets the height and width accordingly. For correct
824operation you must not change these values during the GDB session.
825
826@vindex gud-gdb-command-name
827@findex gdba
828 You can also run GDB in text command mode, like other debuggers. To
829do this, replace the GDB @code{"--annotate=3"} option with
830@code{"--fullname"} either in the minibuffer for the current Emacs
831session, or the custom variable @code{gud-gdb-command-name} for all
832future sessions. You need to use text command mode to debug multiple
833programs within one Emacs session. If you have customized
834@code{gud-gdb-command-name} in this way, you can use @kbd{M-x gdba} to
835invoke GDB in graphical mode. Moreover, this command succeeds where
836@kbd{M-x gdb} fails, such as when your @file{.gdbinit} file contains
837executable GDB commands.
838
839@menu
840* GDB-UI Layout:: Control the number of displayed buffers.
841* Source Buffers:: Use the mouse in the fringe/margin to
842 control your program.
843* Breakpoints Buffer:: A breakpoint control panel.
844* Stack Buffer:: Select a frame from the call stack.
845* Other GDB-UI Buffers:: Input/output, locals, registers,
846 assembler, threads and memory buffers.
847* Watch Expressions:: Monitor variable values in the speedbar.
848@end menu
849
850@node GDB-UI Layout
851@subsubsection GDB User Interface Layout
852@cindex GDB User Interface layout
853
854@vindex gdb-many-windows
855 If the variable @code{gdb-many-windows} is @code{nil} (the default
856value) then @kbd{M-x gdb} normally displays only the GUD buffer.
857However, if the variable @code{gdb-show-main} is also non-@code{nil},
858it starts with two windows: one displaying the GUD buffer, and the
859other showing the source for the @code{main} function of the program
860you are debugging.
861
862 If @code{gdb-many-windows} is non-@code{nil}, then @kbd{M-x gdb}
863displays the following frame layout:
864
865@smallexample
866@group
867+--------------------------------+--------------------------------+
868| GUD buffer (I/O of GDB) | Locals buffer |
869|--------------------------------+--------------------------------+
870| Primary Source buffer | I/O buffer for debugged pgm |
871|--------------------------------+--------------------------------+
872| Stack buffer | Breakpoints buffer |
873+--------------------------------+--------------------------------+
874@end group
875@end smallexample
876
877 However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O
878buffer does not appear and the primary source buffer occupies the full
879width of the frame.
880
881@findex gdb-restore-windows
882 If you change the window layout, for example, while editing and
883re-compiling your program, then you can restore this standard window
884layout with the command @code{gdb-restore-windows}.
885
886@findex gdb-many-windows
887 To switch between this standard layout and a simple layout
888containing just the GUD buffer and a source file, type @kbd{M-x
889gdb-many-windows}.
890
891 You may also specify additional GDB-related buffers to display,
892either in the same frame or a different one. Select the buffers you
893want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames}
894sub-menus. If the menu-bar is unavailable, type @code{M-x
895gdb-display-@var{buffertype}-buffer} or @code{M-x
896gdb-frame-@var{buffertype}-buffer} respectively, where
897@var{buffertype} is the relevant buffer type, such as
898@samp{breakpoints}. Most of these buffers are read-only, and typing
899@kbd{q} in them kills them.
900
901 When you finish debugging, kill the GUD buffer with @kbd{C-x k},
902which will also kill all the buffers associated with the session.
903However you need not do this if, after editing and re-compiling your
904source code within Emacs, you wish continue debugging. When you
905restart execution, GDB will automatically find your new executable.
906Keeping the GUD buffer has the advantage of keeping the shell history
907as well as GDB's breakpoints. You do need to check that the
908breakpoints in recently edited source files are still in the right
909places.
910
911@node Source Buffers
912@subsubsection Source Buffers
913@cindex GDB commands in Fringe
914
915@c @findex gdb-mouse-set-clear-breakpoint
916@c @findex gdb-mouse-toggle-breakpoint
917Many GDB commands can be entered using keybindings or the tool bar but
918sometimes it is quicker to use the fringe. These commands either
919manipulate breakpoints or control program execution. When there is no
920fringe, you can use the margin but this is only present when the
921source file already has a breakpoint.
922
923You can click @kbd{Mouse-1} in the fringe or display margin of a
924source buffer to set a breakpoint there and, on a graphical display, a
925red bullet will appear on that line. If a breakpoint already exists
926on that line, the same click will remove it. You can also enable or
927disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet.
928
929A solid arrow in the left fringe of a source buffer indicates the line
930of the innermost frame where the debugged program has stopped. A
931hollow arrow indicates the current execution line of higher level
932frames.
933
934If you drag the arrow in the fringe with @kbd{Mouse-1}
935(@code{gdb-mouse-until}), execution will continue to the line where
936you release the button, provided it is still in the same frame.
937Alternatively, you can click @kbd{Mouse-3} at some point in the fringe
938of this buffer and execution will advance to there. A similar command
939(@code{gdb-mouse-jump}) allows you to jump to a source line without
940executing the intermediate lines by clicking @kbd{C-Mouse-3}. This
941command allows you to go backwards which can be useful for running
942through code that has already executed, in order to examine its
943execution in more detail.
944
945@table @kbd
946@item Mouse-1
947Set or clear a breakpoint.
948
949@item C-Mouse-1
950Enable or disable a breakpoint.
951
952@item Mouse-3
953Continue execution to here.
954
955@item C-Mouse-3
956Jump to here.
957@end table
958
959If the variable @code{gdb-find-source-frame} is non-@code{nil} and
960execution stops in a frame for which there is no source code e.g after
961an interrupt, then Emacs finds and displays the first frame further up
962stack for which there is source. If it is @code{nil} then the source
963buffer continues to display the last frame which maybe more useful,
964for example, when re-setting a breakpoint.
965
966@node Breakpoints Buffer
967@subsubsection Breakpoints Buffer
968
969 The breakpoints buffer shows the existing breakpoints, watchpoints and
970catchpoints (@pxref{Breakpoints,,, gdb, The GNU debugger}). It has
971these special commands, which mostly apply to the @dfn{current
972breakpoint}, the breakpoint which point is on.
973
974@table @kbd
975@item @key{SPC}
976@kindex SPC @r{(GDB breakpoints buffer)}
977@findex gdb-toggle-breakpoint
978Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}).
979On a graphical display, this changes the color of a bullet in the
980margin of a source buffer at the relevant line. This is red when
981the breakpoint is enabled and grey when it is disabled. Text-only
982terminals correspondingly display a @samp{B} or @samp{b}.
983
984@item D
985@kindex D @r{(GDB breakpoints buffer)}
986@findex gdb-delete-breakpoint
987Delete the current breakpoint (@code{gdb-delete-breakpoint}).
988
989@item @key{RET}
990@kindex RET @r{(GDB breakpoints buffer)}
991@findex gdb-goto-breakpoint
992Visit the source line for the current breakpoint
993(@code{gdb-goto-breakpoint}).
994
995@item Mouse-2
996@kindex Mouse-2 @r{(GDB breakpoints buffer)}
997Visit the source line for the breakpoint you click on.
998@end table
999
1000@node Stack Buffer
1001@subsubsection Stack Buffer
1002
1003 The stack buffer displays a @dfn{call stack}, with one line for each
1004of the nested subroutine calls (@dfn{stack frames}) now active in the
1005program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}.
1006
1007@findex gdb-frames-select
1008An arrow in the fringe points to the selected frame or, if the fringe is
1009not present, the number of the selected frame is displayed in reverse
1010contrast. To select a frame in GDB, move point in the stack buffer to
1011that stack frame and type @key{RET} (@code{gdb-frames-select}), or click
1012@kbd{Mouse-2} on a stack frame. If the locals buffer is visible,
1013selecting a stack frame updates it to display the local variables of the
1014new frame.
1015
1016@node Other GDB-UI Buffers
1017@subsubsection Other Buffers
1018
1019@table @asis
1020@item Input/Output Buffer
1021@vindex gdb-use-separate-io-buffer
1022If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil},
1023the program being debugged takes its input and displays its output
1024here. Otherwise it uses the GUD buffer for that. To toggle whether
1025GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}.
1026This takes effect when you next restart the program you are debugging.
1027
1028The history and replay commands from Shell mode are available here,
1029as are the commands to send signals to the debugged program.
1030@xref{Shell Mode}.
1031
1032@item Locals Buffer
1033The locals buffer displays the values of local variables of the
1034current frame for simple data types (@pxref{Frame Info, Frame Info,
1035Information on a frame, gdb, The GNU debugger}). Press @key{RET} or
1036click @kbd{Mouse-2} on the value if you want to edit it.
1037
1038Arrays and structures display their type only. With GDB 6.4 or later,
1039move point to their name and press @key{RET}, or alternatively click
1040@kbd{Mouse-2} there, to examine their values. With earlier versions
1041of GDB, use @kbd{Mouse-2} or @key{RET} on the type description
1042(@samp{[struct/union]} or @samp{[array]}). @xref{Watch Expressions}.
1043
1044@item Registers Buffer
1045@findex toggle-gdb-all-registers
1046The registers buffer displays the values held by the registers
1047(@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or
1048click @kbd{Mouse-2} on a register if you want to edit its value.
1049With GDB 6.4 or later, recently changed register values display with
1050@code{font-lock-warning-face}. With earlier versions of GDB, you can
1051press @key{SPC} to toggle the display of floating point registers
1052(@code{toggle-gdb-all-registers}).
1053
1054@item Assembler Buffer
1055The assembler buffer displays the current frame as machine code. An
1056arrow points to the current instruction, and you can set and remove
1057breakpoints as in a source buffer. Breakpoint icons also appear in
1058the fringe or margin.
1059
1060@item Threads Buffer
1061@findex gdb-threads-select
1062The threads buffer displays a summary of all threads currently in your
1063program (@pxref{Threads, Threads, Debugging programs with multiple
1064threads, gdb, The GNU debugger}). Move point to any thread in the
1065list and press @key{RET} to select it (@code{gdb-threads-select}) and
1066display the associated source in the primary source buffer.
1067Alternatively, click @kbd{Mouse-2} on a thread to select it. If the
1068locals buffer is visible, its contents update to display the variables
1069that are local in the new thread.
1070
1071@item Memory Buffer
1072The memory buffer lets you examine sections of program memory
1073(@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}).
1074Click @kbd{Mouse-1} on the appropriate part of the header line to
1075change the starting address or number of data items that the buffer
1076displays. Click @kbd{Mouse-3} on the header line to select the
1077display format or unit size for these data items.
1078@end table
1079
1080@node Watch Expressions
1081@subsubsection Watch Expressions
1082@cindex Watching expressions in GDB
1083
1084@findex gud-watch
1085@kindex C-x C-a C-w @r{(GUD)}
1086 If you want to see how a variable changes each time your program
1087stops, move point into the variable name and click on the watch icon
1088in the tool bar (@code{gud-watch}) or type @kbd{C-x C-a C-w}. If you
1089specify a prefix argument, you can enter the variable name in the
1090minibuffer.
1091
1092 Each watch expression is displayed in the speedbar. Complex data
1093types, such as arrays, structures and unions are represented in a tree
1094format. Leaves and simple data types show the name of the expression
1095and its value and, when the speedbar frame is selected, display the
1096type as a tooltip. Higher levels show the name, type and address
1097value for pointers and just the name and type otherwise. Root expressions
1098also display the frame address as a tooltip to help identify the frame
1099in which they were defined.
1100
1101 To expand or contract a complex data type, click @kbd{Mouse-2} or
1102press @key{SPC} on the tag to the left of the expression. Emacs asks
1103for confirmation before expanding the expression if its number of
1104immediate children exceeds the value of the variable
1105@code{gdb-max-children}.
1106
1107@kindex D @r{(GDB speedbar)}
1108@findex gdb-var-delete
1109 To delete a complex watch expression, move point to the root
1110expression in the speedbar and type @kbd{D} (@code{gdb-var-delete}).
1111
1112@kindex RET @r{(GDB speedbar)}
1113@findex gdb-edit-value
1114 To edit a variable with a simple data type, or a simple element of a
1115complex data type, move point there in the speedbar and type @key{RET}
1116(@code{gdb-edit-value}). Or you can click @kbd{Mouse-2} on a value to
1117edit it. Either way, this reads the new value using the minibuffer.
1118
1119@vindex gdb-show-changed-values
1120 If you set the variable @code{gdb-show-changed-values} to
1121non-@code{nil} (the default value), Emacs uses
1122@code{font-lock-warning-face} to highlight values that have recently
1123changed and @code{shadow} face to make variables which have gone out of
1124scope less noticeable. When a variable goes out of scope you can't
1125edit its value.
1126
1127@vindex gdb-use-colon-colon-notation
1128 If the variable @code{gdb-use-colon-colon-notation} is
1129non-@code{nil}, Emacs uses the @samp{@var{function}::@var{variable}}
1130format. This allows the user to display watch expressions which share
1131the same variable name. The default value is @code{nil}.
1132
1133@vindex gdb-speedbar-auto-raise
1134To automatically raise the speedbar every time the display of watch
1135expressions updates, set @code{gdb-speedbar-auto-raise} to
1136non-@code{nil}. This can be useful if you are debugging with a full
1137screen Emacs frame.
1138
1139@node Executing Lisp
1140@section Executing Lisp Expressions
1141
1142 Emacs has several different major modes for Lisp and Scheme. They are
1143the same in terms of editing commands, but differ in the commands for
1144executing Lisp expressions. Each mode has its own purpose.
1145
1146@table @asis
1147@item Emacs-Lisp mode
1148The mode for editing source files of programs to run in Emacs Lisp.
1149This mode defines @kbd{C-M-x} to evaluate the current defun.
1150@xref{Lisp Libraries}.
1151@item Lisp Interaction mode
1152The mode for an interactive session with Emacs Lisp. It defines
1153@kbd{C-j} to evaluate the sexp before point and insert its value in the
1154buffer. @xref{Lisp Interaction}.
1155@item Lisp mode
1156The mode for editing source files of programs that run in Lisps other
1157than Emacs Lisp. This mode defines @kbd{C-M-x} to send the current defun
1158to an inferior Lisp process. @xref{External Lisp}.
1159@item Inferior Lisp mode
1160The mode for an interactive session with an inferior Lisp process.
1161This mode combines the special features of Lisp mode and Shell mode
1162(@pxref{Shell Mode}).
1163@item Scheme mode
1164Like Lisp mode but for Scheme programs.
1165@item Inferior Scheme mode
1166The mode for an interactive session with an inferior Scheme process.
1167@end table
1168
1169 Most editing commands for working with Lisp programs are in fact
1170available globally. @xref{Programs}.
1171
1172@node Lisp Libraries
1173@section Libraries of Lisp Code for Emacs
1174@cindex libraries
1175@cindex loading Lisp code
1176
1177 Lisp code for Emacs editing commands is stored in files whose names
1178conventionally end in @file{.el}. This ending tells Emacs to edit them in
1179Emacs-Lisp mode (@pxref{Executing Lisp}).
1180
1181@cindex byte code
1182 Emacs Lisp code can be compiled into byte-code, which loads faster,
1183takes up less space, and executes faster. @xref{Byte Compilation,,
1184Byte Compilation, elisp, the Emacs Lisp Reference Manual}. By
1185convention, the compiled code for a library goes in a separate file
1186whose name ends in @samp{.elc}. Thus, the compiled code for
1187@file{foo.el} goes in @file{foo.elc}.
1188
1189@findex load-file
1190 To execute a file of Emacs Lisp code, use @kbd{M-x load-file}. This
1191command reads a file name using the minibuffer and then executes the
1192contents of that file as Lisp code. It is not necessary to visit the
1193file first; in any case, this command reads the file as found on disk,
1194not text in an Emacs buffer.
1195
1196@findex load
1197@findex load-library
1198 Once a file of Lisp code is installed in the Emacs Lisp library
1199directories, users can load it using @kbd{M-x load-library}. Programs
1200can load it by calling @code{load}, a more primitive function that is
1201similar but accepts some additional arguments.
1202
1203 @kbd{M-x load-library} differs from @kbd{M-x load-file} in that it
1204searches a sequence of directories and tries three file names in each
1205directory. Suppose your argument is @var{lib}; the three names are
1206@file{@var{lib}.elc}, @file{@var{lib}.el}, and lastly just
1207@file{@var{lib}}. If @file{@var{lib}.elc} exists, it is by convention
1208the result of compiling @file{@var{lib}.el}; it is better to load the
1209compiled file, since it will load and run faster.
1210
1211 If @code{load-library} finds that @file{@var{lib}.el} is newer than
1212@file{@var{lib}.elc} file, it issues a warning, because it's likely
1213that somebody made changes to the @file{.el} file and forgot to
1214recompile it. Nonetheless, it loads @file{@var{lib}.elc}. This is
1215because people often leave unfinished edits the source file, and don't
1216recompile it until they think it is ready to use.
1217
1218 Because the argument to @code{load-library} is usually not in itself
1219a valid file name, file name completion is not available. Indeed, when
1220using this command, you usually do not know exactly what file name
1221will be used.
1222
1223@vindex load-path
1224 The sequence of directories searched by @kbd{M-x load-library} is
1225specified by the variable @code{load-path}, a list of strings that are
1226directory names. The default value of the list contains the directories where
1227the Lisp code for Emacs itself is stored. If you have libraries of
1228your own, put them in a single directory and add that directory
1229to @code{load-path}. @code{nil} in this list stands for the current default
1230directory, but it is probably not a good idea to put @code{nil} in the
1231list. If you find yourself wishing that @code{nil} were in the list,
1232most likely what you really want to do is use @kbd{M-x load-file}
1233this once.
1234
1235@cindex autoload
1236 Often you do not have to give any command to load a library, because
1237the commands defined in the library are set up to @dfn{autoload} that
1238library. Trying to run any of those commands calls @code{load} to load
1239the library; this replaces the autoload definitions with the real ones
1240from the library.
1241
1242@vindex load-dangerous-libraries
1243@cindex Lisp files byte-compiled by XEmacs
1244 By default, Emacs refuses to load compiled Lisp files which were
1245compiled with XEmacs, a modified versions of Emacs---they can cause
1246Emacs to crash. Set the variable @code{load-dangerous-libraries} to
1247@code{t} if you want to try loading them.
1248
1249@node Lisp Eval
1250@section Evaluating Emacs Lisp Expressions
1251@cindex Emacs-Lisp mode
1252@cindex mode, Emacs-Lisp
1253
1254@findex emacs-lisp-mode
1255 Lisp programs intended to be run in Emacs should be edited in
1256Emacs-Lisp mode; this happens automatically for file names ending in
1257@file{.el}. By contrast, Lisp mode itself is used for editing Lisp
1258programs intended for other Lisp systems. To switch to Emacs-Lisp mode
1259explicitly, use the command @kbd{M-x emacs-lisp-mode}.
1260
1261 For testing of Lisp programs to run in Emacs, it is often useful to
1262evaluate part of the program as it is found in the Emacs buffer. For
1263example, after changing the text of a Lisp function definition,
1264evaluating the definition installs the change for future calls to the
1265function. Evaluation of Lisp expressions is also useful in any kind of
1266editing, for invoking noninteractive functions (functions that are
1267not commands).
1268
1269@table @kbd
1270@item M-:
1271Read a single Lisp expression in the minibuffer, evaluate it, and print
1272the value in the echo area (@code{eval-expression}).
1273@item C-x C-e
1274Evaluate the Lisp expression before point, and print the value in the
1275echo area (@code{eval-last-sexp}).
1276@item C-M-x
1277Evaluate the defun containing or after point, and print the value in
1278the echo area (@code{eval-defun}).
1279@item M-x eval-region
1280Evaluate all the Lisp expressions in the region.
1281@item M-x eval-buffer
1282Evaluate all the Lisp expressions in the buffer.
1283@end table
1284
1285@ifinfo
1286@c This uses ``colon'' instead of a literal `:' because Info cannot
1287@c cope with a `:' in a menu
1288@kindex M-@key{colon}
1289@end ifinfo
1290@ifnotinfo
1291@kindex M-:
1292@end ifnotinfo
1293@findex eval-expression
1294 @kbd{M-:} (@code{eval-expression}) is the most basic command for evaluating
1295a Lisp expression interactively. It reads the expression using the
1296minibuffer, so you can execute any expression on a buffer regardless of
1297what the buffer contains. When the expression is evaluated, the current
1298buffer is once again the buffer that was current when @kbd{M-:} was
1299typed.
1300
1301@kindex C-M-x @r{(Emacs-Lisp mode)}
1302@findex eval-defun
1303 In Emacs-Lisp mode, the key @kbd{C-M-x} is bound to the command
1304@code{eval-defun}, which parses the defun containing or following point
1305as a Lisp expression and evaluates it. The value is printed in the echo
1306area. This command is convenient for installing in the Lisp environment
1307changes that you have just made in the text of a function definition.
1308
1309 @kbd{C-M-x} treats @code{defvar} expressions specially. Normally,
1310evaluating a @code{defvar} expression does nothing if the variable it
1311defines already has a value. But @kbd{C-M-x} unconditionally resets the
1312variable to the initial value specified in the @code{defvar} expression.
1313@code{defcustom} expressions are treated similarly.
1314This special feature is convenient for debugging Lisp programs.
1315Typing @kbd{C-M-x} on a @code{defface} expression reinitializes
1316the face according to the @code{defface} specification.
1317
1318@kindex C-x C-e
1319@findex eval-last-sexp
1320 The command @kbd{C-x C-e} (@code{eval-last-sexp}) evaluates the Lisp
1321expression preceding point in the buffer, and displays the value in the
1322echo area. It is available in all major modes, not just Emacs-Lisp
1323mode. It does not treat @code{defvar} specially.
1324
1325 When the result of an evaluation is an integer, you can type
1326@kbd{C-x C-e} a second time to display the value of the integer result
1327in additional formats (octal, hexadecimal, and character).
1328
1329 If @kbd{C-x C-e}, or @kbd{M-:} is given a numeric argument, it
1330inserts the value into the current buffer at point, rather than
1331displaying it in the echo area. The argument's value does not matter.
1332@kbd{C-M-x} with a numeric argument instruments the function
1333definition for Edebug (@pxref{Instrumenting, Instrumenting for Edebug,, elisp, the Emacs Lisp Reference Manual}).
1334
1335@findex eval-region
1336@findex eval-buffer
1337 The most general command for evaluating Lisp expressions from a buffer
1338is @code{eval-region}. @kbd{M-x eval-region} parses the text of the
1339region as one or more Lisp expressions, evaluating them one by one.
1340@kbd{M-x eval-buffer} is similar but evaluates the entire
1341buffer. This is a reasonable way to install the contents of a file of
1342Lisp code that you are ready to test. Later, as you find bugs and
1343change individual functions, use @kbd{C-M-x} on each function that you
1344change. This keeps the Lisp world in step with the source file.
1345
1346@vindex eval-expression-print-level
1347@vindex eval-expression-print-length
1348@vindex eval-expression-debug-on-error
1349 The two customizable variables @code{eval-expression-print-level} and
1350@code{eval-expression-print-length} control the maximum depth and length
1351of lists to print in the result of the evaluation commands before
1352abbreviating them. @code{eval-expression-debug-on-error} controls
1353whether evaluation errors invoke the debugger when these commands are
1354used; its default is @code{t}.
1355
1356@node Lisp Interaction
1357@section Lisp Interaction Buffers
1358
1359 The buffer @samp{*scratch*} which is selected when Emacs starts up is
1360provided for evaluating Lisp expressions interactively inside Emacs.
1361
1362 The simplest way to use the @samp{*scratch*} buffer is to insert Lisp
1363expressions and type @kbd{C-j} after each expression. This command
1364reads the Lisp expression before point, evaluates it, and inserts the
1365value in printed representation before point. The result is a complete
1366typescript of the expressions you have evaluated and their values.
1367
1368 The @samp{*scratch*} buffer's major mode is Lisp Interaction mode, which
1369is the same as Emacs-Lisp mode except for the binding of @kbd{C-j}.
1370
1371@findex lisp-interaction-mode
1372 The rationale for this feature is that Emacs must have a buffer when
1373it starts up, but that buffer is not useful for editing files since a
1374new buffer is made for every file that you visit. The Lisp interpreter
1375typescript is the most useful thing I can think of for the initial
1376buffer to do. Type @kbd{M-x lisp-interaction-mode} to put the current
1377buffer in Lisp Interaction mode.
1378
1379@findex ielm
1380 An alternative way of evaluating Emacs Lisp expressions interactively
1381is to use Inferior Emacs-Lisp mode, which provides an interface rather
1382like Shell mode (@pxref{Shell Mode}) for evaluating Emacs Lisp
1383expressions. Type @kbd{M-x ielm} to create an @samp{*ielm*} buffer
1384which uses this mode. For more information see that command's
1385documentation.
1386
1387@node External Lisp
1388@section Running an External Lisp
1389
1390 Emacs has facilities for running programs in other Lisp systems. You can
1391run a Lisp process as an inferior of Emacs, and pass expressions to it to
1392be evaluated. You can also pass changed function definitions directly from
1393the Emacs buffers in which you edit the Lisp programs to the inferior Lisp
1394process.
1395
1396@findex run-lisp
1397@vindex inferior-lisp-program
1398@kindex C-x C-z
1399 To run an inferior Lisp process, type @kbd{M-x run-lisp}. This runs
1400the program named @code{lisp}, the same program you would run by typing
1401@code{lisp} as a shell command, with both input and output going through
1402an Emacs buffer named @samp{*lisp*}. That is to say, any ``terminal
1403output'' from Lisp will go into the buffer, advancing point, and any
1404``terminal input'' for Lisp comes from text in the buffer. (You can
1405change the name of the Lisp executable file by setting the variable
1406@code{inferior-lisp-program}.)
1407
1408 To give input to Lisp, go to the end of the buffer and type the input,
1409terminated by @key{RET}. The @samp{*lisp*} buffer is in Inferior Lisp
1410mode, which combines the special characteristics of Lisp mode with most
1411of the features of Shell mode (@pxref{Shell Mode}). The definition of
1412@key{RET} to send a line to a subprocess is one of the features of Shell
1413mode.
1414
1415@findex lisp-mode
1416 For the source files of programs to run in external Lisps, use Lisp
1417mode. You can switch to this mode with @kbd{M-x lisp-mode}, and it is
1418used automatically for files whose names end in @file{.l},
1419@file{.lsp}, or @file{.lisp}.
1420
1421@kindex C-M-x @r{(Lisp mode)}
1422@findex lisp-eval-defun
1423 When you edit a function in a Lisp program you are running, the easiest
1424way to send the changed definition to the inferior Lisp process is the key
1425@kbd{C-M-x}. In Lisp mode, this runs the function @code{lisp-eval-defun},
1426which finds the defun around or following point and sends it as input to
1427the Lisp process. (Emacs can send input to any inferior process regardless
1428of what buffer is current.)
1429
1430 Contrast the meanings of @kbd{C-M-x} in Lisp mode (for editing
1431programs to be run in another Lisp system) and Emacs-Lisp mode (for
1432editing Lisp programs to be run in Emacs; see @pxref{Lisp Eval}): in
1433both modes it has the effect of installing the function definition
1434that point is in, but the way of doing so is different according to
1435where the relevant Lisp environment is found.
1436
1437
1438@ignore
1439 arch-tag: 9c3c2f71-b332-4144-8500-3ff9945a50ed
1440@end ignore
diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi
new file mode 100644
index 00000000000..61d519cbd12
--- /dev/null
+++ b/doc/emacs/cal-xtra.texi
@@ -0,0 +1,838 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7
8@c Moved here from the Emacs Lisp Reference Manual, 2005-03-26.
9@node Advanced Calendar/Diary Usage
10@section Customizing the Calendar and Diary
11
12 There are many customizations that you can use to make the calendar and
13diary suit your personal tastes.
14
15@menu
16* Calendar Customizing:: Defaults you can set.
17* Holiday Customizing:: Defining your own holidays.
18* Date Display Format:: Changing the format.
19* Time Display Format:: Changing the format.
20* Diary Customizing:: Defaults you can set.
21* Hebrew/Islamic Entries:: How to obtain them.
22* Fancy Diary Display:: Enhancing the diary display, sorting entries,
23 using included diary files.
24* Sexp Diary Entries:: Fancy things you can do.
25@end menu
26
27@node Calendar Customizing
28@subsection Customizing the Calendar
29@vindex calendar-holiday-marker
30@vindex diary-entry-marker
31 The variable @code{calendar-holiday-marker} specifies how to mark a
32date as being a holiday. Its value may be a single-character string
33to insert next to the date, or a face name to use for displaying the
34date. Likewise, the variable @code{diary-entry-marker} specifies how
35to mark a date that has diary entries. The calendar creates faces
36named @code{holiday-face} and @code{diary-face} for these purposes;
37those symbols are the default values of these variables.
38
39@vindex calendar-load-hook
40 The variable @code{calendar-load-hook} is a normal hook run when the
41calendar package is first loaded (before actually starting to display
42the calendar).
43
44@vindex initial-calendar-window-hook
45 Starting the calendar runs the normal hook
46@code{initial-calendar-window-hook}. Recomputation of the calendar
47display does not run this hook. But if you leave the calendar with the
48@kbd{q} command and reenter it, the hook runs again.@refill
49
50@vindex today-visible-calendar-hook
51 The variable @code{today-visible-calendar-hook} is a normal hook run
52after the calendar buffer has been prepared with the calendar when the
53current date is visible in the window. One use of this hook is to
54replace today's date with asterisks; to do that, use the hook function
55@code{calendar-star-date}.
56
57@findex calendar-star-date
58@example
59(add-hook 'today-visible-calendar-hook 'calendar-star-date)
60@end example
61
62@noindent
63Another standard hook function marks the current date, either by
64changing its face or by adding an asterisk. Here's how to use it:
65
66@findex calendar-mark-today
67@example
68(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
69@end example
70
71@noindent
72@vindex calendar-today-marker
73The variable @code{calendar-today-marker} specifies how to mark
74today's date. Its value should be a single-character string to insert
75next to the date or a face name to use for displaying the date. A
76face named @code{calendar-today-face} is provided for this purpose;
77that symbol is the default for this variable.
78
79@vindex today-invisible-calendar-hook
80@noindent
81 A similar normal hook, @code{today-invisible-calendar-hook} is run if
82the current date is @emph{not} visible in the window.
83
84@vindex calendar-move-hook
85 Each of the calendar cursor motion commands runs the hook
86@code{calendar-move-hook} after it moves the cursor.
87
88@node Holiday Customizing
89@subsection Customizing the Holidays
90
91@vindex calendar-holidays
92@vindex christian-holidays
93@vindex hebrew-holidays
94@vindex islamic-holidays
95 Emacs knows about holidays defined by entries on one of several lists.
96You can customize these lists of holidays to your own needs, adding or
97deleting holidays. The lists of holidays that Emacs uses are for
98general holidays (@code{general-holidays}), local holidays
99(@code{local-holidays}), Christian holidays (@code{christian-holidays}),
100Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim)
101holidays (@code{islamic-holidays}), and other holidays
102(@code{other-holidays}).
103
104@vindex general-holidays
105 The general holidays are, by default, holidays common throughout the
106United States. To eliminate these holidays, set @code{general-holidays}
107to @code{nil}.
108
109@vindex local-holidays
110 There are no default local holidays (but sites may supply some). You
111can set the variable @code{local-holidays} to any list of holidays, as
112described below.
113
114@vindex all-christian-calendar-holidays
115@vindex all-hebrew-calendar-holidays
116@vindex all-islamic-calendar-holidays
117 By default, Emacs does not include all the holidays of the religions
118that it knows, only those commonly found in secular calendars. For a
119more extensive collection of religious holidays, you can set any (or
120all) of the variables @code{all-christian-calendar-holidays},
121@code{all-hebrew-calendar-holidays}, or
122@code{all-islamic-calendar-holidays} to @code{t}. If you want to
123eliminate the religious holidays, set any or all of the corresponding
124variables @code{christian-holidays}, @code{hebrew-holidays}, and
125@code{islamic-holidays} to @code{nil}.@refill
126
127@vindex other-holidays
128 You can set the variable @code{other-holidays} to any list of
129holidays. This list, normally empty, is intended for individual use.
130
131@cindex holiday forms
132 Each of the lists (@code{general-holidays}, @code{local-holidays},
133@code{christian-holidays}, @code{hebrew-holidays},
134@code{islamic-holidays}, and @code{other-holidays}) is a list of
135@dfn{holiday forms}, each holiday form describing a holiday (or
136sometimes a list of holidays).
137
138 Here is a table of the possible kinds of holiday form. Day numbers
139and month numbers count starting from 1, but ``dayname'' numbers
140count Sunday as 0. The element @var{string} is always the
141name of the holiday, as a string.
142
143@table @code
144@item (holiday-fixed @var{month} @var{day} @var{string})
145A fixed date on the Gregorian calendar.
146
147@item (holiday-float @var{month} @var{dayname} @var{k} @var{string})
148The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar
149(@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back
150from the end of the month.
151
152@item (holiday-hebrew @var{month} @var{day} @var{string})
153A fixed date on the Hebrew calendar.
154
155@item (holiday-islamic @var{month} @var{day} @var{string})
156A fixed date on the Islamic calendar.
157
158@item (holiday-julian @var{month} @var{day} @var{string})
159A fixed date on the Julian calendar.
160
161@item (holiday-sexp @var{sexp} @var{string})
162A date calculated by the Lisp expression @var{sexp}. The expression
163should use the variable @code{year} to compute and return the date of a
164holiday, or @code{nil} if the holiday doesn't happen this year. The
165value of @var{sexp} must represent the date as a list of the form
166@code{(@var{month} @var{day} @var{year})}.
167
168@item (if @var{condition} @var{holiday-form})
169A holiday that happens only if @var{condition} is true.
170
171@item (@var{function} @r{[}@var{args}@r{]})
172A list of dates calculated by the function @var{function}, called with
173arguments @var{args}.
174@end table
175
176 For example, suppose you want to add Bastille Day, celebrated in
177France on July 14. You can do this as follows:
178
179@smallexample
180(setq other-holidays '((holiday-fixed 7 14 "Bastille Day")))
181@end smallexample
182
183@noindent
184The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the
185fourteenth day of the seventh month (July).
186
187 Many holidays occur on a specific day of the week, at a specific time
188of month. Here is a holiday form describing Hurricane Supplication Day,
189celebrated in the Virgin Islands on the fourth Monday in August:
190
191@smallexample
192(holiday-float 8 1 4 "Hurricane Supplication Day")
193@end smallexample
194
195@noindent
196Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
197Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
198the month (1 specifies the first occurrence, 2 the second occurrence,
199@minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and
200so on).
201
202 You can specify holidays that occur on fixed days of the Hebrew,
203Islamic, and Julian calendars too. For example,
204
205@smallexample
206(setq other-holidays
207 '((holiday-hebrew 10 2 "Last day of Hanukkah")
208 (holiday-islamic 3 12 "Mohammed's Birthday")
209 (holiday-julian 4 2 "Jefferson's Birthday")))
210@end smallexample
211
212@noindent
213adds the last day of Hanukkah (since the Hebrew months are numbered with
2141 starting from Nisan), the Islamic feast celebrating Mohammed's
215birthday (since the Islamic months are numbered from 1 starting with
216Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
217Julian calendar.
218
219 To include a holiday conditionally, use either Emacs Lisp's @code{if} or the
220@code{holiday-sexp} form. For example, American presidential elections
221occur on the first Tuesday after the first Monday in November of years
222divisible by 4:
223
224@smallexample
225(holiday-sexp '(if (= 0 (% year 4))
226 (calendar-gregorian-from-absolute
227 (1+ (calendar-dayname-on-or-before
228 1 (+ 6 (calendar-absolute-from-gregorian
229 (list 11 1 year)))))))
230 "US Presidential Election")
231@end smallexample
232
233@noindent
234or
235
236@smallexample
237(if (= 0 (% displayed-year 4))
238 (fixed 11
239 (extract-calendar-day
240 (calendar-gregorian-from-absolute
241 (1+ (calendar-dayname-on-or-before
242 1 (+ 6 (calendar-absolute-from-gregorian
243 (list 11 1 displayed-year)))))))
244 "US Presidential Election"))
245@end smallexample
246
247 Some holidays just don't fit into any of these forms because special
248calculations are involved in their determination. In such cases you
249must write a Lisp function to do the calculation. To include eclipses,
250for example, add @code{(eclipses)} to @code{other-holidays}
251and write an Emacs Lisp function @code{eclipses} that returns a
252(possibly empty) list of the relevant Gregorian dates among the range
253visible in the calendar window, with descriptive strings, like this:
254
255@smallexample
256(((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
257@end smallexample
258
259@node Date Display Format
260@subsection Date Display Format
261@vindex calendar-date-display-form
262
263 You can customize the manner of displaying dates in the diary, in mode
264lines, and in messages by setting @code{calendar-date-display-form}.
265This variable holds a list of expressions that can involve the variables
266@code{month}, @code{day}, and @code{year}, which are all numbers in
267string form, and @code{monthname} and @code{dayname}, which are both
268alphabetic strings. In the American style, the default value of this
269list is as follows:
270
271@smallexample
272((if dayname (concat dayname ", ")) monthname " " day ", " year)
273@end smallexample
274
275@noindent
276while in the European style this value is the default:
277
278@smallexample
279((if dayname (concat dayname ", ")) day " " monthname " " year)
280@end smallexample
281
282@noindent
283The ISO standard date representation is this:
284
285@smallexample
286(year "-" month "-" day)
287@end smallexample
288
289@noindent
290This specifies a typical American format:
291
292@smallexample
293(month "/" day "/" (substring year -2))
294@end smallexample
295
296@node Time Display Format
297@subsection Time Display Format
298@vindex calendar-time-display-form
299
300 The calendar and diary by default display times of day in the
301conventional American style with the hours from 1 through 12, minutes,
302and either @samp{am} or @samp{pm}. If you prefer the European style,
303also known in the US as military, in which the hours go from 00 to 23,
304you can alter the variable @code{calendar-time-display-form}. This
305variable is a list of expressions that can involve the variables
306@code{12-hours}, @code{24-hours}, and @code{minutes}, which are all
307numbers in string form, and @code{am-pm} and @code{time-zone}, which are
308both alphabetic strings. The default value of
309@code{calendar-time-display-form} is as follows:
310
311@smallexample
312(12-hours ":" minutes am-pm
313 (if time-zone " (") time-zone (if time-zone ")"))
314@end smallexample
315
316@noindent
317Here is a value that provides European style times:
318
319@smallexample
320(24-hours ":" minutes
321 (if time-zone " (") time-zone (if time-zone ")"))
322@end smallexample
323
324@node Diary Customizing
325@subsection Customizing the Diary
326
327@vindex holidays-in-diary-buffer
328 Ordinarily, the mode line of the diary buffer window indicates any
329holidays that fall on the date of the diary entries. The process of
330checking for holidays can take several seconds, so including holiday
331information delays the display of the diary buffer noticeably. If you'd
332prefer to have a faster display of the diary buffer but without the
333holiday information, set the variable @code{holidays-in-diary-buffer} to
334@code{nil}.@refill
335
336@vindex number-of-diary-entries
337 The variable @code{number-of-diary-entries} controls the number of
338days of diary entries to be displayed at one time. It affects the
339initial display when @code{view-diary-entries-initially} is @code{t}, as
340well as the command @kbd{M-x diary}. For example, the default value is
3411, which says to display only the current day's diary entries. If the
342value is 2, both the current day's and the next day's entries are
343displayed. The value can also be a vector of seven elements: for
344example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries
345appear on Sunday, the current date's and the next day's diary entries
346appear Monday through Thursday, Friday through Monday's entries appear
347on Friday, while on Saturday only that day's entries appear.
348
349@vindex print-diary-entries-hook
350@findex print-diary-entries
351 The variable @code{print-diary-entries-hook} is a normal hook run
352after preparation of a temporary buffer containing just the diary
353entries currently visible in the diary buffer. (The other, irrelevant
354diary entries are really absent from the temporary buffer; in the diary
355buffer, they are merely hidden.) The default value of this hook does
356the printing with the command @code{lpr-buffer}. If you want to use a
357different command to do the printing, just change the value of this
358hook. Other uses might include, for example, rearranging the lines into
359order by day and time.
360
361@vindex diary-date-forms
362 You can customize the form of dates in your diary file, if neither the
363standard American nor European styles suits your needs, by setting the
364variable @code{diary-date-forms}. This variable is a list of patterns
365for recognizing a date. Each date pattern is a list whose elements may
366be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs
367Lisp Reference Manual}) or the symbols @code{month}, @code{day},
368@code{year}, @code{monthname}, and @code{dayname}. All these elements
369serve as patterns that match certain kinds of text in the diary file.
370In order for the date pattern, as a whole, to match, all of its elements
371must match consecutively.
372
373 A regular expression in a date pattern matches in its usual fashion,
374using the standard syntax table altered so that @samp{*} is a word
375constituent.
376
377 The symbols @code{month}, @code{day}, @code{year}, @code{monthname},
378and @code{dayname} match the month number, day number, year number,
379month name, and day name of the date being considered. The symbols that
380match numbers allow leading zeros; those that match names allow
381three-letter abbreviations and capitalization. All the symbols can
382match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any
383month'', and so on, it should match regardless of the date being
384considered.
385
386 The default value of @code{diary-date-forms} in the American style is
387this:
388
389@example
390((month "/" day "[^/0-9]")
391 (month "/" day "/" year "[^0-9]")
392 (monthname " *" day "[^,0-9]")
393 (monthname " *" day ", *" year "[^0-9]")
394 (dayname "\\W"))
395@end example
396
397 The date patterns in the list must be @emph{mutually exclusive} and
398must not match any portion of the diary entry itself, just the date and
399one character of whitespace. If, to be mutually exclusive, the pattern
400must match a portion of the diary entry text---beyond the whitespace
401that ends the date---then the first element of the date pattern
402@emph{must} be @code{backup}. This causes the date recognizer to back
403up to the beginning of the current word of the diary entry, after
404finishing the match. Even if you use @code{backup}, the date pattern
405must absolutely not match more than a portion of the first word of the
406diary entry. The default value of @code{diary-date-forms} in the
407European style is this list:
408
409@example
410((day "/" month "[^/0-9]")
411 (day "/" month "/" year "[^0-9]")
412 (backup day " *" monthname "\\W+\\<[^*0-9]")
413 (day " *" monthname " *" year "[^0-9]")
414 (dayname "\\W"))
415@end example
416
417@noindent
418Notice the use of @code{backup} in the third pattern, because it needs
419to match part of a word beyond the date itself to distinguish it from
420the fourth pattern.
421
422@node Hebrew/Islamic Entries
423@subsection Hebrew- and Islamic-Date Diary Entries
424
425 Your diary file can have entries based on Hebrew or Islamic dates, as
426well as entries based on the world-standard Gregorian calendar.
427However, because recognition of such entries is time-consuming and most
428people don't use them, you must explicitly enable their use. If you
429want the diary to recognize Hebrew-date diary entries, for example,
430you must do this:
431
432@vindex nongregorian-diary-listing-hook
433@vindex nongregorian-diary-marking-hook
434@findex list-hebrew-diary-entries
435@findex mark-hebrew-diary-entries
436@smallexample
437(add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
438(add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
439@end smallexample
440
441@noindent
442If you want Islamic-date entries, do this:
443
444@findex list-islamic-diary-entries
445@findex mark-islamic-diary-entries
446@smallexample
447(add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries)
448(add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
449@end smallexample
450
451 Hebrew- and Islamic-date diary entries have the same formats as
452Gregorian-date diary entries, except that @samp{H} precedes a Hebrew
453date and @samp{I} precedes an Islamic date. Moreover, because the
454Hebrew and Islamic month names are not uniquely specified by the first
455three letters, you may not abbreviate them. For example, a diary entry
456for the Hebrew date Heshvan 25 could look like this:
457
458@smallexample
459HHeshvan 25 Happy Hebrew birthday!
460@end smallexample
461
462@noindent
463and would appear in the diary for any date that corresponds to Heshvan 25
464on the Hebrew calendar. And here is an Islamic-date diary entry that matches
465Dhu al-Qada 25:
466
467@smallexample
468IDhu al-Qada 25 Happy Islamic birthday!
469@end smallexample
470
471 As with Gregorian-date diary entries, Hebrew- and Islamic-date entries
472are nonmarking if they are preceded with an ampersand (@samp{&}).
473
474 Here is a table of commands used in the calendar to create diary entries
475that match the selected date and other dates that are similar in the Hebrew
476or Islamic calendar:
477
478@table @kbd
479@item i h d
480Add a diary entry for the Hebrew date corresponding to the selected date
481(@code{insert-hebrew-diary-entry}).
482@item i h m
483Add a diary entry for the day of the Hebrew month corresponding to the
484selected date (@code{insert-monthly-hebrew-diary-entry}). This diary
485entry matches any date that has the same Hebrew day-within-month as the
486selected date.
487@item i h y
488Add a diary entry for the day of the Hebrew year corresponding to the
489selected date (@code{insert-yearly-hebrew-diary-entry}). This diary
490entry matches any date which has the same Hebrew month and day-within-month
491as the selected date.
492@item i i d
493Add a diary entry for the Islamic date corresponding to the selected date
494(@code{insert-islamic-diary-entry}).
495@item i i m
496Add a diary entry for the day of the Islamic month corresponding to the
497selected date (@code{insert-monthly-islamic-diary-entry}).
498@item i i y
499Add a diary entry for the day of the Islamic year corresponding to the
500selected date (@code{insert-yearly-islamic-diary-entry}).
501@end table
502
503@findex insert-hebrew-diary-entry
504@findex insert-monthly-hebrew-diary-entry
505@findex insert-yearly-hebrew-diary-entry
506@findex insert-islamic-diary-entry
507@findex insert-monthly-islamic-diary-entry
508@findex insert-yearly-islamic-diary-entry
509 These commands work much like the corresponding commands for ordinary
510diary entries: they apply to the date that point is on in the calendar
511window, and what they do is insert just the date portion of a diary entry
512at the end of your diary file. You must then insert the rest of the
513diary entry.
514
515@node Fancy Diary Display
516@subsection Fancy Diary Display
517@vindex diary-display-hook
518@findex simple-diary-display
519
520 Diary display works by preparing the diary buffer and then running the
521hook @code{diary-display-hook}. The default value of this hook
522(@code{simple-diary-display}) hides the irrelevant diary entries and
523then displays the buffer. However, if you specify the hook as follows,
524
525@cindex diary buffer
526@findex fancy-diary-display
527@example
528(add-hook 'diary-display-hook 'fancy-diary-display)
529@end example
530
531@noindent
532this enables fancy diary display. It displays diary entries and
533holidays by copying them into a special buffer that exists only for the
534sake of display. Copying to a separate buffer provides an opportunity
535to change the displayed text to make it prettier---for example, to sort
536the entries by the dates they apply to.
537
538 As with simple diary display, you can print a hard copy of the buffer
539with @code{print-diary-entries}. To print a hard copy of a day-by-day
540diary for a week, position point on Sunday of that week, type
541@kbd{7 d}, and then do @kbd{M-x print-diary-entries}. As usual, the
542inclusion of the holidays slows down the display slightly; you can speed
543things up by setting the variable @code{holidays-in-diary-buffer} to
544@code{nil}.
545
546@vindex diary-list-include-blanks
547 Ordinarily, the fancy diary buffer does not show days for which there are
548no diary entries, even if that day is a holiday. If you want such days to be
549shown in the fancy diary buffer, set the variable
550@code{diary-list-include-blanks} to @code{t}.@refill
551
552@cindex sorting diary entries
553 If you use the fancy diary display, you can use the normal hook
554@code{list-diary-entries-hook} to sort each day's diary entries by their
555time of day. Here's how:
556
557@findex sort-diary-entries
558@example
559(add-hook 'list-diary-entries-hook 'sort-diary-entries t)
560@end example
561
562@noindent
563For each day, this sorts diary entries that begin with a recognizable
564time of day according to their times. Diary entries without times come
565first within each day.
566
567 Fancy diary display also has the ability to process included diary
568files. This permits a group of people to share a diary file for events
569that apply to all of them. Lines in the diary file of this form:
570
571@smallexample
572#include "@var{filename}"
573@end smallexample
574
575@noindent
576includes the diary entries from the file @var{filename} in the fancy
577diary buffer. The include mechanism is recursive, so that included files
578can include other files, and so on; you must be careful not to have a
579cycle of inclusions, of course. Here is how to enable the include
580facility:
581
582@vindex list-diary-entries-hook
583@vindex mark-diary-entries-hook
584@findex include-other-diary-files
585@findex mark-included-diary-files
586@smallexample
587(add-hook 'list-diary-entries-hook 'include-other-diary-files)
588(add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
589@end smallexample
590
591The include mechanism works only with the fancy diary display, because
592ordinary diary display shows the entries directly from your diary file.
593
594@node Sexp Diary Entries
595@subsection Sexp Entries and the Fancy Diary Display
596@cindex sexp diary entries
597
598 Sexp diary entries allow you to do more than just have complicated
599conditions under which a diary entry applies. If you use the fancy
600diary display, sexp entries can generate the text of the entry depending
601on the date itself. For example, an anniversary diary entry can insert
602the number of years since the anniversary date into the text of the
603diary entry. Thus the @samp{%d} in this diary entry:
604
605@findex diary-anniversary
606@smallexample
607%%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
608@end smallexample
609
610@noindent
611gets replaced by the age, so on October 31, 1990 the entry appears in
612the fancy diary buffer like this:
613
614@smallexample
615Arthur's birthday (42 years old)
616@end smallexample
617
618@noindent
619If the diary file instead contains this entry:
620
621@smallexample
622%%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
623@end smallexample
624
625@noindent
626the entry in the fancy diary buffer for October 31, 1990 appears like this:
627
628@smallexample
629Arthur's 42nd birthday
630@end smallexample
631
632 Similarly, cyclic diary entries can interpolate the number of repetitions
633that have occurred:
634
635@findex diary-cyclic
636@smallexample
637%%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
638@end smallexample
639
640@noindent
641looks like this:
642
643@smallexample
644Renew medication (5th time)
645@end smallexample
646
647@noindent
648in the fancy diary display on September 8, 1990.
649
650 There is an early reminder diary sexp that includes its entry in the
651diary not only on the date of occurrence, but also on earlier dates.
652For example, if you want a reminder a week before your anniversary, you
653can use
654
655@findex diary-remind
656@smallexample
657%%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary
658@end smallexample
659
660@noindent
661and the fancy diary will show
662@smallexample
663Ed's anniversary
664@end smallexample
665@noindent
666both on December 15 and on December 22.
667
668@findex diary-date
669 The function @code{diary-date} applies to dates described by a month,
670day, year combination, each of which can be an integer, a list of
671integers, or @code{t}. The value @code{t} means all values. For
672example,
673
674@smallexample
675%%(diary-date '(10 11 12) 22 t) Rake leaves
676@end smallexample
677
678@noindent
679causes the fancy diary to show
680
681@smallexample
682Rake leaves
683@end smallexample
684
685@noindent
686on October 22, November 22, and December 22 of every year.
687
688@findex diary-float
689 The function @code{diary-float} allows you to describe diary entries
690that apply to dates like the third Friday of November, or the last
691Tuesday in April. The parameters are the @var{month}, @var{dayname},
692and an index @var{n}. The entry appears on the @var{n}th @var{dayname}
693of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and
694so on. If @var{n} is negative it counts backward from the end of
695@var{month}. The value of @var{month} can be a list of months, a single
696month, or @code{t} to specify all months. You can also use an optional
697parameter @var{day} to specify the @var{n}th @var{dayname} of
698@var{month} on or after/before @var{day}; the value of @var{day} defaults
699to 1 if @var{n} is positive and to the last day of @var{month} if
700@var{n} is negative. For example,
701
702@smallexample
703%%(diary-float t 1 -1) Pay rent
704@end smallexample
705
706@noindent
707causes the fancy diary to show
708
709@smallexample
710Pay rent
711@end smallexample
712
713@noindent
714on the last Monday of every month.
715
716 The generality of sexp diary entries lets you specify any diary
717entry that you can describe algorithmically. A sexp diary entry
718contains an expression that computes whether the entry applies to any
719given date. If its value is non-@code{nil}, the entry applies to that
720date; otherwise, it does not. The expression can use the variable
721@code{date} to find the date being considered; its value is a list
722(@var{month} @var{day} @var{year}) that refers to the Gregorian
723calendar.
724
725 The sexp diary entry applies to a date when the expression's value
726is non-@code{nil}, but some values have more specific meanings. If
727the value is a string, that string is a description of the event which
728occurs on that date. The value can also have the form
729@code{(@var{mark} . @var{string})}; then @var{mark} specifies how to
730mark the date in the calendar, and @var{string} is the description of
731the event. If @var{mark} is a single-character string, that character
732appears next to the date in the calendar. If @var{mark} is a face
733name, the date is displayed in that face. If @var{mark} is
734@code{nil}, that specifies no particular highlighting for the date.
735
736 Suppose you get paid on the 21st of the month if it is a weekday, and
737on the Friday before if the 21st is on a weekend. Here is how to write
738a sexp diary entry that matches those dates:
739
740@smallexample
741&%%(let ((dayname (calendar-day-of-week date))
742 (day (car (cdr date))))
743 (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
744 (and (memq day '(19 20)) (= dayname 5)))
745 ) Pay check deposited
746@end smallexample
747
748 The following sexp diary entries take advantage of the ability (in the fancy
749diary display) to concoct diary entries whose text varies based on the date:
750
751@findex diary-sunrise-sunset
752@findex diary-phases-of-moon
753@findex diary-day-of-year
754@findex diary-iso-date
755@findex diary-julian-date
756@findex diary-astro-day-number
757@findex diary-hebrew-date
758@findex diary-islamic-date
759@findex diary-french-date
760@findex diary-mayan-date
761@table @code
762@item %%(diary-sunrise-sunset)
763Make a diary entry for the local times of today's sunrise and sunset.
764@item %%(diary-phases-of-moon)
765Make a diary entry for the phases (quarters) of the moon.
766@item %%(diary-day-of-year)
767Make a diary entry with today's day number in the current year and the number
768of days remaining in the current year.
769@item %%(diary-iso-date)
770Make a diary entry with today's equivalent ISO commercial date.
771@item %%(diary-julian-date)
772Make a diary entry with today's equivalent date on the Julian calendar.
773@item %%(diary-astro-day-number)
774Make a diary entry with today's equivalent astronomical (Julian) day number.
775@item %%(diary-hebrew-date)
776Make a diary entry with today's equivalent date on the Hebrew calendar.
777@item %%(diary-islamic-date)
778Make a diary entry with today's equivalent date on the Islamic calendar.
779@item %%(diary-french-date)
780Make a diary entry with today's equivalent date on the French Revolutionary
781calendar.
782@item %%(diary-mayan-date)
783Make a diary entry with today's equivalent date on the Mayan calendar.
784@end table
785
786@noindent
787Thus including the diary entry
788
789@example
790&%%(diary-hebrew-date)
791@end example
792
793@noindent
794causes every day's diary display to contain the equivalent date on the
795Hebrew calendar, if you are using the fancy diary display. (With simple
796diary display, the line @samp{&%%(diary-hebrew-date)} appears in the
797diary for any date, but does nothing particularly useful.)
798
799 These functions can be used to construct sexp diary entries based on
800the Hebrew calendar in certain standard ways:
801
802@cindex rosh hodesh
803@findex diary-rosh-hodesh
804@cindex parasha, weekly
805@findex diary-parasha
806@cindex candle lighting times
807@findex diary-sabbath-candles
808@cindex omer count
809@findex diary-omer
810@cindex yahrzeits
811@findex diary-yahrzeit
812@table @code
813@item %%(diary-rosh-hodesh)
814Make a diary entry that tells the occurrence and ritual announcement of each
815new Hebrew month.
816@item %%(diary-parasha)
817Make a Saturday diary entry that tells the weekly synagogue scripture reading.
818@item %%(diary-sabbath-candles)
819Make a Friday diary entry that tells the @emph{local time} of Sabbath
820candle lighting.
821@item %%(diary-omer)
822Make a diary entry that gives the omer count, when appropriate.
823@item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name}
824Make a diary entry marking the anniversary of a date of death. The date
825is the @emph{Gregorian} (civil) date of death. The diary entry appears
826on the proper Hebrew calendar anniversary and on the day before. (In
827the European style, the order of the parameters is changed to @var{day},
828@var{month}, @var{year}.)
829@end table
830
831 All the functions documented above take an optional argument
832@var{mark} which specifies how to mark the date in the calendar display.
833If one of these functions decides that it applies to a certain date,
834it returns a value that contains @var{mark}.
835
836@ignore
837 arch-tag: 52cb299f-fd1f-4616-bfe6-91b988669431
838@end ignore
diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi
new file mode 100644
index 00000000000..5182474622d
--- /dev/null
+++ b/doc/emacs/calendar.texi
@@ -0,0 +1,1687 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Calendar/Diary, Gnus, Dired, Top
6@chapter The Calendar and the Diary
7@cindex calendar
8@findex calendar
9
10 Emacs provides the functions of a desk calendar, with a diary of
11planned or past events. It also has facilities for managing your
12appointments, and keeping track of how much time you spend working on
13certain projects.
14
15 To enter the calendar, type @kbd{M-x calendar}; this displays a
16three-month calendar centered on the current month, with point on the
17current date. With a numeric argument, as in @kbd{C-u M-x calendar}, it
18prompts you for the month and year to be the center of the three-month
19calendar. The calendar uses its own buffer, whose major mode is
20Calendar mode.
21
22 @kbd{Mouse-2} in the calendar brings up a menu of operations on a
23particular date; @kbd{Mouse-3} brings up a menu of commonly used
24calendar features that are independent of any particular date. To exit
25the calendar, type @kbd{q}.
26
27@iftex
28 This chapter describes the basic calendar features.
29@inforef{Advanced Calendar/Diary Usage,, emacs-xtra}, for information
30about more specialized features.
31@end iftex
32
33@menu
34* Calendar Motion:: Moving through the calendar; selecting a date.
35* Scroll Calendar:: Bringing earlier or later months onto the screen.
36* Counting Days:: How many days are there between two dates?
37* General Calendar:: Exiting or recomputing the calendar.
38* Writing Calendar Files:: Writing calendars to files of various formats.
39* Holidays:: Displaying dates of holidays.
40* Sunrise/Sunset:: Displaying local times of sunrise and sunset.
41* Lunar Phases:: Displaying phases of the moon.
42* Other Calendars:: Converting dates to other calendar systems.
43* Diary:: Displaying events from your diary.
44* Appointments:: Reminders when it's time to do something.
45* Importing Diary:: Converting diary events to/from other formats.
46* Daylight Saving:: How to specify when daylight saving time is active.
47* Time Intervals:: Keeping track of time intervals.
48@ifnottex
49* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
50@end ifnottex
51@end menu
52
53@node Calendar Motion
54@section Movement in the Calendar
55
56@cindex moving inside the calendar
57 Calendar mode provides commands to move through the calendar in
58logical units of time such as days, weeks, months, and years. If you
59move outside the three months originally displayed, the calendar
60display ``scrolls'' automatically through time to make the selected
61date visible. Moving to a date lets you view its holidays or diary
62entries, or convert it to other calendars; moving by long time periods
63is also useful simply to scroll the calendar.
64
65@menu
66* Calendar Unit Motion:: Moving by days, weeks, months, and years.
67* Move to Beginning or End:: Moving to start/end of weeks, months, and years.
68* Specified Dates:: Moving to the current date or another
69 specific date.
70@end menu
71
72@node Calendar Unit Motion
73@subsection Motion by Standard Lengths of Time
74
75 The commands for movement in the calendar buffer parallel the
76commands for movement in text. You can move forward and backward by
77days, weeks, months, and years.
78
79@table @kbd
80@item C-f
81Move point one day forward (@code{calendar-forward-day}).
82@item C-b
83Move point one day backward (@code{calendar-backward-day}).
84@item C-n
85Move point one week forward (@code{calendar-forward-week}).
86@item C-p
87Move point one week backward (@code{calendar-backward-week}).
88@item M-@}
89Move point one month forward (@code{calendar-forward-month}).
90@item M-@{
91Move point one month backward (@code{calendar-backward-month}).
92@item C-x ]
93Move point one year forward (@code{calendar-forward-year}).
94@item C-x [
95Move point one year backward (@code{calendar-backward-year}).
96@end table
97
98@kindex C-f @r{(Calendar mode)}
99@findex calendar-forward-day
100@kindex C-b @r{(Calendar mode)}
101@findex calendar-backward-day
102@kindex C-n @r{(Calendar mode)}
103@findex calendar-forward-week
104@kindex C-p @r{(Calendar mode)}
105@findex calendar-backward-week
106 The day and week commands are natural analogues of the usual Emacs
107commands for moving by characters and by lines. Just as @kbd{C-n}
108usually moves to the same column in the following line, in Calendar
109mode it moves to the same day in the following week. And @kbd{C-p}
110moves to the same day in the previous week.
111
112 The arrow keys are equivalent to @kbd{C-f}, @kbd{C-b}, @kbd{C-n} and
113@kbd{C-p}, just as they normally are in other modes.
114
115@kindex M-@} @r{(Calendar mode)}
116@findex calendar-forward-month
117@kindex M-@{ @r{(Calendar mode)}
118@findex calendar-backward-month
119@kindex C-x ] @r{(Calendar mode)}
120@findex calendar-forward-year
121@kindex C-x [ @r{(Calendar mode)}
122@findex calendar-forward-year
123 The commands for motion by months and years work like those for
124weeks, but move a larger distance. The month commands @kbd{M-@}} and
125@kbd{M-@{} move forward or backward by an entire month. The year
126commands @kbd{C-x ]} and @w{@kbd{C-x [}} move forward or backward a
127whole year.
128
129 The easiest way to remember these commands is to consider months and
130years analogous to paragraphs and pages of text, respectively. But
131the commands themselves are not quite analogous. The ordinary Emacs
132paragraph commands move to the beginning or end of a paragraph,
133whereas these month and year commands move by an entire month or an
134entire year, keeping the same date within the month or year.
135
136 All these commands accept a numeric argument as a repeat count.
137For convenience, the digit keys and the minus sign specify numeric
138arguments in Calendar mode even without the Meta modifier. For example,
139@kbd{100 C-f} moves point 100 days forward from its present location.
140
141@node Move to Beginning or End
142@subsection Beginning or End of Week, Month or Year
143
144 A week (or month, or year) is not just a quantity of days; we think of
145weeks (months, years) as starting on particular dates. So Calendar mode
146provides commands to move to the beginning or end of a week, month or
147year:
148
149@table @kbd
150@kindex C-a @r{(Calendar mode)}
151@findex calendar-beginning-of-week
152@item C-a
153Move point to start of week (@code{calendar-beginning-of-week}).
154@kindex C-e @r{(Calendar mode)}
155@findex calendar-end-of-week
156@item C-e
157Move point to end of week (@code{calendar-end-of-week}).
158@kindex M-a @r{(Calendar mode)}
159@findex calendar-beginning-of-month
160@item M-a
161Move point to start of month (@code{calendar-beginning-of-month}).
162@kindex M-e @r{(Calendar mode)}
163@findex calendar-end-of-month
164@item M-e
165Move point to end of month (@code{calendar-end-of-month}).
166@kindex M-< @r{(Calendar mode)}
167@findex calendar-beginning-of-year
168@item M-<
169Move point to start of year (@code{calendar-beginning-of-year}).
170@kindex M-> @r{(Calendar mode)}
171@findex calendar-end-of-year
172@item M->
173Move point to end of year (@code{calendar-end-of-year}).
174@end table
175
176 These commands also take numeric arguments as repeat counts, with the
177repeat count indicating how many weeks, months, or years to move
178backward or forward.
179
180@vindex calendar-week-start-day
181@cindex weeks, which day they start on
182@cindex calendar, first day of week
183 By default, weeks begin on Sunday. To make them begin on Monday
184instead, set the variable @code{calendar-week-start-day} to 1.
185
186@node Specified Dates
187@subsection Specified Dates
188
189 Calendar mode provides commands for moving to a particular date
190specified in various ways.
191
192@table @kbd
193@item g d
194Move point to specified date (@code{calendar-goto-date}).
195@item g D
196Move point to specified day of year (@code{calendar-goto-day-of-year}).
197@item g w
198Move point to specified week of year (@code{calendar-goto-iso-week}).
199@item o
200Center calendar around specified month (@code{calendar-other-month}).
201@item .
202Move point to today's date (@code{calendar-goto-today}).
203@end table
204
205@kindex g d @r{(Calendar mode)}
206@findex calendar-goto-date
207 @kbd{g d} (@code{calendar-goto-date}) prompts for a year, a month, and a day
208of the month, and then moves to that date. Because the calendar includes all
209dates from the beginning of the current era, you must type the year in its
210entirety; that is, type @samp{1990}, not @samp{90}.
211
212@kindex g D @r{(Calendar mode)}
213@findex calendar-goto-day-of-year
214@kindex g w @r{(Calendar mode)}
215@findex calendar-goto-iso-week
216 @kbd{g D} (@code{calendar-goto-day-of-year}) prompts for a year and
217day number, and moves to that date. Negative day numbers count
218backward from the end of the year. @kbd{g w}
219(@code{calendar-goto-iso-week}) prompts for a year and week number,
220and moves to that week.
221
222@kindex o @r{(Calendar mode)}
223@findex calendar-other-month
224 @kbd{o} (@code{calendar-other-month}) prompts for a month and year,
225then centers the three-month calendar around that month.
226
227@kindex . @r{(Calendar mode)}
228@findex calendar-goto-today
229 You can return to today's date with @kbd{.}@:
230(@code{calendar-goto-today}).
231
232@node Scroll Calendar
233@section Scrolling in the Calendar
234
235@cindex scrolling in the calendar
236 The calendar display scrolls automatically through time when you
237move out of the visible portion. You can also scroll it manually.
238Imagine that the calendar window contains a long strip of paper with
239the months on it. Scrolling the calendar means moving the strip
240horizontally, so that new months become visible in the window.
241
242@table @kbd
243@item >
244Scroll calendar one month forward (@code{scroll-calendar-left}).
245@item <
246Scroll calendar one month backward (@code{scroll-calendar-right}).
247@item C-v
248@itemx @key{NEXT}
249Scroll calendar three months forward
250(@code{scroll-calendar-left-three-months}).
251@item M-v
252@itemx @key{PRIOR}
253Scroll calendar three months backward
254(@code{scroll-calendar-right-three-months}).
255@end table
256
257@kindex > @r{(Calendar mode)}
258@findex scroll-calendar-left
259@kindex < @r{(Calendar mode)}
260@findex scroll-calendar-right
261 The most basic calendar scroll commands scroll by one month at a
262time. This means that there are two months of overlap between the
263display before the command and the display after. @kbd{>} scrolls the
264calendar contents one month forward in time. @kbd{<} scrolls the
265contents one month backwards in time.
266
267@kindex C-v @r{(Calendar mode)}
268@findex scroll-calendar-left-three-months
269@kindex M-v @r{(Calendar mode)}
270@findex scroll-calendar-right-three-months
271 The commands @kbd{C-v} and @kbd{M-v} scroll the calendar by an entire
272``screenful''---three months---in analogy with the usual meaning of
273these commands. @kbd{C-v} makes later dates visible and @kbd{M-v} makes
274earlier dates visible. These commands take a numeric argument as a
275repeat count; in particular, since @kbd{C-u} multiplies the next command
276by four, typing @kbd{C-u C-v} scrolls the calendar forward by a year and
277typing @kbd{C-u M-v} scrolls the calendar backward by a year.
278
279 The function keys @key{NEXT} and @key{PRIOR} are equivalent to
280@kbd{C-v} and @kbd{M-v}, just as they are in other modes.
281
282@node Counting Days
283@section Counting Days
284
285@table @kbd
286@item M-=
287Display the number of days in the current region
288(@code{calendar-count-days-region}).
289@end table
290
291@kindex M-= @r{(Calendar mode)}
292@findex calendar-count-days-region
293 To determine the number of days in the region, type @kbd{M-=}
294(@code{calendar-count-days-region}). The numbers of days shown is
295@emph{inclusive}; that is, it includes the days specified by mark and
296point.
297
298@node General Calendar
299@section Miscellaneous Calendar Commands
300
301@table @kbd
302@item p d
303Display day-in-year (@code{calendar-print-day-of-year}).
304@item C-c C-l
305Regenerate the calendar window (@code{redraw-calendar}).
306@item SPC
307Scroll the next window up (@code{scroll-other-window}).
308@item DEL
309Scroll the next window down (@code{scroll-other-window-down}).
310@item q
311Exit from calendar (@code{exit-calendar}).
312@end table
313
314@kindex p d @r{(Calendar mode)}
315@cindex day of year
316@findex calendar-print-day-of-year
317 To display the number of days elapsed since the start of the year, or
318the number of days remaining in the year, type the @kbd{p d} command
319(@code{calendar-print-day-of-year}). This displays both of those
320numbers in the echo area. The count of days elapsed includes the
321selected date. The count of days remaining does not include that
322date.
323
324@kindex C-c C-l @r{(Calendar mode)}
325@findex redraw-calendar
326 If the calendar window text gets corrupted, type @kbd{C-c C-l}
327(@code{redraw-calendar}) to redraw it. (This can only happen if you use
328non-Calendar-mode editing commands.)
329
330@kindex SPC @r{(Calendar mode)}
331 In Calendar mode, you can use @kbd{SPC} (@code{scroll-other-window})
332and @kbd{DEL} (@code{scroll-other-window-down}) to scroll the other
333window up or down, respectively. This is handy when you display a list
334of holidays or diary entries in another window.
335
336@kindex q @r{(Calendar mode)}
337@findex exit-calendar
338 To exit from the calendar, type @kbd{q} (@code{exit-calendar}). This
339buries all buffers related to the calendar, selecting other buffers.
340(If a frame contains a dedicated calendar window, exiting from the
341calendar iconifies that frame.)
342
343@node Writing Calendar Files
344@section Writing Calendar Files
345
346 These packages produce files of various formats containing calendar
347and diary entries, for display purposes.
348
349@cindex calendar and HTML
350 The Calendar HTML commands produce files of HTML code that contain
351calendar and diary entries. Each file applies to one month, and has a
352name of the format @file{@var{yyyy}-@var{mm}.html}, where @var{yyyy} and
353@var{mm} are the four-digit year and two-digit month, respectively. The
354variable @code{cal-html-directory} specifies the default output
355directory for the HTML files.
356
357@vindex cal-html-css-default
358 Diary entries enclosed by @code{<} and @code{>} are interpreted as
359HTML tags (for example: this is a diary entry with <font
360color=''red''>some red text</font>). You can change the overall
361appearance of the displayed HTML pages (for example, the color of
362various page elements, header styles) via a stylesheet @file{cal.css} in
363the directory containing the HTML files (see the value of the variable
364@code{cal-html-css-default} for relevant style settings).
365
366@kindex t @r{(Calendar mode)}
367@table @kbd
368@item H m
369Generate a one-month calendar (@code{cal-html-cursor-month}).
370@item H y
371Generate a calendar file for each month of a year, as well as an index
372page (@code{cal-html-cursor-year}). By default, this command writes
373files to a @var{yyyy} subdirectory - if this is altered some hyperlinks
374between years will not work.
375@end table
376
377 If the variable @code{cal-html-print-day-number-flag} is
378non-@code{nil}, then the monthly calendars show the day-of-the-year
379number. The variable @code{cal-html-year-index-cols} specifies the
380number of columns in the yearly index page.
381
382@cindex calendar and La@TeX{}
383 The Calendar La@TeX{} commands produce a buffer of La@TeX{} code that
384prints as a calendar. Depending on the command you use, the printed
385calendar covers the day, week, month or year that point is in.
386
387@kindex t @r{(Calendar mode)}
388@table @kbd
389@item t m
390Generate a one-month calendar (@code{cal-tex-cursor-month}).
391@item t M
392Generate a sideways-printing one-month calendar
393(@code{cal-tex-cursor-month-landscape}).
394@item t d
395Generate a one-day calendar
396(@code{cal-tex-cursor-day}).
397@item t w 1
398Generate a one-page calendar for one week
399(@code{cal-tex-cursor-week}).
400@item t w 2
401Generate a two-page calendar for one week
402(@code{cal-tex-cursor-week2}).
403@item t w 3
404Generate an ISO-style calendar for one week
405(@code{cal-tex-cursor-week-iso}).
406@item t w 4
407Generate a calendar for one Monday-starting week
408(@code{cal-tex-cursor-week-monday}).
409@item t f w
410Generate a Filofax-style two-weeks-at-a-glance calendar
411(@code{cal-tex-cursor-filofax-2week}).
412@item t f W
413Generate a Filofax-style one-week-at-a-glance calendar
414(@code{cal-tex-cursor-filofax-week}).
415@item t y
416Generate a calendar for one year
417(@code{cal-tex-cursor-year}).
418@item t Y
419Generate a sideways-printing calendar for one year
420(@code{cal-tex-cursor-year-landscape}).
421@item t f y
422Generate a Filofax-style calendar for one year
423(@code{cal-tex-cursor-filofax-year}).
424@end table
425
426 Some of these commands print the calendar sideways (in ``landscape
427mode''), so it can be wider than it is long. Some of them use Filofax
428paper size (3.75in x 6.75in). All of these commands accept a prefix
429argument which specifies how many days, weeks, months or years to print
430(starting always with the selected one).
431
432 If the variable @code{cal-tex-holidays} is non-@code{nil} (the default),
433then the printed calendars show the holidays in @code{calendar-holidays}.
434If the variable @code{cal-tex-diary} is non-@code{nil} (the default is
435@code{nil}), diary entries are included also (in monthly, filofax, and
436iso-week calendars only). If the variable @code{cal-tex-rules} is
437non-@code{nil} (the default is @code{nil}), the calendar displays ruled
438pages in styles that have sufficient room. Consult the documentation of
439the individual cal-tex functions to see which calendars support which
440features.
441
442 You can use the variable @code{cal-tex-preamble-extra} to insert extra
443La@TeX{} commands in the preamble of the generated document if you need
444to.
445
446@node Holidays
447@section Holidays
448@cindex holidays
449
450 The Emacs calendar knows about all major and many minor holidays,
451and can display them.
452
453@table @kbd
454@item h
455Display holidays for the selected date
456(@code{calendar-cursor-holidays}).
457@item Mouse-2 Holidays
458Display any holidays for the date you click on.
459@item x
460Mark holidays in the calendar window (@code{mark-calendar-holidays}).
461@item u
462Unmark calendar window (@code{calendar-unmark}).
463@item a
464List all holidays for the displayed three months in another window
465(@code{list-calendar-holidays}).
466@item M-x holidays
467List all holidays for three months around today's date in another
468window.
469@item M-x list-holidays
470List holidays in another window for a specified range of years.
471@end table
472
473@kindex h @r{(Calendar mode)}
474@findex calendar-cursor-holidays
475@vindex view-calendar-holidays-initially
476 To see if any holidays fall on a given date, position point on that
477date in the calendar window and use the @kbd{h} command. Alternatively,
478click on that date with @kbd{Mouse-2} and then choose @kbd{Holidays}
479from the menu that appears. Either way, this displays the holidays for
480that date, in the echo area if they fit there, otherwise in a separate
481window.
482
483@kindex x @r{(Calendar mode)}
484@findex mark-calendar-holidays
485@kindex u @r{(Calendar mode)}
486@findex calendar-unmark
487@vindex mark-holidays-in-calendar
488 To view the distribution of holidays for all the dates shown in the
489calendar, use the @kbd{x} command. This displays the dates that are
490holidays in a different face (or places a @samp{*} after these dates, if
491display with multiple faces is not available).
492@iftex
493@inforef{Calendar Customizing, calendar-holiday-marker, emacs-xtra}.
494@end iftex
495@ifnottex
496@xref{Calendar Customizing, calendar-holiday-marker}.
497@end ifnottex
498 The command applies both to the currently visible months and to
499other months that subsequently become visible by scrolling. To turn
500marking off and erase the current marks, type @kbd{u}, which also
501erases any diary marks (@pxref{Diary}). If the variable
502@code{mark-holidays-in-calendar} is non-@code{nil}, creating or
503updating the calendar marks holidays automatically.
504
505@kindex a @r{(Calendar mode)}
506@findex list-calendar-holidays
507 To get even more detailed information, use the @kbd{a} command, which
508displays a separate buffer containing a list of all holidays in the
509current three-month range. You can use @key{SPC} and @key{DEL} in the
510calendar window to scroll that list up and down, respectively.
511
512@findex holidays
513 The command @kbd{M-x holidays} displays the list of holidays for the
514current month and the preceding and succeeding months; this works even
515if you don't have a calendar window. If the variable
516@code{view-calendar-holidays-initially} is non-@code{nil}, creating
517the calendar displays holidays in this way. If you want the list of
518holidays centered around a different month, use @kbd{C-u M-x
519holidays}, which prompts for the month and year.
520
521 The holidays known to Emacs include United States holidays and the
522major Christian, Jewish, and Islamic holidays; also the solstices and
523equinoxes.
524
525@findex list-holidays
526 The command @kbd{M-x list-holidays} displays the list of holidays for
527a range of years. This function asks you for the starting and stopping
528years, and allows you to choose all the holidays or one of several
529categories of holidays. You can use this command even if you don't have
530a calendar window.
531
532 The dates used by Emacs for holidays are based on @emph{current
533practice}, not historical fact. For example Veteran's Day began in
5341919, but is shown in earlier years.
535
536@node Sunrise/Sunset
537@section Times of Sunrise and Sunset
538@cindex sunrise and sunset
539
540 Special calendar commands can tell you, to within a minute or two, the
541times of sunrise and sunset for any date.
542
543@table @kbd
544@item S
545Display times of sunrise and sunset for the selected date
546(@code{calendar-sunrise-sunset}).
547@item Mouse-2 Sunrise/sunset
548Display times of sunrise and sunset for the date you click on.
549@item M-x sunrise-sunset
550Display times of sunrise and sunset for today's date.
551@item C-u M-x sunrise-sunset
552Display times of sunrise and sunset for a specified date.
553@end table
554
555@kindex S @r{(Calendar mode)}
556@findex calendar-sunrise-sunset
557@findex sunrise-sunset
558 Within the calendar, to display the @emph{local times} of sunrise and
559sunset in the echo area, move point to the date you want, and type
560@kbd{S}. Alternatively, click @kbd{Mouse-2} on the date, then choose
561@samp{Sunrise/sunset} from the menu that appears. The command @kbd{M-x
562sunrise-sunset} is available outside the calendar to display this
563information for today's date or a specified date. To specify a date
564other than today, use @kbd{C-u M-x sunrise-sunset}, which prompts for
565the year, month, and day.
566
567 You can display the times of sunrise and sunset for any location and
568any date with @kbd{C-u C-u M-x sunrise-sunset}. This asks you for a
569longitude, latitude, number of minutes difference from Coordinated
570Universal Time, and date, and then tells you the times of sunrise and
571sunset for that location on that date.
572
573 Because the times of sunrise and sunset depend on the location on
574earth, you need to tell Emacs your latitude, longitude, and location
575name before using these commands. Here is an example of what to set:
576
577@vindex calendar-location-name
578@vindex calendar-longitude
579@vindex calendar-latitude
580@example
581(setq calendar-latitude 40.1)
582(setq calendar-longitude -88.2)
583(setq calendar-location-name "Urbana, IL")
584@end example
585
586@noindent
587Use one decimal place in the values of @code{calendar-latitude} and
588@code{calendar-longitude}.
589
590 Your time zone also affects the local time of sunrise and sunset.
591Emacs usually gets time zone information from the operating system, but
592if these values are not what you want (or if the operating system does
593not supply them), you must set them yourself. Here is an example:
594
595@vindex calendar-time-zone
596@vindex calendar-standard-time-zone-name
597@vindex calendar-daylight-time-zone-name
598@example
599(setq calendar-time-zone -360)
600(setq calendar-standard-time-zone-name "CST")
601(setq calendar-daylight-time-zone-name "CDT")
602@end example
603
604@noindent
605The value of @code{calendar-time-zone} is the number of minutes
606difference between your local standard time and Coordinated Universal
607Time (Greenwich time). The values of
608@code{calendar-standard-time-zone-name} and
609@code{calendar-daylight-time-zone-name} are the abbreviations used in
610your time zone. Emacs displays the times of sunrise and sunset
611@emph{corrected for daylight saving time}. @xref{Daylight Saving},
612for how daylight saving time is determined.
613
614 As a user, you might find it convenient to set the calendar location
615variables for your usual physical location in your @file{.emacs} file.
616And when you install Emacs on a machine, you can create a
617@file{default.el} file which sets them properly for the typical location
618of most users of that machine. @xref{Init File}.
619
620@node Lunar Phases
621@section Phases of the Moon
622@cindex phases of the moon
623@cindex moon, phases of
624
625 These calendar commands display the dates and times of the phases of
626the moon (new moon, first quarter, full moon, last quarter). This
627feature is useful for debugging problems that ``depend on the phase of
628the moon.''
629
630@table @kbd
631@item M
632Display the dates and times for all the quarters of the moon for the
633three-month period shown (@code{calendar-phases-of-moon}).
634@item M-x phases-of-moon
635Display dates and times of the quarters of the moon for three months around
636today's date.
637@end table
638
639@kindex M @r{(Calendar mode)}
640@findex calendar-phases-of-moon
641 Within the calendar, use the @kbd{M} command to display a separate
642buffer of the phases of the moon for the current three-month range. The
643dates and times listed are accurate to within a few minutes.
644
645@findex phases-of-moon
646 Outside the calendar, use the command @kbd{M-x phases-of-moon} to
647display the list of the phases of the moon for the current month and the
648preceding and succeeding months. For information about a different
649month, use @kbd{C-u M-x phases-of-moon}, which prompts for the month and
650year.
651
652 The dates and times given for the phases of the moon are given in
653local time (corrected for daylight saving, when appropriate); but if
654the variable @code{calendar-time-zone} is void, Coordinated Universal
655Time (the Greenwich time zone) is used. @xref{Daylight Saving}.
656
657@node Other Calendars
658@section Conversion To and From Other Calendars
659
660@cindex Gregorian calendar
661 The Emacs calendar displayed is @emph{always} the Gregorian calendar,
662sometimes called the ``new style'' calendar, which is used in most of
663the world today. However, this calendar did not exist before the
664sixteenth century and was not widely used before the eighteenth century;
665it did not fully displace the Julian calendar and gain universal
666acceptance until the early twentieth century. The Emacs calendar can
667display any month since January, year 1 of the current era, but the
668calendar displayed is the Gregorian, even for a date at which the
669Gregorian calendar did not exist.
670
671 While Emacs cannot display other calendars, it can convert dates to
672and from several other calendars.
673
674@menu
675* Calendar Systems:: The calendars Emacs understands
676 (aside from Gregorian).
677* To Other Calendar:: Converting the selected date to various calendars.
678* From Other Calendar:: Moving to a date specified in another calendar.
679* Mayan Calendar:: Moving to a date specified in a Mayan calendar.
680@end menu
681
682@node Calendar Systems
683@subsection Supported Calendar Systems
684
685@cindex ISO commercial calendar
686 The ISO commercial calendar is used largely in Europe.
687
688@cindex Julian calendar
689 The Julian calendar, named after Julius Caesar, was the one used in Europe
690throughout medieval times, and in many countries up until the nineteenth
691century.
692
693@cindex Julian day numbers
694@cindex astronomical day numbers
695 Astronomers use a simple counting of days elapsed since noon, Monday,
696January 1, 4713 B.C. on the Julian calendar. The number of days elapsed
697is called the @dfn{Julian day number} or the @dfn{Astronomical day number}.
698
699@cindex Hebrew calendar
700 The Hebrew calendar is used by tradition in the Jewish religion. The
701Emacs calendar program uses the Hebrew calendar to determine the dates
702of Jewish holidays. Hebrew calendar dates begin and end at sunset.
703
704@cindex Islamic calendar
705 The Islamic calendar is used in many predominantly Islamic countries.
706Emacs uses it to determine the dates of Islamic holidays. There is no
707universal agreement in the Islamic world about the calendar; Emacs uses
708a widely accepted version, but the precise dates of Islamic holidays
709often depend on proclamation by religious authorities, not on
710calculations. As a consequence, the actual dates of observance can vary
711slightly from the dates computed by Emacs. Islamic calendar dates begin
712and end at sunset.
713
714@cindex French Revolutionary calendar
715 The French Revolutionary calendar was created by the Jacobins after the 1789
716revolution, to represent a more secular and nature-based view of the annual
717cycle, and to install a 10-day week in a rationalization measure similar to
718the metric system. The French government officially abandoned this
719calendar at the end of 1805.
720
721@cindex Mayan calendar
722 The Maya of Central America used three separate, overlapping calendar
723systems, the @emph{long count}, the @emph{tzolkin}, and the @emph{haab}.
724Emacs knows about all three of these calendars. Experts dispute the
725exact correlation between the Mayan calendar and our calendar; Emacs uses the
726Goodman-Martinez-Thompson correlation in its calculations.
727
728@cindex Coptic calendar
729@cindex Ethiopic calendar
730 The Copts use a calendar based on the ancient Egyptian solar calendar.
731Their calendar consists of twelve 30-day months followed by an extra
732five-day period. Once every fourth year they add a leap day to this
733extra period to make it six days. The Ethiopic calendar is identical in
734structure, but has different year numbers and month names.
735
736@cindex Persian calendar
737 The Persians use a solar calendar based on a design of Omar Khayyam.
738Their calendar consists of twelve months of which the first six have 31
739days, the next five have 30 days, and the last has 29 in ordinary years
740and 30 in leap years. Leap years occur in a complicated pattern every
741four or five years.
742The calendar implemented here is the arithmetical Persian calendar
743championed by Birashk, based on a 2,820-year cycle. It differs from
744the astronomical Persian calendar, which is based on astronomical
745events. As of this writing the first future discrepancy is projected
746to occur on March 20, 2025. It is currently not clear what the
747official calendar of Iran will be that far into the future.
748
749@cindex Chinese calendar
750 The Chinese calendar is a complicated system of lunar months arranged
751into solar years. The years go in cycles of sixty, each year containing
752either twelve months in an ordinary year or thirteen months in a leap
753year; each month has either 29 or 30 days. Years, ordinary months, and
754days are named by combining one of ten ``celestial stems'' with one of
755twelve ``terrestrial branches'' for a total of sixty names that are
756repeated in a cycle of sixty.
757
758@node To Other Calendar
759@subsection Converting To Other Calendars
760
761 The following commands describe the selected date (the date at point)
762in various other calendar systems:
763
764@table @kbd
765@item Mouse-2 Other calendars
766Display the date that you click on, expressed in various other calendars.
767@kindex p @r{(Calendar mode)}
768@findex calendar-print-iso-date
769@item p c
770Display ISO commercial calendar equivalent for selected day
771(@code{calendar-print-iso-date}).
772@findex calendar-print-julian-date
773@item p j
774Display Julian date for selected day (@code{calendar-print-julian-date}).
775@findex calendar-print-astro-day-number
776@item p a
777Display astronomical (Julian) day number for selected day
778(@code{calendar-print-astro-day-number}).
779@findex calendar-print-hebrew-date
780@item p h
781Display Hebrew date for selected day (@code{calendar-print-hebrew-date}).
782@findex calendar-print-islamic-date
783@item p i
784Display Islamic date for selected day (@code{calendar-print-islamic-date}).
785@findex calendar-print-french-date
786@item p f
787Display French Revolutionary date for selected day
788(@code{calendar-print-french-date}).
789@findex calendar-print-chinese-date
790@item p C
791Display Chinese date for selected day
792(@code{calendar-print-chinese-date}).
793@findex calendar-print-coptic-date
794@item p k
795Display Coptic date for selected day
796(@code{calendar-print-coptic-date}).
797@findex calendar-print-ethiopic-date
798@item p e
799Display Ethiopic date for selected day
800(@code{calendar-print-ethiopic-date}).
801@findex calendar-print-persian-date
802@item p p
803Display Persian date for selected day
804(@code{calendar-print-persian-date}).
805@findex calendar-print-mayan-date
806@item p m
807Display Mayan date for selected day (@code{calendar-print-mayan-date}).
808@end table
809
810 If you are using X, the easiest way to translate a date into other
811calendars is to click on it with @kbd{Mouse-2}, then choose @kbd{Other
812calendars} from the menu that appears. This displays the equivalent
813forms of the date in all the calendars Emacs understands, in the form of
814a menu. (Choosing an alternative from this menu doesn't actually do
815anything---the menu is used only for display.)
816
817 Otherwise, move point to the date you want to convert, then type the
818appropriate command starting with @kbd{p} from the table above. The
819prefix @kbd{p} is a mnemonic for ``print,'' since Emacs ``prints'' the
820equivalent date in the echo area.
821
822@node From Other Calendar
823@subsection Converting From Other Calendars
824
825 You can use the other supported calendars to specify a date to move
826to. This section describes the commands for doing this using calendars
827other than Mayan; for the Mayan calendar, see the following section.
828
829@kindex g @var{char} @r{(Calendar mode)}
830@findex calendar-goto-iso-date
831@findex calendar-goto-iso-week
832@findex calendar-goto-julian-date
833@findex calendar-goto-astro-day-number
834@findex calendar-goto-hebrew-date
835@findex calendar-goto-islamic-date
836@findex calendar-goto-french-date
837@findex calendar-goto-chinese-date
838@findex calendar-goto-persian-date
839@findex calendar-goto-coptic-date
840@findex calendar-goto-ethiopic-date
841@table @kbd
842@item g c
843Move to a date specified in the ISO commercial calendar
844(@code{calendar-goto-iso-date}).
845@item g w
846Move to a week specified in the ISO commercial calendar
847(@code{calendar-goto-iso-week}).
848@item g j
849Move to a date specified in the Julian calendar
850(@code{calendar-goto-julian-date}).
851@item g a
852Move to a date specified with an astronomical (Julian) day number
853(@code{calendar-goto-astro-day-number}).
854@item g h
855Move to a date specified in the Hebrew calendar
856(@code{calendar-goto-hebrew-date}).
857@item g i
858Move to a date specified in the Islamic calendar
859(@code{calendar-goto-islamic-date}).
860@item g f
861Move to a date specified in the French Revolutionary calendar
862(@code{calendar-goto-french-date}).
863@item g C
864Move to a date specified in the Chinese calendar
865(@code{calendar-goto-chinese-date}).
866@item g p
867Move to a date specified in the Persian calendar
868(@code{calendar-goto-persian-date}).
869@item g k
870Move to a date specified in the Coptic calendar
871(@code{calendar-goto-coptic-date}).
872@item g e
873Move to a date specified in the Ethiopic calendar
874(@code{calendar-goto-ethiopic-date}).
875@end table
876
877 These commands ask you for a date on the other calendar, move point to
878the Gregorian calendar date equivalent to that date, and display the
879other calendar's date in the echo area. Emacs uses strict completion
880(@pxref{Completion}) whenever it asks you to type a month name, so you
881don't have to worry about the spelling of Hebrew, Islamic, or French names.
882
883@findex list-yahrzeit-dates
884@cindex yahrzeits
885 One common question concerning the Hebrew calendar is the computation
886of the anniversary of a date of death, called a ``yahrzeit.'' The Emacs
887calendar includes a facility for such calculations. If you are in the
888calendar, the command @kbd{M-x list-yahrzeit-dates} asks you for a
889range of years and then displays a list of the yahrzeit dates for those
890years for the date given by point. If you are not in the calendar,
891this command first asks you for the date of death and the range of
892years, and then displays the list of yahrzeit dates.
893
894@node Mayan Calendar
895@subsection Converting from the Mayan Calendar
896
897 Here are the commands to select dates based on the Mayan calendar:
898
899@table @kbd
900@item g m l
901Move to a date specified by the long count calendar
902(@code{calendar-goto-mayan-long-count-date}).
903@item g m n t
904Move to the next occurrence of a place in the
905tzolkin calendar (@code{calendar-next-tzolkin-date}).
906@item g m p t
907Move to the previous occurrence of a place in the
908tzolkin calendar (@code{calendar-previous-tzolkin-date}).
909@item g m n h
910Move to the next occurrence of a place in the
911haab calendar (@code{calendar-next-haab-date}).
912@item g m p h
913Move to the previous occurrence of a place in the
914haab calendar (@code{calendar-previous-haab-date}).
915@item g m n c
916Move to the next occurrence of a place in the
917calendar round (@code{calendar-next-calendar-round-date}).
918@item g m p c
919Move to the previous occurrence of a place in the
920calendar round (@code{calendar-previous-calendar-round-date}).
921@end table
922
923@cindex Mayan long count
924 To understand these commands, you need to understand the Mayan calendars.
925The @dfn{long count} is a counting of days with these units:
926
927@display
9281 kin = 1 day@ @ @ 1 uinal = 20 kin@ @ @ 1 tun = 18 uinal
9291 katun = 20 tun@ @ @ 1 baktun = 20 katun
930@end display
931
932@kindex g m @r{(Calendar mode)}
933@findex calendar-goto-mayan-long-count-date
934@noindent
935Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11
936tun, 16 uinal, and 6 kin. The Emacs calendar can handle Mayan long
937count dates as early as 7.17.18.13.3, but no earlier. When you use the
938@kbd{g m l} command, type the Mayan long count date with the baktun,
939katun, tun, uinal, and kin separated by periods.
940
941@findex calendar-previous-tzolkin-date
942@findex calendar-next-tzolkin-date
943@cindex Mayan tzolkin calendar
944 The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of
945independent cycles of 13 and 20 days. Since this cycle repeats
946endlessly, Emacs provides commands to move backward and forward to the
947previous or next point in the cycle. Type @kbd{g m p t} to go to the
948previous tzolkin date; Emacs asks you for a tzolkin date and moves point
949to the previous occurrence of that date. Similarly, type @kbd{g m n t}
950to go to the next occurrence of a tzolkin date.
951
952@findex calendar-previous-haab-date
953@findex calendar-next-haab-date
954@cindex Mayan haab calendar
955 The Mayan haab calendar is a cycle of 365 days arranged as 18 months
956of 20 days each, followed a 5-day monthless period. Like the tzolkin
957cycle, this cycle repeats endlessly, and there are commands to move
958backward and forward to the previous or next point in the cycle. Type
959@kbd{g m p h} to go to the previous haab date; Emacs asks you for a haab
960date and moves point to the previous occurrence of that date.
961Similarly, type @kbd{g m n h} to go to the next occurrence of a haab
962date.
963
964@c This is omitted because it is too long for smallbook format.
965@c @findex calendar-previous-calendar-round-date
966@findex calendar-next-calendar-round-date
967@cindex Mayan calendar round
968 The Maya also used the combination of the tzolkin date and the haab
969date. This combination is a cycle of about 52 years called a
970@emph{calendar round}. If you type @kbd{g m p c}, Emacs asks you for
971both a haab and a tzolkin date and then moves point to the previous
972occurrence of that combination. Use @kbd{g m n c} to move point to the
973next occurrence of a combination. These commands signal an error if the
974haab/tzolkin date combination you have typed is impossible.
975
976 Emacs uses strict completion (@pxref{Strict Completion}) whenever it
977asks you to type a Mayan name, so you don't have to worry about
978spelling.
979
980@node Diary
981@section The Diary
982@cindex diary
983
984 The Emacs diary keeps track of appointments or other events on a daily
985basis, in conjunction with the calendar. To use the diary feature, you
986must first create a @dfn{diary file} containing a list of events and
987their dates. Then Emacs can automatically pick out and display the
988events for today, for the immediate future, or for any specified
989date.
990
991 The name of the diary file is specified by the variable
992@code{diary-file}; @file{~/diary} is the default. A sample diary file
993is (note that the file format is essentially the same as that used by
994the external shell utility @samp{calendar}):
995
996@example
99712/22/1988 Twentieth wedding anniversary!!
998&1/1. Happy New Year!
99910/22 Ruth's birthday.
1000* 21, *: Payday
1001Tuesday--weekly meeting with grad students at 10am
1002 Supowit, Shen, Bitner, and Kapoor to attend.
10031/13/89 Friday the thirteenth!!
1004&thu 4pm squash game with Lloyd.
1005mar 16 Dad's birthday
1006April 15, 1989 Income tax due.
1007&* 15 time cards due.
1008@end example
1009
1010@noindent
1011This example uses extra spaces to align the event descriptions of most
1012of the entries. Such formatting is purely a matter of taste.
1013
1014 Although you probably will start by creating a diary manually, Emacs
1015provides a number of commands to let you view, add, and change diary
1016entries.
1017
1018@menu
1019* Displaying the Diary:: Viewing diary entries and associated calendar dates.
1020* Format of Diary File:: Entering events in your diary.
1021* Date Formats:: Various ways you can specify dates.
1022* Adding to Diary:: Commands to create diary entries.
1023* Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc.
1024@end menu
1025
1026@node Displaying the Diary
1027@subsection Displaying the Diary
1028
1029 Once you have created a diary file, you can use the calendar to view
1030it. You can also view today's events outside of Calendar mode.
1031
1032@table @kbd
1033@item d
1034Display all diary entries for the selected date
1035(@code{diary-view-entries}).
1036@item Mouse-2 Diary
1037Display all diary entries for the date you click on.
1038@item s
1039Display the entire diary file (@code{diary-show-all-entries}).
1040@item m
1041Mark all visible dates that have diary entries
1042(@code{mark-diary-entries}).
1043@item u
1044Unmark the calendar window (@code{calendar-unmark}).
1045@item M-x print-diary-entries
1046Print hard copy of the diary display as it appears.
1047@item M-x diary
1048Display all diary entries for today's date.
1049@item M-x diary-mail-entries
1050Mail yourself email reminders about upcoming diary entries.
1051@end table
1052
1053@kindex d @r{(Calendar mode)}
1054@findex diary-view-entries
1055@vindex view-diary-entries-initially
1056 Displaying the diary entries with @kbd{d} shows in a separate window
1057the diary entries for the selected date in the calendar. The mode line
1058of the new window shows the date of the diary entries and any holidays
1059that fall on that date. If you specify a numeric argument with @kbd{d},
1060it shows all the diary entries for that many successive days. Thus,
1061@kbd{2 d} displays all the entries for the selected date and for the
1062following day.
1063
1064 Another way to display the diary entries for a date is to click
1065@kbd{Mouse-2} on the date, and then choose @kbd{Diary entries} from
1066the menu that appears. If the variable
1067@code{view-diary-entries-initially} is non-@code{nil}, creating the
1068calendar lists the diary entries for the current date (provided the
1069current date is visible).
1070
1071@kindex m @r{(Calendar mode)}
1072@findex mark-diary-entries
1073@vindex mark-diary-entries-in-calendar
1074 To get a broader view of which days are mentioned in the diary, use
1075the @kbd{m} command. This displays the dates that have diary entries in
1076a different face (or places a @samp{+} after these dates, if display
1077with multiple faces is not available).
1078@iftex
1079@inforef{Calendar Customizing, diary-entry-marker, emacs-xtra}.
1080@end iftex
1081@ifnottex
1082@xref{Calendar Customizing, diary-entry-marker}.
1083@end ifnottex
1084 The command applies both to the currently visible months and to
1085other months that subsequently become visible by scrolling. To turn
1086marking off and erase the current marks, type @kbd{u}, which also
1087turns off holiday marks (@pxref{Holidays}). If the variable
1088@code{mark-diary-entries-in-calendar} is non-@code{nil}, creating or
1089updating the calendar marks diary dates automatically.
1090
1091@kindex s @r{(Calendar mode)}
1092@findex diary-show-all-entries
1093 To see the full diary file, rather than just some of the entries, use
1094the @kbd{s} command.
1095
1096 Display of selected diary entries uses the selective display feature
1097to hide entries that don't apply. The diary buffer as you see it is
1098an illusion, so simply printing the buffer does not print what you see
1099on your screen. There is a special command to print hard copy of the
1100diary buffer @emph{as it appears}; this command is @kbd{M-x
1101print-diary-entries}. It sends the data directly to the printer. You
1102can customize it like @code{lpr-region} (@pxref{Printing}).
1103
1104@findex diary
1105 The command @kbd{M-x diary} displays the diary entries for the current
1106date, independently of the calendar display, and optionally for the next
1107few days as well; the variable @code{number-of-diary-entries} specifies
1108how many days to include.
1109@iftex
1110@inforef{Diary Customizing,, emacs-xtra}.
1111@end iftex
1112@ifnottex
1113@xref{Diary Customizing, number-of-diary-entries}.
1114@end ifnottex
1115
1116 If you put @code{(diary)} in your @file{.emacs} file, this
1117automatically displays a window with the day's diary entries, when you
1118enter Emacs. The mode line of the displayed window shows the date and
1119any holidays that fall on that date.
1120
1121@findex diary-mail-entries
1122@vindex diary-mail-days
1123 Many users like to receive notice of events in their diary as email.
1124To send such mail to yourself, use the command @kbd{M-x
1125diary-mail-entries}. A prefix argument specifies how many days
1126(starting with today) to check; otherwise, the variable
1127@code{diary-mail-days} says how many days.
1128
1129@node Format of Diary File
1130@subsection The Diary File
1131@cindex diary file
1132
1133@vindex diary-file
1134 Your @dfn{diary file} is a file that records events associated with
1135particular dates. The name of the diary file is specified by the
1136variable @code{diary-file}; @file{~/diary} is the default. The
1137@code{calendar} utility program supports a subset of the format allowed
1138by the Emacs diary facilities, so you can use that utility to view the
1139diary file, with reasonable results aside from the entries it cannot
1140understand.
1141
1142 Each entry in the diary file describes one event and consists of one
1143or more lines. An entry always begins with a date specification at the
1144left margin. The rest of the entry is simply text to describe the
1145event. If the entry has more than one line, then the lines after the
1146first must begin with whitespace to indicate they continue a previous
1147entry. Lines that do not begin with valid dates and do not continue a
1148preceding entry are ignored.
1149
1150 You can inhibit the marking of certain diary entries in the calendar
1151window; to do this, insert an ampersand (@samp{&}) at the beginning of
1152the entry, before the date. This has no effect on display of the entry
1153in the diary window; it affects only marks on dates in the calendar
1154window. Nonmarking entries are especially useful for generic entries
1155that would otherwise mark many different dates.
1156
1157 If the first line of a diary entry consists only of the date or day
1158name with no following blanks or punctuation, then the diary window
1159display doesn't include that line; only the continuation lines appear.
1160For example, this entry:
1161
1162@example
116302/11/1989
1164 Bill B. visits Princeton today
1165 2pm Cognitive Studies Committee meeting
1166 2:30-5:30 Liz at Lawrenceville
1167 4:00pm Dentist appt
1168 7:30pm Dinner at George's
1169 8:00-10:00pm concert
1170@end example
1171
1172@noindent
1173appears in the diary window without the date line at the beginning.
1174This style of entry looks neater when you display just a single day's
1175entries, but can cause confusion if you ask for more than one day's
1176entries.
1177
1178 You can edit the diary entries as they appear in the window, but it is
1179important to remember that the buffer displayed contains the @emph{entire}
1180diary file, with portions of it concealed from view. This means, for
1181instance, that the @kbd{C-f} (@code{forward-char}) command can put point
1182at what appears to be the end of the line, but what is in reality the
1183middle of some concealed line.
1184
1185 @emph{Be careful when editing the diary entries!} Inserting
1186additional lines or adding/deleting characters in the middle of a
1187visible line cannot cause problems, but editing at the end of a line may
1188not do what you expect. Deleting a line may delete other invisible
1189entries that follow it. Before editing the diary, it is best to display
1190the entire file with @kbd{s} (@code{diary-show-all-entries}).
1191
1192@node Date Formats
1193@subsection Date Formats
1194
1195 Here are some sample diary entries, illustrating different ways of
1196formatting a date. The examples all show dates in American order
1197(month, day, year), but Calendar mode supports European order (day,
1198month, year) as an option.
1199
1200@example
12014/20/93 Switch-over to new tabulation system
1202apr. 25 Start tabulating annual results
12034/30 Results for April are due
1204*/25 Monthly cycle finishes
1205Friday Don't leave without backing up files
1206@end example
1207
1208 The first entry appears only once, on April 20, 1993. The second and
1209third appear every year on the specified dates, and the fourth uses a
1210wildcard (asterisk) for the month, so it appears on the 25th of every
1211month. The final entry appears every week on Friday.
1212
1213 You can use just numbers to express a date, as in
1214@samp{@var{month}/@var{day}} or @samp{@var{month}/@var{day}/@var{year}}.
1215This must be followed by a nondigit. In the date itself, @var{month}
1216and @var{day} are numbers of one or two digits. The optional @var{year}
1217is also a number, and may be abbreviated to the last two digits; that
1218is, you can use @samp{11/12/1989} or @samp{11/12/89}.
1219
1220 Dates can also have the form @samp{@var{monthname} @var{day}} or
1221@samp{@var{monthname} @var{day}, @var{year}}, where the month's name can
1222be spelled in full or abbreviated (with or without a period). The
1223preferred abbreviations can be controlled using the variables
1224@code{calendar-abbrev-length}, @code{calendar-month-abbrev-array}, and
1225@code{calendar-day-abbrev-array}. The default is to use the first three
1226letters of a name as its abbreviation. Case is not significant.
1227
1228 A date may be @dfn{generic}; that is, partially unspecified. Then the
1229entry applies to all dates that match the specification. If the date
1230does not contain a year, it is generic and applies to any year.
1231Alternatively, @var{month}, @var{day}, or @var{year} can be a @samp{*};
1232this matches any month, day, or year, respectively. Thus, a diary entry
1233@samp{3/*/*} matches any day in March of any year; so does @samp{march
1234*}.
1235
1236@vindex european-calendar-style
1237@findex european-calendar
1238@findex american-calendar
1239 If you prefer the European style of writing dates---in which the day
1240comes before the month---type @kbd{M-x european-calendar} while in the
1241calendar, or set the variable @code{european-calendar-style} to @code{t}
1242with @kbd{M-x customize}, or @emph{before} using any calendar or diary
1243command. This mode interprets all dates in the diary in the European
1244manner, and also uses European style for displaying diary dates. (Note
1245that there is no comma after the @var{monthname} in the European style.)
1246To go back to the (default) American style of writing dates, type
1247@kbd{M-x american-calendar}.
1248
1249 You can use the name of a day of the week as a generic date which
1250applies to any date falling on that day of the week. You can abbreviate
1251the day of the week to three letters (with or without a period) or spell
1252it in full; case is not significant.
1253
1254@node Adding to Diary
1255@subsection Commands to Add to the Diary
1256
1257 While in the calendar, there are several commands to create diary
1258entries:
1259
1260@table @kbd
1261@item i d
1262Add a diary entry for the selected date (@code{insert-diary-entry}).
1263@item i w
1264Add a diary entry for the selected day of the week (@code{insert-weekly-diary-entry}).
1265@item i m
1266Add a diary entry for the selected day of the month (@code{insert-monthly-diary-entry}).
1267@item i y
1268Add a diary entry for the selected day of the year (@code{insert-yearly-diary-entry}).
1269@end table
1270
1271@kindex i d @r{(Calendar mode)}
1272@findex insert-diary-entry
1273 You can make a diary entry for a specific date by selecting that date
1274in the calendar window and typing the @kbd{i d} command. This command
1275displays the end of your diary file in another window and inserts the
1276date; you can then type the rest of the diary entry.
1277
1278@kindex i w @r{(Calendar mode)}
1279@findex insert-weekly-diary-entry
1280@kindex i m @r{(Calendar mode)}
1281@findex insert-monthly-diary-entry
1282@kindex i y @r{(Calendar mode)}
1283@findex insert-yearly-diary-entry
1284 If you want to make a diary entry that applies to a specific day of
1285the week, select that day of the week (any occurrence will do) and type
1286@kbd{i w}. This inserts the day-of-week as a generic date; you can then
1287type the rest of the diary entry. You can make a monthly diary entry in
1288the same fashion: select the day of the month, use the @kbd{i m}
1289command, and type the rest of the entry. Similarly, you can insert a
1290yearly diary entry with the @kbd{i y} command.
1291
1292 All of the above commands make marking diary entries by default. To
1293make a nonmarking diary entry, give a numeric argument to the command.
1294For example, @kbd{C-u i w} makes a nonmarking weekly diary entry.
1295
1296 When you modify the diary file, be sure to save the file before
1297exiting Emacs. Saving the diary file after using any of the above
1298insertion commands will automatically update the diary marks in the
1299calendar window, if appropriate. You can use the command
1300@code{redraw-calendar} to force an update at any time.
1301
1302@node Special Diary Entries
1303@subsection Special Diary Entries
1304
1305 In addition to entries based on calendar dates, the diary file can
1306contain @dfn{sexp entries} for regular events such as anniversaries.
1307These entries are based on Lisp expressions (sexps) that Emacs evaluates
1308as it scans the diary file. Instead of a date, a sexp entry contains
1309@samp{%%} followed by a Lisp expression which must begin and end with
1310parentheses. The Lisp expression determines which dates the entry
1311applies to.
1312
1313 Calendar mode provides commands to insert certain commonly used
1314sexp entries:
1315
1316@table @kbd
1317@item i a
1318Add an anniversary diary entry for the selected date
1319(@code{insert-anniversary-diary-entry}).
1320@item i b
1321Add a block diary entry for the current region
1322(@code{insert-block-diary-entry}).
1323@item i c
1324Add a cyclic diary entry starting at the date
1325(@code{insert-cyclic-diary-entry}).
1326@end table
1327
1328@kindex i a @r{(Calendar mode)}
1329@findex insert-anniversary-diary-entry
1330 If you want to make a diary entry that applies to the anniversary of a
1331specific date, move point to that date and use the @kbd{i a} command.
1332This displays the end of your diary file in another window and inserts
1333the anniversary description; you can then type the rest of the diary
1334entry. The entry looks like this:
1335
1336@findex diary-anniversary
1337@example
1338%%(diary-anniversary 10 31 1948) Arthur's birthday
1339@end example
1340
1341@noindent
1342This entry applies to October 31 in any year after 1948; @samp{10 31
13431948} specifies the date. (If you are using the European calendar
1344style, the month and day are interchanged.) The reason this expression
1345requires a beginning year is that advanced diary functions can use it to
1346calculate the number of elapsed years.
1347
1348 A @dfn{block} diary entry applies to a specified range of consecutive
1349dates. Here is a block diary entry that applies to all dates from June
135024, 1990 through July 10, 1990:
1351
1352@findex diary-block
1353@example
1354%%(diary-block 6 24 1990 7 10 1990) Vacation
1355@end example
1356
1357@noindent
1358The @samp{6 24 1990} indicates the starting date and the @samp{7 10 1990}
1359indicates the stopping date. (Again, if you are using the European calendar
1360style, the month and day are interchanged.)
1361
1362@kindex i b @r{(Calendar mode)}
1363@findex insert-block-diary-entry
1364 To insert a block entry, place point and the mark on the two
1365dates that begin and end the range, and type @kbd{i b}. This command
1366displays the end of your diary file in another window and inserts the
1367block description; you can then type the diary entry.
1368
1369@kindex i c @r{(Calendar mode)}
1370@findex insert-cyclic-diary-entry
1371 @dfn{Cyclic} diary entries repeat after a fixed interval of days. To
1372create one, select the starting date and use the @kbd{i c} command. The
1373command prompts for the length of interval, then inserts the entry,
1374which looks like this:
1375
1376@findex diary-cyclic
1377@example
1378%%(diary-cyclic 50 3 1 1990) Renew medication
1379@end example
1380
1381@noindent
1382This entry applies to March 1, 1990 and every 50th day following;
1383@samp{3 1 1990} specifies the starting date. (If you are using the
1384European calendar style, the month and day are interchanged.)
1385
1386 All three of these commands make marking diary entries. To insert a
1387nonmarking entry, give a numeric argument to the command. For example,
1388@kbd{C-u i a} makes a nonmarking anniversary diary entry.
1389
1390 Marking sexp diary entries in the calendar is @emph{extremely}
1391time-consuming, since every date visible in the calendar window must be
1392individually checked. So it's a good idea to make sexp diary entries
1393nonmarking (with @samp{&}) when possible.
1394
1395 Another sophisticated kind of sexp entry, a @dfn{floating} diary entry,
1396specifies a regularly occurring event by offsets specified in days,
1397weeks, and months. It is comparable to a crontab entry interpreted by
1398the @code{cron} utility. Here is a nonmarking, floating diary entry
1399that applies to the last Thursday in November:
1400
1401@findex diary-float
1402@example
1403&%%(diary-float 11 4 -1) American Thanksgiving
1404@end example
1405
1406@noindent
1407The 11 specifies November (the eleventh month), the 4 specifies Thursday
1408(the fourth day of the week, where Sunday is numbered zero), and the
1409@minus{}1 specifies ``last'' (1 would mean ``first,'' 2 would mean
1410``second,'' @minus{}2 would mean ``second-to-last,'' and so on). The
1411month can be a single month or a list of months. Thus you could change
1412the 11 above to @samp{'(1 2 3)} and have the entry apply to the last
1413Thursday of January, February, and March. If the month is @code{t}, the
1414entry applies to all months of the year.@refill
1415
1416 Each of the standard sexp diary entries takes an optional parameter
1417specifying the name of a face or a single-character string to use when
1418marking the entry in the calendar. Most generally, sexp diary entries
1419can perform arbitrary computations to determine when they apply.
1420@iftex
1421@inforef{Sexp Diary Entries,, emacs-xtra}.
1422@end iftex
1423@ifnottex
1424@inforef{Sexp Diary Entries}.
1425@end ifnottex
1426
1427@node Appointments
1428@section Appointments
1429@cindex appointment notification
1430
1431@vindex appt-display-format
1432@vindex appt-audible
1433@vindex appt-display-mode-line
1434 If you have a diary entry for an appointment, and that diary entry
1435begins with a recognizable time of day, Emacs can warn you several
1436minutes beforehand that that appointment is pending. Emacs alerts you
1437to the appointment by displaying a message in your chosen format, as
1438specified by the variable @code{appt-display-format}. If the value of
1439@code{appt-audible} is non-@code{nil}, the warning includes an audible
1440reminder. In addition, if @code{appt-display-mode-line} is
1441non-@code{nil}, Emacs displays the number of minutes to the
1442appointment on the mode line.
1443
1444@vindex appt-display-duration
1445@vindex appt-disp-window-function
1446@vindex appt-delete-window-function
1447 If @code{appt-display-format} has the value @code{window}, then the
1448variable @code{appt-display-duration} controls how long the reminder
1449window is visible for; and the variables
1450@code{appt-disp-window-function} and @code{appt-delete-window-function}
1451give the names of functions used to create and destroy the window,
1452respectively.
1453
1454@findex appt-activate
1455 To enable appointment notification, use the command @kbd{M-x
1456appt-activate}. With a positive argument, it enables notification;
1457with a negative argument, it disables notification; with no argument,
1458it toggles. Enabling notification also sets up an appointment list
1459for today from the diary file, giving all diary entries found with
1460recognizable times of day, and reminds you just before each of them.
1461
1462 For example, suppose the diary file contains these lines:
1463
1464@example
1465Monday
1466 9:30am Coffee break
1467 12:00pm Lunch
1468@end example
1469
1470@vindex appt-message-warning-time
1471@noindent
1472Then on Mondays, you will be reminded at around 9:20am about your
1473coffee break and at around 11:50am about lunch. The variable
1474@code{appt-message-warning-time} specifies how many minutes in advance
1475to warn you; its default value is 12 (12 minutes).
1476
1477 You can write times in am/pm style (with @samp{12:00am} standing
1478for midnight and @samp{12:00pm} standing for noon), or 24-hour
1479European/military style. You need not be consistent; your diary file
1480can have a mixture of the two styles. Times must be at the beginning
1481of lines if they are to be recognized.
1482
1483@vindex appt-display-diary
1484 Emacs updates the appointments list from the diary file
1485automatically just after midnight. You can force an update at any
1486time by re-enabling appointment notification. Both these actions also
1487display the day's diary buffer, unless you set
1488@code{appt-display-diary} to @code{nil}. The appointments list is
1489also updated whenever the diary file is saved.
1490
1491@findex appt-add
1492@findex appt-delete
1493@cindex alarm clock
1494 You can also use the appointment notification facility like an alarm
1495clock. The command @kbd{M-x appt-add} adds entries to the appointment
1496list without affecting your diary file. You delete entries from the
1497appointment list with @kbd{M-x appt-delete}.
1498
1499@node Importing Diary
1500@section Importing and Exporting Diary Entries
1501
1502 You can transfer diary entries between Emacs diary files and a
1503variety of other formats.
1504
1505@vindex diary-outlook-formats
1506 You can import diary entries from Outlook-generated appointment
1507messages. While viewing such a message in Rmail or Gnus, do @kbd{M-x
1508diary-from-outlook} to import the entry. You can make this command
1509recognize additional appointment message formats by customizing the
1510variable @code{diary-outlook-formats}.
1511
1512@cindex iCalendar support
1513 The icalendar package allows you to transfer data between your Emacs
1514diary file and iCalendar files, which are defined in ``RFC
15152445---Internet Calendaring and Scheduling Core Object Specification
1516(iCalendar)'' (as well as the earlier vCalendar format).
1517
1518 Importing works for ``ordinary'' (i.e. non-recurring) events, but
1519(at present) may not work correctly (if at all) for recurring events.
1520Exporting of diary files into iCalendar files should work correctly
1521for most diary entries. This feature is a work in progress, so the
1522commands may evolve in future.
1523
1524@findex icalendar-import-buffer
1525 The command @code{icalendar-import-buffer} extracts
1526iCalendar data from the current buffer and adds it to your (default)
1527diary file. This function is also suitable for automatic extraction of
1528iCalendar data; for example with the Rmail mail client one could use:
1529
1530@example
1531(add-hook 'rmail-show-message-hook 'icalendar-import-buffer)
1532@end example
1533
1534@findex icalendar-import-file
1535 The command @code{icalendar-import-file} imports an iCalendar file
1536and adds the results to an Emacs diary file. For example:
1537
1538@example
1539(icalendar-import-file "/here/is/calendar.ics"
1540 "/there/goes/ical-diary")
1541@end example
1542
1543@noindent
1544You can use an @code{#include} directive to add the import file contents
1545to the main diary file, if these are different files.
1546@iftex
1547@inforef{Fancy Diary Display,, emacs-xtra}.
1548@end iftex
1549@ifnottex
1550@xref{Fancy Diary Display}.
1551@end ifnottex
1552
1553
1554@findex icalendar-export-file, icalendar-export-region
1555 Use @code{icalendar-export-file} to interactively export an entire
1556Emacs diary file to iCalendar format. To export only a part of a diary
1557file, mark the relevant area, and call @code{icalendar-export-region}.
1558In both cases the result is appended to the target file.
1559
1560@node Daylight Saving
1561@section Daylight Saving Time
1562@cindex daylight saving time
1563
1564 Emacs understands the difference between standard time and daylight
1565saving time---the times given for sunrise, sunset, solstices,
1566equinoxes, and the phases of the moon take that into account. The rules
1567for daylight saving time vary from place to place and have also varied
1568historically from year to year. To do the job properly, Emacs needs to
1569know which rules to use.
1570
1571@vindex calendar-daylight-savings-starts
1572@vindex calendar-daylight-savings-ends
1573 Some operating systems keep track of the rules that apply to the place
1574where you are; on these systems, Emacs gets the information it needs
1575from the system automatically. If some or all of this information is
1576missing, Emacs fills in the gaps with the rules currently used in
1577Cambridge, Massachusetts. If the resulting rules are not what you want,
1578you can tell Emacs the rules to use by setting certain variables:
1579@code{calendar-daylight-savings-starts} and
1580@code{calendar-daylight-savings-ends}.
1581
1582 These values should be Lisp expressions that refer to the variable
1583@code{year}, and evaluate to the Gregorian date on which daylight
1584saving time starts or (respectively) ends, in the form of a list
1585@code{(@var{month} @var{day} @var{year})}. The values should be
1586@code{nil} if your area does not use daylight saving time.
1587
1588 Emacs uses these expressions to determine the starting date of
1589daylight saving time for the holiday list and for correcting times of
1590day in the solar and lunar calculations.
1591
1592 The values for Cambridge, Massachusetts are as follows:
1593
1594@example
1595(calendar-nth-named-day 2 0 3 year)
1596(calendar-nth-named-day 1 0 11 year)
1597@end example
1598
1599@noindent
1600That is, the second 0th day (Sunday) of the third month (March) in
1601the year specified by @code{year}, and the first Sunday of the eleventh month
1602(November) of that year. If daylight saving time were
1603changed to start on October 1, you would set
1604@code{calendar-daylight-savings-starts} to this:
1605
1606@example
1607(list 10 1 year)
1608@end example
1609
1610 If there is no daylight saving time at your location, or if you want
1611all times in standard time, set @code{calendar-daylight-savings-starts}
1612and @code{calendar-daylight-savings-ends} to @code{nil}.
1613
1614@vindex calendar-daylight-time-offset
1615 The variable @code{calendar-daylight-time-offset} specifies the
1616difference between daylight saving time and standard time, measured in
1617minutes. The value for Cambridge, Massachusetts is 60.
1618
1619@c @vindex calendar-daylight-savings-starts-time too long!
1620@vindex calendar-daylight-savings-ends-time
1621 Finally, the two variables
1622@code{calendar-daylight-savings-starts-time} and
1623@code{calendar-daylight-savings-ends-time} specify the number of
1624minutes after midnight local time when the transition to and from
1625daylight saving time should occur. For Cambridge, Massachusetts both
1626variables' values are 120.
1627
1628@node Time Intervals
1629@section Summing Time Intervals
1630@cindex time intervals, summing
1631@cindex summing time intervals
1632@cindex timeclock
1633
1634 The timeclock feature adds up time intervals, so you can (for
1635instance) keep track of how much time you spend working on particular
1636projects.
1637
1638@findex timeclock-in
1639@findex timeclock-out
1640@findex timeclock-change
1641@findex timeclock-workday-remaining
1642@findex timeclock-when-to-leave
1643 Use the @kbd{M-x timeclock-in} command when you start working on a
1644project, and @kbd{M-x timeclock-out} command when you're done. Each
1645time you do this, it adds one time interval to the record of the
1646project. You can change to working on a different project with @kbd{M-x
1647timeclock-change}.
1648
1649 Once you've collected data from a number of time intervals, you can use
1650@kbd{M-x timeclock-workday-remaining} to see how much time is left to
1651work today (assuming a typical average of 8 hours a day), and @kbd{M-x
1652timeclock-when-to-leave} which will calculate when you're ``done.''
1653
1654@vindex timeclock-modeline-display
1655@findex timeclock-modeline-display
1656 If you want Emacs to display the amount of time ``left'' of your
1657workday in the mode line, either customize the
1658@code{timeclock-modeline-display} variable and set its value to
1659@code{t}, or invoke the @kbd{M-x timeclock-modeline-display} command.
1660
1661@vindex timeclock-ask-before-exiting
1662 Terminating the current Emacs session might or might not mean that
1663you have stopped working on the project and, by default, Emacs asks
1664you. You can, however, set the value of the variable
1665@code{timeclock-ask-before-exiting} to @code{nil} (via @kbd{M-x
1666customize}) to avoid the question; then, only an explicit @kbd{M-x
1667timeclock-out} or @kbd{M-x timeclock-change} will tell Emacs that the
1668current interval is over.
1669
1670@cindex @file{.timelog} file
1671@vindex timeclock-file
1672@findex timeclock-reread-log
1673 The timeclock functions work by accumulating the data in a file
1674called @file{.timelog} in your home directory. You can specify a
1675different name for this file by customizing the variable
1676@code{timeclock-file}. If you edit the timeclock file manually, or if
1677you change the value of any of timeclock's customizable variables, you
1678should run the command @kbd{M-x timeclock-reread-log} to update the
1679data in Emacs from the file.
1680
1681@ifnottex
1682@include cal-xtra.texi
1683@end ifnottex
1684
1685@ignore
1686 arch-tag: 4531ef09-9df3-449d-9c52-2b5a4a337f92
1687@end ignore
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
new file mode 100644
index 00000000000..28bad72f0bf
--- /dev/null
+++ b/doc/emacs/cmdargs.texi
@@ -0,0 +1,1263 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Emacs Invocation, X Resources, GNU Free Documentation License, Top
6@appendix Command Line Arguments for Emacs Invocation
7@cindex command line arguments
8@cindex arguments (command line)
9@cindex options (command line)
10@cindex switches (command line)
11@cindex startup (command line arguments)
12@cindex invocation (command line arguments)
13
14 GNU Emacs supports command line arguments to request various actions
15when invoking Emacs. These are for compatibility with other editors and
16for sophisticated activities. We don't recommend using them for
17ordinary editing.
18
19 Arguments starting with @samp{-} are @dfn{options}, and so is
20@samp{+@var{linenum}}. All other arguments specify files to visit.
21Emacs visits the specified files while it starts up. The last file
22name on your command line becomes the current buffer; the other files
23are also visited in other buffers. If there are two files, they are
24both displayed; otherwise the last file is displayed along with a
25buffer list that shows what other buffers there are. As with most
26programs, the special argument @samp{--} says that all subsequent
27arguments are file names, not options, even if they start with
28@samp{-}.
29
30 Emacs command options can specify many things, such as the size and
31position of the X window Emacs uses, its colors, and so on. A few
32options support advanced usage, such as running Lisp functions on files
33in batch mode. The sections of this chapter describe the available
34options, arranged according to their purpose.
35
36 There are two ways of writing options: the short forms that start with
37a single @samp{-}, and the long forms that start with @samp{--}. For
38example, @samp{-d} is a short form and @samp{--display} is the
39corresponding long form.
40
41 The long forms with @samp{--} are easier to remember, but longer to
42type. However, you don't have to spell out the whole option name; any
43unambiguous abbreviation is enough. When a long option takes an
44argument, you can use either a space or an equal sign to separate the
45option name and the argument. Thus, you can write either
46@samp{--display sugar-bombs:0.0} or @samp{--display=sugar-bombs:0.0}.
47We recommend an equal sign because it makes the relationship clearer,
48and the tables below always show an equal sign.
49
50@cindex initial options (command line)
51@cindex action options (command line)
52@vindex command-line-args
53 Most options specify how to initialize Emacs, or set parameters for
54the Emacs session. We call them @dfn{initial options}. A few options
55specify things to do: for example, load libraries, call functions, or
56terminate Emacs. These are called @dfn{action options}. These and file
57names together are called @dfn{action arguments}. Emacs processes all
58the action arguments in the order they are written. The @file{.emacs} file
59can access the values of the action arguments as the elements of a list in
60the variable @code{command-line-args}.
61
62
63
64@menu
65* Action Arguments:: Arguments to visit files, load libraries,
66 and call functions.
67* Initial Options:: Arguments that take effect while starting Emacs.
68* Command Example:: Examples of using command line arguments.
69* Resume Arguments:: Specifying arguments when you resume a running Emacs.
70* Environment:: Environment variables that Emacs uses.
71* Display X:: Changing the default display and using remote login.
72* Font X:: Choosing a font for text, under X.
73* Colors:: Choosing display colors.
74* Window Size X:: Start-up window size, under X.
75* Borders X:: Internal and external borders, under X.
76* Title X:: Specifying the initial frame's title.
77* Icons X:: Choosing what sort of icon to use, under X.
78* Misc X:: Other display options.
79@end menu
80
81@node Action Arguments
82@appendixsec Action Arguments
83
84 Here is a table of the action arguments and options:
85
86@table @samp
87@item @var{file}
88@opindex --file
89@itemx --file=@var{file}
90@opindex --find-file
91@itemx --find-file=@var{file}
92@opindex --visit
93@itemx --visit=@var{file}
94@cindex visiting files, command-line argument
95@vindex inhibit-startup-buffer-menu
96Visit @var{file} using @code{find-file}. @xref{Visiting}.
97If you visit several files at startup in this way, Emacs
98also displays a Buffer Menu buffer to show you what files it
99has visited. You can inhibit that by setting @code{inhibit-startup-buffer-menu} to @code{t}.
100
101@item +@var{linenum} @var{file}
102@opindex +@var{linenum}
103Visit @var{file} using @code{find-file}, then go to line number
104@var{linenum} in it.
105
106@item +@var{linenum}:@var{columnnum} @var{file}
107Visit @var{file} using @code{find-file}, then go to line number
108@var{linenum} and put point at column number @var{columnnum}.
109
110@need 3000
111@item -l @var{file}
112@opindex -l
113@itemx --load=@var{file}
114@opindex --load
115@cindex loading Lisp libraries, command-line argument
116Load a Lisp library named @var{file} with the function @code{load}.
117@xref{Lisp Libraries}. If @var{file} is not an absolute file name,
118the library can be found either in the current directory, or in the
119Emacs library search path as specified with @env{EMACSLOADPATH}
120(@pxref{General Variables}).
121
122@strong{Warning:} If previous command-line arguments have visited
123files, the current directory is the directory of the last file
124visited.
125
126@item -L @var{dir}
127@opindex -L
128@itemx --directory=@var{dir}
129@opindex --directory
130Add directory @var{dir} to the variable @code{load-path}.
131
132@item -f @var{function}
133@opindex -f
134@itemx --funcall=@var{function}
135@opindex --funcall
136@cindex call Lisp functions, command-line argument
137Call Lisp function @var{function}. If it is an interactive function
138(a command), it reads the arguments interactively just as if you had
139called the same function with a key sequence. Otherwise, it calls the
140function with no arguments.
141
142@item --eval=@var{expression}
143@opindex --eval
144@itemx --execute=@var{expression}
145@opindex --execute
146@cindex evaluate expression, command-line argument
147Evaluate Lisp expression @var{expression}.
148
149@item --insert=@var{file}
150@opindex --insert
151@cindex insert file contents, command-line argument
152Insert the contents of @var{file} into the current buffer. This is like
153what @kbd{M-x insert-file} does. @xref{Misc File Ops}.
154
155@item --kill
156@opindex --kill
157Exit from Emacs without asking for confirmation.
158
159@item --help
160@opindex --help
161Print a usage message listing all available options, then exit
162successfully.
163
164@item --version
165@opindex --version
166Print Emacs version, then exit successfully.
167@end table
168
169@node Initial Options
170@appendixsec Initial Options
171
172 The initial options specify parameters for the Emacs session. This
173section describes the more general initial options; some other options
174specifically related to the X Window System appear in the following
175sections.
176
177 Some initial options affect the loading of init files. The normal
178actions of Emacs are to first load @file{site-start.el} if it exists,
179then your own init file @file{~/.emacs} if it exists, and finally
180@file{default.el} if it exists. @xref{Init File}. Certain options
181prevent loading of some of these files or substitute other files for
182them.
183
184@table @samp
185@item -t @var{device}
186@opindex -t
187@itemx --terminal=@var{device}
188@opindex --terminal
189@cindex device for Emacs terminal I/O
190Use @var{device} as the device for terminal input and output.
191@samp{--terminal} implies @samp{--no-window-system}.
192
193@item -d @var{display}
194@opindex -d
195@itemx --display=@var{display}
196@opindex --display
197@cindex display for Emacs frame
198Use the X Window System and use the display named @var{display} to open
199the initial Emacs frame. @xref{Display X}, for more details.
200
201@item -nw
202@opindex -nw
203@itemx --no-window-system
204@opindex --no-window-system
205@cindex disable window system
206Don't communicate directly with the window system, disregarding the
207@env{DISPLAY} environment variable even if it is set. This means that
208Emacs uses the terminal from which it was launched for all its display
209and input.
210
211@need 3000
212@cindex batch mode
213@item -batch
214@opindex --batch
215@itemx --batch
216Run Emacs in @dfn{batch mode}. Batch mode is used for running
217programs written in Emacs Lisp from shell scripts, makefiles, and so
218on. You should also use the @samp{-l}, @samp{-f} or @samp{--eval}
219option, to invoke a Lisp program to do batch processing.
220
221In batch mode, Emacs does not display the text being edited, and the
222standard terminal interrupt characters such as @kbd{C-z} and @kbd{C-c}
223continue to have their normal effect. The functions @code{prin1},
224@code{princ} and @code{print} output to @code{stdout} instead of the
225echo area, while @code{message} and error messages output to
226@code{stderr}. Functions that would normally read from the minibuffer
227take their input from @code{stdin} instead.
228
229@samp{--batch} implies @samp{-q} (do not load an init file), but
230@file{site-start.el} is loaded nonetheless. It also causes Emacs to
231exit after processing all the command options. In addition, it
232disables auto-saving except in buffers for which it has been
233explicitly requested.
234
235@item --script @var{file}
236@opindex --script
237@cindex script mode
238Run Emacs in batch mode, like @samp{--batch}, and then read and
239execute the Lisp code in @var{file}.
240
241The normal use of this option is in executable script files that run
242Emacs. They can start with this text on the first line
243
244@example
245#!/usr/bin/emacs --script
246@end example
247
248@noindent
249which will invoke Emacs with @samp{--script} and supply the name of
250the script file as @var{file}. Emacs Lisp then treats @samp{#!} as a
251comment delimiter.
252
253@item -q
254@opindex -q
255@itemx --no-init-file
256@opindex --no-init-file
257@cindex bypassing init and @file{default.el} file
258@cindex init file, not loading
259@cindex @file{default.el} file, not loading
260Do not load your Emacs init file @file{~/.emacs}, or @file{default.el}
261either. Regardless of this switch, @file{site-start.el} is still loaded.
262When invoked like this, Emacs does not allow saving options
263changed with the @kbd{M-x customize} command and its variants.
264@xref{Easy Customization}.
265
266@item --no-site-file
267@opindex --no-site-file
268@cindex @file{site-start.el} file, not loading
269Do not load @file{site-start.el}. The options @samp{-q}, @samp{-u}
270and @samp{--batch} have no effect on the loading of this file---this
271option and @samp{-Q} are the only options that block it.
272
273@item -Q
274@opindex -Q
275@itemx --quick
276@opindex --quick
277Start emacs with minimum customizations. This is like using @samp{-q}
278and @samp{--no-site-file}, but also disables the startup screen.
279
280@item --no-splash
281@opindex --no-splash
282@vindex inhibit-splash-screen
283@cindex splash screen
284@cindex startup message
285Do not display a splash screen on startup. You can also achieve this
286effect by setting the variable @code{inhibit-splash-screen} to
287non-@code{nil} in you personal init file (but @emph{not} in
288@file{site-start.el}). (This variable was called
289@code{inhibit-startup-message} in previous Emacs versions.)
290
291@item --no-desktop
292@opindex --no-desktop
293Do not reload any saved desktop. @xref{Saving Emacs Sessions}.
294
295@item -u @var{user}
296@opindex -u
297@itemx --user=@var{user}
298@opindex --user
299@cindex load init file of another user
300Load @var{user}'s Emacs init file @file{~@var{user}/.emacs} instead of
301your own@footnote{
302This option has no effect on MS-Windows.}.
303
304@item --debug-init
305@opindex --debug-init
306@cindex errors in init file
307Enable the Emacs Lisp debugger for errors in the init file.
308@xref{Error Debugging,, Entering the Debugger on an Error, elisp, The
309GNU Emacs Lisp Reference Manual}.
310
311@item --unibyte
312@opindex --unibyte
313@itemx --no-multibyte
314@opindex --no-multibyte
315@cindex unibyte operation, command-line argument
316Do almost everything with single-byte buffers and strings.
317All buffers and strings are unibyte unless you (or a Lisp program)
318explicitly ask for a multibyte buffer or string. (Note that Emacs
319always loads Lisp files in multibyte mode, even if @samp{--unibyte} is
320specified; see @ref{Enabling Multibyte}.) Setting the environment
321variable @env{EMACS_UNIBYTE} has the same effect
322(@pxref{General Variables}).
323
324@item --multibyte
325@opindex --multibyte
326@itemx --no-unibyte
327@opindex --no-unibyte
328Inhibit the effect of @env{EMACS_UNIBYTE}, so that Emacs
329uses multibyte characters by default, as usual.
330@end table
331
332@node Command Example
333@appendixsec Command Argument Example
334
335 Here is an example of using Emacs with arguments and options. It
336assumes you have a Lisp program file called @file{hack-c.el} which, when
337loaded, performs some useful operation on the current buffer, expected
338to be a C program.
339
340@example
341emacs --batch foo.c -l hack-c -f save-buffer >& log
342@end example
343
344@noindent
345This says to visit @file{foo.c}, load @file{hack-c.el} (which makes
346changes in the visited file), save @file{foo.c} (note that
347@code{save-buffer} is the function that @kbd{C-x C-s} is bound to), and
348then exit back to the shell (because of @samp{--batch}). @samp{--batch}
349also guarantees there will be no problem redirecting output to
350@file{log}, because Emacs will not assume that it has a display terminal
351to work with.
352
353@node Resume Arguments
354@appendixsec Resuming Emacs with Arguments
355
356 You can specify action arguments for Emacs when you resume it after
357a suspension. To prepare for this, put the following code in your
358@file{.emacs} file (@pxref{Hooks}):
359
360@c `resume-suspend-hook' is correct. It is the name of a function.
361@example
362(add-hook 'suspend-hook 'resume-suspend-hook)
363(add-hook 'suspend-resume-hook 'resume-process-args)
364@end example
365
366 As further preparation, you must execute the shell script
367@file{emacs.csh} (if you use csh as your shell) or @file{emacs.bash}
368(if you use bash as your shell). These scripts define an alias named
369@code{edit}, which will resume Emacs giving it new command line
370arguments such as files to visit. The scripts are found in the
371@file{etc} subdirectory of the Emacs distribution.
372
373 Only action arguments work properly when you resume Emacs. Initial
374arguments are not recognized---it's too late to execute them anyway.
375
376 Note that resuming Emacs (with or without arguments) must be done from
377within the shell that is the parent of the Emacs job. This is why
378@code{edit} is an alias rather than a program or a shell script. It is
379not possible to implement a resumption command that could be run from
380other subjobs of the shell; there is no way to define a command that could
381be made the value of @env{EDITOR}, for example. Therefore, this feature
382does not take the place of the Emacs Server feature (@pxref{Emacs
383Server}).
384
385 The aliases use the Emacs Server feature if you appear to have a
386server Emacs running. However, they cannot determine this with complete
387accuracy. They may think that a server is still running when in
388actuality you have killed that Emacs, because the file
389@file{/tmp/esrv@dots{}} still exists. If this happens, find that
390file and delete it.
391
392@node Environment
393@appendixsec Environment Variables
394@cindex environment variables
395
396 The @dfn{environment} is a feature of the operating system; it
397consists of a collection of variables with names and values. Each
398variable is called an @dfn{environment variable}; environment variable
399names are case-sensitive, and it is conventional to use upper case
400letters only. The values are all text strings.
401
402 What makes the environment useful is that subprocesses inherit the
403environment automatically from their parent process. This means you
404can set up an environment variable in your login shell, and all the
405programs you run (including Emacs) will automatically see it.
406Subprocesses of Emacs (such as shells, compilers, and version-control
407software) inherit the environment from Emacs, too.
408
409@findex setenv
410@findex getenv
411 Inside Emacs, the command @kbd{M-x getenv} gets the value of an
412environment variable. @kbd{M-x setenv} sets a variable in the Emacs
413environment. (Environment variable substitutions with @samp{$} work
414in the value just as in file names; see @ref{File Names with $}.)
415
416 The way to set environment variables outside of Emacs depends on the
417operating system, and especially the shell that you are using. For
418example, here's how to set the environment variable @env{ORGANIZATION}
419to @samp{not very much} using Bash:
420
421@example
422export ORGANIZATION="not very much"
423@end example
424
425@noindent
426and here's how to do it in csh or tcsh:
427
428@example
429setenv ORGANIZATION "not very much"
430@end example
431
432 When Emacs is using the X Window System, various environment
433variables that control X work for Emacs as well. See the X
434documentation for more information.
435
436@menu
437* General Variables:: Environment variables that all versions of Emacs use.
438* Misc Variables:: Certain system-specific variables.
439* MS-Windows Registry:: An alternative to the environment on MS-Windows.
440@end menu
441
442@node General Variables
443@appendixsubsec General Variables
444
445 Here is an alphabetical list of specific environment variables that
446have special meanings in Emacs, giving the name of each variable and
447its meaning. Most of these variables are also used by some other
448programs. Emacs does not require any of these environment variables
449to be set, but it uses their values if they are set.
450
451@table @env
452@item CDPATH
453Used by the @code{cd} command to search for the directory you specify,
454when you specify a relative directory name.
455@item EMACS_UNIBYTE
456@cindex unibyte operation, environment variable
457Defining this environment variable with a nonempty value directs Emacs
458to do almost everything with single-byte buffers and strings. It is
459equivalent to using the @samp{--unibyte} command-line option on each
460invocation. @xref{Initial Options}.
461@item EMACSDATA
462Directory for the architecture-independent files that come with Emacs.
463This is used to initialize the Lisp variable @code{data-directory}.
464@item EMACSDOC
465Directory for the documentation string file,
466@file{DOC-@var{emacsversion}}. This is used to initialize the Lisp
467variable @code{doc-directory}.
468@item EMACSLOADPATH
469A colon-separated list of directories@footnote{
470Here and below, whenever we say ``colon-separated list of directories,''
471it pertains to Unix and GNU/Linux systems. On MS-DOS and MS-Windows,
472the directories are separated by semi-colons instead, since DOS/Windows
473file names might include a colon after a drive letter.}
474to search for Emacs Lisp files---used to initialize @code{load-path}.
475@item EMACSPATH
476A colon-separated list of directories to search for executable
477files---used to initialize @code{exec-path}.
478@item EMAIL
479@vindex user-mail-address@r{, initialization}
480Your email address; used to initialize the Lisp variable
481@code{user-mail-address}, which the Emacs mail interface puts into
482the @samp{From} header of outgoing messages (@pxref{Mail Headers}).
483@item ESHELL
484Used for shell-mode to override the @env{SHELL} environment variable.
485@item HISTFILE
486The name of the file that shell commands are saved in between logins.
487This variable defaults to @file{~/.bash_history} if you use Bash, to
488@file{~/.sh_history} if you use ksh, and to @file{~/.history}
489otherwise.
490@item HOME
491The location of your files in the directory tree; used for
492expansion of file names starting with a tilde (@file{~}). On MS-DOS,
493it defaults to the directory from which Emacs was started, with
494@samp{/bin} removed from the end if it was present. On Windows, the
495default value of @env{HOME} is the @file{Application Data}
496subdirectory of the user profile directory (normally, this is
497@file{C:/Documents and Settings/@var{username}/Application Data},
498where @var{username} is your user name), though for backwards
499compatibility @file{C:/} will be used instead if a @file{.emacs} file
500is found there.
501@item HOSTNAME
502The name of the machine that Emacs is running on.
503@item INCPATH
504A colon-separated list of directories. Used by the @code{complete} package
505to search for files.
506@item INFOPATH
507A colon-separated list of directories in which to search for Info files.
508@item LC_ALL
509@itemx LC_COLLATE
510@itemx LC_CTYPE
511@itemx LC_MESSAGES
512@itemx LC_MONETARY
513@itemx LC_NUMERIC
514@itemx LC_TIME
515@itemx LANG
516The user's preferred locale. The locale has six categories, specified
517by the environment variables @env{LC_COLLATE} for sorting,
518@env{LC_CTYPE} for character encoding, @env{LC_MESSAGES} for system
519messages, @env{LC_MONETARY} for monetary formats, @env{LC_NUMERIC} for
520numbers, and @env{LC_TIME} for dates and times. If one of these
521variables is not set, the category defaults to the value of the
522@env{LANG} environment variable, or to the default @samp{C} locale if
523@env{LANG} is not set. But if @env{LC_ALL} is specified, it overrides
524the settings of all the other locale environment variables.
525
526On MS-Windows, if @env{LANG} is not already set in the environment
527when Emacs starts, Emacs sets it based on the system-wide default
528language, which you can set in the @samp{Regional Settings} Control Panel
529on some versions of MS-Windows.
530
531The value of the @env{LC_CTYPE} category is
532matched against entries in @code{locale-language-names},
533@code{locale-charset-language-names}, and
534@code{locale-preferred-coding-systems}, to select a default language
535environment and coding system. @xref{Language Environments}.
536@item LOGNAME
537The user's login name. See also @env{USER}.
538@item MAIL
539The name of your system mail inbox.
540@item MH
541Name of setup file for the mh system. (The default is @file{~/.mh_profile}.)
542@item NAME
543Your real-world name.
544@item NNTPSERVER
545The name of the news server. Used by the mh and Gnus packages.
546@item ORGANIZATION
547The name of the organization to which you belong. Used for setting the
548`Organization:' header in your posts from the Gnus package.
549@item PATH
550A colon-separated list of directories in which executables reside. This
551is used to initialize the Emacs Lisp variable @code{exec-path}.
552@item PWD
553If set, this should be the default directory when Emacs was started.
554@item REPLYTO
555If set, this specifies an initial value for the variable
556@code{mail-default-reply-to}. @xref{Mail Headers}.
557@item SAVEDIR
558The name of a directory in which news articles are saved by default.
559Used by the Gnus package.
560@item SHELL
561The name of an interpreter used to parse and execute programs run from
562inside Emacs.
563@item SMTPSERVER
564The name of the outgoing mail server. Used by the SMTP library
565(@pxref{Top,,,smtpmail,Sending mail via SMTP}).
566@cindex background mode, on @command{xterm}
567@item TERM
568The type of the terminal that Emacs is using. This variable must be
569set unless Emacs is run in batch mode. On MS-DOS, it defaults to
570@samp{internal}, which specifies a built-in terminal emulation that
571handles the machine's own display. If the value of @env{TERM} indicates
572that Emacs runs in non-windowed mode from @command{xterm} or a similar
573terminal emulator, the background mode defaults to @samp{light}, and
574Emacs will choose colors that are appropriate for a light background.
575@item TERMCAP
576The name of the termcap library file describing how to program the
577terminal specified by the @env{TERM} variable. This defaults to
578@file{/etc/termcap}.
579@item TMPDIR
580Used by the Emerge package as a prefix for temporary files.
581@item TZ
582This specifies the current time zone and possibly also daylight
583saving time information. On MS-DOS, if @env{TZ} is not set in the
584environment when Emacs starts, Emacs defines a default value as
585appropriate for the country code returned by DOS. On MS-Windows, Emacs
586does not use @env{TZ} at all.
587@item USER
588The user's login name. See also @env{LOGNAME}. On MS-DOS, this
589defaults to @samp{root}.
590@item VERSION_CONTROL
591Used to initialize the @code{version-control} variable (@pxref{Numbered Backups}).
592@end table
593
594@node Misc Variables
595@appendixsubsec Miscellaneous Variables
596
597These variables are used only on particular configurations:
598
599@table @env
600@item COMSPEC
601On MS-DOS and MS-Windows, the name of the command interpreter to use
602when invoking batch files and commands internal to the shell. On MS-DOS
603this is also used to make a default value for the @env{SHELL} environment
604variable.
605
606@item NAME
607On MS-DOS, this variable defaults to the value of the @env{USER}
608variable.
609
610@item TEMP
611@itemx TMP
612On MS-DOS and MS-Windows, these specify the name of the directory for
613storing temporary files in.
614
615@item EMACSTEST
616On MS-DOS, this specifies a file to use to log the operation of the
617internal terminal emulator. This feature is useful for submitting bug
618reports.
619
620@item EMACSCOLORS
621On MS-DOS, this specifies the screen colors. It is useful to set them
622this way, since otherwise Emacs would display the default colors
623momentarily when it starts up.
624
625The value of this variable should be the two-character encoding of the
626foreground (the first character) and the background (the second
627character) colors of the default face. Each character should be the
628hexadecimal code for the desired color on a standard PC text-mode
629display. For example, to get blue text on a light gray background,
630specify @samp{EMACSCOLORS=17}, since 1 is the code of the blue color and
6317 is the code of the light gray color.
632
633The PC display usually supports only eight background colors. However,
634Emacs switches the DOS display to a mode where all 16 colors can be used
635for the background, so all four bits of the background color are
636actually used.
637
638@item WINDOW_GFX
639Used when initializing the Sun windows system.
640
641@item PRELOAD_WINSOCK
642On MS-Windows, if you set this variable, Emacs will load and initialize
643the network library at startup, instead of waiting until the first
644time it is required.
645
646@item emacs_dir
647On MS-Windows, @env{emacs_dir} is a special environment variable, which
648indicates the full path of the directory in which Emacs is installed.
649If Emacs is installed in the standard directory structure, it
650calculates this value automatically. It is not much use setting this
651variable yourself unless your installation is non-standard, since
652unlike other environment variables, it will be overridden by Emacs at
653startup. When setting other environment variables, such as
654@env{EMACSLOADPATH}, you may find it useful to use @env{emacs_dir}
655rather than hard-coding an absolute path. This allows multiple
656versions of Emacs to share the same environment variable settings, and
657it allows you to move the Emacs installation directory, without
658changing any environment or registry settings.
659@end table
660
661@node MS-Windows Registry
662@appendixsubsec The MS-Windows System Registry
663@pindex addpm, MS-Windows installation program
664@cindex registry, setting environment variables and resources on MS-Windows
665
666Under MS-Windows, the installation program @command{addpm.exe} adds
667values for @env{emacs_dir}, @env{EMACSLOADPATH}, @env{EMACSDATA},
668@env{EMACSPATH}, @env{EMACSDOC}, @env{SHELL} and @env{TERM} to the
669@file{HKEY_LOCAL_MACHINE} section of the system registry, under
670@file{/Software/GNU/Emacs}. It does this because there is no standard
671place to set environment variables across different versions of
672Windows. Running @command{addpm.exe} is no longer strictly necessary
673in recent versions of Emacs, but if you are upgrading from an older
674version, running @command{addpm.exe} ensures that you do not have
675older registry entries from a previous installation, which may not be
676compatible with the latest version of Emacs.
677
678When Emacs starts, as well as checking the environment, it also checks
679the System Registry for those variables and for @env{HOME}, @env{LANG}
680and @env{PRELOAD_WINSOCK}.
681
682To determine the value of those variables, Emacs goes through the
683following procedure. First, the environment is checked. If the
684variable is not found there, Emacs looks for registry keys by that
685name under @file{/Software/GNU/Emacs}; first in the
686@file{HKEY_CURRENT_USER} section of the registry, and if not found
687there, in the @file{HKEY_LOCAL_MACHINE} section. Finally, if Emacs
688still cannot determine the values, compiled-in defaults are used.
689
690In addition to the environment variables above, you can also add many
691of the settings which on X belong in the @file{.Xdefaults} file
692(@pxref{X Resources}) to the @file{/Software/GNU/Emacs} registry key.
693Settings you add to the @file{HKEY_LOCAL_MACHINE} section will affect
694all users of the machine. Settings you add to the
695@file{HKEY_CURRENT_USER} section will only affect you, and will
696override machine wide settings.
697
698@node Display X
699@appendixsec Specifying the Display Name
700@cindex display name (X Window System)
701@cindex @env{DISPLAY} environment variable
702
703 The environment variable @env{DISPLAY} tells all X clients, including
704Emacs, where to display their windows. Its value is set by default
705in ordinary circumstances, when you start an X server and run jobs
706locally. Occasionally you may need to specify the display yourself; for
707example, if you do a remote login and want to run a client program
708remotely, displaying on your local screen.
709
710 With Emacs, the main reason people change the default display is to
711let them log into another system, run Emacs on that system, but have the
712window displayed at their local terminal. You might need to log in
713to another system because the files you want to edit are there, or
714because the Emacs executable file you want to run is there.
715
716 The syntax of the @env{DISPLAY} environment variable is
717@samp{@var{host}:@var{display}.@var{screen}}, where @var{host} is the
718host name of the X Window System server machine, @var{display} is an
719arbitrarily-assigned number that distinguishes your server (X terminal)
720from other servers on the same machine, and @var{screen} is a
721rarely-used field that allows an X server to control multiple terminal
722screens. The period and the @var{screen} field are optional. If
723included, @var{screen} is usually zero.
724
725 For example, if your host is named @samp{glasperle} and your server is
726the first (or perhaps the only) server listed in the configuration, your
727@env{DISPLAY} is @samp{glasperle:0.0}.
728
729 You can specify the display name explicitly when you run Emacs, either
730by changing the @env{DISPLAY} variable, or with the option @samp{-d
731@var{display}} or @samp{--display=@var{display}}. Here is an example:
732
733@smallexample
734emacs --display=glasperle:0 &
735@end smallexample
736
737 You can inhibit the direct use of the window system and GUI with the
738@samp{-nw} option. It tells Emacs to display using ordinary @acronym{ASCII} on
739its controlling terminal. This is also an initial option.
740
741 Sometimes, security arrangements prevent a program on a remote system
742from displaying on your local system. In this case, trying to run Emacs
743produces messages like this:
744
745@smallexample
746Xlib: connection to "glasperle:0.0" refused by server
747@end smallexample
748
749@noindent
750You might be able to overcome this problem by using the @command{xhost}
751command on the local system to give permission for access from your
752remote machine.
753
754@node Font X
755@appendixsec Font Specification Options
756@cindex font name (X Window System)
757
758 By default, Emacs displays text in a twelve point Courier font (when
759using X). You can specify a different font on your command line
760through the option @samp{-fn @var{name}} (or @samp{--font}, which is
761an alias for @samp{-fn}).
762
763@table @samp
764@item -fn @var{name}
765@opindex -fn
766@itemx --font=@var{name}
767@opindex --font
768@cindex specify default font from the command line
769Use font @var{name} as the default font.
770@end table
771
772 Under X, each font has a long name which consists of fourteen words
773or numbers, separated by dashes. Some fonts also have shorter
774nicknames. For instance, @samp{9x15} is such a nickname. This font
775makes each character nine pixels wide and fifteen pixels high. You
776can use either kind of name. Case is insignificant in both kinds.
777You can use wildcard patterns for the font name; then Emacs lets X
778choose one of the fonts that match the pattern. The wildcard
779character @samp{*} matches any sequence of characters (including none)
780and @samp{?} matches any single character. However, matching is
781implementation-dependent, and can be inaccurate when wildcards match
782dashes in a long name. For reliable results, supply all 14 dashes and
783use wildcards only within a field. Here is an example, which happens
784to specify the font whose nickname is @samp{6x13}:
785
786@smallexample
787emacs -fn \
788 "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1" &
789@end smallexample
790
791@noindent
792You can also specify the font in your @file{.Xdefaults} file:
793
794@smallexample
795emacs.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
796@end smallexample
797
798 Note that if you use a wildcard pattern on the command line, you
799need to enclose it in single or double quotes, to prevent the shell
800from accidentally expanding it into a list of file names. On the
801other hand, you should not quote the name in the @file{.Xdefaults}
802file.
803
804The default font used by Emacs (under X) is:
805
806@smallexample
807-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1
808@end smallexample
809
810 A long font name has the following form:
811
812@smallexample
813-@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{}
814@dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{registry}-@var{encoding}
815@end smallexample
816
817@table @var
818@item maker
819This is the name of the font manufacturer.
820@item family
821This is the name of the font family---for example, @samp{courier}.
822@item weight
823This is normally @samp{bold}, @samp{medium} or @samp{light}. Other
824words may appear here in some font names.
825@item slant
826This is @samp{r} (roman), @samp{i} (italic), @samp{o} (oblique),
827@samp{ri} (reverse italic), or @samp{ot} (other).
828@item widthtype
829This is normally @samp{condensed}, @samp{extended}, @samp{semicondensed}
830or @samp{normal}. Other words may appear here in some font names.
831@item style
832This is an optional additional style name. Usually it is empty---most
833long font names have two hyphens in a row at this point.
834@item pixels
835This is the font height, in pixels.
836@item height
837This is the font height on the screen, measured in tenths of a printer's
838point---approximately 1/720 of an inch. In other words, it is the point
839size of the font, times ten. For a given vertical resolution,
840@var{height} and @var{pixels} are proportional; therefore, it is common
841to specify just one of them and use @samp{*} for the other.
842@item horiz
843This is the horizontal resolution, in pixels per inch, of the screen for
844which the font is intended.
845@item vert
846This is the vertical resolution, in pixels per inch, of the screen for
847which the font is intended. Normally the resolution of the fonts on
848your system is the right value for your screen; therefore, you normally
849specify @samp{*} for this and @var{horiz}.
850@item spacing
851This is @samp{m} (monospace), @samp{p} (proportional) or @samp{c}
852(character cell).
853@item width
854This is the average character width, in pixels, multiplied by ten.
855@item registry
856@itemx encoding
857These together make up the X font character set that the font depicts.
858(X font character sets are not the same as Emacs charsets, but they
859are solutions for the same problem.) You can use the
860@command{xfontsel} program to check which choices you have. However,
861normally you should use @samp{iso8859} for @var{registry} and @samp{1}
862for @var{encoding}.
863@end table
864
865@cindex listing system fonts
866 You will probably want to use a fixed-width default font---that is,
867a font in which all characters have the same width. Any font with
868@samp{m} or @samp{c} in the @var{spacing} field of the long name is a
869fixed-width font. Here's how to use the @command{xlsfonts} program to
870list all the fixed-width fonts available on your system:
871
872@example
873xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+"
874xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*'
875xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*'
876@end example
877
878@noindent
879To see what a particular font looks like, use the @command{xfd} command.
880For example:
881
882@example
883xfd -fn 6x13
884@end example
885
886@noindent
887displays the entire font @samp{6x13}.
888
889 While running Emacs, you can set the font of the current frame
890(@pxref{Frame Parameters}) or for a specific kind of text
891(@pxref{Faces}).
892
893@node Colors
894@appendixsec Window Color Options
895@cindex color of window, from command line
896@cindex text colors, from command line
897
898@findex list-colors-display
899@cindex available colors
900 On a color display, you can specify which color to use for various
901parts of the Emacs display. To find out what colors are available on
902your system, type @kbd{M-x list-colors-display}, or press
903@kbd{C-Mouse-2} and select @samp{Display Colors} from the pop-up menu.
904(A particular window system might support many more colors, but the
905list displayed by @code{list-colors-display} shows their portable
906subset that can be safely used on any display supported by Emacs.)
907If you do not specify colors, on windowed displays the default for the
908background is white and the default for all other colors is black. On a
909monochrome display, the foreground is black, the background is white,
910and the border is gray if the display supports that. On terminals, the
911background is usually black and the foreground is white.
912
913 Here is a list of the command-line options for specifying colors:
914
915@table @samp
916@item -fg @var{color}
917@opindex -fg
918@itemx --foreground-color=@var{color}
919@opindex --foreground-color
920@cindex foreground color, command-line argument
921Specify the foreground color. @var{color} should be a standard color
922name, or a numeric specification of the color's red, green, and blue
923components as in @samp{#4682B4} or @samp{RGB:46/82/B4}.
924@item -bg @var{color}
925@opindex -bg
926@itemx --background-color=@var{color}
927@opindex --background-color
928@cindex background color, command-line argument
929Specify the background color.
930@item -bd @var{color}
931@opindex -bd
932@itemx --border-color=@var{color}
933@opindex --border-color
934@cindex border color, command-line argument
935Specify the color of the border of the X window.
936@item -cr @var{color}
937@opindex -cr
938@itemx --cursor-color=@var{color}
939@opindex --cursor-color
940@cindex cursor color, command-line argument
941Specify the color of the Emacs cursor which indicates where point is.
942@item -ms @var{color}
943@opindex -ms
944@itemx --mouse-color=@var{color}
945@opindex --mouse-color
946@cindex mouse pointer color, command-line argument
947Specify the color for the mouse cursor when the mouse is in the Emacs window.
948@item -r
949@opindex -r
950@itemx -rv
951@opindex -rv
952@itemx --reverse-video
953@opindex --reverse-video
954@cindex reverse video, command-line argument
955Reverse video---swap the foreground and background colors.
956@item --color=@var{mode}
957@opindex --color
958@cindex standard colors on a character terminal
959@cindex override character terminal color support
960For a character terminal only, specify the mode of color support.
961This option is intended for overriding the number of supported colors
962that the character terminal advertises in its @code{termcap} or
963@code{terminfo} database. The parameter @var{mode} can be one of the
964following:
965@table @samp
966@item never
967@itemx no
968Don't use colors even if the terminal's capabilities specify color
969support.
970@item default
971@itemx auto
972Same as when @option{--color} is not used at all: Emacs detects at
973startup whether the terminal supports colors, and if it does, turns on
974colored display.
975@item always
976@itemx yes
977@itemx ansi8
978Turn on the color support unconditionally, and use color commands
979specified by the ANSI escape sequences for the 8 standard colors.
980@item @var{num}
981Use color mode for @var{num} colors. If @var{num} is -1, turn off
982color support (equivalent to @samp{never}); if it is 0, use the
983default color support for this terminal (equivalent to @samp{auto});
984otherwise use an appropriate standard mode for @var{num} colors.
985Depending on your terminal's capabilities, Emacs might be able to turn
986on a color mode for 8, 16, 88, or 256 as the value of @var{num}. If
987there is no mode that supports @var{num} colors, Emacs acts as if
988@var{num} were 0, i.e.@: it uses the terminal's default color support
989mode.
990@end table
991If @var{mode} is omitted, it defaults to @var{ansi8}.
992@end table
993
994 For example, to use a coral mouse cursor and a slate blue text cursor,
995enter:
996
997@example
998emacs -ms coral -cr 'slate blue' &
999@end example
1000
1001 You can reverse the foreground and background colors through the
1002@samp{-rv} option or with the X resource @samp{reverseVideo}.
1003
1004 The @samp{-fg}, @samp{-bg}, and @samp{-rv} options function on
1005text-only terminals as well as on graphical displays.
1006
1007@node Window Size X
1008@appendixsec Options for Window Size and Position
1009@cindex geometry of Emacs window
1010@cindex position and size of Emacs frame
1011@cindex width and height of Emacs frame
1012@cindex specifying fullscreen for Emacs frame
1013
1014 Here is a list of the command-line options for specifying size and
1015position of the initial Emacs frame:
1016
1017@table @samp
1018@item -g @var{width}x@var{height}@r{[@{}+-@r{@}}@var{xoffset}@r{@{}+-@r{@}}@var{yoffset}@r{]]}
1019@opindex -g
1020@itemx --geometry=@var{width}x@var{height}@r{[@{}+-@r{@}}@var{xoffset}@r{@{}+-@r{@}}@var{yoffset}@r{]]}
1021@opindex --geometry
1022@cindex geometry, command-line argument
1023Specify the size @var{width} and @var{height} (measured in character
1024columns and lines), and positions @var{xoffset} and @var{yoffset}
1025(measured in pixels). The @var{width} and @var{height} parameters
1026apply to all frames, whereas @var{xoffset} and @var{yoffset} only to
1027the initial frame.
1028
1029@item -fs
1030@opindex -fs
1031@itemx --fullscreen
1032@opindex --fullscreen
1033@cindex fullscreen, command-line argument
1034Specify that width and height shall be the size of the screen.
1035
1036@item -fh
1037@opindex -fh
1038@itemx --fullheight
1039@opindex --fullheight
1040@cindex fullheight, command-line argument
1041Specify that the height shall be the height of the screen.
1042
1043@item -fw
1044@opindex -fw
1045@itemx --fullwidth
1046@opindex --fullwidth
1047@cindex fullwidth, command-line argument
1048Specify that the width shall be the width of the screen.
1049@end table
1050
1051
1052@noindent
1053In the @samp{--geometry} option, @code{@r{@{}+-@r{@}}} means either a plus
1054 sign or a minus sign. A plus
1055sign before @var{xoffset} means it is the distance from the left side of
1056the screen; a minus sign means it counts from the right side. A plus
1057sign before @var{yoffset} means it is the distance from the top of the
1058screen, and a minus sign there indicates the distance from the bottom.
1059The values @var{xoffset} and @var{yoffset} may themselves be positive or
1060negative, but that doesn't change their meaning, only their direction.
1061
1062 Emacs uses the same units as @command{xterm} does to interpret the geometry.
1063The @var{width} and @var{height} are measured in characters, so a large font
1064creates a larger frame than a small font. (If you specify a proportional
1065font, Emacs uses its maximum bounds width as the width unit.) The
1066@var{xoffset} and @var{yoffset} are measured in pixels.
1067
1068 You do not have to specify all of the fields in the geometry
1069specification. If you omit both @var{xoffset} and @var{yoffset}, the
1070window manager decides where to put the Emacs frame, possibly by
1071letting you place it with the mouse. For example, @samp{164x55}
1072specifies a window 164 columns wide, enough for two ordinary width
1073windows side by side, and 55 lines tall.
1074
1075 The default width for Emacs is 80 characters and the default height is
107640 lines. You can omit either the width or the height or both. If
1077you start the geometry with an integer, Emacs interprets it as the
1078width. If you start with an @samp{x} followed by an integer, Emacs
1079interprets it as the height. Thus, @samp{81} specifies just the width;
1080@samp{x45} specifies just the height.
1081
1082 If you start with @samp{+} or @samp{-}, that introduces an offset,
1083which means both sizes are omitted. Thus, @samp{-3} specifies the
1084@var{xoffset} only. (If you give just one offset, it is always
1085@var{xoffset}.) @samp{+3-3} specifies both the @var{xoffset} and the
1086@var{yoffset}, placing the frame near the bottom left of the screen.
1087
1088 You can specify a default for any or all of the fields in
1089@file{.Xdefaults} file, and then override selected fields with a
1090@samp{--geometry} option.
1091
1092 Since the mode line and the echo area occupy the last 2 lines of the
1093frame, the height of the initial text window is 2 less than the height
1094specified in your geometry. In non-X-toolkit versions of Emacs, the
1095menu bar also takes one line of the specified number. But in the X
1096toolkit version, the menu bar is additional and does not count against
1097the specified height. The tool bar, if present, is also additional.
1098
1099 Enabling or disabling the menu bar or tool bar alters the amount of
1100space available for ordinary text. Therefore, if Emacs starts up with
1101a tool bar (which is the default), and handles the geometry
1102specification assuming there is a tool bar, and then your
1103@file{~/.emacs} file disables the tool bar, you will end up with a
1104frame geometry different from what you asked for. To get the intended
1105size with no tool bar, use an X resource to specify ``no tool bar''
1106(@pxref{Table of Resources}); then Emacs will already know there's no
1107tool bar when it processes the specified geometry.
1108
1109 When using one of @samp{--fullscreen}, @samp{--fullwidth} or
1110@samp{--fullheight} there may be some space around the frame
1111anyway. That is because Emacs rounds the sizes so they are an
1112even number of character heights and widths.
1113
1114 Some window managers have options that can make them ignore both
1115program-specified and user-specified positions (sawfish is one).
1116If these are set, Emacs fails to position the window correctly.
1117
1118@node Borders X
1119@appendixsec Internal and External Borders
1120@cindex borders (X Window System)
1121
1122 An Emacs frame has an internal border and an external border. The
1123internal border is an extra strip of the background color around the
1124text portion of the frame. Emacs itself draws the internal border.
1125The external border is added by the window manager outside the frame;
1126depending on the window manager you use, it may contain various boxes
1127you can click on to move or iconify the window.
1128
1129@table @samp
1130@item -ib @var{width}
1131@opindex -ib
1132@itemx --internal-border=@var{width}
1133@opindex --internal-border
1134@cindex internal border width, command-line argument
1135Specify @var{width} as the width of the internal border (between the text
1136and the main border), in pixels.
1137
1138@item -bw @var{width}
1139@opindex -bw
1140@itemx --border-width=@var{width}
1141@opindex --border-width
1142@cindex main border width, command-line argument
1143Specify @var{width} as the width of the main border, in pixels.
1144@end table
1145
1146 When you specify the size of the frame, that does not count the
1147borders. The frame's position is measured from the outside edge of the
1148external border.
1149
1150 Use the @samp{-ib @var{n}} option to specify an internal border
1151@var{n} pixels wide. The default is 1. Use @samp{-bw @var{n}} to
1152specify the width of the external border (though the window manager may
1153not pay attention to what you specify). The default width of the
1154external border is 2.
1155
1156@node Title X
1157@appendixsec Frame Titles
1158
1159 An Emacs frame may or may not have a specified title. The frame
1160title, if specified, appears in window decorations and icons as the
1161name of the frame. If an Emacs frame has no specified title, the
1162default title has the form @samp{@var{invocation-name}@@@var{machine}}
1163(if there is only one frame) or the selected window's buffer name (if
1164there is more than one frame).
1165
1166 You can specify a title for the initial Emacs frame with a command
1167line option:
1168
1169@table @samp
1170@item -T @var{title}
1171@opindex -T
1172@itemx --title=@var{title}
1173@opindex --title
1174@cindex frame title, command-line argument
1175Specify @var{title} as the title for the initial Emacs frame.
1176@end table
1177
1178 The @samp{--name} option (@pxref{Resources}) also specifies the title
1179for the initial Emacs frame.
1180
1181@node Icons X
1182@appendixsec Icons
1183@cindex icons (X Window System)
1184
1185 Most window managers allow you to ``iconify'' a frame, removing
1186it from sight, and leaving a small, distinctive ``icon'' window in its
1187place. Clicking on the icon window makes the frame itself appear again.
1188If you have many clients running at once, you can avoid cluttering up
1189the screen by iconifying most of the clients.
1190
1191@table @samp
1192@item -nbi
1193@opindex -nbi
1194@itemx --no-bitmap-icon
1195@opindex --no-bitmap-icon
1196@cindex Emacs icon, a gnu
1197Do not use a picture of a gnu as the Emacs icon.
1198
1199@item -iconic
1200@opindex --iconic
1201@itemx --iconic
1202@cindex start iconified, command-line argument
1203Start Emacs in iconified state.
1204@end table
1205
1206 By default Emacs uses an icon window containing a picture of the GNU gnu.
1207The @samp{-nbi} or @samp{--no-bitmap-icon} option tells Emacs to let the
1208window manager choose what sort of icon to use---usually just a small
1209rectangle containing the frame's title.
1210
1211 The @samp{-iconic} option tells Emacs to begin running as an icon,
1212rather than showing a frame right away. In this situation, the icon
1213is the only indication that Emacs has started; the text frame doesn't
1214appear until you deiconify it.
1215
1216@node Misc X
1217@appendixsec Other Display Options
1218
1219@table @samp
1220@item -hb
1221@opindex -hb
1222@itemx --horizontal-scroll-bars
1223@opindex --horizontal-scroll-bars
1224@c @cindex horizontal scroll bars, command-line argument
1225Enable horizontal scroll bars. Since horizontal scroll bars
1226are not yet implemented, this actually does nothing.
1227
1228@item -vb
1229@opindex -vb
1230@itemx --vertical-scroll-bars
1231@opindex --vertical-scroll-bars
1232@cindex vertical scroll bars, command-line argument
1233Enable vertical scroll bars.
1234
1235@item -lsp @var{pixels}
1236@opindex -lsp
1237@itemx --line-spacing=@var{pixels}
1238@opindex --line-spacing
1239@cindex line spacing, command-line argument
1240Specify @var{pixels} as additional space to put between lines, in pixels.
1241
1242@item -nbc
1243@opindex -nbc
1244@itemx --no-blinking-cursor
1245@opindex --no-blinking-cursor
1246@cindex blinking cursor disable, command-line argument
1247Disable the blinking cursor on graphical displays.
1248
1249@item -D
1250@opindex -D
1251@itemx --basic-display
1252@opindex --basic-display
1253Disable the menu-bar, the tool-bar, the scroll-bars, and tool tips,
1254and turn off the blinking cursor. This can be useful for making a
1255test case that simplifies debugging of display problems.
1256@end table
1257
1258 The @samp{--xrm} option (@pxref{Resources}) specifies additional
1259X resource values.
1260
1261@ignore
1262 arch-tag: fffecd9e-7329-4a51-a3cc-dd4a9889340e
1263@end ignore
diff --git a/doc/emacs/commands.texi b/doc/emacs/commands.texi
new file mode 100644
index 00000000000..d2daffe00bb
--- /dev/null
+++ b/doc/emacs/commands.texi
@@ -0,0 +1,294 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@iftex
6@chapter Characters, Keys and Commands
7
8 This chapter explains the character sets used by Emacs for input
9commands and for the contents of files, and the fundamental concepts of
10@dfn{keys} and @dfn{commands}, whereby Emacs interprets your keyboard
11and mouse input.
12@end iftex
13
14@ifnottex
15@raisesections
16@end ifnottex
17
18@node User Input, Keys, Screen, Top
19@section Kinds of User Input
20@cindex input with the keyboard
21@cindex keyboard input
22@cindex character set (keyboard)
23@cindex @acronym{ASCII}
24@cindex C-
25@cindex Control
26@cindex control characters
27
28 GNU Emacs is designed for use with keyboard commands because that is
29the most efficient way to edit. You can do editing with the mouse, as
30in other editors, and you can give commands with the menu bar and tool
31bar, and scroll with the scroll bar. But if you keep on editing that
32way, you won't get the benefits of Emacs. Therefore, this manual
33documents primarily how to edit with the keyboard. You can force
34yourself to practice using the keyboard by using the shell command
35@samp{emacs -nw} to start Emacs, so that the mouse won't work.
36
37 Emacs uses an extension of the @acronym{ASCII} character set for
38keyboard input; it also accepts non-character input events including
39function keys and mouse button actions.
40
41 @acronym{ASCII} consists of 128 character codes. Some of these codes are
42assigned graphic symbols such as @samp{a} and @samp{=}; the rest are
43control characters, such as @kbd{Control-a} (usually written @kbd{C-a}
44for short). @kbd{C-a} gets its name from the fact that you type it by
45holding down the @key{CTRL} key while pressing @kbd{a}.
46
47 Some @acronym{ASCII} control characters have special names, and most
48terminals have special keys you can type them with: for example,
49@key{RET}, @key{TAB}, @key{DEL} and @key{ESC}. The space character is
50usually known as @key{SPC}, even though strictly speaking it is a
51graphic character that is blank.
52
53 Emacs extends the @acronym{ASCII} character set with thousands more printing
54characters (@pxref{International}), additional control characters, and a
55few more modifiers that can be combined with any character.
56
57 On @acronym{ASCII} terminals, there are only 32 possible control characters.
58These are the control variants of letters and @samp{@@[]\^_}. In
59addition, the shift key is meaningless with control characters:
60@kbd{C-a} and @kbd{C-A} are the same character, and Emacs cannot
61distinguish them.
62
63 The Emacs character set has room for control variants of all
64printing characters, and distinguishes @kbd{C-A} from @kbd{C-a}.
65Graphical terminals make it possible to enter all these characters.
66For example, @kbd{C--} (that's Control-Minus) and @kbd{C-5} are
67meaningful Emacs commands on a graphical terminal.
68
69 Another Emacs character-set extension is additional modifier bits.
70Only one modifier bit is commonly used; it is called Meta. Every
71character has a Meta variant; examples include @kbd{Meta-a} (normally
72written @kbd{M-a}, for short), @kbd{M-A} (different from @kbd{M-a},
73but they are normally equivalent in Emacs), @kbd{M-@key{RET}}, and
74@kbd{M-C-a}. That last means @kbd{a} with both the @key{CTRL} and
75@key{META} modifiers. We usually write it as @kbd{C-M-a} rather than
76@kbd{M-C-a}, for reasons of tradition.
77
78@cindex Meta
79@cindex M-
80@cindex @key{ESC} replacing @key{META} key
81 Some terminals have a @key{META} key, and allow you to type Meta
82characters by holding this key down. Thus, you can type @kbd{Meta-a}
83by holding down @key{META} and pressing @kbd{a}. The @key{META} key
84works much like the @key{SHIFT} key. In fact, this key is more often
85labeled @key{ALT} or @key{EDIT}, instead of @key{META}; on a Sun
86keyboard, it may have a diamond on it.
87
88 If there is no @key{META} key, you can still type Meta characters
89using two-character sequences starting with @key{ESC}. Thus, you can
90enter @kbd{M-a} by typing @kbd{@key{ESC} a}. You can enter
91@kbd{C-M-a} by typing @kbd{@key{ESC} C-a}. Unlike @key{META}, which
92modifies other characters, @key{ESC} is a separate character. You
93don't hold down @key{ESC} while typing the next character; instead,
94you press it and release it, then you enter the next character.
95@key{ESC} is allowed on terminals with @key{META} keys, too, in case
96you have formed a habit of using it.
97
98 Emacs defines several other modifier keys that can be applied to any
99input character. These are called @key{SUPER}, @key{HYPER} and
100@key{ALT}. We write @samp{s-}, @samp{H-} and @samp{A-} to say that a
101character uses these modifiers. Thus, @kbd{s-H-C-x} is short for
102@kbd{Super-Hyper-Control-x}. Not all graphical terminals actually
103provide keys for these modifier flags---in fact, many terminals have a
104key labeled @key{ALT} which is really a @key{META} key. The standard
105key bindings of Emacs do not include any characters with these
106modifiers. But you can assign them meanings of your own by
107customizing Emacs.
108
109 If your keyboard lacks one of these modifier keys, you can enter it
110using @kbd{C-x @@}: @kbd{C-x @@ h} adds the ``hyper'' flag to the next
111character, @kbd{C-x @@ s} adds the ``super'' flag, and @kbd{C-x @@ a}
112adds the ``alt'' flag. For instance, @kbd{C-x @@ h C-a} is a way to
113enter @kbd{Hyper-Control-a}. (Unfortunately there is no way to add
114two modifiers by using @kbd{C-x @@} twice for the same character,
115because the first one goes to work on the @kbd{C-x}.)
116
117 Keyboard input includes keyboard keys that are not characters at
118all, such as function keys and arrow keys. Mouse buttons are also not
119characters. However, you can modify these events with the modifier
120keys @key{CTRL}, @key{META}, @key{SUPER}, @key{HYPER} and @key{ALT},
121just like keyboard characters.
122
123@cindex input event
124 Input characters and non-character inputs are collectively called
125@dfn{input events}. @xref{Input Events,,, elisp, The Emacs Lisp
126Reference Manual}, for the full Lisp-level details. If you are not
127doing Lisp programming, but simply want to redefine the meaning of
128some characters or non-character events, see @ref{Customization}.
129
130 @acronym{ASCII} terminals cannot really send anything to the computer except
131@acronym{ASCII} characters. These terminals use a sequence of characters to
132represent each function key. But that is invisible to the Emacs user,
133because the keyboard input routines catch these special sequences
134and convert them to function key events before any other part of Emacs
135gets to see them.
136
137@cindex keys stolen by window manager
138@cindex window manager, keys stolen by
139 On graphical displays, the window manager is likely to block the
140character @kbd{Meta-@key{TAB}} before Emacs can see it. It may also
141block @kbd{Meta-@key{SPC}}, @kbd{C-M-d} and @kbd{C-M-l}. If you have
142these problems, we recommend that you customize your window manager to
143turn off those commands, or put them on key combinations that Emacs
144does not use.
145
146@node Keys, Commands, User Input, Top
147@section Keys
148
149@cindex key sequence
150@cindex key
151 A @dfn{key sequence} (@dfn{key}, for short) is a sequence of input
152events that is meaningful as a unit---a ``single command.'' Some
153Emacs command sequences are invoked by just one character or one
154event; for example, just @kbd{C-f} moves forward one character in the
155buffer. But Emacs also has commands that take two or more events to
156invoke.
157
158@cindex complete key
159@cindex prefix key
160 If a sequence of events is enough to invoke a command, it is a
161@dfn{complete key}. Examples of complete keys include @kbd{C-a},
162@kbd{X}, @key{RET}, @key{NEXT} (a function key), @key{DOWN} (an arrow
163key), @kbd{C-x C-f}, and @kbd{C-x 4 C-f}. If it isn't long enough to be
164complete, we call it a @dfn{prefix key}. The above examples show that
165@kbd{C-x} and @kbd{C-x 4} are prefix keys. Every key sequence is either
166a complete key or a prefix key.
167
168 Most single characters constitute complete keys in the standard Emacs
169command bindings. A few of them are prefix keys. A prefix key combines
170with the following input event to make a longer key sequence, which may
171itself be complete or a prefix. For example, @kbd{C-x} is a prefix key,
172so @kbd{C-x} and the next input event combine to make a two-event
173key sequence. Most of these key sequences are complete keys, including
174@kbd{C-x C-f} and @kbd{C-x b}. A few, such as @kbd{C-x 4} and @kbd{C-x
175r}, are themselves prefix keys that lead to three-event key
176sequences. There's no limit to the length of a key sequence, but in
177practice people rarely use sequences longer than four events.
178
179 You can't add input events onto a complete key. For example, the
180two-event sequence @kbd{C-f C-k} is not a key, because the @kbd{C-f}
181is a complete key in itself. It's impossible to give @kbd{C-f C-k} an
182independent meaning as a command. @kbd{C-f C-k} is two key sequences,
183not one.@refill
184
185 All told, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h},
186@kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x
187n}, @w{@kbd{C-x r}}, @kbd{C-x v}, @kbd{C-x 4}, @kbd{C-x 5}, @kbd{C-x
1886}, @key{ESC}, @kbd{M-g}, and @kbd{M-o}. (@key{F1} and @key{F2} are
189aliases for @kbd{C-h} and @kbd{C-x 6}.) This list is not cast in stone;
190it describes the standard key bindings. If you customize Emacs, you can make
191new prefix keys, or eliminate some of the standard ones (not
192recommended for most users). @xref{Key Bindings}.
193
194 If you make or eliminate prefix keys, that changes the set of
195possible key sequences. For example, if you redefine @kbd{C-f} as a
196prefix, @kbd{C-f C-k} automatically becomes a key (complete, unless
197you define that too as a prefix). Conversely, if you remove the
198prefix definition of @kbd{C-x 4}, then @kbd{C-x 4 f} and @kbd{C-x 4
199@var{anything}} are no longer keys.
200
201 Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key
202displays a list of the commands starting with that prefix. There are
203a few prefix keys after which @kbd{C-h} does not work---for historical
204reasons, they define other meanings for @kbd{C-h} which are painful to
205change. @key{F1} works after all prefix keys.
206
207@node Commands, Text Characters, Keys, Top
208@section Keys and Commands
209
210@cindex binding
211@cindex command
212@cindex function definition
213 This manual is full of passages that tell you what particular keys
214do. But Emacs does not assign meanings to keys directly. Instead,
215Emacs assigns meanings to named @dfn{commands}, and then gives keys
216their meanings by @dfn{binding} them to commands.
217
218 Every command has a name chosen by a programmer. The name is
219usually made of a few English words separated by dashes; for example,
220@code{next-line} or @code{forward-word}. A command also has a
221@dfn{function definition} which is a Lisp program; this is how the
222command does its work. In Emacs Lisp, a command is a Lisp function with
223special options to read arguments and for interactive use. For more
224information on commands and functions, see @ref{What Is a Function,,
225What Is a Function, elisp, The Emacs Lisp Reference Manual}. (The
226definition here is simplified slightly.)
227
228 The bindings between keys and commands are recorded in tables called
229@dfn{keymaps}. @xref{Keymaps}.
230
231 When we say that ``@kbd{C-n} moves down vertically one line'' we are
232glossing over a subtle distinction that is irrelevant in ordinary use,
233but vital for Emacs customization. The command @code{next-line} does
234a vertical move downward. @kbd{C-n} has this effect @emph{because} it
235is bound to @code{next-line}. If you rebind @kbd{C-n} to the command
236@code{forward-word}, @kbd{C-n} will move forward one word instead.
237Rebinding keys is an important method of customization.
238
239 In the rest of this manual, we usually ignore this distinction to
240keep things simple. We will often speak of keys like @kbd{C-n} as
241commands, even though strictly speaking the key is bound to a command.
242Usually we state the name of the command which really does the work in
243parentheses after mentioning the key that runs it. For example, we
244will say that ``The command @kbd{C-n} (@code{next-line}) moves point
245vertically down,'' meaning that the command @code{next-line} moves
246vertically down, and the key @kbd{C-n} is normally bound to it.
247
248 Since we are discussing customization, we should tell you about
249@dfn{variables}. Often the description of a command will say, ``To
250change this, set the variable @code{mumble-foo}.'' A variable is a
251name used to store a value. Most of the variables documented in this
252manual are meant for customization: some command or other part of
253Emacs examines the variable and behaves differently according to the
254value that you set. You can ignore the information about variables
255until you are interested in customizing them. Then read the basic
256information on variables (@pxref{Variables}) and the information about
257specific variables will make sense.
258
259@node Text Characters, Entering Emacs, Commands, Top
260@section Character Set for Text
261@cindex characters (in text)
262
263 Text in Emacs buffers is a sequence of characters. In the simplest
264case, these are @acronym{ASCII} characters, each stored in one 8-bit
265byte. Both @acronym{ASCII} control characters (octal codes 000
266through 037, and 0177) and @acronym{ASCII} printing characters (codes
267040 through 0176) are allowed. The other modifier flags used in
268keyboard input, such as Meta, are not allowed in buffers.
269
270 Non-@acronym{ASCII} printing characters can also appear in buffers,
271when multibyte characters are enabled. They have character codes
272starting at 256, octal 0400, and each one is represented as a sequence
273of two or more bytes. @xref{International}. Single-byte characters
274with codes 128 through 255 can also appear in multibyte buffers.
275However, non-@acronym{ASCII} control characters cannot appear in a
276buffer.
277
278 Some @acronym{ASCII} control characters serve special purposes in text, and have
279special names. For example, the newline character (octal code 012) is
280used in the buffer to end a line, and the tab character (octal code 011)
281is used for indenting to the next tab stop column (normally every 8
282columns). @xref{Text Display}.
283
284 If you disable multibyte characters, then you can use only one
285alphabet of non-@acronym{ASCII} characters, which all fit in one byte.
286They use octal codes 0200 through 0377. @xref{Unibyte Mode}.
287
288@ifnottex
289@lowersections
290@end ifnottex
291
292@ignore
293 arch-tag: 9be43eef-d1f4-4d03-a916-c741ea713a45
294@end ignore
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
new file mode 100644
index 00000000000..d496ab84b19
--- /dev/null
+++ b/doc/emacs/custom.texi
@@ -0,0 +1,2515 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Customization, Quitting, Amusements, Top
6@chapter Customization
7@cindex customization
8
9 This chapter talks about various topics relevant to adapting the
10behavior of Emacs in ways we have anticipated.
11@iftex
12See @cite{The Emacs Lisp Reference Manual}
13@end iftex
14@ifnottex
15@xref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp
16Reference Manual},
17@end ifnottex
18for how to make more far-reaching and open-ended changes. @xref{X
19Resources}, for information on using X resources to customize Emacs.
20
21 Customization that you do within Emacs normally affects only the
22particular Emacs session that you do it in---it does not persist
23between sessions unless you save the customization in a file such as
24your init file (@file{.emacs}) that will affect future sessions.
25(@xref{Init File}.) When you tell the customization buffer to save
26customizations for future sessions, this actually works by editing
27@file{.emacs} for you.
28
29 Another means of customization is the keyboard macro, which is a
30sequence of keystrokes to be replayed with a single command.
31@xref{Keyboard Macros}, for full instruction how to record, manage, and
32replay sequences of keys.
33
34@menu
35* Minor Modes:: Each minor mode is one feature you can turn on
36 independently of any others.
37* Easy Customization:: Convenient way to browse and change settings.
38* Variables:: Many Emacs commands examine Emacs variables
39 to decide what to do; by setting variables,
40 you can control their functioning.
41* Key Bindings:: The keymaps say what command each key runs.
42 By changing them, you can "redefine keys".
43* Syntax:: The syntax table controls how words and
44 expressions are parsed.
45* Init File:: How to write common customizations in the
46 @file{.emacs} file.
47@end menu
48
49@node Minor Modes
50@section Minor Modes
51@cindex minor modes
52@cindex mode, minor
53
54 Minor modes are optional features which you can turn on or off. For
55example, Auto Fill mode is a minor mode in which @key{SPC} breaks lines
56between words as you type. All the minor modes are independent of each
57other and of the selected major mode. Most minor modes say in the mode
58line when they are enabled; for example, @samp{Fill} in the mode line means
59that Auto Fill mode is enabled.
60
61 You should append @code{-mode} to the name of a minor mode to
62produce the name of the command that turns the mode on or off. Thus,
63the command to enable or disable Auto Fill mode is called
64@code{auto-fill-mode}. These commands are usually invoked with
65@kbd{M-x}, but you can bind keys to them if you wish.
66
67 With no argument, the minor mode function turns the mode on if it
68was off, and off if it was on. This is known as @dfn{toggling}. A
69positive argument always turns the mode on, and an explicit zero
70argument or a negative argument always turns it off.
71
72 Some minor modes are global: while enabled, they affect everything
73you do in the Emacs session, in all buffers. Other minor modes are
74buffer-local; they apply only to the current buffer, so you can enable
75the mode in certain buffers and not others.
76
77 For most minor modes, the command name is also the name of a
78variable. The variable's value is non-@code{nil} if the mode is
79enabled and @code{nil} if it is disabled. Some minor-mode commands
80work by just setting the variable. For example, the command
81@code{abbrev-mode} works by setting the value of @code{abbrev-mode} as
82a variable; it is this variable that directly turns Abbrev mode on and
83off. You can directly set the variable's value instead of calling the
84mode function. For other minor modes, you need to either set the
85variable through the Customize interface or call the mode function to
86correctly enable or disable the mode. To check which of these two
87possibilities applies to a given minor mode, use @kbd{C-h v} to ask
88for documentation on the variable name.
89
90 For minor mode commands that work by just setting the minor mode
91variable, that variable provides a good way for Lisp programs to turn
92minor modes on and off; it is also useful in a file's local variables
93list (@pxref{File Variables}). But please think twice before setting
94minor modes with a local variables list, because most minor modes are
95a matter of user preference---other users editing the same file might
96not want the same minor modes you prefer.
97
98 The most useful buffer-local minor modes include Abbrev mode, Auto
99Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, Outline minor
100mode, Overwrite mode, and Binary Overwrite mode.
101
102 Abbrev mode allows you to define abbreviations that automatically expand
103as you type them. For example, @samp{amd} might expand to @samp{abbrev
104mode}. @xref{Abbrevs}, for full information.
105
106 Auto Fill mode allows you to enter filled text without breaking lines
107explicitly. Emacs inserts newlines as necessary to prevent lines from
108becoming too long. @xref{Filling}.
109
110 Auto Save mode saves the buffer contents periodically to reduce the
111amount of work you can lose in case of a crash. @xref{Auto Save}.
112
113 Enriched mode enables editing and saving of formatted text.
114@xref{Formatted Text}.
115
116 Flyspell mode automatically highlights misspelled words.
117@xref{Spelling}.
118
119 Font-Lock mode automatically highlights certain textual units found
120in programs, such as comments, strings, and function names being
121defined. This requires a display that can show multiple fonts or
122colors. @xref{Faces}.
123
124@ignore
125 ISO Accents mode makes the characters @samp{`}, @samp{'}, @samp{"},
126@samp{^}, @samp{/} and @samp{~} combine with the following letter, to
127produce an accented letter in the ISO Latin-1 character set. The
128newer and more general feature of input methods more or less
129supersedes ISO Accents mode. @xref{Unibyte Mode}.
130@end ignore
131
132 Outline minor mode provides the same facilities as the major mode
133called Outline mode; but since it is a minor mode instead, you can
134combine it with any major mode. @xref{Outline Mode}.
135
136@cindex Overwrite mode
137@cindex mode, Overwrite
138 Overwrite mode causes ordinary printing characters to replace existing
139text instead of shoving it to the right. For example, if point is in
140front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing a
141@kbd{G} changes it to @samp{FOOGAR}, instead of producing @samp{FOOGBAR}
142as usual. In Overwrite mode, the command @kbd{C-q} inserts the next
143character whatever it may be, even if it is a digit---this gives you a
144way to insert a character instead of replacing an existing character.
145
146@findex overwrite-mode
147@kindex INSERT
148 The command @code{overwrite-mode} is an exception to the rule that
149commands which toggle minor modes are normally not bound to keys: it is
150bound to the @key{INSERT} function key. This is because many other
151programs bind @key{INSERT} to similar functions.
152
153@findex binary-overwrite-mode
154 Binary Overwrite mode is a variant of Overwrite mode for editing
155binary files; it treats newlines and tabs like other characters, so that
156they overwrite other characters and can be overwritten by them.
157In Binary Overwrite mode, digits after @kbd{C-q} specify an
158octal character code, as usual.
159
160 Here are some useful minor modes that normally apply to all buffers
161at once. Since Line Number mode and Transient Mark mode can be
162enabled or disabled just by setting the value of the minor mode
163variable, you @emph{can} set them differently for particular buffers,
164by explicitly making the corresponding variable local in those
165buffers. @xref{Locals}.
166
167 Icomplete mode displays an indication of available completions when
168you are in the minibuffer and completion is active. @xref{Completion
169Options}.
170
171 Line Number mode enables continuous display in the mode line of the
172line number of point, and Column Number mode enables display of the
173column number. @xref{Mode Line}.
174
175 Scroll Bar mode gives each window a scroll bar (@pxref{Scroll Bars}).
176Menu Bar mode gives each frame a menu bar (@pxref{Menu Bars}). Both of
177these modes are enabled by default when you use the X Window System.
178
179 In Transient Mark mode, every change in the buffer contents
180``deactivates'' the mark, so that commands that operate on the region
181will get an error. This means you must either set the mark, or
182explicitly ``reactivate'' it, before each command that uses the region.
183The advantage of Transient Mark mode is that Emacs can display the
184region highlighted. @xref{Mark}.
185
186@node Easy Customization
187@section Easy Customization Interface
188
189@cindex settings
190 Emacs has many @dfn{settings} which have values that you can specify
191in order to customize various commands. Many are documented in this
192manual. Most settings are @dfn{user options}---that is to say, Lisp
193variables (@pxref{Variables})---so their names appear in the Variable
194Index (@pxref{Variable Index}). The other settings are faces and
195their attributes (@pxref{Faces}).
196
197@findex customize
198@cindex customization buffer
199 You can browse interactively through settings and change them using
200@kbd{M-x customize}. This command creates a @dfn{customization
201buffer}, which offers commands to navigate through a logically
202organized structure of the Emacs settings; you can also use it to edit
203and set their values, and to save settings permanently in your
204@file{~/.emacs} file (@pxref{Init File}).
205
206 The appearance of the example buffers in this section is typically
207different under a graphical display, since faces are then used to indicate
208buttons, links and editable fields.
209
210@menu
211* Groups: Customization Groups. How settings are classified in a structure.
212* Browsing: Browsing Custom. Browsing and searching for settings.
213* Changing a Variable:: How to edit an option's value and set the option.
214* Saving Customizations:: Specifying the file for saving customizations.
215* Face Customization:: How to edit the attributes of a face.
216* Specific Customization:: Making a customization buffer for specific
217 variables, faces, or groups.
218* Custom Themes:: How to define collections of customized options
219 that can be loaded and unloaded together.
220@end menu
221
222@node Customization Groups
223@subsection Customization Groups
224@cindex customization groups
225
226 For customization purposes, settings are organized into @dfn{groups}
227to help you find them. Groups are collected into bigger groups, all
228the way up to a master group called @code{Emacs}.
229
230 @kbd{M-x customize} creates a customization buffer that shows the
231top-level @code{Emacs} group and the second-level groups immediately
232under it. It looks like this, in part:
233
234@c we want the buffer example to all be on one page, but unfortunately
235@c that's quite a bit of text, so force all space to the bottom.
236@page
237@smallexample
238@group
239/- Emacs group: ---------------------------------------------------\
240 [State]: visible group members are all at standard values.
241 Customization of the One True Editor.
242 See also [Manual].
243
244Editing group: [Go to Group]
245Basic text editing facilities.
246
247External group: [Go to Group]
248Interfacing to external utilities.
249
250@var{more second-level groups}
251
252\- Emacs group end ------------------------------------------------/
253@end group
254@end smallexample
255
256@noindent
257This says that the buffer displays the contents of the @code{Emacs}
258group. The other groups are listed because they are its contents. But
259they are listed differently, without indentation and dashes, because
260@emph{their} contents are not included. Each group has a single-line
261documentation string; the @code{Emacs} group also has a @samp{[State]}
262line.
263
264@cindex editable fields (customization buffer)
265@cindex buttons (customization buffer)
266@cindex links (customization buffer)
267 Most of the text in the customization buffer is read-only, but it
268typically includes some @dfn{editable fields} that you can edit.
269There are also @dfn{buttons} and @dfn{links}, which do something when
270you @dfn{invoke} them. To invoke a button or a link, either click on
271it with @kbd{Mouse-1}, or move point to it and type @key{RET}.
272
273 For example, the phrase @samp{[State]} that appears in
274a second-level group is a button. It operates on the same
275customization buffer. The phrase @samp{[Go to Group]} is a kind
276of hypertext link to another group. Invoking it creates a new
277customization buffer, which shows that group and its contents.
278
279 The @code{Emacs} group includes a few settings, but mainly it
280contains other groups, which contain more groups, which contain the
281settings. By browsing the hierarchy of groups, you will eventually
282find the feature you are interested in customizing. Then you can use
283the customization buffer to set that feature's settings. You can also
284go straight to a particular group by name, using the command @kbd{M-x
285customize-group}.
286
287@node Browsing Custom
288@subsection Browsing and Searching for Options and Faces
289@findex customize-browse
290
291 @kbd{M-x customize-browse} is another way to browse the available
292settings. This command creates a special customization buffer which
293shows only the names of groups and settings, and puts them in a
294structure.
295
296 In this buffer, you can show the contents of a group by invoking the
297@samp{[+]} button. When the group contents are visible, this button
298changes to @samp{[-]}; invoking that hides the group contents again.
299
300 Each group or setting in this buffer has a link which says
301@samp{[Group]}, @samp{[Option]} or @samp{[Face]}. Invoking this link
302creates an ordinary customization buffer showing just that group and
303its contents, just that user option, or just that face. This is the
304way to change settings that you find with @kbd{M-x customize-browse}.
305
306 If you can guess part of the name of the settings you are interested
307in, @kbd{M-x customize-apropos} is another way to search for settings.
308However, unlike @code{customize} and @code{customize-browse},
309@code{customize-apropos} can only find groups and settings that are
310loaded in the current Emacs session. @xref{Specific Customization,,
311Customizing Specific Items}.
312
313@node Changing a Variable
314@subsection Changing a Variable
315
316 Here is an example of what a variable (a user option) looks like in
317the customization buffer:
318
319@smallexample
320Kill Ring Max: [Hide Value] 60
321 [State]: STANDARD.
322Maximum length of kill ring before oldest elements are thrown away.
323@end smallexample
324
325 The text following @samp{[Hide Value]}, @samp{60} in this case, indicates
326the current value of the variable. If you see @samp{[Show Value]} instead of
327@samp{[Hide Value]}, it means that the value is hidden; the customization
328buffer initially hides values that take up several lines. Invoke
329@samp{[Show Value]} to show the value.
330
331 The line after the variable name indicates the @dfn{customization
332state} of the variable: in the example above, it says you have not
333changed the option yet. The @samp{[State]} button at the beginning of
334this line gives you a menu of various operations for customizing the
335variable.
336
337 The line after the @samp{[State]} line displays the beginning of the
338variable's documentation string. If there are more lines of
339documentation, this line ends with a @samp{[More]} button; invoke that
340to show the full documentation string.
341
342 To enter a new value for @samp{Kill Ring Max}, move point to the
343value and edit it textually. For example, you can type @kbd{M-d},
344then insert another number. As you begin to alter the text, you will
345see the @samp{[State]} line change to say that you have edited the
346value:
347
348@smallexample
349[State]: EDITED, shown value does not take effect until you set or @r{@dots{}}
350 save it.
351@end smallexample
352
353@cindex user options, how to set
354@cindex variables, how to set
355@cindex settings, how to set
356 Editing the value does not actually set the variable. To do that,
357you must @dfn{set} the variable. To do this, invoke the
358@samp{[State]} button and choose @samp{Set for Current Session}.
359
360 The state of the variable changes visibly when you set it:
361
362@smallexample
363[State]: SET for current session only.
364@end smallexample
365
366 You don't have to worry about specifying a value that is not valid;
367the @samp{Set for Current Session} operation checks for validity and
368will not install an unacceptable value.
369
370@kindex M-TAB @r{(customization buffer)}
371@findex widget-complete
372 While editing a field that is a file name, directory name,
373command name, or anything else for which completion is defined, you
374can type @kbd{M-@key{TAB}} (@code{widget-complete}) to do completion.
375(@kbd{@key{ESC} @key{TAB}} and @kbd{C-M-i} do the same thing.)
376
377 Some variables have a small fixed set of possible legitimate values.
378These variables don't let you edit the value textually. Instead, a
379@samp{[Value Menu]} button appears before the value; invoke this
380button to change the value. For a boolean ``on or off'' value, the
381button says @samp{[Toggle]}, and it changes to the other value.
382@samp{[Value Menu]} and @samp{[Toggle]} simply edit the buffer; the
383changes take real effect when you use the @samp{Set for Current
384Session} operation.
385
386 Some variables have values with complex structure. For example, the
387value of @code{file-coding-system-alist} is an association list. Here
388is how it appears in the customization buffer:
389
390@smallexample
391File Coding System Alist: [Hide Value]
392[INS] [DEL] File regexp: \.elc\'
393 Choice: [Value Menu] Encoding/decoding pair:
394 Decoding: emacs-mule
395 Encoding: emacs-mule
396[INS] [DEL] File regexp: \(\`\|/\)loaddefs.el\'
397 Choice: [Value Menu] Encoding/decoding pair:
398 Decoding: raw-text
399 Encoding: raw-text-unix
400[INS] [DEL] File regexp: \.tar\'
401 Choice: [Value Menu] Encoding/decoding pair:
402 Decoding: no-conversion
403 Encoding: no-conversion
404[INS] [DEL] File regexp:
405 Choice: [Value Menu] Encoding/decoding pair:
406 Decoding: undecided
407 Encoding: nil
408[INS]
409 [State]: STANDARD.
410Alist to decide a coding system to use for a file I/O @r{@dots{}}
411 operation. [Hide Rest]
412The format is ((PATTERN . VAL) ...),
413where PATTERN is a regular expression matching a file name,
414@r{[@dots{}more lines of documentation@dots{}]}
415@end smallexample
416
417@noindent
418Each association in the list appears on four lines, with several
419editable fields and/or buttons. You can edit the regexps and coding
420systems using ordinary editing commands. You can also invoke
421@samp{[Value Menu]} to switch to a different kind of value---for
422instance, to specify a function instead of a pair of coding systems.
423
424To delete an association from the list, invoke the @samp{[DEL]} button
425for that item. To add an association, invoke @samp{[INS]} at the
426position where you want to add it. There is an @samp{[INS]} button
427between each pair of associations, another at the beginning and another
428at the end, so you can add a new association at any position in the
429list.
430
431@kindex TAB @r{(customization buffer)}
432@kindex S-TAB @r{(customization buffer)}
433@findex widget-forward
434@findex widget-backward
435 Two special commands, @key{TAB} and @kbd{S-@key{TAB}}, are useful
436for moving through the customization buffer. @key{TAB}
437(@code{widget-forward}) moves forward to the next button or editable
438field; @kbd{S-@key{TAB}} (@code{widget-backward}) moves backward to
439the previous button or editable field.
440
441 Typing @key{RET} on an editable field also moves forward, just like
442@key{TAB}. We set it up this way because people often type @key{RET}
443when they are finished editing a field. To insert a newline within an
444editable field, use @kbd{C-o} or @kbd{C-q C-j}.
445
446@cindex saving a setting
447@cindex settings, how to save
448 Setting the variable changes its value in the current Emacs session;
449@dfn{saving} the value changes it for future sessions as well. To
450save the variable, invoke @samp{[State]} and select the @samp{Save for
451Future Sessions} operation. This works by writing code so as to set
452the variable again, each time you start Emacs (@pxref{Saving
453Customizations}).
454
455 You can also restore the variable to its standard value by invoking
456@samp{[State]} and selecting the @samp{Erase Customization} operation.
457There are actually four reset operations:
458
459@table @samp
460@item Undo Edits
461If you have made some modifications and not yet set the variable,
462this restores the text in the customization buffer to match
463the actual value.
464
465@item Reset to Saved
466This restores the value of the variable to the last saved value,
467and updates the text accordingly.
468
469@item Erase Customization
470This sets the variable to its standard value, and updates the text
471accordingly. This also eliminates any saved value for the variable,
472so that you will get the standard value in future Emacs sessions.
473
474@item Set to Backup Value
475This sets the variable to a previous value that was set in the
476customization buffer in this session. If you customize a variable
477and then reset it, which discards the customized value,
478you can get the discarded value back again with this operation.
479@end table
480
481@cindex comments on customized settings
482 Sometimes it is useful to record a comment about a specific
483customization. Use the @samp{Add Comment} item from the
484@samp{[State]} menu to create a field for entering the comment. The
485comment you enter will be saved, and displayed again if you again view
486the same variable in a customization buffer, even in another session.
487
488 The state of a group indicates whether anything in that group has been
489edited, set or saved.
490
491 Near the top of the customization buffer there are two lines of buttons:
492
493@smallexample
494 [Set for Current Session] [Save for Future Sessions]
495 [Undo Edits] [Reset to Saved] [Erase Customization] [Finish]
496@end smallexample
497
498@vindex custom-buffer-done-function
499@noindent
500Invoking @samp{[Finish]} either buries or kills this customization
501buffer according to the setting of the option
502@code{custom-buffer-done-kill}; the default is to bury the buffer.
503Each of the other buttons performs an operation---set, save or
504reset---on each of the settings in the buffer that could meaningfully
505be set, saved or reset. They do not operate on settings whose values
506are hidden, nor on subgroups which are hidden or not visible in the buffer.
507
508@node Saving Customizations
509@subsection Saving Customizations
510
511 Saving customizations from the customization buffer works by writing
512code that future sessions will read, code to set up those
513customizations again.
514
515@vindex custom-file
516 Normally this saves customizations in your init file,
517@file{~/.emacs}. If you wish, you can save customizations in another
518file instead. To make this work, your @file{~/.emacs} should set
519@code{custom-file} to the name of that file. Then you should load the
520file by calling @code{load}. For example:
521
522@example
523(setq custom-file "~/.emacs-custom.el")
524(load custom-file)
525@end example
526
527 You can use @code{custom-file} to specify different customization
528files for different Emacs versions, like this:
529
530@example
531(cond ((< emacs-major-version 21)
532 ;; @r{Emacs 20 customization.}
533 (setq custom-file "~/.custom-20.el"))
534 ((and (= emacs-major-version 21) (< emacs-minor-version 4))
535 ;; @r{Emacs 21 customization, before version 21.4.}
536 (setq custom-file "~/.custom-21.el"))
537 ((< emacs-major-version 22)
538 ;; @r{Emacs version 21.4 or later.}
539 (setq custom-file "~/.custom-21.4.el"))
540 (t
541 ;; @r{Emacs version 22.1 or later.}
542 (setq custom-file "~/.custom-22.el")))
543
544(load custom-file)
545@end example
546
547 If Emacs was invoked with the @option{-q} or @option{--no-init-file}
548options (@pxref{Initial Options}), it will not let you save your
549customizations in your @file{~/.emacs} init file. This is because
550saving customizations from such a session would wipe out all the other
551customizations you might have on your init file.
552
553@node Face Customization
554@subsection Customizing Faces
555@cindex customizing faces
556@cindex bold font
557@cindex italic font
558@cindex fonts and faces
559
560 In addition to variables, some customization groups also include
561faces. When you show the contents of a group, both the variables and
562the faces in the group appear in the customization buffer. Here is an
563example of how a face looks:
564
565@smallexample
566Custom Changed Face:(sample) [Hide Face]
567 [State]: STANDARD.
568Face used when the customize item has been changed.
569Parent groups: [Custom Magic Faces]
570Attributes: [ ] Font Family: *
571 [ ] Width: *
572 [ ] Height: *
573 [ ] Weight: *
574 [ ] Slant: *
575 [ ] Underline: *
576 [ ] Overline: *
577 [ ] Strike-through: *
578 [ ] Box around text: *
579 [ ] Inverse-video: *
580 [X] Foreground: white (sample)
581 [X] Background: blue (sample)
582 [ ] Stipple: *
583 [ ] Inherit: *
584@end smallexample
585
586 Each face attribute has its own line. The @samp{[@var{x}]} button
587before the attribute name indicates whether the attribute is
588@dfn{enabled}; @samp{[X]} means that it's enabled, and @samp{[ ]}
589means that it's disabled. You can enable or disable the attribute by
590clicking that button. When the attribute is enabled, you can change
591the attribute value in the usual ways.
592
593 For the colors, you can specify a color name (use @kbd{M-x
594list-colors-display} for a list of them) or a hexadecimal color
595specification of the form @samp{#@var{rr}@var{gg}@var{bb}}.
596(@samp{#000000} is black, @samp{#ff0000} is red, @samp{#00ff00} is
597green, @samp{#0000ff} is blue, and @samp{#ffffff} is white.) On a
598black-and-white display, the colors you can use for the background are
599@samp{black}, @samp{white}, @samp{gray}, @samp{gray1}, and
600@samp{gray3}. Emacs supports these shades of gray by using background
601stipple patterns instead of a color.
602
603 Setting, saving and resetting a face work like the same operations for
604variables (@pxref{Changing a Variable}).
605
606 A face can specify different appearances for different types of
607display. For example, a face can make text red on a color display, but
608use a bold font on a monochrome display. To specify multiple
609appearances for a face, select @samp{For All Kinds of Displays} in the
610menu you get from invoking @samp{[State]}.
611
612@findex modify-face
613 Another more basic way to set the attributes of a specific face is
614with @kbd{M-x modify-face}. This command reads the name of a face, then
615reads the attributes one by one. For the color and stipple attributes,
616the attribute's current value is the default---type just @key{RET} if
617you don't want to change that attribute. Type @samp{none} if you want
618to clear out the attribute.
619
620@node Specific Customization
621@subsection Customizing Specific Items
622
623 Instead of finding the setting you want to change by navigating the
624structure of groups, here are other ways to specify the settings that
625you want to customize.
626
627@table @kbd
628@item M-x customize-option @key{RET} @var{option} @key{RET}
629Set up a customization buffer with just one user option variable,
630@var{option}.
631@item M-x customize-face @key{RET} @var{face} @key{RET}
632Set up a customization buffer with just one face, @var{face}.
633@item M-x customize-group @key{RET} @var{group} @key{RET}
634Set up a customization buffer with just one group, @var{group}.
635@item M-x customize-apropos @key{RET} @var{regexp} @key{RET}
636Set up a customization buffer with all the settings and groups that
637match @var{regexp}.
638@item M-x customize-changed @key{RET} @var{version} @key{RET}
639Set up a customization buffer with all the settings and groups
640whose meaning has changed since Emacs version @var{version}.
641@item M-x customize-saved
642Set up a customization buffer containing all settings that you
643have saved with customization buffers.
644@item M-x customize-unsaved
645Set up a customization buffer containing all settings that you have
646set but not saved.
647@end table
648
649@findex customize-option
650 If you want to alter a particular user option with the customization
651buffer, and you know its name, you can use the command @kbd{M-x
652customize-option} and specify the user option (variable) name. This
653sets up the customization buffer with just one user option---the one
654that you asked for. Editing, setting and saving the value work as
655described above, but only for the specified user option. Minibuffer
656completion is handy if you only know part of the name. However, this
657command can only see options that have been loaded in the current
658Emacs session.
659
660@findex customize-face
661 Likewise, you can modify a specific face, chosen by name, using
662@kbd{M-x customize-face}. By default it operates on the face used
663on the character after point.
664
665@findex customize-group
666 You can also set up the customization buffer with a specific group,
667using @kbd{M-x customize-group}. The immediate contents of the chosen
668group, including settings (user options and faces), and other groups,
669all appear as well (even if not already loaded). However, the
670subgroups' own contents are not included.
671
672@findex customize-apropos
673 For a more general way of controlling what to customize, you can use
674@kbd{M-x customize-apropos}. You specify a regular expression as
675argument; then all @emph{loaded} settings and groups whose names match
676this regular expression are set up in the customization buffer. If
677you specify an empty regular expression, this includes @emph{all}
678loaded groups and settings---which takes a long time to set up.
679
680@findex customize-changed
681 When you upgrade to a new Emacs version, you might want to consider
682customizing new settings, and settings whose meanings or default
683values have changed. To do this, use @kbd{M-x customize-changed} and
684specify a previous Emacs version number using the minibuffer. It
685creates a customization buffer which shows all the settings and groups
686whose definitions have been changed since the specified version,
687loading them if necessary.
688
689@findex customize-saved
690@findex customize-unsaved
691 If you change settings and then decide the change was a mistake, you
692can use two special commands to revisit your previous changes. Use
693@kbd{M-x customize-saved} to look at the settings that you have saved.
694Use @kbd{M-x customize-unsaved} to look at the settings that you
695have set but not saved.
696
697@node Custom Themes
698@subsection Customization Themes
699@cindex custom themes
700
701 @dfn{Custom themes} are collections of settings that can be enabled
702or disabled as a unit. You can use Custom themes to switch quickly
703and easily between various collections of settings, and to transfer
704such collections from one computer to another.
705
706@findex customize-create-theme
707 To define a Custom theme, use @kbd{M-x customize-create-theme},
708which brings up a buffer named @samp{*New Custom Theme*}. At the top
709of the buffer is an editable field where you can specify the name of
710the theme. Click on the button labelled @samp{Insert Variable} to add
711a variable to the theme, and click on @samp{Insert Face} to add a
712face. You can edit these values in the @samp{*New Custom Theme*}
713buffer like in an ordinary Customize buffer. To remove an option from
714the theme, click on its @samp{State} button and select @samp{Delete}.
715
716@vindex custom-theme-directory
717 After adding the desired options, click on @samp{Save Theme} to save
718the Custom theme. This writes the theme definition to a file
719@file{@var{foo}-theme.el} (where @var{foo} is the theme name you
720supplied), in the directory @file{~/.emacs.d/}. You can specify the
721directory by setting @code{custom-theme-directory}.
722
723 You can view and edit the settings of a previously-defined theme by
724clicking on @samp{Visit Theme} and specifying the theme name. You can
725also import the variables and faces that you have set using Customize
726by visiting the ``special'' theme named @samp{user}. This theme, which
727records all the options that you set in the ordinary customization
728buffer, is always enabled, and always takes precedence over all other
729enabled Custom themes. Additionally, the @samp{user} theme is
730recorded with code in your @file{.emacs} file, rather than a
731@file{user-theme.el} file.
732
733@vindex custom-enabled-themes
734 Once you have defined a Custom theme, you can use it by customizing
735the variable @code{custom-enabled-themes}. This is a list of Custom
736themes that are @dfn{enabled}, or put into effect. If you set
737@code{custom-enabled-themes} using the Customize interface, the theme
738definitions are automatically loaded from the theme files, if they
739aren't already. If you save the value of @code{custom-enabled-themes}
740for future Emacs sessions, those Custom themes will be enabled
741whenever Emacs is started up.
742
743 If two enabled themes specify different values for an option, the
744theme occurring earlier in @code{custom-enabled-themes} takes effect.
745
746@findex load-theme
747@findex enable-theme
748@findex disable-theme
749 You can temporarily enable a Custom theme with @kbd{M-x
750enable-theme}. This prompts for a theme name in the minibuffer, loads
751the theme from the theme file if necessary, and enables the theme.
752You can @dfn{disable} any enabled theme with the command @kbd{M-x
753disable-theme}; this returns the options specified in the theme to
754their original values. To re-enable the theme, type @kbd{M-x
755enable-theme} again. If a theme file is changed during your Emacs
756session, you can reload it by typing @kbd{M-x load-theme}. (This also
757enables the theme.)
758
759@node Variables
760@section Variables
761@cindex variable
762@cindex option, user
763@cindex user option
764
765 A @dfn{variable} is a Lisp symbol which has a value. The symbol's
766name is also called the name of the variable. A variable name can
767contain any characters that can appear in a file, but conventionally
768variable names consist of words separated by hyphens. A variable can
769have a documentation string which describes what kind of value it should
770have and how the value will be used.
771
772 Emacs Lisp allows any variable (with a few exceptions) to have any
773kind of value, but most variables that Emacs uses expect a value of a
774certain type. Often the value should always be a string, or should
775always be a number. Sometimes we say that a certain feature is turned
776on if a variable is ``non-@code{nil},'' meaning that if the variable's
777value is @code{nil}, the feature is off, but the feature is on for
778@emph{any} other value. The conventional value to use to turn on the
779feature---since you have to pick one particular value when you set the
780variable---is @code{t}.
781
782 Emacs uses many Lisp variables for internal record keeping, but the
783most interesting variables for a non-programmer user are those meant
784for users to change---these are called @dfn{user options}.
785
786 Each user option that you can set with the customization buffer is
787in fact a Lisp variable. Emacs does not (usually) change the values
788of these variables on its own; instead, you set the values in order to
789control the behavior of certain Emacs commands. Use of the
790customization buffer is explained above (@pxref{Easy Customization});
791here we describe other aspects of Emacs variables.
792
793@menu
794* Examining:: Examining or setting one variable's value.
795* Hooks:: Hook variables let you specify programs for parts
796 of Emacs to run on particular occasions.
797* Locals:: Per-buffer values of variables.
798* File Variables:: How files can specify variable values.
799@end menu
800
801@node Examining
802@subsection Examining and Setting Variables
803@cindex setting variables
804
805@table @kbd
806@item C-h v @var{var} @key{RET}
807Display the value and documentation of variable @var{var}
808(@code{describe-variable}).
809@item M-x set-variable @key{RET} @var{var} @key{RET} @var{value} @key{RET}
810Change the value of variable @var{var} to @var{value}.
811@end table
812
813 To examine the value of a single variable, use @kbd{C-h v}
814(@code{describe-variable}), which reads a variable name using the
815minibuffer, with completion. It displays both the value and the
816documentation of the variable. For example,
817
818@example
819C-h v fill-column @key{RET}
820@end example
821
822@noindent
823displays something like this:
824
825@smallexample
826fill-column is a variable defined in `C source code'.
827fill-column's value is 70
828Local in buffer custom.texi; global value is 70
829Automatically becomes buffer-local when set in any fashion.
830
831This variable is safe to use as a file local variable only if its value
832satisfies the predicate `integerp'.
833
834Documentation:
835*Column beyond which automatic line-wrapping should happen.
836Interactively, you can set the buffer local value using C-x f.
837
838You can customize this variable.
839@end smallexample
840
841@noindent
842The line that says you can customize the variable indicates that this
843variable is a user option. (The star also indicates this, but it is
844an obsolete indicator that may eventually disappear.) @kbd{C-h v} is
845not restricted to user options; it allows any variable name.
846
847@findex set-variable
848The most convenient way to set a specific user option variable is with
849@kbd{M-x set-variable}. This reads the variable name with the
850minibuffer (with completion), and then reads a Lisp expression for the
851new value using the minibuffer a second time (you can insert the old
852value into the minibuffer for editing via @kbd{M-n}). For example,
853
854@example
855M-x set-variable @key{RET} fill-column @key{RET} 75 @key{RET}
856@end example
857
858@noindent
859sets @code{fill-column} to 75.
860
861 @kbd{M-x set-variable} is limited to user option variables, but you can
862set any variable with a Lisp expression, using the function @code{setq}.
863Here is a @code{setq} expression to set @code{fill-column}:
864
865@example
866(setq fill-column 75)
867@end example
868
869 To execute an expression like this one, go to the @samp{*scratch*}
870buffer, type in the expression, and then type @kbd{C-j}. @xref{Lisp
871Interaction}.
872
873 Setting variables, like all means of customizing Emacs except where
874otherwise stated, affects only the current Emacs session. The only
875way to alter the variable in future sessions is to put something in
876the @file{~/.emacs} file to set it those sessions (@pxref{Init File}).
877
878@node Hooks
879@subsection Hooks
880@cindex hook
881@cindex running a hook
882
883 @dfn{Hooks} are an important mechanism for customization of Emacs. A
884hook is a Lisp variable which holds a list of functions, to be called on
885some well-defined occasion. (This is called @dfn{running the hook}.)
886The individual functions in the list are called the @dfn{hook functions}
887of the hook. With rare exceptions, hooks in Emacs are empty when Emacs
888starts up, so the only hook functions in any given hook are the ones you
889explicitly put there as customization.
890
891 Most major modes run one or more @dfn{mode hooks} as the last step of
892initialization. This makes it easy for you to customize the behavior of
893the mode, by setting up a hook function to override the local variable
894assignments already made by the mode. But hooks are also used in other
895contexts. For example, the hook @code{suspend-hook} runs just before
896Emacs suspends itself (@pxref{Exiting}).
897
898@cindex normal hook
899 Most Emacs hooks are @dfn{normal hooks}. This means that running the
900hook operates by calling all the hook functions, unconditionally, with
901no arguments. We have made an effort to keep most hooks normal so that
902you can use them in a uniform way. Every variable in Emacs whose name
903ends in @samp{-hook} is a normal hook.
904
905@cindex abnormal hook
906 There are also a few @dfn{abnormal hooks}. These variables' names end
907in @samp{-hooks} or @samp{-functions}, instead of @samp{-hook}. What
908makes these hooks abnormal is that there is something peculiar about the
909way its functions are called---perhaps they are given arguments, or
910perhaps the values they return are used in some way. For example,
911@code{find-file-not-found-functions} (@pxref{Visiting}) is abnormal because
912as soon as one hook function returns a non-@code{nil} value, the rest
913are not called at all. The documentation of each abnormal hook variable
914explains in detail what is peculiar about it.
915
916@findex add-hook
917 You can set a hook variable with @code{setq} like any other Lisp
918variable, but the recommended way to add a hook function to a hook
919(either normal or abnormal) is by calling @code{add-hook}.
920@xref{Hooks,,, elisp, The Emacs Lisp Reference Manual}.
921
922 For example, here's how to set up a hook to turn on Auto Fill mode
923when entering Text mode and other modes based on Text mode:
924
925@example
926(add-hook 'text-mode-hook 'turn-on-auto-fill)
927@end example
928
929 The next example shows how to use a hook to customize the indentation
930of C code. (People often have strong personal preferences for one
931format compared to another.) Here the hook function is an anonymous
932lambda expression.
933
934@example
935@group
936(setq my-c-style
937 '((c-comment-only-line-offset . 4)
938@end group
939@group
940 (c-cleanup-list . (scope-operator
941 empty-defun-braces
942 defun-close-semi))
943@end group
944@group
945 (c-offsets-alist . ((arglist-close . c-lineup-arglist)
946 (substatement-open . 0)))))
947@end group
948
949@group
950(add-hook 'c-mode-common-hook
951 '(lambda ()
952 (c-add-style "my-style" my-c-style t)))
953@end group
954@end example
955
956 It is best to design your hook functions so that the order in which
957they are executed does not matter. Any dependence on the order is
958``asking for trouble.'' However, the order is predictable: the most
959recently added hook functions are executed first.
960
961@findex remove-hook
962 If you play with adding various different versions of a hook
963function by calling @code{add-hook} over and over, remember that all
964the versions you added will remain in the hook variable together. You
965can clear out individual functions by calling @code{remove-hook}, or
966do @code{(setq @var{hook-variable} nil)} to remove everything.
967
968@node Locals
969@subsection Local Variables
970
971@table @kbd
972@item M-x make-local-variable @key{RET} @var{var} @key{RET}
973Make variable @var{var} have a local value in the current buffer.
974@item M-x kill-local-variable @key{RET} @var{var} @key{RET}
975Make variable @var{var} use its global value in the current buffer.
976@item M-x make-variable-buffer-local @key{RET} @var{var} @key{RET}
977Mark variable @var{var} so that setting it will make it local to the
978buffer that is current at that time.
979@end table
980
981@cindex local variables
982 Almost any variable can be made @dfn{local} to a specific Emacs
983buffer. This means that its value in that buffer is independent of its
984value in other buffers. A few variables are always local in every
985buffer. Every other Emacs variable has a @dfn{global} value which is in
986effect in all buffers that have not made the variable local.
987
988@findex make-local-variable
989 @kbd{M-x make-local-variable} reads the name of a variable and makes
990it local to the current buffer. Changing its value subsequently in
991this buffer will not affect others, and changes in its global value
992will not affect this buffer.
993
994@findex make-variable-buffer-local
995@cindex per-buffer variables
996 @kbd{M-x make-variable-buffer-local} marks a variable so it will
997become local automatically whenever it is set. More precisely, once a
998variable has been marked in this way, the usual ways of setting the
999variable automatically do @code{make-local-variable} first. We call
1000such variables @dfn{per-buffer} variables. Many variables in Emacs
1001are normally per-buffer; the variable's document string tells you when
1002this is so. A per-buffer variable's global value is normally never
1003effective in any buffer, but it still has a meaning: it is the initial
1004value of the variable for each new buffer.
1005
1006 Major modes (@pxref{Major Modes}) always make variables local to the
1007buffer before setting the variables. This is why changing major modes
1008in one buffer has no effect on other buffers. Minor modes also work
1009by setting variables---normally, each minor mode has one controlling
1010variable which is non-@code{nil} when the mode is enabled
1011(@pxref{Minor Modes}). For many minor modes, the controlling variable
1012is per buffer, and thus always buffer-local. Otherwise, you can make
1013it local in a specific buffer like any other variable.
1014
1015 A few variables cannot be local to a buffer because they are always
1016local to each display instead (@pxref{Multiple Displays}). If you try to
1017make one of these variables buffer-local, you'll get an error message.
1018
1019@findex kill-local-variable
1020 @kbd{M-x kill-local-variable} makes a specified variable cease to be
1021local to the current buffer. The global value of the variable
1022henceforth is in effect in this buffer. Setting the major mode kills
1023all the local variables of the buffer except for a few variables
1024specially marked as @dfn{permanent locals}.
1025
1026@findex setq-default
1027 To set the global value of a variable, regardless of whether the
1028variable has a local value in the current buffer, you can use the Lisp
1029construct @code{setq-default}. This construct is used just like
1030@code{setq}, but it sets variables' global values instead of their local
1031values (if any). When the current buffer does have a local value, the
1032new global value may not be visible until you switch to another buffer.
1033Here is an example:
1034
1035@example
1036(setq-default fill-column 75)
1037@end example
1038
1039@noindent
1040@code{setq-default} is the only way to set the global value of a variable
1041that has been marked with @code{make-variable-buffer-local}.
1042
1043@findex default-value
1044 Lisp programs can use @code{default-value} to look at a variable's
1045default value. This function takes a symbol as argument and returns its
1046default value. The argument is evaluated; usually you must quote it
1047explicitly. For example, here's how to obtain the default value of
1048@code{fill-column}:
1049
1050@example
1051(default-value 'fill-column)
1052@end example
1053
1054@node File Variables
1055@subsection Local Variables in Files
1056@cindex local variables in files
1057@cindex file local variables
1058
1059 A file can specify local variable values for use when you edit the
1060file with Emacs. Visiting the file checks for local variable
1061specifications; it automatically makes these variables local to the
1062buffer, and sets them to the values specified in the file.
1063
1064@menu
1065* Specifying File Variables:: Specifying file local variables.
1066* Safe File Variables:: Making sure file local variables are safe.
1067@end menu
1068
1069@node Specifying File Variables
1070@subsubsection Specifying File Variables
1071
1072 There are two ways to specify file local variable values: in the first
1073line, or with a local variables list. Here's how to specify them in the
1074first line:
1075
1076@example
1077-*- mode: @var{modename}; @var{var}: @var{value}; @dots{} -*-
1078@end example
1079
1080@noindent
1081You can specify any number of variables/value pairs in this way, each
1082pair with a colon and semicolon as shown above. @code{mode:
1083@var{modename};} specifies the major mode; this should come first in the
1084line. The @var{value}s are not evaluated; they are used literally.
1085Here is an example that specifies Lisp mode and sets two variables with
1086numeric values:
1087
1088@smallexample
1089;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*-
1090@end smallexample
1091
1092 You can also specify the coding system for a file in this way: just
1093specify a value for the ``variable'' named @code{coding}. The ``value''
1094must be a coding system name that Emacs recognizes. @xref{Coding
1095Systems}. @w{@samp{unibyte: t}} specifies unibyte loading for a
1096particular Lisp file. @xref{Enabling Multibyte}.
1097
1098 The @code{eval} pseudo-variable, described below, can be specified in
1099the first line as well.
1100
1101@cindex shell scripts, and local file variables
1102 In shell scripts, the first line is used to identify the script
1103interpreter, so you cannot put any local variables there. To
1104accommodate this, Emacs looks for local variable specifications in the
1105@emph{second} line when the first line specifies an interpreter.
1106
1107 A @dfn{local variables list} goes near the end of the file, in the
1108last page. (It is often best to put it on a page by itself.) The local
1109variables list starts with a line containing the string @samp{Local
1110Variables:}, and ends with a line containing the string @samp{End:}. In
1111between come the variable names and values, one set per line, as
1112@samp{@var{variable}:@: @var{value}}. The @var{value}s are not
1113evaluated; they are used literally. If a file has both a local
1114variables list and a @samp{-*-} line, Emacs processes @emph{everything}
1115in the @samp{-*-} line first, and @emph{everything} in the local
1116variables list afterward.
1117
1118 Here is an example of a local variables list:
1119
1120@example
1121;; Local Variables: **
1122;; mode:lisp **
1123;; comment-column:0 **
1124;; comment-start: ";; " **
1125;; comment-end:"**" **
1126;; End: **
1127@end example
1128
1129 Each line starts with the prefix @samp{;; } and each line ends with
1130the suffix @samp{ **}. Emacs recognizes these as the prefix and
1131suffix based on the first line of the list, by finding them
1132surrounding the magic string @samp{Local Variables:}; then it
1133automatically discards them from the other lines of the list.
1134
1135 The usual reason for using a prefix and/or suffix is to embed the
1136local variables list in a comment, so it won't confuse other programs
1137that the file is intended as input for. The example above is for a
1138language where comment lines start with @samp{;; } and end with
1139@samp{**}; the local values for @code{comment-start} and
1140@code{comment-end} customize the rest of Emacs for this unusual
1141syntax. Don't use a prefix (or a suffix) if you don't need one.
1142
1143 If you write a multi-line string value, you should put the prefix
1144and suffix on each line, even lines that start or end within the
1145string. They will be stripped off for processing the list. If you
1146want to split a long string across multiple lines of the file, you can
1147use backslash-newline, which is ignored in Lisp string constants.
1148Here's an example of doing this:
1149
1150@example
1151# Local Variables:
1152# compile-command: "cc foo.c -Dfoo=bar -Dhack=whatever \
1153# -Dmumble=blaah"
1154# End:
1155@end example
1156
1157 Some ``variable names'' have special meanings in a local variables
1158list. Specifying the ``variable'' @code{mode} really sets the major
1159mode, while any value specified for the ``variable'' @code{eval} is
1160simply evaluated as an expression (its value is ignored). A value for
1161@code{coding} specifies the coding system for character code
1162conversion of this file, and a value of @code{t} for @code{unibyte}
1163says to visit the file in a unibyte buffer. These four ``variables''
1164are not really variables; setting them in any other context has no
1165special meaning.
1166
1167 @emph{If @code{mode} is used to set a major mode, it should be the
1168first ``variable'' in the list.} Otherwise, the entries that precede
1169it will usually be ignored, since most modes kill all local variables
1170as part of their initialization.
1171
1172 You can use the @code{mode} ``variable'' to set minor modes as well
1173as the major modes; in fact, you can use it more than once, first to
1174set the major mode and then to set minor modes which are specific to
1175particular buffers. But most minor modes should not be specified in
1176the file at all, because they represent user preferences.
1177
1178 For example, you may be tempted to try to turn on Auto Fill mode with
1179a local variable list. That is a mistake. The choice of Auto Fill mode
1180or not is a matter of individual taste, not a matter of the contents of
1181particular files. If you want to use Auto Fill, set up major mode hooks
1182with your @file{.emacs} file to turn it on (when appropriate) for you
1183alone (@pxref{Init File}). Don't use a local variable list to impose
1184your taste on everyone.
1185
1186 The start of the local variables list must be no more than 3000
1187characters from the end of the file, and must be in the last page if the
1188file is divided into pages. Otherwise, Emacs will not notice it is
1189there. The purpose of this rule is so that a stray @samp{Local
1190Variables:}@: not in the last page does not confuse Emacs, and so that
1191visiting a long file that is all one page and has no local variables
1192list need not take the time to search the whole file.
1193
1194 Use the command @code{normal-mode} to reset the local variables and
1195major mode of a buffer according to the file name and contents,
1196including the local variables list if any. @xref{Choosing Modes}.
1197
1198@node Safe File Variables
1199@subsubsection Safety of File Variables
1200
1201 File-local variables can be dangerous; when you visit someone else's
1202file, there's no telling what its local variables list could do to
1203your Emacs. Improper values of the @code{eval} ``variable,'' and
1204other variables such as @code{load-path}, could execute Lisp code you
1205didn't intend to run.
1206
1207 Therefore, whenever Emacs encounters file local variable values that
1208are not known to be safe, it displays the file's entire local
1209variables list, and asks you for confirmation before setting them.
1210You can type @kbd{y} or @key{SPC} to put the local variables list into
1211effect, or @kbd{n} to ignore it. When Emacs is run in batch mode
1212(@pxref{Initial Options}), it can't really ask you, so it assumes the
1213answer @kbd{n}.
1214
1215 Emacs normally recognizes certain variables/value pairs as safe.
1216For instance, it is safe to give @code{comment-column} or
1217@code{fill-column} any integer value. If a file specifies only
1218known-safe variable/value pairs, Emacs does not ask for confirmation
1219before setting them. Otherwise, you can tell Emacs to record all the
1220variable/value pairs in this file as safe, by typing @kbd{!} at the
1221confirmation prompt. When Emacs encounters these variable/value pairs
1222subsequently, in the same file or others, it will assume they are
1223safe.
1224
1225@vindex safe-local-variable-values
1226@cindex risky variable
1227 Some variables, such as @code{load-path}, are considered
1228particularly @dfn{risky}: there is seldom any reason to specify them
1229as local variables, and changing them can be dangerous. If a file
1230contains only risky local variables, Emacs neither offers nor accepts
1231@kbd{!} as input at the confirmation prompt. If some of the local
1232variables in a file are risky, and some are only potentially unsafe, you
1233can enter @kbd{!} at the prompt. It applies all the variables, but only
1234marks the non-risky ones as safe for the future. If you really want to
1235record safe values for risky variables, do it directly by customizing
1236@samp{safe-local-variable-values} (@pxref{Easy Customization}).
1237
1238@vindex enable-local-variables
1239 The variable @code{enable-local-variables} allows you to change the
1240way Emacs processes local variables. Its default value is @code{t},
1241which specifies the behavior described above. If it is @code{nil},
1242Emacs simply ignores all file local variables. @code{:safe} means use
1243only the safe values and ignore the rest. Any other value says to
1244query you about each file that has local variables, without trying to
1245determine whether the values are known to be safe.
1246
1247@vindex enable-local-eval
1248 The variable @code{enable-local-eval} controls whether Emacs
1249processes @code{eval} variables. The three possibilities for the
1250variable's value are @code{t}, @code{nil}, and anything else, just as
1251for @code{enable-local-variables}. The default is @code{maybe}, which
1252is neither @code{t} nor @code{nil}, so normally Emacs does ask for
1253confirmation about processing @code{eval} variables.
1254
1255@vindex safe-local-eval-forms
1256 But there is an exception. The @code{safe-local-eval-forms} is a
1257customizable list of eval forms which are safe. Emacs does not ask
1258for confirmation when it finds these forms for the @code{eval}
1259variable.
1260
1261@node Key Bindings
1262@section Customizing Key Bindings
1263@cindex key bindings
1264
1265 This section describes @dfn{key bindings}, which map keys to commands,
1266and @dfn{keymaps}, which record key bindings. It also explains how
1267to customize key bindings.
1268
1269 Recall that a command is a Lisp function whose definition provides for
1270interactive use. Like every Lisp function, a command has a function
1271name, which usually consists of lower-case letters and hyphens.
1272
1273@menu
1274* Keymaps:: Generalities. The global keymap.
1275* Prefix Keymaps:: Keymaps for prefix keys.
1276* Local Keymaps:: Major and minor modes have their own keymaps.
1277* Minibuffer Maps:: The minibuffer uses its own local keymaps.
1278* Rebinding:: How to redefine one key's meaning conveniently.
1279* Init Rebinding:: Rebinding keys with your init file, @file{.emacs}.
1280* Function Keys:: Rebinding terminal function keys.
1281* Named ASCII Chars:: Distinguishing @key{TAB} from @kbd{C-i}, and so on.
1282* Mouse Buttons:: Rebinding mouse buttons in Emacs.
1283* Disabling:: Disabling a command means confirmation is required
1284 before it can be executed. This is done to protect
1285 beginners from surprises.
1286@end menu
1287
1288@node Keymaps
1289@subsection Keymaps
1290@cindex keymap
1291
1292 The bindings between key sequences and command functions are recorded
1293in data structures called @dfn{keymaps}. Emacs has many of these, each
1294used on particular occasions.
1295
1296 Recall that a @dfn{key sequence} (@dfn{key}, for short) is a sequence
1297of @dfn{input events} that have a meaning as a unit. Input events
1298include characters, function keys and mouse buttons---all the inputs
1299that you can send to the computer with your terminal. A key sequence
1300gets its meaning from its @dfn{binding}, which says what command it
1301runs. The function of keymaps is to record these bindings.
1302
1303@cindex global keymap
1304 The @dfn{global} keymap is the most important keymap because it is
1305always in effect. The global keymap defines keys for Fundamental mode;
1306most of these definitions are common to most or all major modes. Each
1307major or minor mode can have its own keymap which overrides the global
1308definitions of some keys.
1309
1310 For example, a self-inserting character such as @kbd{g} is
1311self-inserting because the global keymap binds it to the command
1312@code{self-insert-command}. The standard Emacs editing characters such
1313as @kbd{C-a} also get their standard meanings from the global keymap.
1314Commands to rebind keys, such as @kbd{M-x global-set-key}, actually work
1315by storing the new binding in the proper place in the global map.
1316@xref{Rebinding}.
1317
1318 Meta characters work differently; Emacs translates each Meta
1319character into a pair of characters starting with @key{ESC}. When you
1320type the character @kbd{M-a} in a key sequence, Emacs replaces it with
1321@kbd{@key{ESC} a}. A meta key comes in as a single input event, but
1322becomes two events for purposes of key bindings. The reason for this is
1323historical, and we might change it someday.
1324
1325@cindex function key
1326 Most modern keyboards have function keys as well as character keys.
1327Function keys send input events just as character keys do, and keymaps
1328can have bindings for them.
1329
1330 On text terminals, typing a function key actually sends the computer a
1331sequence of characters; the precise details of the sequence depends on
1332which function key and on the model of terminal you are using. (Often
1333the sequence starts with @kbd{@key{ESC} [}.) If Emacs understands your
1334terminal type properly, it recognizes the character sequences forming
1335function keys wherever they occur in a key sequence (not just at the
1336beginning). Thus, for most purposes, you can pretend the function keys
1337reach Emacs directly and ignore their encoding as character sequences.
1338
1339@cindex mouse
1340 Mouse buttons also produce input events. These events come with other
1341data---the window and position where you pressed or released the button,
1342and a time stamp. But only the choice of button matters for key
1343bindings; the other data matters only if a command looks at it.
1344(Commands designed for mouse invocation usually do look at the other
1345data.)
1346
1347 A keymap records definitions for single events. Interpreting a key
1348sequence of multiple events involves a chain of keymaps. The first
1349keymap gives a definition for the first event; this definition is
1350another keymap, which is used to look up the second event in the
1351sequence, and so on.
1352
1353 Key sequences can mix function keys and characters. For example,
1354@kbd{C-x @key{SELECT}} is meaningful. If you make @key{SELECT} a prefix
1355key, then @kbd{@key{SELECT} C-n} makes sense. You can even mix mouse
1356events with keyboard events, but we recommend against it, because such
1357key sequences are inconvenient to use.
1358
1359 As a user, you can redefine any key; but it is usually best to stick
1360to key sequences that consist of @kbd{C-c} followed by a letter (upper
1361or lower case). These keys are ``reserved for users,'' so they won't
1362conflict with any properly designed Emacs extension. The function
1363keys @key{F5} through @key{F9} are also reserved for users. If you
1364redefine some other key, your definition may be overridden by certain
1365extensions or major modes which redefine the same key.
1366
1367@node Prefix Keymaps
1368@subsection Prefix Keymaps
1369
1370 A prefix key such as @kbd{C-x} or @key{ESC} has its own keymap,
1371which holds the definition for the event that immediately follows
1372that prefix.
1373
1374 The definition of a prefix key is usually the keymap to use for
1375looking up the following event. The definition can also be a Lisp
1376symbol whose function definition is the following keymap; the effect is
1377the same, but it provides a command name for the prefix key that can be
1378used as a description of what the prefix key is for. Thus, the binding
1379of @kbd{C-x} is the symbol @code{Control-X-prefix}, whose function
1380definition is the keymap for @kbd{C-x} commands. The definitions of
1381@kbd{C-c}, @kbd{C-x}, @kbd{C-h} and @key{ESC} as prefix keys appear in
1382the global map, so these prefix keys are always available.
1383
1384 Aside from ordinary prefix keys, there is a fictitious ``prefix key''
1385which represents the menu bar; see @ref{Menu Bar,,,elisp, The Emacs Lisp
1386Reference Manual}, for special information about menu bar key bindings.
1387Mouse button events that invoke pop-up menus are also prefix keys; see
1388@ref{Menu Keymaps,,,elisp, The Emacs Lisp Reference Manual}, for more
1389details.
1390
1391 Some prefix keymaps are stored in variables with names:
1392
1393@itemize @bullet
1394@item
1395@vindex ctl-x-map
1396@code{ctl-x-map} is the variable name for the map used for characters that
1397follow @kbd{C-x}.
1398@item
1399@vindex help-map
1400@code{help-map} is for characters that follow @kbd{C-h}.
1401@item
1402@vindex esc-map
1403@code{esc-map} is for characters that follow @key{ESC}. Thus, all Meta
1404characters are actually defined by this map.
1405@item
1406@vindex ctl-x-4-map
1407@code{ctl-x-4-map} is for characters that follow @kbd{C-x 4}.
1408@item
1409@vindex mode-specific-map
1410@code{mode-specific-map} is for characters that follow @kbd{C-c}.
1411@end itemize
1412
1413@node Local Keymaps
1414@subsection Local Keymaps
1415
1416@cindex local keymap
1417 So far we have explained the ins and outs of the global map. Major
1418modes customize Emacs by providing their own key bindings in @dfn{local
1419keymaps}. For example, C mode overrides @key{TAB} to make it indent the
1420current line for C code. Portions of text in the buffer can specify
1421their own keymaps to substitute for the keymap of the buffer's major
1422mode.
1423
1424@cindex minor mode keymap
1425 Minor modes can also have local keymaps. Whenever a minor mode is
1426in effect, the definitions in its keymap override both the major
1427mode's local keymap and the global keymap.
1428
1429 A local keymap can locally redefine a key as a prefix key by defining
1430it as a prefix keymap. If the key is also defined globally as a prefix,
1431then its local and global definitions (both keymaps) effectively
1432combine: both of them are used to look up the event that follows the
1433prefix key. Thus, if the mode's local keymap defines @kbd{C-c} as
1434another keymap, and that keymap defines @kbd{C-z} as a command, this
1435provides a local meaning for @kbd{C-c C-z}. This does not affect other
1436sequences that start with @kbd{C-c}; if those sequences don't have their
1437own local bindings, their global bindings remain in effect.
1438
1439 Another way to think of this is that Emacs handles a multi-event key
1440sequence by looking in several keymaps, one by one, for a binding of the
1441whole key sequence. First it checks the minor mode keymaps for minor
1442modes that are enabled, then it checks the major mode's keymap, and then
1443it checks the global keymap. This is not precisely how key lookup
1444works, but it's good enough for understanding the results in ordinary
1445circumstances.
1446
1447@cindex rebinding major mode keys
1448 Most major modes construct their keymaps when the mode is used for
1449the first time in a session. If you wish to change one of these
1450keymaps, you must use the major mode's @dfn{mode hook}
1451(@pxref{Hooks}).
1452
1453@findex define-key
1454 For example, the command @code{texinfo-mode} to select Texinfo mode
1455runs the hook @code{texinfo-mode-hook}. Here's how you can use the hook
1456to add local bindings (not very useful, we admit) for @kbd{C-c n} and
1457@kbd{C-c p} in Texinfo mode:
1458
1459@example
1460(add-hook 'texinfo-mode-hook
1461 '(lambda ()
1462 (define-key texinfo-mode-map "\C-cp"
1463 'backward-paragraph)
1464 (define-key texinfo-mode-map "\C-cn"
1465 'forward-paragraph)))
1466@end example
1467
1468@node Minibuffer Maps
1469@subsection Minibuffer Keymaps
1470
1471@cindex minibuffer keymaps
1472@vindex minibuffer-local-map
1473@vindex minibuffer-local-ns-map
1474@vindex minibuffer-local-completion-map
1475@vindex minibuffer-local-must-match-map
1476@vindex minibuffer-local-filename-completion-map
1477@vindex minibuffer-local-must-match-filename-map
1478 The minibuffer has its own set of local keymaps; they contain various
1479completion and exit commands.
1480
1481@itemize @bullet
1482@item
1483@code{minibuffer-local-map} is used for ordinary input (no completion).
1484@item
1485@code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits
1486just like @key{RET}. This is used mainly for Mocklisp compatibility.
1487@item
1488@code{minibuffer-local-completion-map} is for permissive completion.
1489@item
1490@code{minibuffer-local-must-match-map} is for strict completion and
1491for cautious completion.
1492@item
1493Finally, @code{minibuffer-local-filename-completion-map} and
1494@code{minibuffer-local-must-match-filename-map} are like the two
1495previous ones, but they are specifically for file name completion.
1496They do not bind @key{SPC}.
1497@end itemize
1498
1499@node Rebinding
1500@subsection Changing Key Bindings Interactively
1501@cindex key rebinding, this session
1502@cindex redefining keys, this session
1503
1504 The way to redefine an Emacs key is to change its entry in a keymap.
1505You can change the global keymap, in which case the change is effective in
1506all major modes (except those that have their own overriding local
1507definitions for the same key). Or you can change the current buffer's
1508local map, which affects all buffers using the same major mode.
1509
1510@findex global-set-key
1511@findex local-set-key
1512@findex global-unset-key
1513@findex local-unset-key
1514@table @kbd
1515@item M-x global-set-key @key{RET} @var{key} @var{cmd} @key{RET}
1516Define @var{key} globally to run @var{cmd}.
1517@item M-x local-set-key @key{RET} @var{key} @var{cmd} @key{RET}
1518Define @var{key} locally (in the major mode now in effect) to run
1519@var{cmd}.
1520@item M-x global-unset-key @key{RET} @var{key}
1521Make @var{key} undefined in the global map.
1522@item M-x local-unset-key @key{RET} @var{key}
1523Make @var{key} undefined locally (in the major mode now in effect).
1524@end table
1525
1526 For example, suppose you like to execute commands in a subshell within
1527an Emacs buffer, instead of suspending Emacs and executing commands in
1528your login shell. Normally, @kbd{C-z} is bound to the function
1529@code{suspend-emacs} (when not using the X Window System), but you can
1530change @kbd{C-z} to invoke an interactive subshell within Emacs, by
1531binding it to @code{shell} as follows:
1532
1533@example
1534M-x global-set-key @key{RET} C-z shell @key{RET}
1535@end example
1536
1537@noindent
1538@code{global-set-key} reads the command name after the key. After you
1539press the key, a message like this appears so that you can confirm that
1540you are binding the key you want:
1541
1542@example
1543Set key C-z to command:
1544@end example
1545
1546 You can redefine function keys and mouse events in the same way; just
1547type the function key or click the mouse when it's time to specify the
1548key to rebind.
1549
1550 You can rebind a key that contains more than one event in the same
1551way. Emacs keeps reading the key to rebind until it is a complete key
1552(that is, not a prefix key). Thus, if you type @kbd{C-f} for
1553@var{key}, that's the end; it enters the minibuffer immediately to
1554read @var{cmd}. But if you type @kbd{C-x}, since that's a prefix, it
1555reads another character; if that is @kbd{4}, another prefix character,
1556it reads one more character, and so on. For example,
1557
1558@example
1559M-x global-set-key @key{RET} C-x 4 $ spell-other-window @key{RET}
1560@end example
1561
1562@noindent
1563redefines @kbd{C-x 4 $} to run the (fictitious) command
1564@code{spell-other-window}.
1565
1566 The two-character keys consisting of @kbd{C-c} followed by a letter
1567are reserved for user customizations. Lisp programs are not supposed to
1568define these keys, so the bindings you make for them will be available
1569in all major modes and will never get in the way of anything.
1570
1571 You can remove the global definition of a key with
1572@code{global-unset-key}. This makes the key @dfn{undefined}; if you
1573type it, Emacs will just beep. Similarly, @code{local-unset-key} makes
1574a key undefined in the current major mode keymap, which makes the global
1575definition (or lack of one) come back into effect in that major mode.
1576
1577 If you have redefined (or undefined) a key and you subsequently wish
1578to retract the change, undefining the key will not do the job---you need
1579to redefine the key with its standard definition. To find the name of
1580the standard definition of a key, go to a Fundamental mode buffer in a
1581fresh Emacs and use @kbd{C-h c}. The documentation of keys in this
1582manual also lists their command names.
1583
1584 If you want to prevent yourself from invoking a command by mistake, it
1585is better to disable the command than to undefine the key. A disabled
1586command is less work to invoke when you really want to.
1587@xref{Disabling}.
1588
1589@node Init Rebinding
1590@subsection Rebinding Keys in Your Init File
1591
1592 If you have a set of key bindings that you like to use all the time,
1593you can specify them in your @file{.emacs} file by using their Lisp
1594syntax. (@xref{Init File}.)
1595
1596 The simplest method for doing this works for @acronym{ASCII} characters and
1597Meta-modified @acronym{ASCII} characters only. This method uses a string to
1598represent the key sequence you want to rebind. For example, here's how
1599to bind @kbd{C-z} to @code{shell}:
1600
1601@example
1602(global-set-key "\C-z" 'shell)
1603@end example
1604
1605@noindent
1606This example uses a string constant containing one character,
1607@kbd{C-z}. (@samp{\C-} is string syntax for a control character.) The
1608single-quote before the command name, @code{shell}, marks it as a
1609constant symbol rather than a variable. If you omit the quote, Emacs
1610would try to evaluate @code{shell} immediately as a variable. This
1611probably causes an error; it certainly isn't what you want.
1612
1613 Here is another example that binds the key sequence @kbd{C-x M-l}:
1614
1615@example
1616(global-set-key "\C-x\M-l" 'make-symbolic-link)
1617@end example
1618
1619 To put @key{TAB}, @key{RET}, @key{ESC}, or @key{DEL} in the
1620string, you can use the Emacs Lisp escape sequences, @samp{\t},
1621@samp{\r}, @samp{\e}, and @samp{\d}. Here is an example which binds
1622@kbd{C-x @key{TAB}}:
1623
1624@example
1625(global-set-key "\C-x\t" 'indent-rigidly)
1626@end example
1627
1628 These examples show how to write some other special @acronym{ASCII} characters
1629in strings for key bindings:
1630
1631@example
1632(global-set-key "\r" 'newline) ;; @key{RET}
1633(global-set-key "\d" 'delete-backward-char) ;; @key{DEL}
1634(global-set-key "\C-x\e\e" 'repeat-complex-command) ;; @key{ESC}
1635@end example
1636
1637 When the key sequence includes function keys or mouse button events,
1638or non-@acronym{ASCII} characters such as @code{C-=} or @code{H-a}, you must use
1639the more general method of rebinding, which uses a vector to specify the
1640key sequence.
1641
1642 The way to write a vector in Emacs Lisp is with square brackets around
1643the vector elements. Use spaces to separate the elements. If an
1644element is a symbol, simply write the symbol's name---no other
1645delimiters or punctuation are needed. If a vector element is a
1646character, write it as a Lisp character constant: @samp{?} followed by
1647the character as it would appear in a string.
1648
1649 Here are examples of using vectors to rebind @kbd{C-=} (a control
1650character not in @acronym{ASCII}), @kbd{C-M-=} (not in @acronym{ASCII} because @kbd{C-=}
1651is not), @kbd{H-a} (a Hyper character; @acronym{ASCII} doesn't have Hyper at
1652all), @key{F7} (a function key), and @kbd{C-Mouse-1} (a
1653keyboard-modified mouse button):
1654
1655@example
1656(global-set-key [?\C-=] 'make-symbolic-link)
1657(global-set-key [?\M-\C-=] 'make-symbolic-link)
1658(global-set-key [?\H-a] 'make-symbolic-link)
1659(global-set-key [f7] 'make-symbolic-link)
1660(global-set-key [C-mouse-1] 'make-symbolic-link)
1661@end example
1662
1663 You can use a vector for the simple cases too. Here's how to
1664rewrite the first six examples above to use vectors:
1665
1666@example
1667(global-set-key [?\C-z] 'shell)
1668(global-set-key [?\C-x ?l] 'make-symbolic-link)
1669(global-set-key [?\C-x ?\t] 'indent-rigidly)
1670(global-set-key [?\r] 'newline)
1671(global-set-key [?\d] 'delete-backward-char)
1672(global-set-key [?\C-x ?\e ?\e] 'repeat-complex-command)
1673@end example
1674
1675@noindent
1676As you see, you represent a multi-character key sequence with a vector
1677by listing all of the characters, in order, within the square brackets
1678that delimit the vector.
1679
1680 Language and coding systems can cause problems with key bindings
1681for non-@acronym{ASCII} characters. @xref{Init Non-ASCII}.
1682
1683@node Function Keys
1684@subsection Rebinding Function Keys
1685
1686 Key sequences can contain function keys as well as ordinary
1687characters. Just as Lisp characters (actually integers) represent
1688keyboard characters, Lisp symbols represent function keys. If the
1689function key has a word as its label, then that word is also the name of
1690the corresponding Lisp symbol. Here are the conventional Lisp names for
1691common function keys:
1692
1693@table @asis
1694@item @code{left}, @code{up}, @code{right}, @code{down}
1695Cursor arrow keys.
1696
1697@item @code{begin}, @code{end}, @code{home}, @code{next}, @code{prior}
1698Other cursor repositioning keys.
1699
1700@item @code{select}, @code{print}, @code{execute}, @code{backtab}
1701@itemx @code{insert}, @code{undo}, @code{redo}, @code{clearline}
1702@itemx @code{insertline}, @code{deleteline}, @code{insertchar}, @code{deletechar}
1703Miscellaneous function keys.
1704
1705@item @code{f1}, @code{f2}, @dots{} @code{f35}
1706Numbered function keys (across the top of the keyboard).
1707
1708@item @code{kp-add}, @code{kp-subtract}, @code{kp-multiply}, @code{kp-divide}
1709@itemx @code{kp-backtab}, @code{kp-space}, @code{kp-tab}, @code{kp-enter}
1710@itemx @code{kp-separator}, @code{kp-decimal}, @code{kp-equal}
1711Keypad keys (to the right of the regular keyboard), with names or punctuation.
1712
1713@item @code{kp-0}, @code{kp-1}, @dots{} @code{kp-9}
1714Keypad keys with digits.
1715
1716@item @code{kp-f1}, @code{kp-f2}, @code{kp-f3}, @code{kp-f4}
1717Keypad PF keys.
1718@end table
1719
1720 These names are conventional, but some systems (especially when using
1721X) may use different names. To make certain what symbol is used for a
1722given function key on your terminal, type @kbd{C-h c} followed by that
1723key.
1724
1725 A key sequence which contains function key symbols (or anything but
1726@acronym{ASCII} characters) must be a vector rather than a string.
1727Thus, to bind function key @samp{f1} to the command @code{rmail},
1728write the following:
1729
1730@example
1731(global-set-key [f1] 'rmail)
1732@end example
1733
1734@noindent
1735To bind the right-arrow key to the command @code{forward-char}, you can
1736use this expression:
1737
1738@example
1739(global-set-key [right] 'forward-char)
1740@end example
1741
1742@noindent
1743This uses the Lisp syntax for a vector containing the symbol
1744@code{right}. (This binding is present in Emacs by default.)
1745
1746 @xref{Init Rebinding}, for more information about using vectors for
1747rebinding.
1748
1749 You can mix function keys and characters in a key sequence. This
1750example binds @kbd{C-x @key{NEXT}} to the command @code{forward-page}.
1751
1752@example
1753(global-set-key [?\C-x next] 'forward-page)
1754@end example
1755
1756@noindent
1757where @code{?\C-x} is the Lisp character constant for the character
1758@kbd{C-x}. The vector element @code{next} is a symbol and therefore
1759does not take a question mark.
1760
1761 You can use the modifier keys @key{CTRL}, @key{META}, @key{HYPER},
1762@key{SUPER}, @key{ALT} and @key{SHIFT} with function keys. To represent
1763these modifiers, add the strings @samp{C-}, @samp{M-}, @samp{H-},
1764@samp{s-}, @samp{A-} and @samp{S-} at the front of the symbol name.
1765Thus, here is how to make @kbd{Hyper-Meta-@key{RIGHT}} move forward a
1766word:
1767
1768@example
1769(global-set-key [H-M-right] 'forward-word)
1770@end example
1771
1772@cindex keypad
1773 Many keyboards have a ``numeric keypad'' on the right hand side.
1774The numeric keys in the keypad double up as cursor motion keys,
1775toggled by a key labeled @samp{Num Lock}. By default, Emacs
1776translates these keys to the corresponding keys in the main keyboard.
1777For example, when @samp{Num Lock} is on, the key labeled @samp{8} on
1778the numeric keypad produces @code{kp-8}, which is translated to
1779@kbd{8}; when @samp{Num Lock} is off, the same key produces
1780@code{kp-up}, which is translated to @key{UP}. If you rebind a key
1781such as @kbd{8} or @key{UP}, it affects the equivalent keypad key too.
1782However, if you rebind a @samp{kp-} key directly, that won't affect
1783its non-keypad equivalent.
1784
1785 Emacs provides a convenient method for binding the numeric keypad
1786keys, using the variables @code{keypad-setup},
1787@code{keypad-numlock-setup}, @code{keypad-shifted-setup}, and
1788@code{keypad-numlock-shifted-setup}. These can be found in the
1789@samp{keyboard} customization group (@pxref{Easy Customization}). You
1790can rebind the keys to perform other tasks, such as issuing numeric
1791prefix arguments.
1792
1793@node Named ASCII Chars
1794@subsection Named @acronym{ASCII} Control Characters
1795
1796 @key{TAB}, @key{RET}, @key{BS}, @key{LFD}, @key{ESC} and @key{DEL}
1797started out as names for certain @acronym{ASCII} control characters,
1798used so often that they have special keys of their own. For instance,
1799@key{TAB} was another name for @kbd{C-i}. Later, users found it
1800convenient to distinguish in Emacs between these keys and the ``same''
1801control characters typed with the @key{CTRL} key. Therefore, on most
1802modern terminals, they are no longer the same, and @key{TAB} is
1803distinguishable from @kbd{C-i}.
1804
1805 Emacs can distinguish these two kinds of input if the keyboard does.
1806It treats the ``special'' keys as function keys named @code{tab},
1807@code{return}, @code{backspace}, @code{linefeed}, @code{escape}, and
1808@code{delete}. These function keys translate automatically into the
1809corresponding @acronym{ASCII} characters @emph{if} they have no
1810bindings of their own. As a result, neither users nor Lisp programs
1811need to pay attention to the distinction unless they care to.
1812
1813 If you do not want to distinguish between (for example) @key{TAB} and
1814@kbd{C-i}, make just one binding, for the @acronym{ASCII} character @key{TAB}
1815(octal code 011). If you do want to distinguish, make one binding for
1816this @acronym{ASCII} character, and another for the ``function key'' @code{tab}.
1817
1818 With an ordinary @acronym{ASCII} terminal, there is no way to distinguish
1819between @key{TAB} and @kbd{C-i} (and likewise for other such pairs),
1820because the terminal sends the same character in both cases.
1821
1822@node Mouse Buttons
1823@subsection Rebinding Mouse Buttons
1824@cindex mouse button events
1825@cindex rebinding mouse buttons
1826@cindex click events
1827@cindex drag events
1828@cindex down events
1829@cindex button down events
1830
1831 Emacs uses Lisp symbols to designate mouse buttons, too. The ordinary
1832mouse events in Emacs are @dfn{click} events; these happen when you
1833press a button and release it without moving the mouse. You can also
1834get @dfn{drag} events, when you move the mouse while holding the button
1835down. Drag events happen when you finally let go of the button.
1836
1837 The symbols for basic click events are @code{mouse-1} for the leftmost
1838button, @code{mouse-2} for the next, and so on. Here is how you can
1839redefine the second mouse button to split the current window:
1840
1841@example
1842(global-set-key [mouse-2] 'split-window-vertically)
1843@end example
1844
1845 The symbols for drag events are similar, but have the prefix
1846@samp{drag-} before the word @samp{mouse}. For example, dragging the
1847first button generates a @code{drag-mouse-1} event.
1848
1849 You can also define bindings for events that occur when a mouse button
1850is pressed down. These events start with @samp{down-} instead of
1851@samp{drag-}. Such events are generated only if they have key bindings.
1852When you get a button-down event, a corresponding click or drag event
1853will always follow.
1854
1855@cindex double clicks
1856@cindex triple clicks
1857 If you wish, you can distinguish single, double, and triple clicks. A
1858double click means clicking a mouse button twice in approximately the
1859same place. The first click generates an ordinary click event. The
1860second click, if it comes soon enough, generates a double-click event
1861instead. The event type for a double-click event starts with
1862@samp{double-}: for example, @code{double-mouse-3}.
1863
1864 This means that you can give a special meaning to the second click at
1865the same place, but it must act on the assumption that the ordinary
1866single click definition has run when the first click was received.
1867
1868 This constrains what you can do with double clicks, but user interface
1869designers say that this constraint ought to be followed in any case. A
1870double click should do something similar to the single click, only
1871``more so.'' The command for the double-click event should perform the
1872extra work for the double click.
1873
1874 If a double-click event has no binding, it changes to the
1875corresponding single-click event. Thus, if you don't define a
1876particular double click specially, it executes the single-click command
1877twice.
1878
1879 Emacs also supports triple-click events whose names start with
1880@samp{triple-}. Emacs does not distinguish quadruple clicks as event
1881types; clicks beyond the third generate additional triple-click events.
1882However, the full number of clicks is recorded in the event list, so
1883if you know Emacs Lisp you can distinguish if you really want to
1884(@pxref{Accessing Events,,, elisp, The Emacs Lisp Reference Manual}).
1885We don't recommend distinct meanings for more than three clicks, but
1886sometimes it is useful for subsequent clicks to cycle through the same
1887set of three meanings, so that four clicks are equivalent to one
1888click, five are equivalent to two, and six are equivalent to three.
1889
1890 Emacs also records multiple presses in drag and button-down events.
1891For example, when you press a button twice, then move the mouse while
1892holding the button, Emacs gets a @samp{double-drag-} event. And at the
1893moment when you press it down for the second time, Emacs gets a
1894@samp{double-down-} event (which is ignored, like all button-down
1895events, if it has no binding).
1896
1897@vindex double-click-time
1898 The variable @code{double-click-time} specifies how much time can
1899elapse between clicks and still allow them to be grouped as a multiple
1900click. Its value is in units of milliseconds. If the value is
1901@code{nil}, double clicks are not detected at all. If the value is
1902@code{t}, then there is no time limit. The default is 500.
1903
1904@vindex double-click-fuzz
1905 The variable @code{double-click-fuzz} specifies how much the mouse
1906can move between clicks and still allow them to be grouped as a multiple
1907click. Its value is in units of pixels on windowed displays and in
1908units of 1/8 of a character cell on text-mode terminals; the default is
19093.
1910
1911 The symbols for mouse events also indicate the status of the modifier
1912keys, with the usual prefixes @samp{C-}, @samp{M-}, @samp{H-},
1913@samp{s-}, @samp{A-} and @samp{S-}. These always precede @samp{double-}
1914or @samp{triple-}, which always precede @samp{drag-} or @samp{down-}.
1915
1916 A frame includes areas that don't show text from the buffer, such as
1917the mode line and the scroll bar. You can tell whether a mouse button
1918comes from a special area of the screen by means of dummy ``prefix
1919keys.'' For example, if you click the mouse in the mode line, you get
1920the prefix key @code{mode-line} before the ordinary mouse-button symbol.
1921Thus, here is how to define the command for clicking the first button in
1922a mode line to run @code{scroll-up}:
1923
1924@example
1925(global-set-key [mode-line mouse-1] 'scroll-up)
1926@end example
1927
1928 Here is the complete list of these dummy prefix keys and their
1929meanings:
1930
1931@table @code
1932@item mode-line
1933The mouse was in the mode line of a window.
1934@item vertical-line
1935The mouse was in the vertical line separating side-by-side windows. (If
1936you use scroll bars, they appear in place of these vertical lines.)
1937@item vertical-scroll-bar
1938The mouse was in a vertical scroll bar. (This is the only kind of
1939scroll bar Emacs currently supports.)
1940@item menu-bar
1941The mouse was in the menu bar.
1942@item header-line
1943The mouse was in a header line.
1944@ignore
1945@item horizontal-scroll-bar
1946The mouse was in a horizontal scroll bar. Horizontal scroll bars do
1947horizontal scrolling, and people don't use them often.
1948@end ignore
1949@end table
1950
1951 You can put more than one mouse button in a key sequence, but it isn't
1952usual to do so.
1953
1954@node Disabling
1955@subsection Disabling Commands
1956@cindex disabled command
1957
1958 Disabling a command means that invoking it interactively asks for
1959confirmation from the user. The purpose of disabling a command is to
1960prevent users from executing it by accident; we do this for commands
1961that might be confusing to the uninitiated.
1962
1963 Attempting to invoke a disabled command interactively in Emacs
1964displays a window containing the command's name, its documentation,
1965and some instructions on what to do immediately; then Emacs asks for
1966input saying whether to execute the command as requested, enable it
1967and execute it, or cancel. If you decide to enable the command, you
1968must then answer another question---whether to do this permanently, or
1969just for the current session. (Enabling permanently works by
1970automatically editing your @file{.emacs} file.) You can also type
1971@kbd{!} to enable @emph{all} commands, for the current session only.
1972
1973 The direct mechanism for disabling a command is to put a
1974non-@code{nil} @code{disabled} property on the Lisp symbol for the
1975command. Here is the Lisp program to do this:
1976
1977@example
1978(put 'delete-region 'disabled t)
1979@end example
1980
1981 If the value of the @code{disabled} property is a string, that string
1982is included in the message displayed when the command is used:
1983
1984@example
1985(put 'delete-region 'disabled
1986 "It's better to use `kill-region' instead.\n")
1987@end example
1988
1989@findex disable-command
1990@findex enable-command
1991 You can make a command disabled either by editing the @file{.emacs}
1992file directly, or with the command @kbd{M-x disable-command}, which edits
1993the @file{.emacs} file for you. Likewise, @kbd{M-x enable-command}
1994edits @file{.emacs} to enable a command permanently. @xref{Init File}.
1995
1996 If Emacs was invoked with the @option{-q} or @option{--no-init-file}
1997options (@pxref{Initial Options}), it will not edit your
1998@file{~/.emacs} init file. Doing so could lose information
1999because Emacs has not read your init file.
2000
2001 Whether a command is disabled is independent of what key is used to
2002invoke it; disabling also applies if the command is invoked using
2003@kbd{M-x}. However, disabling a command has no effect on calling it
2004as a function from Lisp programs.
2005
2006@node Syntax
2007@section The Syntax Table
2008@cindex syntax table
2009
2010 All the Emacs commands which parse words or balance parentheses are
2011controlled by the @dfn{syntax table}. The syntax table says which
2012characters are opening delimiters, which are parts of words, which are
2013string quotes, and so on. It does this by assigning each character to
2014one of fifteen-odd @dfn{syntax classes}. In some cases it specifies
2015some additional information also.
2016
2017 Each major mode has its own syntax table (though related major modes
2018sometimes share one syntax table), which it installs in each buffer
2019that uses the mode. The syntax table installed in the current buffer
2020is the one that all commands use, so we call it ``the'' syntax table.
2021
2022@kindex C-h s
2023@findex describe-syntax
2024 To display a description of the contents of the current syntax
2025table, type @kbd{C-h s} (@code{describe-syntax}). The description of
2026each character includes the string you would have to give to
2027@code{modify-syntax-entry} to set up that character's current syntax,
2028starting with the character which designates its syntax class, plus
2029some English text to explain its meaning.
2030
2031 A syntax table is actually a Lisp object, a char-table, whose
2032elements are cons cells. For full information on the syntax table,
2033see @ref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp
2034Reference Manual}.
2035
2036@node Init File
2037@section The Init File, @file{~/.emacs}
2038@cindex init file
2039@cindex Emacs initialization file
2040@cindex key rebinding, permanent
2041@cindex rebinding keys, permanently
2042@cindex startup (init file)
2043
2044 When Emacs is started, it normally loads a Lisp program from the file
2045@file{.emacs} or @file{.emacs.el} in your home directory (@pxref{Find Init}).
2046We call this file your @dfn{init file} because it specifies how to
2047initialize Emacs for you. You can use the command line switch
2048@samp{-q} to prevent loading your init file, and @samp{-u} (or
2049@samp{--user}) to specify a different user's init file (@pxref{Initial
2050Options}).
2051
2052 You can also use @file{~/.emacs.d/init.el} as the init file. Emacs
2053tries this if it cannot find @file{~/.emacs} or @file{~/.emacs.el}.
2054
2055@cindex @file{default.el}, the default init file
2056 There can also be a @dfn{default init file}, which is the library
2057named @file{default.el}, found via the standard search path for
2058libraries. The Emacs distribution contains no such library; your site
2059may create one for local customizations. If this library exists, it is
2060loaded whenever you start Emacs (except when you specify @samp{-q}).
2061But your init file, if any, is loaded first; if it sets
2062@code{inhibit-default-init} non-@code{nil}, then @file{default} is not
2063loaded.
2064
2065@cindex site init file
2066@cindex @file{site-start.el}, the site startup file
2067 Your site may also have a @dfn{site startup file}; this is named
2068@file{site-start.el}, if it exists. Like @file{default.el}, Emacs
2069finds this file via the standard search path for Lisp libraries.
2070Emacs loads this library before it loads your init file. To inhibit
2071loading of this library, use the option @samp{--no-site-file}.
2072@xref{Initial Options}. We recommend against using
2073@file{site-start.el} for changes that some users may not like. It is
2074better to put them in @file{default.el}, so that users can more easily
2075override them.
2076
2077 You can place @file{default.el} and @file{site-start.el} in any of
2078the directories which Emacs searches for Lisp libraries. The variable
2079@code{load-path} (@pxref{Lisp Libraries}) specifies these directories.
2080Many sites put these files in the @file{site-lisp} subdirectory of the
2081Emacs installation directory, typically
2082@file{/usr/local/share/emacs/site-lisp}.
2083
2084 If you have a large amount of code in your @file{.emacs} file, you
2085should rename it to @file{~/.emacs.el}, and byte-compile it. @xref{Byte
2086Compilation,, Byte Compilation, elisp, the Emacs Lisp Reference Manual},
2087for more information about compiling Emacs Lisp programs.
2088
2089 If you are going to write actual Emacs Lisp programs that go beyond
2090minor customization, you should read the @cite{Emacs Lisp Reference Manual}.
2091@ifnottex
2092@xref{Top, Emacs Lisp, Emacs Lisp, elisp, the Emacs Lisp Reference
2093Manual}.
2094@end ifnottex
2095
2096@menu
2097* Init Syntax:: Syntax of constants in Emacs Lisp.
2098* Init Examples:: How to do some things with an init file.
2099* Terminal Init:: Each terminal type can have an init file.
2100* Find Init:: How Emacs finds the init file.
2101* Init Non-ASCII:: Using non-@acronym{ASCII} characters in an init file.
2102@end menu
2103
2104@node Init Syntax
2105@subsection Init File Syntax
2106
2107 The @file{.emacs} file contains one or more Lisp function call
2108expressions. Each of these consists of a function name followed by
2109arguments, all surrounded by parentheses. For example, @code{(setq
2110fill-column 60)} calls the function @code{setq} to set the variable
2111@code{fill-column} (@pxref{Filling}) to 60.
2112
2113 You can set any Lisp variable with @code{setq}, but with certain
2114variables @code{setq} won't do what you probably want in the
2115@file{.emacs} file. Some variables automatically become buffer-local
2116when set with @code{setq}; what you want in @file{.emacs} is to set
2117the default value, using @code{setq-default}. Some customizable minor
2118mode variables do special things to enable the mode when you set them
2119with Customize, but ordinary @code{setq} won't do that; to enable the
2120mode in your @file{.emacs} file, call the minor mode command. The
2121following section has examples of both of these methods.
2122
2123 The second argument to @code{setq} is an expression for the new
2124value of the variable. This can be a constant, a variable, or a
2125function call expression. In @file{.emacs}, constants are used most
2126of the time. They can be:
2127
2128@table @asis
2129@item Numbers:
2130Numbers are written in decimal, with an optional initial minus sign.
2131
2132@item Strings:
2133@cindex Lisp string syntax
2134@cindex string syntax
2135Lisp string syntax is the same as C string syntax with a few extra
2136features. Use a double-quote character to begin and end a string constant.
2137
2138In a string, you can include newlines and special characters literally.
2139But often it is cleaner to use backslash sequences for them: @samp{\n}
2140for newline, @samp{\b} for backspace, @samp{\r} for carriage return,
2141@samp{\t} for tab, @samp{\f} for formfeed (control-L), @samp{\e} for
2142escape, @samp{\\} for a backslash, @samp{\"} for a double-quote, or
2143@samp{\@var{ooo}} for the character whose octal code is @var{ooo}.
2144Backslash and double-quote are the only characters for which backslash
2145sequences are mandatory.
2146
2147@samp{\C-} can be used as a prefix for a control character, as in
2148@samp{\C-s} for @acronym{ASCII} control-S, and @samp{\M-} can be used as a prefix for
2149a Meta character, as in @samp{\M-a} for @kbd{Meta-A} or @samp{\M-\C-a} for
2150@kbd{Control-Meta-A}.@refill
2151
2152@xref{Init Non-ASCII}, for information about including
2153non-@acronym{ASCII} in your init file.
2154
2155@item Characters:
2156Lisp character constant syntax consists of a @samp{?} followed by
2157either a character or an escape sequence starting with @samp{\}.
2158Examples: @code{?x}, @code{?\n}, @code{?\"}, @code{?\)}. Note that
2159strings and characters are not interchangeable in Lisp; some contexts
2160require one and some contexts require the other.
2161
2162@xref{Init Non-ASCII}, for information about binding commands to
2163keys which send non-@acronym{ASCII} characters.
2164
2165@item True:
2166@code{t} stands for `true'.
2167
2168@item False:
2169@code{nil} stands for `false'.
2170
2171@item Other Lisp objects:
2172Write a single-quote (@code{'}) followed by the Lisp object you want.
2173@end table
2174
2175@node Init Examples
2176@subsection Init File Examples
2177
2178 Here are some examples of doing certain commonly desired things with
2179Lisp expressions:
2180
2181@itemize @bullet
2182@item
2183Make @key{TAB} in C mode just insert a tab if point is in the middle of a
2184line.
2185
2186@example
2187(setq c-tab-always-indent nil)
2188@end example
2189
2190Here we have a variable whose value is normally @code{t} for `true'
2191and the alternative is @code{nil} for `false'.
2192
2193@item
2194Make searches case sensitive by default (in all buffers that do not
2195override this).
2196
2197@example
2198(setq-default case-fold-search nil)
2199@end example
2200
2201This sets the default value, which is effective in all buffers that do
2202not have local values for the variable. Setting @code{case-fold-search}
2203with @code{setq} affects only the current buffer's local value, which
2204is not what you probably want to do in an init file.
2205
2206@item
2207@vindex user-mail-address
2208Specify your own email address, if Emacs can't figure it out correctly.
2209
2210@example
2211(setq user-mail-address "rumsfeld@@torture.gov")
2212@end example
2213
2214Various Emacs packages that need your own email address use the value of
2215@code{user-mail-address}.
2216
2217@item
2218Make Text mode the default mode for new buffers.
2219
2220@example
2221(setq default-major-mode 'text-mode)
2222@end example
2223
2224Note that @code{text-mode} is used because it is the command for
2225entering Text mode. The single-quote before it makes the symbol a
2226constant; otherwise, @code{text-mode} would be treated as a variable
2227name.
2228
2229@need 1500
2230@item
2231Set up defaults for the Latin-1 character set
2232which supports most of the languages of Western Europe.
2233
2234@example
2235(set-language-environment "Latin-1")
2236@end example
2237
2238@need 1500
2239@item
2240Turn off Line Number mode, a global minor mode.
2241
2242@example
2243(line-number-mode 0)
2244@end example
2245
2246@need 1500
2247@item
2248Turn on Auto Fill mode automatically in Text mode and related modes.
2249
2250@example
2251(add-hook 'text-mode-hook
2252 '(lambda () (auto-fill-mode 1)))
2253@end example
2254
2255This shows how to add a hook function to a normal hook variable
2256(@pxref{Hooks}). The function we supply is a list starting with
2257@code{lambda}, with a single-quote in front of it to make it a list
2258constant rather than an expression.
2259
2260It's beyond the scope of this manual to explain Lisp functions, but for
2261this example it is enough to know that the effect is to execute
2262@code{(auto-fill-mode 1)} when Text mode is entered. You can replace
2263that with any other expression that you like, or with several
2264expressions in a row.
2265
2266Emacs comes with a function named @code{turn-on-auto-fill} whose
2267definition is @code{(lambda () (auto-fill-mode 1))}. Thus, a simpler
2268way to write the above example is as follows:
2269
2270@example
2271(add-hook 'text-mode-hook 'turn-on-auto-fill)
2272@end example
2273
2274@item
2275Load the installed Lisp library named @file{foo} (actually a file
2276@file{foo.elc} or @file{foo.el} in a standard Emacs directory).
2277
2278@example
2279(load "foo")
2280@end example
2281
2282When the argument to @code{load} is a relative file name, not starting
2283with @samp{/} or @samp{~}, @code{load} searches the directories in
2284@code{load-path} (@pxref{Lisp Libraries}).
2285
2286@item
2287Load the compiled Lisp file @file{foo.elc} from your home directory.
2288
2289@example
2290(load "~/foo.elc")
2291@end example
2292
2293Here an absolute file name is used, so no searching is done.
2294
2295@item
2296@cindex loading Lisp libraries automatically
2297@cindex autoload Lisp libraries
2298Tell Emacs to find the definition for the function @code{myfunction}
2299by loading a Lisp library named @file{mypackage} (i.e.@: a file
2300@file{mypackage.elc} or @file{mypackage.el}):
2301
2302@example
2303(autoload 'myfunction "mypackage" "Do what I say." t)
2304@end example
2305
2306@noindent
2307Here the string @code{"Do what I say."} is the function's
2308documentation string. You specify it in the @code{autoload}
2309definition so it will be available for help commands even when the
2310package is not loaded. The last argument, @code{t}, indicates that
2311this function is interactive; that is, it can be invoked interactively
2312by typing @kbd{M-x myfunction @key{RET}} or by binding it to a key.
2313If the function is not interactive, omit the @code{t} or use
2314@code{nil}.
2315
2316@item
2317Rebind the key @kbd{C-x l} to run the function @code{make-symbolic-link}
2318(@pxref{Init Rebinding}).
2319
2320@example
2321(global-set-key "\C-xl" 'make-symbolic-link)
2322@end example
2323
2324or
2325
2326@example
2327(define-key global-map "\C-xl" 'make-symbolic-link)
2328@end example
2329
2330Note once again the single-quote used to refer to the symbol
2331@code{make-symbolic-link} instead of its value as a variable.
2332
2333@item
2334Do the same thing for Lisp mode only.
2335
2336@example
2337(define-key lisp-mode-map "\C-xl" 'make-symbolic-link)
2338@end example
2339
2340@item
2341Redefine all keys which now run @code{next-line} in Fundamental mode
2342so that they run @code{forward-line} instead.
2343
2344@findex substitute-key-definition
2345@example
2346(substitute-key-definition 'next-line 'forward-line
2347 global-map)
2348@end example
2349
2350@item
2351Make @kbd{C-x C-v} undefined.
2352
2353@example
2354(global-unset-key "\C-x\C-v")
2355@end example
2356
2357One reason to undefine a key is so that you can make it a prefix.
2358Simply defining @kbd{C-x C-v @var{anything}} will make @kbd{C-x C-v} a
2359prefix, but @kbd{C-x C-v} must first be freed of its usual non-prefix
2360definition.
2361
2362@item
2363Make @samp{$} have the syntax of punctuation in Text mode.
2364Note the use of a character constant for @samp{$}.
2365
2366@example
2367(modify-syntax-entry ?\$ "." text-mode-syntax-table)
2368@end example
2369
2370@item
2371Enable the use of the command @code{narrow-to-region} without confirmation.
2372
2373@example
2374(put 'narrow-to-region 'disabled nil)
2375@end example
2376
2377@item
2378Adjusting the configuration to various platforms and Emacs versions.
2379
2380Users typically want Emacs to behave the same on all systems, so the
2381same init file is right for all platforms. However, sometimes it
2382happens that a function you use for customizing Emacs is not available
2383on some platforms or in older Emacs versions. To deal with that
2384situation, put the customization inside a conditional that tests whether
2385the function or facility is available, like this:
2386
2387@example
2388(if (fboundp 'blink-cursor-mode)
2389 (blink-cursor-mode 0))
2390
2391(if (boundp 'coding-category-utf-8)
2392 (set-coding-priority '(coding-category-utf-8)))
2393@end example
2394
2395@noindent
2396You can also simply disregard the errors that occur if the
2397function is not defined.
2398
2399@example
2400(condition case ()
2401 (set-face-background 'region "grey75")
2402 (error nil))
2403@end example
2404
2405A @code{setq} on a variable which does not exist is generally
2406harmless, so those do not need a conditional.
2407@end itemize
2408
2409@node Terminal Init
2410@subsection Terminal-specific Initialization
2411
2412 Each terminal type can have a Lisp library to be loaded into Emacs when
2413it is run on that type of terminal. For a terminal type named
2414@var{termtype}, the library is called @file{term/@var{termtype}} and it is
2415found by searching the directories @code{load-path} as usual and trying the
2416suffixes @samp{.elc} and @samp{.el}. Normally it appears in the
2417subdirectory @file{term} of the directory where most Emacs libraries are
2418kept.@refill
2419
2420 The usual purpose of the terminal-specific library is to map the
2421escape sequences used by the terminal's function keys onto more
2422meaningful names, using @code{function-key-map}. See the file
2423@file{term/lk201.el} for an example of how this is done. Many function
2424keys are mapped automatically according to the information in the
2425Termcap data base; the terminal-specific library needs to map only the
2426function keys that Termcap does not specify.
2427
2428 When the terminal type contains a hyphen, only the part of the name
2429before the first hyphen is significant in choosing the library name.
2430Thus, terminal types @samp{aaa-48} and @samp{aaa-30-rv} both use
2431the library @file{term/aaa}. The code in the library can use
2432@code{(getenv "TERM")} to find the full terminal type name.@refill
2433
2434@vindex term-file-prefix
2435 The library's name is constructed by concatenating the value of the
2436variable @code{term-file-prefix} and the terminal type. Your @file{.emacs}
2437file can prevent the loading of the terminal-specific library by setting
2438@code{term-file-prefix} to @code{nil}.
2439
2440@vindex term-setup-hook
2441 Emacs runs the hook @code{term-setup-hook} at the end of
2442initialization, after both your @file{.emacs} file and any
2443terminal-specific library have been read in. Add hook functions to this
2444hook if you wish to override part of any of the terminal-specific
2445libraries and to define initializations for terminals that do not have a
2446library. @xref{Hooks}.
2447
2448@node Find Init
2449@subsection How Emacs Finds Your Init File
2450
2451 Normally Emacs uses the environment variable @env{HOME}
2452(@pxref{General Variables, HOME}) to find @file{.emacs}; that's what
2453@samp{~} means in a file name. If @file{.emacs} is not found inside
2454@file{~/} (nor @file{.emacs.el}), Emacs looks for
2455@file{~/.emacs.d/init.el} (which, like @file{~/.emacs.el}, can be
2456byte-compiled).
2457
2458 However, if you run Emacs from a shell started by @code{su}, Emacs
2459tries to find your own @file{.emacs}, not that of the user you are
2460currently pretending to be. The idea is that you should get your own
2461editor customizations even if you are running as the super user.
2462
2463 More precisely, Emacs first determines which user's init file to use.
2464It gets your user name from the environment variables @env{LOGNAME} and
2465@env{USER}; if neither of those exists, it uses effective user-ID.
2466If that user name matches the real user-ID, then Emacs uses @env{HOME};
2467otherwise, it looks up the home directory corresponding to that user
2468name in the system's data base of users.
2469@c LocalWords: backtab
2470
2471@node Init Non-ASCII
2472@subsection Non-@acronym{ASCII} Characters in Init Files
2473@cindex international characters in @file{.emacs}
2474@cindex non-@acronym{ASCII} characters in @file{.emacs}
2475@cindex non-@acronym{ASCII} keys, binding
2476@cindex rebinding non-@acronym{ASCII} keys
2477
2478 Language and coding systems may cause problems if your init file
2479contains non-@acronym{ASCII} characters, such as accented letters, in
2480strings or key bindings.
2481
2482 If you want to use non-@acronym{ASCII} characters in your init file,
2483you should put a @w{@samp{-*-coding: @var{coding-system}-*-}} tag on
2484the first line of the init file, and specify a coding system that
2485supports the character(s) in question. @xref{Recognize Coding}. This
2486is because the defaults for decoding non-@acronym{ASCII} text might
2487not yet be set up by the time Emacs reads those parts of your init
2488file which use such strings, possibly leading Emacs to decode those
2489strings incorrectly. You should then avoid adding Emacs Lisp code
2490that modifies the coding system in other ways, such as calls to
2491@code{set-language-environment}.
2492
2493 To bind non-@acronym{ASCII} keys, you must use a vector (@pxref{Init
2494Rebinding}). The string syntax cannot be used, since the
2495non-@acronym{ASCII} characters will be interpreted as meta keys. For
2496instance:
2497
2498@example
2499(global-set-key [?@var{char}] 'some-function)
2500@end example
2501
2502@noindent
2503Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}.
2504
2505 @strong{Warning:} if you change the keyboard encoding, or change
2506between multibyte and unibyte mode, or anything that would alter which
2507code @kbd{C-q} would insert for that character, this keybinding may
2508stop working. It is therefore advisable to use one and only one
2509coding system, for your init file as well as the files you edit. For
2510example, don't mix the @samp{latin-1} and @samp{latin-9} coding
2511systems.
2512
2513@ignore
2514 arch-tag: c68abddb-4410-4fb5-925f-63394e971d93
2515@end ignore
diff --git a/doc/emacs/dired-xtra.texi b/doc/emacs/dired-xtra.texi
new file mode 100644
index 00000000000..e8fdf8ab468
--- /dev/null
+++ b/doc/emacs/dired-xtra.texi
@@ -0,0 +1,49 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Subdir Switches
8@section Subdirectory Switches in Dired
9
10You can insert subdirectories with specified @code{ls} switches in
11Dired buffers, using @kbd{C-u i}. You can change the @code{ls}
12switches of an already inserted subdirectory using @kbd{C-u l}.
13
14In Emacs versions 22.1 and later, Dired remembers the switches, so
15that reverting the buffer will not change them back to the main
16directory's switches. Deleting a subdirectory forgets about its
17switches.
18
19Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u})
20to reinsert or delete subdirectories, that were inserted with explicit
21switches, can bypass Dired's machinery for remembering (or forgetting)
22switches. Deleting a subdirectory using @code{dired-undo} does not
23forget its switches. When later reinserted using @kbd{i}, it will be
24reinserted using its old switches. Using @code{dired-undo} to
25reinsert a subdirectory that was deleted using the regular
26Dired commands (not @code{dired-undo}) will originally insert it with
27its old switches. However, reverting the buffer will relist it using
28the buffer's default switches. If any of this yields problems, you
29can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
30
31Dired does not remember the @code{R} switch. Inserting a subdirectory
32with switches that include the @code{R} switch is equivalent with
33inserting each of its subdirectories using all remaining switches.
34For instance, updating or killing a subdirectory that was inserted
35with the @code{R} switch will not update or kill its subdirectories.
36
37The buffer's default switches do not affect subdirectories that were
38inserted using explicitly specified switches. In particular,
39commands such as @kbd{s}, that change the buffer's switches do not
40affect such subdirectories. (They do affect subdirectories without
41explicitly assigned switches, however.)
42
43You can make Dired forget about all subdirectory switches and relist
44all subdirectories with the buffer's default switches using
45@kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer.
46
47@ignore
48 arch-tag: e3865701-9179-4ffb-bc34-d321111c688d
49@end ignore
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
new file mode 100644
index 00000000000..3dda3f588eb
--- /dev/null
+++ b/doc/emacs/dired.texi
@@ -0,0 +1,1317 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Dired, Calendar/Diary, Rmail, Top
6@chapter Dired, the Directory Editor
7@cindex Dired
8@cindex file management
9
10 Dired makes an Emacs buffer containing a listing of a directory, and
11optionally some of its subdirectories as well. You can use the normal
12Emacs commands to move around in this buffer, and special Dired commands
13to operate on the files listed.
14
15 The Dired buffer is ``read-only,'' and inserting text in it is not
16useful, so ordinary printing characters such as @kbd{d} and @kbd{x}
17are redefined for special Dired commands. Some Dired commands
18@dfn{mark} or @dfn{flag} the @dfn{current file} (that is, the file on
19the current line); other commands operate on the marked files or on
20the flagged files. You first mark certain files in order to operate
21on all of them with on command.
22
23 The Dired-X package provides various extra features for Dired mode.
24@xref{Top, Dired-X,,dired-x, Dired Extra Version 2 User's Manual}.
25
26@menu
27* Enter: Dired Enter. How to invoke Dired.
28* Navigation: Dired Navigation. Special motion commands in the Dired buffer.
29* Deletion: Dired Deletion. Deleting files with Dired.
30* Flagging Many Files:: Flagging files based on their names.
31* Visit: Dired Visiting. Other file operations through Dired.
32* Marks vs Flags:: Flagging for deletion vs marking.
33* Operating on Files:: How to copy, rename, print, compress, etc.
34 either one file or several files.
35* Shell Commands in Dired:: Running a shell command on the marked files.
36* Transforming File Names:: Using patterns to rename multiple files.
37* Comparison in Dired:: Running `diff' by way of Dired.
38* Subdirectories in Dired:: Adding subdirectories to the Dired buffer.
39@ifnottex
40* Subdir Switches:: Subdirectory switches in Dired.
41@end ifnottex
42* Subdirectory Motion:: Moving across subdirectories, and up and down.
43* Hiding Subdirectories:: Making subdirectories visible or invisible.
44* Updating: Dired Updating. Discarding lines for files of no interest.
45* Find: Dired and Find. Using `find' to choose the files for Dired.
46* Wdired:: Operating on files by editing the Dired buffer.
47* Image-Dired:: Viewing image thumbnails in Dired
48* Misc: Misc Dired Features. Various other features.
49@end menu
50
51@node Dired Enter
52@section Entering Dired
53
54@findex dired
55@kindex C-x d
56@vindex dired-listing-switches
57 To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command
58reads a directory name or wildcard file name pattern as a minibuffer
59argument to specify the files to list. @kbd{C-x C-f} given a
60directory name also invokes Dired. Where @code{dired} differs from
61@code{list-directory} is that it puts the buffer into Dired mode, so
62that the special commands of Dired are available.
63
64 The variable @code{dired-listing-switches} specifies the options to
65give to @code{ls} for listing the directory; this string @emph{must}
66contain @samp{-l}. If you use a numeric prefix argument with the
67@code{dired} command, you can specify the @code{ls} switches with the
68minibuffer before you enter the directory specification. No matter
69how they are specified, the @code{ls} switches can include short
70options (that is, single characters) requiring no arguments, and long
71options (starting with @samp{--}) whose arguments are specified with
72@samp{=}.
73
74 On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls};
75see @ref{ls in Lisp}, for options and peculiarities of that emulation.
76
77
78@findex dired-other-window
79@kindex C-x 4 d
80@findex dired-other-frame
81@kindex C-x 5 d
82 To display the Dired buffer in another window rather than in the
83selected window, use @kbd{C-x 4 d} (@code{dired-other-window}) instead
84of @kbd{C-x d}. @kbd{C-x 5 d} (@code{dired-other-frame}) uses a
85separate frame to display the Dired buffer.
86
87@node Dired Navigation
88@section Navigation in the Dired Buffer
89
90@kindex C-n @r{(Dired)}
91@kindex C-p @r{(Dired)}
92 All the usual Emacs cursor motion commands are available in Dired
93buffers. The keys @kbd{C-n} and @kbd{C-p} are redefined to put the
94cursor at the beginning of the file name on the line, rather than at
95the beginning of the line.
96
97@kindex SPC @r{(Dired)}
98 For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent
99to @kbd{C-n}. @kbd{p} is equivalent to @kbd{C-p}. (Moving by lines is
100so common in Dired that it deserves to be easy to type.) @key{DEL}
101(move up and unflag) is often useful simply for moving up.
102
103@findex dired-goto-file
104@kindex j @r{(Dired)}
105 @kbd{j} (@code{dired-goto-file}) moves point to the line that
106describes a specified file or directory.
107
108 Some additional navigation commands are available when the Dired
109buffer includes several directories. @xref{Subdirectory Motion}.
110
111@node Dired Deletion
112@section Deleting Files with Dired
113@cindex flagging files (in Dired)
114@cindex deleting files (in Dired)
115
116 One of the most frequent uses of Dired is to first @dfn{flag} files for
117deletion, then delete the files that were flagged.
118
119@table @kbd
120@item d
121Flag this file for deletion.
122@item u
123Remove deletion flag on this line.
124@item @key{DEL}
125Move point to previous line and remove the deletion flag on that line.
126@item x
127Delete the files that are flagged for deletion.
128@end table
129
130@kindex d @r{(Dired)}
131@findex dired-flag-file-deletion
132 You can flag a file for deletion by moving to the line describing
133the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The
134deletion flag is visible as a @samp{D} at the beginning of the line.
135This command moves point to the next line, so that repeated @kbd{d}
136commands flag successive files. A numeric argument serves as a repeat
137count.
138
139@kindex u @r{(Dired deletion)}
140@kindex DEL @r{(Dired)}
141 The reason for flagging files for deletion, rather than deleting
142files immediately, is to reduce the danger of deleting a file
143accidentally. Until you direct Dired to delete the flagged files, you
144can remove deletion flags using the commands @kbd{u} and @key{DEL}.
145@kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes
146flags rather than making flags. @key{DEL}
147(@code{dired-unmark-backward}) moves upward, removing flags; it is
148like @kbd{u} with argument @minus{}1.
149
150@kindex x @r{(Dired)}
151@findex dired-do-flagged-delete
152@cindex expunging (Dired)
153 To delete the flagged files, type @kbd{x}
154(@code{dired-do-flagged-delete}). (This is also known as
155@dfn{expunging}.) This command first displays a list of all the file
156names flagged for deletion, and requests confirmation with @kbd{yes}.
157If you confirm, Dired deletes the flagged files, then deletes their
158lines from the text of the Dired buffer. The Dired buffer, with
159somewhat fewer lines, remains selected.
160
161 If you answer @kbd{no} or quit with @kbd{C-g} when asked to confirm, you
162return immediately to Dired, with the deletion flags still present in
163the buffer, and no files actually deleted.
164
165@cindex recursive deletion
166@vindex dired-recursive-deletes
167 You can delete empty directories just like other files, but normally
168Dired cannot delete directories that are nonempty. If the variable
169@code{dired-recursive-deletes} is non-@code{nil}, then Dired can
170delete nonempty directories including all their contents. That can
171be somewhat risky.
172
173@node Flagging Many Files
174@section Flagging Many Files at Once
175@cindex flagging many files for deletion (in Dired)
176
177@table @kbd
178@item #
179Flag all auto-save files (files whose names start and end with @samp{#})
180for deletion (@pxref{Auto Save}).
181
182@item ~
183Flag all backup files (files whose names end with @samp{~}) for deletion
184(@pxref{Backup}).
185
186@item &
187Flag for deletion all files with certain kinds of names which suggest
188you could easily create those files again.
189
190@item .@: @r{(Period)}
191Flag excess numeric backup files for deletion. The oldest and newest
192few backup files of any one file are exempt; the middle ones are
193flagged.
194
195@item % d @var{regexp} @key{RET}
196Flag for deletion all files whose names match the regular expression
197@var{regexp}.
198@end table
199
200 The @kbd{#}, @kbd{~}, @kbd{&}, and @kbd{.} commands flag many files for
201deletion, based on their file names. These commands are useful
202precisely because they do not themselves delete any files; you can
203remove the deletion flags from any flagged files that you really wish to
204keep.@refill
205
206@kindex & @r{(Dired)}
207@findex dired-flag-garbage-files
208@vindex dired-garbage-files-regexp
209@cindex deleting some backup files
210 @kbd{&} (@code{dired-flag-garbage-files}) flags files whose names
211match the regular expression specified by the variable
212@code{dired-garbage-files-regexp}. By default, this matches certain
213files produced by @TeX{}, @samp{.bak} files, and the @samp{.orig} and
214@samp{.rej} files produced by @code{patch}.
215
216@kindex # @r{(Dired)}
217@findex dired-flag-auto-save-files
218@cindex deleting auto-save files
219 @kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all
220files whose names look like auto-save files---that is, files whose
221names begin and end with @samp{#}. @xref{Auto Save}.
222
223@kindex ~ @r{(Dired)}
224@findex dired-flag-backup-files
225 @kbd{~} (@code{dired-flag-backup-files}) flags for deletion all
226files whose names say they are backup files---that is, files whose
227names end in @samp{~}. @xref{Backup}.
228
229@kindex . @r{(Dired)}
230@vindex dired-kept-versions
231@findex dired-clean-directory
232 @kbd{.} (period, @code{dired-clean-directory}) flags just some of the
233backup files for deletion: all but the oldest few and newest few backups
234of any one file. Normally @code{dired-kept-versions} (@strong{not}
235@code{kept-new-versions}; that applies only when saving) specifies the
236number of newest versions of each file to keep, and
237@code{kept-old-versions} specifies the number of oldest versions to
238keep.
239
240 Period with a positive numeric argument, as in @kbd{C-u 3 .},
241specifies the number of newest versions to keep, overriding
242@code{dired-kept-versions}. A negative numeric argument overrides
243@code{kept-old-versions}, using minus the value of the argument to
244specify the number of oldest versions of each file to keep.
245
246@findex dired-flag-files-regexp
247@kindex % d @r{(Dired)}
248 The @kbd{% d} command flags all files whose names match a specified
249regular expression (@code{dired-flag-files-regexp}). Only the
250non-directory part of the file name is used in matching. You can use
251@samp{^} and @samp{$} to anchor matches. You can exclude certain
252subdirectories from marking by hiding them while you use @kbd{% d}.
253@xref{Hiding Subdirectories}.
254
255@node Dired Visiting
256@section Visiting Files in Dired
257
258 There are several Dired commands for visiting or examining the files
259listed in the Dired buffer. All of them apply to the current line's
260file; if that file is really a directory, these commands invoke Dired on
261that subdirectory (making a separate Dired buffer).
262
263@table @kbd
264@item f
265@kindex f @r{(Dired)}
266@findex dired-find-file
267Visit the file described on the current line, like typing @kbd{C-x C-f}
268and supplying that file name (@code{dired-find-file}). @xref{Visiting}.
269
270@item @key{RET}
271@itemx e
272@kindex RET @r{(Dired)}
273@kindex e @r{(Dired)}
274Equivalent to @kbd{f}.
275
276@ignore @c This command seems too risky to document at all.
277@item a
278@kindex a @r{(Dired)}
279@findex dired-find-alternate-file
280Like @kbd{f}, but replaces the contents of the Dired buffer with
281that of an alternate file or directory (@code{dired-find-alternate-file}).
282@end ignore
283
284@item o
285@kindex o @r{(Dired)}
286@findex dired-find-file-other-window
287Like @kbd{f}, but uses another window to display the file's buffer
288(@code{dired-find-file-other-window}). The Dired buffer remains visible
289in the first window. This is like using @kbd{C-x 4 C-f} to visit the
290file. @xref{Windows}.
291
292@item C-o
293@kindex C-o @r{(Dired)}
294@findex dired-display-file
295Visit the file described on the current line, and display the buffer in
296another window, but do not select that window (@code{dired-display-file}).
297
298@item Mouse-1
299@itemx Mouse-2
300@findex dired-mouse-find-file-other-window
301Visit the file named by the line you click on
302(@code{dired-mouse-find-file-other-window}). This uses another window
303to display the file, like the @kbd{o} command.
304
305@item v
306@kindex v @r{(Dired)}
307@findex dired-view-file
308View the file described on the current line, using @kbd{M-x view-file}
309(@code{dired-view-file}). Viewing a file with @code{view-file} is
310like visiting it, but is slanted toward moving around in the file
311conveniently and does not allow changing the file. @xref{Misc File
312Ops, View File, Miscellaneous File Operations}.
313
314@item ^
315@kindex ^ @r{(Dired)}
316@findex dired-up-directory
317Visit the parent directory of the current directory
318(@code{dired-up-directory}). This is equivalent to moving to the line
319for @file{..} and typing @kbd{f} there.
320@end table
321
322@node Marks vs Flags
323@section Dired Marks vs. Flags
324
325@cindex marking many files (in Dired)
326 Instead of flagging a file with @samp{D}, you can @dfn{mark} the
327file with some other character (usually @samp{*}). Most Dired
328commands to operate on files use the files marked with @samp{*}. The
329only command that operates on flagged files is @kbd{x}, which expunges
330them.
331
332 Here are some commands for marking with @samp{*}, for unmarking, and
333for operating on marks. (@xref{Dired Deletion}, for commands to flag
334and unflag files.)
335
336@table @kbd
337@item m
338@itemx * m
339@kindex m @r{(Dired)}
340@kindex * m @r{(Dired)}
341@findex dired-mark
342Mark the current file with @samp{*} (@code{dired-mark}). With a numeric
343argument @var{n}, mark the next @var{n} files starting with the current
344file. (If @var{n} is negative, mark the previous @minus{}@var{n}
345files.)
346
347@item * *
348@kindex * * @r{(Dired)}
349@findex dired-mark-executables
350@cindex marking executable files (in Dired)
351Mark all executable files with @samp{*}
352(@code{dired-mark-executables}). With a numeric argument, unmark all
353those files.
354
355@item * @@
356@kindex * @@ @r{(Dired)}
357@findex dired-mark-symlinks
358@cindex marking symbolic links (in Dired)
359Mark all symbolic links with @samp{*} (@code{dired-mark-symlinks}).
360With a numeric argument, unmark all those files.
361
362@item * /
363@kindex * / @r{(Dired)}
364@findex dired-mark-directories
365@cindex marking subdirectories (in Dired)
366Mark with @samp{*} all files which are directories, except for
367@file{.} and @file{..} (@code{dired-mark-directories}). With a numeric
368argument, unmark all those files.
369
370@item * s
371@kindex * s @r{(Dired)}
372@findex dired-mark-subdir-files
373Mark all the files in the current subdirectory, aside from @file{.}
374and @file{..} (@code{dired-mark-subdir-files}).
375
376@item u
377@itemx * u
378@kindex u @r{(Dired)}
379@kindex * u @r{(Dired)}
380@findex dired-unmark
381Remove any mark on this line (@code{dired-unmark}).
382
383@item @key{DEL}
384@itemx * @key{DEL}
385@kindex * DEL @r{(Dired)}
386@findex dired-unmark-backward
387@cindex unmarking files (in Dired)
388Move point to previous line and remove any mark on that line
389(@code{dired-unmark-backward}).
390
391@item * !
392@itemx U
393@kindex * ! @r{(Dired)}
394@kindex U @r{(Dired)}
395@findex dired-unmark-all-marks
396Remove all marks from all the files in this Dired buffer
397(@code{dired-unmark-all-marks}).
398
399@item * ? @var{markchar}
400@itemx M-@key{DEL}
401@kindex * ? @r{(Dired)}
402@kindex M-DEL @r{(Dired)}
403@findex dired-unmark-all-files
404Remove all marks that use the character @var{markchar}
405(@code{dired-unmark-all-files}). The argument is a single
406character---do not use @key{RET} to terminate it. See the description
407of the @kbd{* c} command below, which lets you replace one mark
408character with another.
409
410With a numeric argument, this command queries about each marked file,
411asking whether to remove its mark. You can answer @kbd{y} meaning yes,
412@kbd{n} meaning no, or @kbd{!} to remove the marks from the remaining
413files without asking about them.
414
415@item * C-n
416@itemx M-@}
417@findex dired-next-marked-file
418@kindex * C-n @r{(Dired)}
419@kindex M-@} @r{(Dired)}
420Move down to the next marked file (@code{dired-next-marked-file})
421A file is ``marked'' if it has any kind of mark.
422
423@item * C-p
424@itemx M-@{
425@findex dired-prev-marked-file
426@kindex * C-p @r{(Dired)}
427@kindex M-@{ @r{(Dired)}
428Move up to the previous marked file (@code{dired-prev-marked-file})
429
430@item t
431@itemx * t
432@kindex t @r{(Dired)}
433@kindex * t @r{(Dired)}
434@findex dired-toggle-marks
435@cindex toggling marks (in Dired)
436Toggle all marks (@code{dired-toggle-marks}): files marked with @samp{*}
437become unmarked, and unmarked files are marked with @samp{*}. Files
438marked in any other way are not affected.
439
440@item * c @var{old-markchar} @var{new-markchar}
441@kindex * c @r{(Dired)}
442@findex dired-change-marks
443Replace all marks that use the character @var{old-markchar} with marks
444that use the character @var{new-markchar} (@code{dired-change-marks}).
445This command is the primary way to create or use marks other than
446@samp{*} or @samp{D}. The arguments are single characters---do not use
447@key{RET} to terminate them.
448
449You can use almost any character as a mark character by means of this
450command, to distinguish various classes of files. If @var{old-markchar}
451is a space (@samp{ }), then the command operates on all unmarked files;
452if @var{new-markchar} is a space, then the command unmarks the files it
453acts on.
454
455To illustrate the power of this command, here is how to put @samp{D}
456flags on all the files that have no marks, while unflagging all those
457that already have @samp{D} flags:
458
459@example
460* c D t * c SPC D * c t SPC
461@end example
462
463This assumes that no files were already marked with @samp{t}.
464
465@item % m @var{regexp} @key{RET}
466@itemx * % @var{regexp} @key{RET}
467@findex dired-mark-files-regexp
468@kindex % m @r{(Dired)}
469@kindex * % @r{(Dired)}
470Mark (with @samp{*}) all files whose names match the regular expression
471@var{regexp} (@code{dired-mark-files-regexp}). This command is like
472@kbd{% d}, except that it marks files with @samp{*} instead of flagging
473with @samp{D}.
474
475Only the non-directory part of the file name is used in matching. Use
476@samp{^} and @samp{$} to anchor matches. You can exclude
477subdirectories by temporarily hiding them (@pxref{Hiding
478Subdirectories}).
479
480@item % g @var{regexp} @key{RET}
481@findex dired-mark-files-containing-regexp
482@kindex % g @r{(Dired)}
483@cindex finding files containing regexp matches (in Dired)
484Mark (with @samp{*}) all files whose @emph{contents} contain a match for
485the regular expression @var{regexp}
486(@code{dired-mark-files-containing-regexp}). This command is like
487@kbd{% m}, except that it searches the file contents instead of the file
488name.
489
490@item C-x u
491@itemx C-_
492@itemx C-/
493@kindex C-_ @r{(Dired)}
494@findex dired-undo
495Undo changes in the Dired buffer, such as adding or removing
496marks (@code{dired-undo}). @emph{This command does not revert the
497actual file operations, nor recover lost files!} It just undoes
498changes in the buffer itself.
499
500In some cases, using this after commands that operate on files can
501cause trouble. For example, after renaming one or more files,
502@code{dired-undo} restores the original names in the Dired buffer,
503which gets the Dired buffer out of sync with the actual contents of
504the directory.
505@end table
506
507@node Operating on Files
508@section Operating on Files
509@cindex operating on files in Dired
510
511 This section describes the basic Dired commands to operate on one file
512or several files. All of these commands are capital letters; all of
513them use the minibuffer, either to read an argument or to ask for
514confirmation, before they act. All of them let you specify the
515files to manipulate in these ways:
516
517@itemize @bullet
518@item
519If you give the command a numeric prefix argument @var{n}, it operates
520on the next @var{n} files, starting with the current file. (If @var{n}
521is negative, the command operates on the @minus{}@var{n} files preceding
522the current line.)
523
524@item
525Otherwise, if some files are marked with @samp{*}, the command operates
526on all those files.
527
528@item
529Otherwise, the command operates on the current file only.
530@end itemize
531
532@noindent
533Certain other Dired commands, such as @kbd{!} and the @samp{%}
534commands, use the same conventions to decide which files to work on.
535
536@vindex dired-dwim-target
537@cindex two directories (in Dired)
538 Commands which ask for a destination directory, such as those which
539copy and rename files or create links for them, try to guess the default
540target directory for the operation. Normally, they suggest the Dired
541buffer's default directory, but if the variable @code{dired-dwim-target}
542is non-@code{nil}, and if there is another Dired buffer displayed in the
543next window, that other buffer's directory is suggested instead.
544
545 Here are the file-manipulating Dired commands that operate on files.
546
547@table @kbd
548@findex dired-do-copy
549@kindex C @r{(Dired)}
550@cindex copying files (in Dired)
551@item C @var{new} @key{RET}
552Copy the specified files (@code{dired-do-copy}). The argument @var{new}
553is the directory to copy into, or (if copying a single file) the new
554name. This is like the shell command @code{cp}.
555
556@vindex dired-copy-preserve-time
557If @code{dired-copy-preserve-time} is non-@code{nil}, then copying
558with this command preserves the modification time of the old file in
559the copy, like @samp{cp -p}.
560
561@vindex dired-recursive-copies
562@cindex recursive copying
563The variable @code{dired-recursive-copies} controls whether to copy
564directories recursively (like @samp{cp -r}). The default is
565@code{nil}, which means that directories cannot be copied.
566
567@item D
568@findex dired-do-delete
569@kindex D @r{(Dired)}
570Delete the specified files (@code{dired-do-delete}). This is like the
571shell command @code{rm}.
572
573Like the other commands in this section, this command operates on the
574@emph{marked} files, or the next @var{n} files. By contrast, @kbd{x}
575(@code{dired-do-flagged-delete}) deletes all @dfn{flagged} files.
576
577@findex dired-do-rename
578@kindex R @r{(Dired)}
579@cindex renaming files (in Dired)
580@cindex moving files (in Dired)
581@item R @var{new} @key{RET}
582Rename the specified files (@code{dired-do-rename}). If you rename a
583single file, the argument @var{new} is the new name of the file. If
584you rename several files, the argument @var{new} is the directory into
585which to move the files (this is like the shell command @code{mv}).
586
587Dired automatically changes the visited file name of buffers associated
588with renamed files so that they refer to the new names.
589
590@findex dired-do-hardlink
591@kindex H @r{(Dired)}
592@cindex hard links (in Dired)
593@item H @var{new} @key{RET}
594Make hard links to the specified files (@code{dired-do-hardlink}).
595This is like the shell command @code{ln}. The argument @var{new} is
596the directory to make the links in, or (if making just one link) the
597name to give the link.
598
599@findex dired-do-symlink
600@kindex S @r{(Dired)}
601@cindex symbolic links (creation in Dired)
602@item S @var{new} @key{RET}
603Make symbolic links to the specified files (@code{dired-do-symlink}).
604This is like @samp{ln -s}. The argument @var{new} is the directory to
605make the links in, or (if making just one link) the name to give the
606link.
607
608@findex dired-do-chmod
609@kindex M @r{(Dired)}
610@cindex changing file permissions (in Dired)
611@item M @var{modespec} @key{RET}
612Change the mode (also called ``permission bits'') of the specified files
613(@code{dired-do-chmod}). This uses the @code{chmod} program, so
614@var{modespec} can be any argument that @code{chmod} can handle.
615
616@findex dired-do-chgrp
617@kindex G @r{(Dired)}
618@cindex changing file group (in Dired)
619@item G @var{newgroup} @key{RET}
620Change the group of the specified files to @var{newgroup}
621(@code{dired-do-chgrp}).
622
623@findex dired-do-chown
624@kindex O @r{(Dired)}
625@cindex changing file owner (in Dired)
626@item O @var{newowner} @key{RET}
627Change the owner of the specified files to @var{newowner}
628(@code{dired-do-chown}). (On most systems, only the superuser can do
629this.)
630
631@vindex dired-chown-program
632The variable @code{dired-chown-program} specifies the name of the
633program to use to do the work (different systems put @code{chown} in
634different places).
635
636@findex dired-do-touch
637@kindex T @r{(Dired)}
638@cindex changing file time (in Dired)
639@item T @var{timestamp} @key{RET}
640Touch the specified files (@code{dired-do-touch}). This means
641updating their modification times to the present time. This is like
642the shell command @code{touch}.
643
644@findex dired-do-print
645@kindex P @r{(Dired)}
646@cindex printing files (in Dired)
647@item P @var{command} @key{RET}
648Print the specified files (@code{dired-do-print}). You must specify the
649command to print them with, but the minibuffer starts out with a
650suitable guess made using the variables @code{lpr-command} and
651@code{lpr-switches} (the same variables that @code{lpr-buffer} uses;
652@pxref{Printing}).
653
654@findex dired-do-compress
655@kindex Z @r{(Dired)}
656@cindex compressing files (in Dired)
657@item Z
658Compress the specified files (@code{dired-do-compress}). If the file
659appears to be a compressed file already, uncompress it instead.
660
661@findex dired-do-load
662@kindex L @r{(Dired)}
663@cindex loading several files (in Dired)
664@item L
665Load the specified Emacs Lisp files (@code{dired-do-load}).
666@xref{Lisp Libraries}.
667
668@findex dired-do-byte-compile
669@kindex B @r{(Dired)}
670@cindex byte-compiling several files (in Dired)
671@item B
672Byte compile the specified Emacs Lisp files
673(@code{dired-do-byte-compile}). @xref{Byte Compilation,, Byte
674Compilation, elisp, The Emacs Lisp Reference Manual}.
675
676@kindex A @r{(Dired)}
677@findex dired-do-search
678@cindex search multiple files (in Dired)
679@item A @var{regexp} @key{RET}
680Search all the specified files for the regular expression @var{regexp}
681(@code{dired-do-search}).
682
683This command is a variant of @code{tags-search}. The search stops at
684the first match it finds; use @kbd{M-,} to resume the search and find
685the next match. @xref{Tags Search}.
686
687@kindex Q @r{(Dired)}
688@findex dired-do-query-replace-regexp
689@cindex search and replace in multiple files (in Dired)
690@item Q @var{regexp} @key{RET} @var{to} @key{RET}
691Perform @code{query-replace-regexp} on each of the specified files,
692replacing matches for @var{regexp} with the string
693@var{to} (@code{dired-do-query-replace-regexp}).
694
695This command is a variant of @code{tags-query-replace}. If you exit the
696query replace loop, you can use @kbd{M-,} to resume the scan and replace
697more matches. @xref{Tags Search}.
698@end table
699
700@node Shell Commands in Dired
701@section Shell Commands in Dired
702@cindex shell commands, Dired
703
704@findex dired-do-shell-command
705@kindex ! @r{(Dired)}
706@kindex X @r{(Dired)}
707The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a
708shell command string in the minibuffer and runs that shell command on
709all the specified files. (@kbd{X} is a synonym for @kbd{!}.) You can
710specify the files to operate on in the usual ways for Dired commands
711(@pxref{Operating on Files}).
712
713 The working directory for the shell command is the top-level directory
714of the Dired buffer.
715
716 There are two ways of applying a shell command to multiple files:
717
718@itemize @bullet
719@item
720If you use @samp{*} surrounded by whitespace in the shell command,
721then the command runs just once, with the list of file names
722substituted for the @samp{*}. The order of file names is the order of
723appearance in the Dired buffer.
724
725Thus, @kbd{! tar cf foo.tar * @key{RET}} runs @code{tar} on the entire
726list of file names, putting them into one tar file @file{foo.tar}.
727
728If you want to use @samp{*} as a shell wildcard with whitespace around
729it, write @samp{*""}. In the shell, this is equivalent to @samp{*};
730but since the @samp{*} is not surrounded by whitespace, Dired does
731not treat it specially.
732
733@item
734If the command string doesn't contain @samp{*} surrounded by
735whitespace, then it runs once @emph{for each file}. Normally the file
736name is added at the end.
737
738For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each
739file.
740
741@item
742However, if the command string contains @samp{?} surrounded by
743whitespace, the current file name is substituted for @samp{?} (rather
744than added at the end). You can use @samp{?} this way more than once
745in the command, and the same file name replaces each occurrence.
746@end itemize
747
748 To iterate over the file names in a more complicated fashion, use an
749explicit shell loop. For example, here is how to uuencode each file,
750making the output file name by appending @samp{.uu} to the input file
751name:
752
753@example
754for file in * ; do uuencode "$file" "$file" >"$file".uu; done
755@end example
756
757 The @kbd{!} command does not attempt to update the Dired buffer to
758show new or modified files, because it doesn't understand shell
759commands, and does not know what files the shell command changed. Use
760the @kbd{g} command to update the Dired buffer (@pxref{Dired
761Updating}).
762
763@node Transforming File Names
764@section Transforming File Names in Dired
765
766 This section describes Dired commands which alter file names in a
767systematic way. Each command operates on some or all of the marked
768files, using a new name made by transforming the existing name.
769
770 Like the basic Dired file-manipulation commands (@pxref{Operating on
771Files}), the commands described here operate either on the next
772@var{n} files, or on all files marked with @samp{*}, or on the current
773file. (To mark files, use the commands described in @ref{Marks vs
774Flags}.)
775
776 All of the commands described in this section work
777@emph{interactively}: they ask you to confirm the operation for each
778candidate file. Thus, you can select more files than you actually
779need to operate on (e.g., with a regexp that matches many files), and
780then filter the selected names by typing @kbd{y} or @kbd{n} when the
781command prompts for confirmation.
782
783@table @kbd
784@findex dired-upcase
785@kindex % u @r{(Dired)}
786@cindex upcase file names
787@item % u
788Rename each of the selected files to an upper-case name
789(@code{dired-upcase}). If the old file names are @file{Foo}
790and @file{bar}, the new names are @file{FOO} and @file{BAR}.
791
792@item % l
793@findex dired-downcase
794@kindex % l @r{(Dired)}
795@cindex downcase file names
796Rename each of the selected files to a lower-case name
797(@code{dired-downcase}). If the old file names are @file{Foo} and
798@file{bar}, the new names are @file{foo} and @file{bar}.
799
800@item % R @var{from} @key{RET} @var{to} @key{RET}
801@kindex % R @r{(Dired)}
802@findex dired-do-rename-regexp
803@itemx % C @var{from} @key{RET} @var{to} @key{RET}
804@kindex % C @r{(Dired)}
805@findex dired-do-copy-regexp
806@itemx % H @var{from} @key{RET} @var{to} @key{RET}
807@kindex % H @r{(Dired)}
808@findex dired-do-hardlink-regexp
809@itemx % S @var{from} @key{RET} @var{to} @key{RET}
810@kindex % S @r{(Dired)}
811@findex dired-do-symlink-regexp
812These four commands rename, copy, make hard links and make soft links,
813in each case computing the new name by regular-expression substitution
814from the name of the old file.
815@end table
816
817 The four regular-expression substitution commands effectively
818perform a search-and-replace on the selected file names. They read
819two arguments: a regular expression @var{from}, and a substitution
820pattern @var{to}; they match each ``old'' file name against
821@var{from}, and then replace the matching part with @var{to}. You can
822use @samp{\&} and @samp{\@var{digit}} in @var{to} to refer to all or
823part of what the pattern matched in the old file name, as in
824@code{replace-regexp} (@pxref{Regexp Replace}). If the regular
825expression matches more than once in a file name, only the first match
826is replaced.
827
828 For example, @kbd{% R ^.*$ @key{RET} x-\& @key{RET}} renames each
829selected file by prepending @samp{x-} to its name. The inverse of this,
830removing @samp{x-} from the front of each file name, is also possible:
831one method is @kbd{% R ^x-\(.*\)$ @key{RET} \1 @key{RET}}; another is
832@kbd{% R ^x- @key{RET} @key{RET}}. (Use @samp{^} and @samp{$} to anchor
833matches that should span the whole file name.)
834
835 Normally, the replacement process does not consider the files'
836directory names; it operates on the file name within the directory. If
837you specify a numeric argument of zero, then replacement affects the
838entire absolute file name including directory name. (A non-zero
839argument specifies the number of files to operate on.)
840
841 You may want to select the set of files to operate on using the same
842regexp @var{from} that you will use to operate on them. To do this,
843mark those files with @kbd{% m @var{from} @key{RET}}, then use the
844same regular expression in the command to operate on the files. To
845make this more convenient, the @kbd{%} commands to operate on files
846use the last regular expression specified in any @kbd{%} command as a
847default.
848
849@node Comparison in Dired
850@section File Comparison with Dired
851@cindex file comparison (in Dired)
852@cindex compare files (in Dired)
853
854 Here are two Dired commands that compare specified files using
855@code{diff}. They show the output in a buffer using Diff mode
856(@pxref{Comparing Files}).
857
858@table @kbd
859@item =
860@findex dired-diff
861@kindex = @r{(Dired)}
862Compare the current file (the file at point) with another file (the
863file at the mark) using the @code{diff} program (@code{dired-diff}).
864The file at the mark is the first argument of @code{diff}, and the
865file at point is the second argument. This refers to the ordinary
866Emacs mark, not Dired marks; use @kbd{C-@key{SPC}}
867(@code{set-mark-command}) to set the mark at the first file's line
868(@pxref{Setting Mark}).
869
870@findex dired-backup-diff
871@kindex M-= @r{(Dired)}
872@item M-=
873Compare the current file with its latest backup file
874(@code{dired-backup-diff}). If the current file is itself a backup,
875compare it with the file it is a backup of; this way, you can compare
876a file with any one of its backups.
877
878The backup file is the first file given to @code{diff}.
879@end table
880
881@node Subdirectories in Dired
882@section Subdirectories in Dired
883@cindex subdirectories in Dired
884@cindex expanding subdirectories in Dired
885
886 A Dired buffer displays just one directory in the normal case;
887but you can optionally include its subdirectories as well.
888
889 The simplest way to include multiple directories in one Dired buffer is
890to specify the options @samp{-lR} for running @code{ls}. (If you give a
891numeric argument when you run Dired, then you can specify these options
892in the minibuffer.) That produces a recursive directory listing showing
893all subdirectories at all levels.
894
895 More often, you will want to show only specific subdirectories. You
896can do this with the @kbd{i} command:
897
898@table @kbd
899@findex dired-maybe-insert-subdir
900@kindex i @r{(Dired)}
901@item i
902@cindex inserted subdirectory (Dired)
903@cindex in-situ subdirectory (Dired)
904Insert the contents of a subdirectory later in the buffer.
905@end table
906
907Use the @kbd{i} (@code{dired-maybe-insert-subdir}) command on a line
908that describes a file which is a directory. It inserts the contents of
909that directory into the same Dired buffer, and moves there. Inserted
910subdirectory contents follow the top-level directory of the Dired
911buffer, just as they do in @samp{ls -lR} output.
912
913If the subdirectory's contents are already present in the buffer, the
914@kbd{i} command just moves to it.
915
916In either case, @kbd{i} sets the Emacs mark before moving, so @kbd{C-u
917C-@key{SPC}} takes you back to the old position in the buffer (the line
918describing that subdirectory).
919
920Use the @kbd{l} command (@code{dired-do-redisplay}) to update the
921subdirectory's contents. Use @kbd{C-u k} on the subdirectory header
922line to delete the subdirectory. @xref{Dired Updating}.
923
924
925
926
927@ifnottex
928@include dired-xtra.texi
929@end ifnottex
930
931@node Subdirectory Motion
932@section Moving Over Subdirectories
933
934 When a Dired buffer lists subdirectories, you can use the page motion
935commands @kbd{C-x [} and @kbd{C-x ]} to move by entire directories
936(@pxref{Pages}).
937
938@cindex header line (Dired)
939@cindex directory header lines
940 The following commands move across, up and down in the tree of
941directories within one Dired buffer. They move to @dfn{directory header
942lines}, which are the lines that give a directory's name, at the
943beginning of the directory's contents.
944
945@table @kbd
946@findex dired-next-subdir
947@kindex C-M-n @r{(Dired)}
948@item C-M-n
949Go to next subdirectory header line, regardless of level
950(@code{dired-next-subdir}).
951
952@findex dired-prev-subdir
953@kindex C-M-p @r{(Dired)}
954@item C-M-p
955Go to previous subdirectory header line, regardless of level
956(@code{dired-prev-subdir}).
957
958@findex dired-tree-up
959@kindex C-M-u @r{(Dired)}
960@item C-M-u
961Go up to the parent directory's header line (@code{dired-tree-up}).
962
963@findex dired-tree-down
964@kindex C-M-d @r{(Dired)}
965@item C-M-d
966Go down in the directory tree, to the first subdirectory's header line
967(@code{dired-tree-down}).
968
969@findex dired-prev-dirline
970@kindex < @r{(Dired)}
971@item <
972Move up to the previous directory-file line (@code{dired-prev-dirline}).
973These lines are the ones that describe a directory as a file in its
974parent directory.
975
976@findex dired-next-dirline
977@kindex > @r{(Dired)}
978@item >
979Move down to the next directory-file line (@code{dired-prev-dirline}).
980@end table
981
982@node Hiding Subdirectories
983@section Hiding Subdirectories
984
985@cindex hiding in Dired (Dired)
986 @dfn{Hiding} a subdirectory means to make it invisible, except for its
987header line.
988
989@table @kbd
990@item $
991@findex dired-hide-subdir
992@kindex $ @r{(Dired)}
993Hide or reveal the subdirectory that point is in, and move point to the
994next subdirectory (@code{dired-hide-subdir}). A numeric argument serves
995as a repeat count.
996
997@item M-$
998@findex dired-hide-all
999@kindex M-$ @r{(Dired)}
1000Hide all subdirectories in this Dired buffer, leaving only their header
1001lines (@code{dired-hide-all}). Or, if any subdirectory is currently
1002hidden, make all subdirectories visible again. You can use this command
1003to get an overview in very deep directory trees or to move quickly to
1004subdirectories far away.
1005@end table
1006
1007 Ordinary Dired commands never consider files inside a hidden
1008subdirectory. For example, the commands to operate on marked files
1009ignore files in hidden directories even if they are marked. Thus you
1010can use hiding to temporarily exclude subdirectories from operations
1011without having to remove the Dired marks on files in those
1012subdirectories.
1013
1014@node Dired Updating
1015@section Updating the Dired Buffer
1016@cindex updating Dired buffer
1017@cindex refreshing displayed files
1018
1019 This section describes commands to update the Dired buffer to reflect
1020outside (non-Dired) changes in the directories and files, and to delete
1021part of the Dired buffer.
1022
1023@table @kbd
1024@item g
1025Update the entire contents of the Dired buffer (@code{revert-buffer}).
1026
1027@item l
1028Update the specified files (@code{dired-do-redisplay}). You specify the
1029files for @kbd{l} in the same way as for file operations.
1030
1031@item k
1032Delete the specified @emph{file lines}---not the files, just the lines
1033(@code{dired-do-kill-lines}).
1034
1035@item s
1036Toggle between alphabetical order and date/time order
1037(@code{dired-sort-toggle-or-edit}).
1038
1039@item C-u s @var{switches} @key{RET}
1040Refresh the Dired buffer using @var{switches} as
1041@code{dired-listing-switches}.
1042@end table
1043
1044@kindex g @r{(Dired)}
1045@findex revert-buffer @r{(Dired)}
1046 Type @kbd{g} (@code{revert-buffer}) to update the contents of the
1047Dired buffer, based on changes in the files and directories listed.
1048This preserves all marks except for those on files that have vanished.
1049Hidden subdirectories are updated but remain hidden.
1050
1051@kindex l @r{(Dired)}
1052@findex dired-do-redisplay
1053 To update only some of the files, type @kbd{l}
1054(@code{dired-do-redisplay}). Like the Dired file-operating commands,
1055this command operates on the next @var{n} files (or previous
1056@minus{}@var{n} files), or on the marked files if any, or on the
1057current file. Updating the files means reading their current status,
1058then updating their lines in the buffer to indicate that status.
1059
1060 If you use @kbd{l} on a subdirectory header line, it updates the
1061contents of the corresponding subdirectory.
1062
1063@kindex k @r{(Dired)}
1064@findex dired-do-kill-lines
1065 To delete the specified @emph{file lines} from the buffer---not
1066delete the files---type @kbd{k} (@code{dired-do-kill-lines}). Like
1067the file-operating commands, this command operates on the next @var{n}
1068files, or on the marked files if any; but it does not operate on the
1069current file as a last resort.
1070
1071 If you use @kbd{k} with a numeric prefix argument to kill the line
1072for a file that is a directory, which you have inserted in the Dired
1073buffer as a subdirectory, it deletes that subdirectory from the buffer
1074as well. Typing @kbd{C-u k} on the header line for a subdirectory
1075also deletes the subdirectory from the Dired buffer.
1076
1077 The @kbd{g} command brings back any individual lines that you have
1078killed in this way, but not subdirectories---you must use @kbd{i} to
1079reinsert a subdirectory.
1080
1081@cindex Dired sorting
1082@cindex sorting Dired buffer
1083@kindex s @r{(Dired)}
1084@findex dired-sort-toggle-or-edit
1085 The files in a Dired buffers are normally listed in alphabetical order
1086by file names. Alternatively Dired can sort them by date/time. The
1087Dired command @kbd{s} (@code{dired-sort-toggle-or-edit}) switches
1088between these two sorting modes. The mode line in a Dired buffer
1089indicates which way it is currently sorted---by name, or by date.
1090
1091 @kbd{C-u s @var{switches} @key{RET}} lets you specify a new value for
1092@code{dired-listing-switches}.
1093
1094@node Dired and Find
1095@section Dired and @code{find}
1096@cindex @code{find} and Dired
1097
1098 You can select a set of files for display in a Dired buffer more
1099flexibly by using the @code{find} utility to choose the files.
1100
1101@findex find-name-dired
1102 To search for files with names matching a wildcard pattern use
1103@kbd{M-x find-name-dired}. It reads arguments @var{directory} and
1104@var{pattern}, and chooses all the files in @var{directory} or its
1105subdirectories whose individual names match @var{pattern}.
1106
1107 The files thus chosen are displayed in a Dired buffer, in which the
1108ordinary Dired commands are available.
1109
1110@findex find-grep-dired
1111 If you want to test the contents of files, rather than their names,
1112use @kbd{M-x find-grep-dired}. This command reads two minibuffer
1113arguments, @var{directory} and @var{regexp}; it chooses all the files in
1114@var{directory} or its subdirectories that contain a match for
1115@var{regexp}. It works by running the programs @code{find} and
1116@code{grep}. See also @kbd{M-x grep-find}, in @ref{Grep Searching}.
1117Remember to write the regular expression for @code{grep}, not for Emacs.
1118(An alternative method of showing files whose contents match a given
1119regexp is the @kbd{% g @var{regexp}} command, see @ref{Marks vs Flags}.)
1120
1121@findex find-dired
1122 The most general command in this series is @kbd{M-x find-dired}, which
1123lets you specify any condition that @code{find} can test. It takes two
1124minibuffer arguments, @var{directory} and @var{find-args}; it runs
1125@code{find} in @var{directory}, passing @var{find-args} to tell
1126@code{find} what condition to test. To use this command, you need to
1127know how to use @code{find}.
1128
1129@vindex find-ls-option
1130 The format of listing produced by these commands is controlled by the
1131variable @code{find-ls-option}, whose default value specifies using
1132options @samp{-ld} for @code{ls}. If your listings are corrupted, you
1133may need to change the value of this variable.
1134
1135@findex locate
1136@findex locate-with-filter
1137@cindex file database (locate)
1138@vindex locate-command
1139 The command @kbd{M-x locate} provides a similar interface to the
1140@code{locate} program. @kbd{M-x locate-with-filter} is similar, but
1141keeps only files whose names match a given regular expression.
1142
1143 These buffers don't work entirely like ordinary Dired buffers: file
1144operations work, but do not always automatically update the buffer.
1145Reverting the buffer with @kbd{g} deletes all inserted subdirectories,
1146and erases all flags and marks.
1147
1148@node Wdired
1149@section Editing the Dired Buffer
1150
1151@cindex wdired mode
1152@findex wdired-change-to-wdired-mode
1153 Wdired is a special mode that allows you to perform file operations
1154by editing the Dired buffer directly (the ``W'' in ``Wdired'' stands
1155for ``writable.'') To enter Wdired mode, type @kbd{C-x C-q} or @kbd{M-x
1156wdired-change-to-wdired-mode} while in a Dired buffer. Alternatively,
1157use @samp{Edit File Names} in the @samp{Immediate} menu bar menu.
1158
1159@findex wdired-finish-edit
1160 While in Wdired mode, you can rename files by editing the file names
1161displayed in the Dired buffer. All the ordinary Emacs editing
1162commands, including rectangle operations and @code{query-replace}, are
1163available for this. Once you are done editing, type @kbd{C-c C-c}
1164(@code{wdired-finish-edit}). This applies your changes and switches
1165back to ordinary Dired mode.
1166
1167 Apart from simply renaming files, you can move a file to another
1168directory by typing in the new file name (either absolute or
1169relative). To mark a file for deletion, delete the entire file name.
1170To change the target of a symbolic link, edit the link target name
1171which appears next to the link name.
1172
1173 The rest of the text in the buffer, such as the file sizes and
1174modification dates, is marked read-only, so you can't edit it.
1175However, if you set @code{wdired-allow-to-change-permissions} to
1176@code{t}, you can edit the file permissions. For example, you can
1177change @samp{-rw-r--r--} to @samp{-rw-rw-rw-} to make a file
1178world-writable. These changes also take effect when you type @kbd{C-c
1179C-c}.
1180
1181@node Image-Dired
1182@section Viewing Image Thumbnails in Dired
1183@cindex image-dired mode
1184@cindex image-dired
1185
1186 Image-Dired is a facility for browsing image files. It provides viewing
1187the images either as thumbnails or in full size, either inside Emacs
1188or through an external viewer.
1189
1190@kindex C-t d @r{(Image-Dired)}
1191@findex image-dired-display-thumbs
1192 To enter Image-Dired, mark the image files you want to look at in
1193the Dired buffer, using @kbd{m} as usual. Then type @kbd{C-t d}
1194(@code{image-dired-display-thumbs}). This creates and switches to a
1195buffer containing image-dired, corresponding to the marked files.
1196
1197 You can also enter Image-Dired directly by typing @kbd{M-x
1198image-dired}. This prompts for a directory; specify one that has
1199image files. This creates thumbnails for all the images in that
1200directory, and displays them all in the ``thumbnail buffer.'' This
1201takes a long time if the directory contains many image files, and it
1202asks for confirmation if the number of image files exceeds
1203@code{image-dired-show-all-from-dir-max-files}.
1204
1205 With point in the thumbnail buffer, you can type @kbd{RET}
1206(@code{image-dired-display-thumbnail-original-image}) to display a
1207sized version of it in another window. This sizes the image to fit
1208the window. Use the arrow keys to move around in the buffer. For
1209easy browsing, use @kbd{SPC}
1210(@code{image-dired-display-next-thumbnail-original}) to advance and
1211display the next image. Typing @kbd{DEL}
1212(@code{image-dired-display-previous-thumbnail-original}) backs up to
1213the previous thumbnail and displays that instead.
1214
1215@vindex image-dired-external-viewer
1216 To view and the image in its original size, either provide a prefix
1217argument (@kbd{C-u}) before pressing @kbd{RET}, or type
1218@kbd{C-@key{RET}} (@code{image-dired-thumbnail-display-external}) to
1219display the image in an external viewer. You must first configure
1220@code{image-dired-external-viewer}.
1221
1222 You can delete images through Image-Dired also. Type @kbd{d}
1223(@code{image-dired-flag-thumb-original-file}) to flag the image file
1224for deletion in the Dired buffer. You can also delete the thumbnail
1225image from the thumbnail buffer with @kbd{C-d}
1226(@code{image-dired-delete-char}).
1227
1228 More advanced features include @dfn{image tags}, which are metadata
1229used to categorize image files. The tags are stored in a plain text
1230file configured by @code{image-dired-db-file}.
1231
1232 To tag image files, mark them in the dired buffer (you can also mark
1233files in Dired from the thumbnail buffer by typing @kbd{m}) and type
1234@kbd{C-t t} (@code{image-dired-tag-files}). You will be prompted for
1235a tag. To mark files having a certain tag, type @kbd{C-t f}
1236(@code{image-dired-mark-tagged-files}). After marking image files
1237with a certain tag, you can use @kbd{C-t d} to view them.
1238
1239 You can also tag a file directly from the thumbnail buffer by typing
1240@kbd{t t} and you can remove a tag by typing @kbd{t r}. There is also
1241a special ``tag'' called ``comment'' for each file (it is not a tag in
1242the exact same sense as the other tags, it is handled slightly
1243different). That is used to enter a comment or description about the
1244image. You comment a file from the thumbnail buffer by typing
1245@kbd{c}. You will be prompted for a comment. Type @kbd{C-t c} to add
1246a comment from Dired (@code{image-dired-dired-comment-files}).
1247
1248 Image-Dired also provides simple image manipulation. In the
1249thumbnail buffer, type @kbd{L} to rotate the original image 90 degrees
1250anti clockwise, and @kbd{R} to rotate it 90 degrees clockwise. This
1251rotation is lossless, and uses an external utility called JpegTRAN.
1252
1253@node Misc Dired Features
1254@section Other Dired Features
1255
1256@kindex + @r{(Dired)}
1257@findex dired-create-directory
1258 An unusual Dired file-operation command is @kbd{+}
1259(@code{dired-create-directory}). This command reads a directory name,
1260and creates the directory if it does not already exist.
1261
1262@cindex Adding to the kill ring in Dired.
1263@kindex w @r{(Dired)}
1264@findex dired-copy-filename-as-kill
1265 The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the
1266names of the marked (or next @var{n}) files into the kill ring, as if
1267you had killed them with @kbd{C-w}. The names are separated by a space.
1268
1269 With a zero prefix argument, this uses the absolute file name of
1270each marked file. With just @kbd{C-u} as the prefix argument, it uses
1271file names relative to the Dired buffer's default directory. (This
1272can still contain slashes if in a subdirectory.) As a special case,
1273if point is on a directory headerline, @kbd{w} gives you the absolute
1274name of that directory. Any prefix argument or marked files are
1275ignored in this case.
1276
1277 The main purpose of this command is so that you can yank the file
1278names into arguments for other Emacs commands. It also displays what
1279it added to the kill ring, so you can use it to display the list of
1280currently marked files in the echo area.
1281
1282@findex dired-compare-directories
1283 The command @kbd{M-x dired-compare-directories} is used to compare
1284the current Dired buffer with another directory. It marks all the files
1285that are ``different'' between the two directories. It puts these marks
1286in all Dired buffers where these files are listed, which of course includes
1287the current buffer.
1288
1289 The default comparison method (used if you type @key{RET} at the
1290prompt) is to compare just the file names---each file name that does
1291not appear in the other directory is ``different.'' You can specify
1292more stringent comparisons by entering a Lisp expression, which can
1293refer to the variables @code{size1} and @code{size2}, the respective
1294file sizes; @code{mtime1} and @code{mtime2}, the last modification
1295times in seconds, as floating point numbers; and @code{fa1} and
1296@code{fa2}, the respective file attribute lists (as returned by the
1297function @code{file-attributes}). This expression is evaluated for
1298each pair of like-named files, and if the expression's value is
1299non-@code{nil}, those files are considered ``different.''
1300
1301 For instance, the sequence @code{M-x dired-compare-directories
1302@key{RET} (> mtime1 mtime2) @key{RET}} marks files newer in this
1303directory than in the other, and marks files older in the other
1304directory than in this one. It also marks files with no counterpart,
1305in both directories, as always.
1306
1307@cindex drag and drop, Dired
1308 On the X window system, Emacs supports the ``drag and drop''
1309protocol. You can drag a file object from another program, and drop
1310it onto a Dired buffer; this either moves, copies, or creates a link
1311to the file in that directory. Precisely which action is taken is
1312determined by the originating program. Dragging files out of a Dired
1313buffer is currently not supported.
1314
1315@ignore
1316 arch-tag: d105f9b9-fc1b-4c5f-a949-9b2cf3ca2fc1
1317@end ignore
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
new file mode 100644
index 00000000000..21a65999ec3
--- /dev/null
+++ b/doc/emacs/display.texi
@@ -0,0 +1,1259 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Display, Search, Registers, Top
6@chapter Controlling the Display
7
8 Since only part of a large buffer fits in the window, Emacs tries to
9show a part that is likely to be interesting. Display-control
10commands allow you to specify which part of the text you want to see,
11and how to display it. Many variables also affect the details of
12redisplay. Unless otherwise stated, the variables described in this
13chapter have their effect by customizing redisplay itself; therefore,
14their values only make a difference at the time of redisplay.
15
16@menu
17* Scrolling:: Commands to move text up and down in a window.
18* Auto Scrolling:: Redisplay scrolls text automatically when needed.
19* Horizontal Scrolling:: Moving text left and right in a window.
20* Follow Mode:: Follow mode lets two windows scroll as one.
21* Faces:: How to change the display style using faces.
22* Standard Faces:: Emacs' predefined faces.
23* Font Lock:: Minor mode for syntactic highlighting using faces.
24* Highlight Interactively:: Tell Emacs what text to highlight.
25* Fringes:: Enabling or disabling window fringes.
26* Displaying Boundaries:: Displaying top and bottom of the buffer.
27* Useless Whitespace:: Showing possibly-spurious trailing whitespace.
28* Selective Display:: Hiding lines with lots of indentation.
29* Optional Mode Line:: Optional mode line display features.
30* Text Display:: How text characters are normally displayed.
31* Cursor Display:: Features for displaying the cursor.
32* Line Truncation:: Truncating lines to fit the screen width instead
33 of continuing them to multiple screen lines.
34* Display Custom:: Information on variables for customizing display.
35@end menu
36
37@node Scrolling
38@section Scrolling
39
40 If a buffer contains text that is too large to fit entirely within a
41window that is displaying the buffer, Emacs shows a contiguous portion of
42the text. The portion shown always contains point.
43
44@cindex scrolling
45 @dfn{Scrolling} means moving text up or down in the window so that
46different parts of the text are visible. Scrolling ``forward'' or
47``up'' means that text moves up, and new text appears at the bottom.
48Scrolling ``backward'' or ``down'' moves text down, and new text
49appears at the top.
50
51 Scrolling happens automatically if you move point past the bottom or
52top of the window. You can also scroll explicitly with the commands
53in this section.
54
55@table @kbd
56@item C-l
57Clear screen and redisplay, scrolling the selected window to center
58point vertically within it (@code{recenter}).
59@item C-v
60Scroll forward (a windowful or a specified number of lines) (@code{scroll-up}).
61@item @key{NEXT}
62@itemx @key{PAGEDOWN}
63Likewise, scroll forward.
64@item M-v
65Scroll backward (@code{scroll-down}).
66@item @key{PRIOR}
67@itemx @key{PAGEUP}
68Likewise, scroll backward.
69@item @var{arg} C-l
70Scroll so point is on line @var{arg} (@code{recenter}).
71@item C-M-l
72Scroll heuristically to bring useful information onto the screen
73(@code{reposition-window}).
74@end table
75
76@kindex C-l
77@findex recenter
78 The most basic scrolling command is @kbd{C-l} (@code{recenter}) with
79no argument. It scrolls the selected window so that point is halfway
80down from the top of the window. On a text terminal, it also clears
81the screen and redisplays all windows. That is useful in case the
82screen is garbled (@pxref{Screen Garbled}).
83
84@kindex C-v
85@kindex M-v
86@kindex NEXT
87@kindex PRIOR
88@kindex PAGEDOWN
89@kindex PAGEUP
90@findex scroll-up
91@findex scroll-down
92 To read the buffer a windowful at a time, use @kbd{C-v}
93(@code{scroll-up}) with no argument. This scrolls forward by nearly
94the whole window height. The effect is to take the two lines at the
95bottom of the window and put them at the top, followed by nearly a
96whole windowful of lines that were not previously visible. If point
97was in the text that scrolled off the top, it ends up at the new top
98of the window.
99
100@vindex next-screen-context-lines
101 @kbd{M-v} (@code{scroll-down}) with no argument scrolls backward in
102a similar way, also with overlap. The number of lines of overlap that
103the @kbd{C-v} or @kbd{M-v} commands leave is controlled by the
104variable @code{next-screen-context-lines}; by default, it is 2. The
105function keys @key{NEXT} and @key{PRIOR}, or @key{PAGEDOWN} and
106@key{PAGEUP}, are equivalent to @kbd{C-v} and @kbd{M-v}.
107
108 The commands @kbd{C-v} and @kbd{M-v} with a numeric argument scroll
109the text in the selected window up or down a few lines. @kbd{C-v}
110with an argument moves the text and point up, together, that many
111lines; it brings the same number of new lines into view at the bottom
112of the window. @kbd{M-v} with numeric argument scrolls the text
113downward, bringing that many new lines into view at the top of the
114window. @kbd{C-v} with a negative argument is like @kbd{M-v} and vice
115versa.
116
117 The names of scroll commands are based on the direction that the
118text moves in the window. Thus, the command to scroll forward is
119called @code{scroll-up} because it moves the text upward on the
120screen. The keys @key{PAGEDOWN} and @key{PAGEUP} derive their names
121and customary meanings from a different convention that developed
122elsewhere; hence the strange result that @key{PAGEDOWN} runs
123@code{scroll-up}.
124
125@vindex scroll-preserve-screen-position
126 Some users like the full-screen scroll commands to keep point at the
127same screen line. To enable this behavior, set the variable
128@code{scroll-preserve-screen-position} to a non-@code{nil} value. In
129this mode, when these commands would scroll the text around point off
130the screen, or within @code{scroll-margin} lines of the edge, they
131move point to keep the same vertical position within the window.
132This mode is convenient for browsing through a file by scrolling by
133screenfuls; if you come back to the screen where you started, point
134goes back to the line where it started. However, this mode is
135inconvenient when you move to the next screen in order to move point
136to the text there.
137
138 Another way to do scrolling is with @kbd{C-l} with a numeric argument.
139@kbd{C-l} does not clear the screen when given an argument; it only scrolls
140the selected window. With a positive argument @var{n}, it repositions text
141to put point @var{n} lines down from the top. An argument of zero puts
142point on the very top line. Point does not move with respect to the text;
143rather, the text and point move rigidly on the screen. @kbd{C-l} with a
144negative argument puts point that many lines from the bottom of the window.
145For example, @kbd{C-u - 1 C-l} puts point on the bottom line, and @kbd{C-u
146- 5 C-l} puts it five lines from the bottom. @kbd{C-u C-l} scrolls to put
147point at the center (vertically) of the selected window.
148
149@kindex C-M-l
150@findex reposition-window
151 The @kbd{C-M-l} command (@code{reposition-window}) scrolls the current
152window heuristically in a way designed to get useful information onto
153the screen. For example, in a Lisp file, this command tries to get the
154entire current defun onto the screen if possible.
155
156@node Auto Scrolling
157@section Automatic Scrolling
158
159@vindex scroll-conservatively
160 Redisplay scrolls the buffer automatically when point moves out of
161the visible portion of the text. The purpose of automatic scrolling
162is to make point visible, but you can customize many aspects of how
163this is done.
164
165 Normally, automatic scrolling centers point vertically within the
166window. However, if you set @code{scroll-conservatively} to a small
167number @var{n}, then if you move point just a little off the
168screen---less than @var{n} lines---then Emacs scrolls the text just
169far enough to bring point back on screen. By default,
170@code{scroll-conservatively} is@tie{}0.
171
172@cindex aggressive scrolling
173@vindex scroll-up-aggressively
174@vindex scroll-down-aggressively
175 When the window does scroll by a longer distance, you can control
176how aggressively it scrolls, by setting the variables
177@code{scroll-up-aggressively} and @code{scroll-down-aggressively}.
178The value of @code{scroll-up-aggressively} should be either
179@code{nil}, or a fraction @var{f} between 0 and 1. A fraction
180specifies where on the screen to put point when scrolling upward.
181More precisely, when a window scrolls up because point is above the
182window start, the new start position is chosen to put point @var{f}
183part of the window height from the top. The larger @var{f}, the more
184aggressive the scrolling.
185
186 @code{nil}, which is the default, scrolls to put point at the center.
187So it is equivalent to .5.
188
189 Likewise, @code{scroll-down-aggressively} is used for scrolling
190down. The value, @var{f}, specifies how far point should be placed
191from the bottom of the window; thus, as with
192@code{scroll-up-aggressively}, a larger value is more aggressive.
193
194@vindex scroll-margin
195 The variable @code{scroll-margin} restricts how close point can come
196to the top or bottom of a window. Its value is a number of screen
197lines; if point comes within that many lines of the top or bottom of the
198window, Emacs recenters the window. By default, @code{scroll-margin} is
1990.
200
201@node Horizontal Scrolling
202@section Horizontal Scrolling
203@cindex horizontal scrolling
204
205 @dfn{Horizontal scrolling} means shifting all the lines sideways
206within a window---so that some of the text near the left margin is not
207displayed at all. When the text in a window is scrolled horizontally,
208text lines are truncated rather than continued (@pxref{Line
209Truncation}). Whenever a window shows truncated lines, Emacs
210automatically updates its horizontal scrolling whenever point moves
211off the left or right edge of the screen. You can also use these
212commands to do explicit horizontal scrolling.
213
214@table @kbd
215@item C-x <
216Scroll text in current window to the left (@code{scroll-left}).
217@item C-x >
218Scroll to the right (@code{scroll-right}).
219@end table
220
221@kindex C-x <
222@kindex C-x >
223@findex scroll-left
224@findex scroll-right
225 The command @kbd{C-x <} (@code{scroll-left}) scrolls the selected
226window to the left by @var{n} columns with argument @var{n}. This moves
227part of the beginning of each line off the left edge of the window.
228With no argument, it scrolls by almost the full width of the window (two
229columns less, to be precise).
230
231 @kbd{C-x >} (@code{scroll-right}) scrolls similarly to the right. The
232window cannot be scrolled any farther to the right once it is displayed
233normally (with each line starting at the window's left margin);
234attempting to do so has no effect. This means that you don't have to
235calculate the argument precisely for @w{@kbd{C-x >}}; any sufficiently large
236argument will restore the normal display.
237
238 If you use those commands to scroll a window horizontally, that sets
239a lower bound for automatic horizontal scrolling. Automatic scrolling
240will continue to scroll the window, but never farther to the right
241than the amount you previously set by @code{scroll-left}.
242
243@vindex hscroll-margin
244 The value of the variable @code{hscroll-margin} controls how close
245to the window's edges point is allowed to get before the window will
246be automatically scrolled. It is measured in columns. If the value
247is 5, then moving point within 5 columns of the edge causes horizontal
248scrolling away from that edge.
249
250@vindex hscroll-step
251 The variable @code{hscroll-step} determines how many columns to
252scroll the window when point gets too close to the edge. If it's
253zero, horizontal scrolling centers point horizontally within the
254window. If it's a positive integer, it specifies the number of
255columns to scroll by. If it's a floating-point number, it specifies
256the fraction of the window's width to scroll by. The default is zero.
257
258@vindex auto-hscroll-mode
259 To disable automatic horizontal scrolling, set the variable
260@code{auto-hscroll-mode} to @code{nil}.
261
262@node Follow Mode
263@section Follow Mode
264@cindex Follow mode
265@cindex mode, Follow
266@findex follow-mode
267@cindex windows, synchronizing
268@cindex synchronizing windows
269
270 @dfn{Follow mode} is a minor mode that makes two windows, both
271showing the same buffer, scroll as a single tall ``virtual window.''
272To use Follow mode, go to a frame with just one window, split it into
273two side-by-side windows using @kbd{C-x 3}, and then type @kbd{M-x
274follow-mode}. From then on, you can edit the buffer in either of the
275two windows, or scroll either one; the other window follows it.
276
277 In Follow mode, if you move point outside the portion visible in one
278window and into the portion visible in the other window, that selects
279the other window---again, treating the two as if they were parts of
280one large window.
281
282 To turn off Follow mode, type @kbd{M-x follow-mode} a second time.
283
284@node Faces
285@section Using Multiple Typefaces
286@cindex faces
287
288 You can specify various styles for displaying text using
289@dfn{faces}. Each face can specify various @dfn{face attributes},
290such as the font family, the height, weight and slant of the
291characters, the foreground and background color, and underlining or
292overlining. A face does not have to specify all of these attributes;
293often it inherits most of them from another face.
294
295 On graphical display, all the Emacs face attributes are meaningful.
296On a text-only terminal, only some of them work. Some text-only
297terminals support inverse video, bold, and underline attributes; some
298support colors. Text-only terminals generally do not support changing
299the height and width or the font family.
300
301 Emacs uses faces automatically for highlighting, through the work of
302Font Lock mode. @xref{Font Lock}, for more information about Font
303Lock mode and syntactic highlighting. You can print out the buffer
304with the highlighting that appears on your screen using the command
305@code{ps-print-buffer-with-faces}. @xref{PostScript}.
306
307 You control the appearance of a part of the text in the buffer by
308specifying the face or faces to use for it. The style of display used
309for any given character is determined by combining the attributes of
310all the applicable faces specified for that character. Any attribute
311that isn't specified by these faces is taken from the @code{default} face,
312whose attributes reflect the default settings of the frame itself.
313
314 Enriched mode, the mode for editing formatted text, includes several
315commands and menus for specifying faces for text in the buffer.
316@xref{Format Faces}, for how to specify the font for text in the
317buffer. @xref{Format Colors}, for how to specify the foreground and
318background color.
319
320@cindex face colors, setting
321@findex set-face-foreground
322@findex set-face-background
323 To alter the appearance of a face, use the customization buffer.
324@xref{Face Customization}. You can also use X resources to specify
325attributes of particular faces (@pxref{Resources}). Alternatively,
326you can change the foreground and background colors of a specific face
327with @kbd{M-x set-face-foreground} and @kbd{M-x set-face-background}.
328These commands prompt in the minibuffer for a face name and a color
329name, with completion, and then set that face to use the specified
330color. Changing the colors of the @code{default} face also changes
331the foreground and background colors on all frames, both existing and
332those to be created in the future. (You can also set foreground and
333background colors for the current frame only; see @ref{Frame
334Parameters}.)
335
336 If you want to alter the appearance of all Emacs frames, you need to
337customize the frame parameters in the variable
338@code{default-frame-alist}; see @ref{Creating Frames,
339default-frame-alist}.
340
341 Emacs can correctly display variable-width fonts, but Emacs commands
342that calculate width and indentation do not know how to calculate
343variable widths. This can sometimes lead to incorrect results when
344you use variable-width fonts. In particular, indentation commands can
345give inconsistent results, so we recommend you avoid variable-width
346fonts for editing program source code. Filling will sometimes make
347lines too long or too short. We plan to address these issues in
348future Emacs versions.
349
350@node Standard Faces
351@section Standard Faces
352
353@findex list-faces-display
354 To see what faces are currently defined, and what they look like,
355type @kbd{M-x list-faces-display}. It's possible for a given face to
356look different in different frames; this command shows the appearance
357in the frame in which you type it. With a prefix argument, this
358prompts for a regular expression, and displays only faces with names
359matching that regular expression.
360
361 Here are the standard faces for specifying text appearance. You can
362apply them to specific text when you want the effects they produce.
363
364@table @code
365@item default
366This face is used for ordinary text that doesn't specify any face.
367@item bold
368This face uses a bold variant of the default font, if it has one.
369It's up to you to choose a default font that has a bold variant,
370if you want to use one.
371@item italic
372This face uses an italic variant of the default font, if it has one.
373@item bold-italic
374This face uses a bold italic variant of the default font, if it has one.
375@item underline
376This face underlines text.
377@item fixed-pitch
378This face forces use of a particular fixed-width font.
379@item variable-pitch
380This face forces use of a particular variable-width font. It's
381reasonable to customize this face to use a different variable-width font,
382if you like, but you should not make it a fixed-width font.
383@item shadow
384This face is used for making the text less noticeable than the surrounding
385ordinary text. Usually this can be achieved by using shades of gray in
386contrast with either black or white default foreground color.
387@end table
388
389 Here's an incomplete list of faces used to highlight parts of the
390text temporarily for specific purposes. (Many other modes define
391their own faces for this purpose.)
392
393@table @code
394@item highlight
395This face is used for highlighting portions of text, in various modes.
396For example, mouse-sensitive text is highlighted using this face.
397@item isearch
398This face is used for highlighting the current Isearch match.
399@item query-replace
400This face is used for highlighting the current Query Replace match.
401@item lazy-highlight
402This face is used for lazy highlighting of Isearch and Query Replace
403matches other than the current one.
404@item region
405This face is used for displaying a selected region (when Transient Mark
406mode is enabled---see below).
407@item secondary-selection
408This face is used for displaying a secondary X selection (@pxref{Secondary
409Selection}).
410@item trailing-whitespace
411The face for highlighting excess spaces and tabs at the end of a line
412when @code{show-trailing-whitespace} is non-@code{nil}; see
413@ref{Useless Whitespace}.
414@item nobreak-space
415The face for displaying the character ``nobreak space.''
416@item escape-glyph
417The face for highlighting the @samp{\} or @samp{^} that indicates
418a control character. It's also used when @samp{\} indicates a
419nobreak space or nobreak (soft) hyphen.
420@end table
421
422@cindex @code{region} face
423 When Transient Mark mode is enabled, the text of the region is
424highlighted when the mark is active. This uses the face named
425@code{region}; you can control the style of highlighting by changing the
426style of this face (@pxref{Face Customization}). @xref{Transient Mark},
427for more information about Transient Mark mode and activation and
428deactivation of the mark.
429
430 These faces control the appearance of parts of the Emacs frame.
431They exist as faces to provide a consistent way to customize the
432appearance of these parts of the frame.
433
434@table @code
435@item mode-line
436@itemx modeline
437This face is used for the mode line of the currently selected window,
438and for menu bars when toolkit menus are not used. By default, it's
439drawn with shadows for a ``raised'' effect on graphical displays, and
440drawn as the inverse of the default face on non-windowed terminals.
441@code{modeline} is an alias for the @code{mode-line} face, for
442compatibility with old Emacs versions.
443@item mode-line-inactive
444Like @code{mode-line}, but used for mode lines of the windows other
445than the selected one (if @code{mode-line-in-non-selected-windows} is
446non-@code{nil}). This face inherits from @code{mode-line}, so changes
447in that face affect mode lines in all windows.
448@item mode-line-highlight
449Like @code{highlight}, but used for portions of text on mode lines.
450@item mode-line-buffer-id
451This face is used for buffer identification parts in the mode line.
452@item header-line
453Similar to @code{mode-line} for a window's header line, which appears
454at the top of a window just as the mode line appears at the bottom.
455Most windows do not have a header line---only some special modes, such
456Info mode, create one.
457@item vertical-border
458This face is used for the vertical divider between windows.
459By default this face inherits from the @code{mode-line-inactive} face
460on character terminals. On graphical displays the foreground color of
461this face is used for the vertical line between windows without
462scrollbars.
463@item minibuffer-prompt
464@cindex @code{minibuffer-prompt} face
465@vindex minibuffer-prompt-properties
466This face is used for the prompt strings displayed in the minibuffer.
467By default, Emacs automatically adds this face to the value of
468@code{minibuffer-prompt-properties}, which is a list of text
469properties used to display the prompt text. (This variable takes
470effect when you enter the minibuffer.)
471@item fringe
472@cindex @code{fringe} face
473The face for the fringes to the left and right of windows on graphic
474displays. (The fringes are the narrow portions of the Emacs frame
475between the text area and the window's right and left borders.)
476@xref{Fringes}.
477@item scroll-bar
478This face determines the visual appearance of the scroll bar.
479@xref{Scroll Bars}.
480@item border
481This face determines the color of the frame border.
482@item cursor
483This face determines the color of the cursor.
484@item mouse
485This face determines the color of the mouse pointer.
486@item tool-bar
487This face determines the color of tool bar icons. @xref{Tool Bars}.
488@item tooltip
489This face is used for tooltips. @xref{Tooltips}.
490@item menu
491@cindex menu bar appearance
492@cindex @code{menu} face, no effect if customized
493@cindex customization of @code{menu} face
494This face determines the colors and font of Emacs's menus. @xref{Menu
495Bars}. Setting the font of LessTif/Motif menus is currently not
496supported; attempts to set the font are ignored in this case.
497Likewise, attempts to customize this face in Emacs built with GTK and
498in the MS-Windows/Mac ports are ignored by the respective GUI toolkits;
499you need to use system-wide styles and options to change the
500appearance of the menus.
501@end table
502
503@node Font Lock
504@section Font Lock mode
505@cindex Font Lock mode
506@cindex mode, Font Lock
507@cindex syntax highlighting and coloring
508
509 Font Lock mode is a minor mode, always local to a particular buffer,
510which highlights (or ``fontifies'') the buffer contents according to
511the syntax of the text you are editing. It can recognize comments and
512strings in most languages; in several languages, it can also recognize
513and properly highlight various other important constructs---for
514example, names of functions being defined or reserved keywords.
515Some special modes, such as Occur mode and Info mode, have completely
516specialized ways of assigning fonts for Font Lock mode.
517
518@findex font-lock-mode
519 Font Lock mode is turned on by default in all modes which support it.
520You can toggle font-lock for each buffer with the command @kbd{M-x
521font-lock-mode}. Using a positive argument unconditionally turns Font
522Lock mode on, and a negative or zero argument turns it off.
523
524@findex global-font-lock-mode
525@vindex global-font-lock-mode
526 If you do not wish Font Lock mode to be turned on by default,
527customize the variable @code{global-font-lock-mode} using the Customize
528interface (@pxref{Easy Customization}), or use the function
529@code{global-font-lock-mode} in your @file{.emacs} file, like this:
530
531@example
532(global-font-lock-mode 0)
533@end example
534
535@noindent
536This variable, like all the variables that control Font Lock mode,
537take effect whenever fontification is done; that is, potentially at
538any time.
539
540@findex turn-on-font-lock
541 If you have disabled Global Font Lock mode, you can still enable Font
542Lock for specific major modes by adding the function
543@code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For
544example, to enable Font Lock mode for editing C files, you can do this:
545
546@example
547(add-hook 'c-mode-hook 'turn-on-font-lock)
548@end example
549
550 Font Lock mode uses several specifically named faces to do its job,
551including @code{font-lock-string-face}, @code{font-lock-comment-face},
552and others. The easiest way to find them all is to use @kbd{M-x
553customize-group @key{RET} font-lock-faces @key{RET}}. You can then
554use that customization buffer to customize the appearance of these
555faces. @xref{Face Customization}.
556
557 You can also customize these faces using @kbd{M-x
558set-face-foreground} or @kbd{M-x set-face-background}. @xref{Faces}.
559
560@vindex font-lock-maximum-decoration
561 The variable @code{font-lock-maximum-decoration} specifies the
562preferred level of fontification, for modes that provide multiple
563levels. Level 1 is the least amount of fontification; some modes
564support levels as high as 3. The normal default is ``as high as
565possible.'' You can specify an integer, which applies to all modes, or
566you can specify different numbers for particular major modes; for
567example, to use level 1 for C/C++ modes, and the default level
568otherwise, use this:
569
570@example
571(setq font-lock-maximum-decoration
572 '((c-mode . 1) (c++-mode . 1)))
573@end example
574
575@vindex font-lock-maximum-size
576 Fontification can be too slow for large buffers, so you can suppress
577it for buffers above a certain size. The variable
578@code{font-lock-maximum-size} specifies a buffer size, beyond which
579buffer fontification is suppressed.
580
581@c @w is used below to prevent a bad page-break.
582@vindex font-lock-beginning-of-syntax-function
583@cindex incorrect fontification
584@cindex parenthesis in column zero and fontification
585@cindex brace in column zero and fontification
586 Comment and string fontification (or ``syntactic'' fontification)
587relies on analysis of the syntactic structure of the buffer text. For
588the sake of speed, some modes, including Lisp mode, rely on a special
589convention: an open-parenthesis or open-brace in the leftmost column
590always defines the @w{beginning} of a defun, and is thus always
591outside any string or comment. (@xref{Left Margin Paren}.) If you
592don't follow this convention, Font Lock mode can misfontify the text
593that follows an open-parenthesis or open-brace in the leftmost column
594that is inside a string or comment.
595
596@cindex slow display during scrolling
597 The variable @code{font-lock-beginning-of-syntax-function} (always
598buffer-local) specifies how Font Lock mode can find a position
599guaranteed to be outside any comment or string. In modes which use the
600leftmost column parenthesis convention, the default value of the variable
601is @code{beginning-of-defun}---that tells Font Lock mode to use the
602convention. If you set this variable to @code{nil}, Font Lock no longer
603relies on the convention. This avoids incorrect results, but the price
604is that, in some cases, fontification for a changed text must rescan
605buffer text from the beginning of the buffer. This can considerably
606slow down redisplay while scrolling, particularly if you are close to
607the end of a large buffer.
608
609@findex font-lock-add-keywords
610 Font Lock highlighting patterns already exist for many modes, but you
611may want to fontify additional patterns. You can use the function
612@code{font-lock-add-keywords}, to add your own highlighting patterns for
613a particular mode. For example, to highlight @samp{FIXME:} words in C
614comments, use this:
615
616@example
617(font-lock-add-keywords
618 'c-mode
619 '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t)))
620@end example
621
622@findex font-lock-remove-keywords
623 To remove keywords from the font-lock highlighting patterns, use the
624function @code{font-lock-remove-keywords}. @xref{Search-based
625Fontification,,, elisp, The Emacs Lisp Reference Manual}, for
626documentation of the format of this list.
627
628@cindex just-in-time (JIT) font-lock
629@cindex background syntax highlighting
630 Fontifying large buffers can take a long time. To avoid large
631delays when a file is visited, Emacs fontifies only the visible
632portion of a buffer. As you scroll through the buffer, each portion
633that becomes visible is fontified as soon as it is displayed. The
634parts of the buffer that are not displayed are fontified
635``stealthily,'' in the background, i.e.@: when Emacs is idle. You can
636control this background fontification, also called @dfn{Just-In-Time}
637(or @dfn{JIT}) Lock, by customizing variables in the customization
638group @samp{jit-lock}. @xref{Specific Customization}.
639
640@node Highlight Interactively
641@section Interactive Highlighting
642@cindex highlighting by matching
643@cindex interactive highlighting
644@cindex Highlight Changes mode
645
646@findex highlight-changes-mode
647 Use @kbd{M-x highlight-changes-mode} to enable (or disable)
648Highlight Changes mode, a minor mode that uses faces (colors,
649typically) to indicate which parts of the buffer were changed most
650recently.
651
652@cindex Hi Lock mode
653@findex hi-lock-mode
654 Hi Lock mode highlights text that matches regular expressions you
655specify. For example, you might wish to see all the references to a
656certain variable in a program source file, highlight certain parts in
657a voluminous output of some program, or make certain names stand out
658in an article. Use the @kbd{M-x hi-lock-mode} command to enable (or
659disable) Hi Lock mode. To enable Hi Lock mode for all buffers, use
660@kbd{M-x global-hi-lock-mode} or place @code{(global-hi-lock-mode 1)}
661in your @file{.emacs} file.
662
663 Hi Lock mode works like Font Lock mode (@pxref{Font Lock}), except
664that you specify explicitly the regular expressions to highlight. You
665control them with these commands:
666
667@table @kbd
668@item C-x w h @var{regexp} @key{RET} @var{face} @key{RET}
669@kindex C-x w h
670@findex highlight-regexp
671Highlight text that matches @var{regexp} using face @var{face}
672(@code{highlight-regexp}). The highlighting will remain as long as
673the buffer is loaded. For example, to highlight all occurrences of
674the word ``whim'' using the default face (a yellow background)
675@kbd{C-x w h whim @key{RET} @key{RET}}. Any face can be used for
676highlighting, Hi Lock provides several of its own and these are
677pre-loaded into a history list. While being prompted for a face use
678@kbd{M-p} and @kbd{M-n} to cycle through them.
679
680You can use this command multiple times, specifying various regular
681expressions to highlight in different ways.
682
683@item C-x w r @var{regexp} @key{RET}
684@kindex C-x w r
685@findex unhighlight-regexp
686Unhighlight @var{regexp} (@code{unhighlight-regexp}).
687
688If you invoke this from the menu, you select the expression to
689unhighlight from a list. If you invoke this from the keyboard, you
690use the minibuffer. It will show the most recently added regular
691expression; use @kbd{M-p} to show the next older expression and
692@kbd{M-n} to select the next newer expression. (You can also type the
693expression by hand, with completion.) When the expression you want to
694unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit
695the minibuffer and unhighlight it.
696
697@item C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
698@kindex C-x w l
699@findex highlight-lines-matching-regexp
700@cindex lines, highlighting
701@cindex highlighting lines of text
702Highlight entire lines containing a match for @var{regexp}, using face
703@var{face} (@code{highlight-lines-matching-regexp}).
704
705@item C-x w b
706@kindex C-x w b
707@findex hi-lock-write-interactive-patterns
708Insert all the current highlighting regexp/face pairs into the buffer
709at point, with comment delimiters to prevent them from changing your
710program. (This key binding runs the
711@code{hi-lock-write-interactive-patterns} command.)
712
713These patterns are extracted from the comments, if appropriate, if you
714invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while
715Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}).
716
717@item C-x w i
718@kindex C-x w i
719@findex hi-lock-find-patterns
720Extract regexp/face pairs from comments in the current buffer
721(@code{hi-lock-find-patterns}). Thus, you can enter patterns
722interactively with @code{highlight-regexp}, store them into the file
723with @code{hi-lock-write-interactive-patterns}, edit them (perhaps
724including different faces for different parenthesized parts of the
725match), and finally use this command (@code{hi-lock-find-patterns}) to
726have Hi Lock highlight the edited patterns.
727
728@vindex hi-lock-file-patterns-policy
729The variable @code{hi-lock-file-patterns-policy} controls whether Hi
730Lock mode should automatically extract and highlight patterns found in
731a file when it is visited. Its value can be @code{nil} (never
732highlight), @code{t} (highlight the patterns), @code{ask} (query the
733user), or a function. If it is a function,
734@code{hi-lock-find-patterns} calls it with the patterns as argument;
735if the function returns non-@code{nil}, the patterns are used. The
736default is @code{nil}. Note that patterns are always highlighted if
737you call @code{hi-lock-find-patterns} directly, regardless of the
738value of this variable.
739
740@vindex hi-lock-exclude-modes
741Also, @code{hi-lock-find-patterns} does nothing if the current major
742mode's symbol is a member of the list @code{hi-lock-exclude-modes}.
743@end table
744
745@node Fringes
746@section Window Fringes
747@cindex fringes
748
749 On a graphical display, each Emacs window normally has narrow
750@dfn{fringes} on the left and right edges. The fringes display
751indications about the text in the window.
752
753 The most common use of the fringes is to indicate a continuation
754line, when one line of text is split into multiple lines on the
755screen. The left fringe shows a curving arrow for each screen line
756except the first, indicating that ``this is not the real beginning.''
757The right fringe shows a curving arrow for each screen line except the
758last, indicating that ``this is not the real end.''
759
760 The fringes indicate line truncation with short horizontal arrows
761meaning ``there's more text on this line which is scrolled
762horizontally out of view;'' clicking the mouse on one of the arrows
763scrolls the display horizontally in the direction of the arrow. The
764fringes can also indicate other things, such as empty lines, or where a
765program you are debugging is executing (@pxref{Debuggers}).
766
767@findex set-fringe-style
768@findex fringe-mode
769 You can enable and disable the fringes for all frames using
770@kbd{M-x fringe-mode}. To enable and disable the fringes
771for the selected frame, use @kbd{M-x set-fringe-style}.
772
773@node Displaying Boundaries
774@section Displaying Boundaries
775
776@vindex indicate-buffer-boundaries
777 On a graphical display, Emacs can indicate the buffer boundaries in
778the fringes. It indicates the first line and the last line with
779angle images in the fringes. This can be combined with up and down
780arrow images which say whether it is possible to scroll the window up
781and down.
782
783 The buffer-local variable @code{indicate-buffer-boundaries} controls
784how the buffer boundaries and window scrolling is indicated in the
785fringes. If the value is @code{left} or @code{right}, both angle and
786arrow bitmaps are displayed in the left or right fringe, respectively.
787
788 If value is an alist, each element @code{(@var{indicator} .
789@var{position})} specifies the position of one of the indicators.
790The @var{indicator} must be one of @code{top}, @code{bottom},
791@code{up}, @code{down}, or @code{t} which specifies the default
792position for the indicators not present in the alist.
793The @var{position} is one of @code{left}, @code{right}, or @code{nil}
794which specifies not to show this indicator.
795
796 For example, @code{((top . left) (t . right))} places the top angle
797bitmap in left fringe, the bottom angle bitmap in right fringe, and
798both arrow bitmaps in right fringe. To show just the angle bitmaps in
799the left fringe, but no arrow bitmaps, use @code{((top . left)
800(bottom . left))}.
801
802@vindex default-indicate-buffer-boundaries
803 The value of the variable @code{default-indicate-buffer-boundaries}
804is the default value for @code{indicate-buffer-boundaries} in buffers
805that do not override it.
806
807@node Useless Whitespace
808@section Useless Whitespace
809
810@cindex trailing whitespace
811@cindex whitespace, trailing
812@vindex show-trailing-whitespace
813 It is easy to leave unnecessary spaces at the end of a line, or
814empty lines at the end of a file, without realizing it. In most
815cases, this @dfn{trailing whitespace} has no effect, but there are
816special circumstances where it matters. It can also be a nuisance
817that the line has ``changed,'' when the change is just spaces added or
818removed at the end.
819
820 You can make trailing whitespace at the end of a line visible on the
821screen by setting the buffer-local variable
822@code{show-trailing-whitespace} to @code{t}. Then Emacs displays
823trailing whitespace in the face @code{trailing-whitespace}.
824
825 This feature does not apply when point is at the end of the line
826containing the whitespace. Strictly speaking, that is ``trailing
827whitespace'' nonetheless, but displaying it specially in that case
828looks ugly while you are typing in new text. In this special case,
829the location of point is enough to show you that the spaces are
830present.
831
832@findex delete-trailing-whitespace
833 To delete all trailing whitespace within the current buffer's
834accessible portion (@pxref{Narrowing}), type @kbd{M-x
835delete-trailing-whitespace @key{RET}}. (This command does not remove
836the form-feed characters.)
837
838@vindex indicate-empty-lines
839@vindex default-indicate-empty-lines
840@cindex unused lines
841@cindex fringes, and unused line indication
842 Emacs can indicate unused lines at the end of the window with a
843small image in the left fringe (@pxref{Fringes}). The image appears
844for window lines that do not correspond to any buffer text. Blank
845lines at the end of the buffer then stand out because they do not have
846this image in the fringe.
847
848 To enable this feature, set the buffer-local variable
849@code{indicate-empty-lines} to a non-@code{nil} value. The default
850value of this variable is controlled by the variable
851@code{default-indicate-empty-lines}; by setting that variable, you
852can enable or disable this feature for all new buffers. (This feature
853currently doesn't work on text-only terminals.)
854
855@node Selective Display
856@section Selective Display
857@cindex selective display
858@findex set-selective-display
859@kindex C-x $
860
861 Emacs has the ability to hide lines indented more than a certain number
862of columns (you specify how many columns). You can use this to get an
863overview of a part of a program.
864
865 To hide lines in the current buffer, type @kbd{C-x $}
866(@code{set-selective-display}) with a numeric argument @var{n}. Then
867lines with at least @var{n} columns of indentation disappear from the
868screen. The only indication of their presence is that three dots
869(@samp{@dots{}}) appear at the end of each visible line that is
870followed by one or more hidden ones.
871
872 The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as
873if they were not there.
874
875 The hidden lines are still present in the buffer, and most editing
876commands see them as usual, so you may find point in the middle of the
877hidden text. When this happens, the cursor appears at the end of the
878previous line, after the three dots. If point is at the end of the
879visible line, before the newline that ends it, the cursor appears before
880the three dots.
881
882 To make all lines visible again, type @kbd{C-x $} with no argument.
883
884@vindex selective-display-ellipses
885 If you set the variable @code{selective-display-ellipses} to
886@code{nil}, the three dots do not appear at the end of a line that
887precedes hidden lines. Then there is no visible indication of the
888hidden lines. This variable becomes local automatically when set.
889
890 See also @ref{Outline Mode} for another way to hide part of
891the text in a buffer.
892
893@node Optional Mode Line
894@section Optional Mode Line Features
895
896@cindex buffer size display
897@cindex display of buffer size
898@findex size-indication-mode
899 The buffer percentage @var{pos} indicates the percentage of the
900buffer above the top of the window. You can additionally display the
901size of the buffer by typing @kbd{M-x size-indication-mode} to turn on
902Size Indication mode. The size will be displayed immediately
903following the buffer percentage like this:
904
905@example
906@var{POS} of @var{SIZE}
907@end example
908
909@noindent
910Here @var{SIZE} is the human readable representation of the number of
911characters in the buffer, which means that @samp{k} for 10^3, @samp{M}
912for 10^6, @samp{G} for 10^9, etc., are used to abbreviate.
913
914@cindex narrowing, and buffer size display
915 If you have narrowed the buffer (@pxref{Narrowing}), the size of the
916accessible part of the buffer is shown.
917
918@cindex line number display
919@cindex display of line number
920@findex line-number-mode
921 The current line number of point appears in the mode line when Line
922Number mode is enabled. Use the command @kbd{M-x line-number-mode} to
923turn this mode on and off; normally it is on. The line number appears
924after the buffer percentage @var{pos}, with the letter @samp{L} to
925indicate what it is.
926
927@cindex Column Number mode
928@cindex mode, Column Number
929@findex column-number-mode
930 Similarly, you can display the current column number by turning on
931Column number mode with @kbd{M-x column-number-mode}. The column
932number is indicated by the letter @samp{C}. However, when both of
933these modes are enabled, the line and column numbers are displayed in
934parentheses, the line number first, rather than with @samp{L} and
935@samp{C}. For example: @samp{(561,2)}. @xref{Minor Modes}, for more
936information about minor modes and about how to use these commands.
937
938@cindex narrowing, and line number display
939 If you have narrowed the buffer (@pxref{Narrowing}), the displayed
940line number is relative to the accessible portion of the buffer.
941Thus, it isn't suitable as an argument to @code{goto-line}. (Use
942@code{what-line} command to see the line number relative to the whole
943file.)
944
945@vindex line-number-display-limit
946 If the buffer is very large (larger than the value of
947@code{line-number-display-limit}), then the line number doesn't appear.
948Emacs doesn't compute the line number when the buffer is large, because
949that would be too slow. Set it to @code{nil} to remove the limit.
950
951@vindex line-number-display-limit-width
952 Line-number computation can also be slow if the lines in the buffer
953are too long. For this reason, Emacs normally doesn't display line
954numbers if the average width, in characters, of lines near point is
955larger than the value of the variable
956@code{line-number-display-limit-width}. The default value is 200
957characters.
958
959@findex display-time
960@cindex time (on mode line)
961 Emacs can optionally display the time and system load in all mode
962lines. To enable this feature, type @kbd{M-x display-time} or customize
963the option @code{display-time-mode}. The information added to the mode
964line usually appears after the buffer name, before the mode names and
965their parentheses. It looks like this:
966
967@example
968@var{hh}:@var{mm}pm @var{l.ll}
969@end example
970
971@noindent
972@vindex display-time-24hr-format
973Here @var{hh} and @var{mm} are the hour and minute, followed always by
974@samp{am} or @samp{pm}. @var{l.ll} is the average number of running
975processes in the whole system recently. (Some fields may be missing if
976your operating system cannot support them.) If you prefer time display
977in 24-hour format, set the variable @code{display-time-24hr-format}
978to @code{t}.
979
980@cindex mail (on mode line)
981@vindex display-time-use-mail-icon
982@vindex display-time-mail-face
983@vindex display-time-mail-file
984@vindex display-time-mail-directory
985 The word @samp{Mail} appears after the load level if there is mail
986for you that you have not read yet. On a graphical display you can use
987an icon instead of @samp{Mail} by customizing
988@code{display-time-use-mail-icon}; this may save some space on the mode
989line. You can customize @code{display-time-mail-face} to make the mail
990indicator prominent. Use @code{display-time-mail-file} to specify
991the mail file to check, or set @code{display-time-mail-directory}
992to specify the directory to check for incoming mail (any nonempty regular
993file in the directory is considered as ``newly arrived mail'').
994
995@cindex mode line, 3D appearance
996@cindex attributes of mode line, changing
997@cindex non-integral number of lines in a window
998 By default, the mode line is drawn on graphics displays with
9993D-style highlighting, like that of a button when it is not being
1000pressed. If you don't like this effect, you can disable the 3D
1001highlighting of the mode line, by customizing the attributes of the
1002@code{mode-line} face. @xref{Face Customization}.
1003
1004@cindex non-selected windows, mode line appearance
1005 By default, the mode line of nonselected windows is displayed in a
1006different face, called @code{mode-line-inactive}. Only the selected
1007window is displayed in the @code{mode-line} face. This helps show
1008which window is selected. When the minibuffer is selected, since
1009it has no mode line, the window from which you activated the minibuffer
1010has its mode line displayed using @code{mode-line}; as a result,
1011ordinary entry to the minibuffer does not change any mode lines.
1012
1013@vindex mode-line-in-non-selected-windows
1014 You can disable use of @code{mode-line-inactive} by setting variable
1015@code{mode-line-in-non-selected-windows} to @code{nil}; then all mode
1016lines are displayed in the @code{mode-line} face.
1017
1018@vindex eol-mnemonic-unix
1019@vindex eol-mnemonic-dos
1020@vindex eol-mnemonic-mac
1021@vindex eol-mnemonic-undecided
1022 You can customize the mode line display for each of the end-of-line
1023formats by setting each of the variables @code{eol-mnemonic-unix},
1024@code{eol-mnemonic-dos}, @code{eol-mnemonic-mac}, and
1025@code{eol-mnemonic-undecided} to the strings you prefer.
1026
1027@node Text Display
1028@section How Text Is Displayed
1029@cindex characters (in text)
1030
1031 @acronym{ASCII} printing characters (octal codes 040 through 0176) in Emacs
1032buffers are displayed with their graphics, as are non-ASCII multibyte
1033printing characters (octal codes above 0400).
1034
1035 Some @acronym{ASCII} control characters are displayed in special ways. The
1036newline character (octal code 012) is displayed by starting a new line.
1037The tab character (octal code 011) is displayed by moving to the next
1038tab stop column (normally every 8 columns).
1039
1040 Other @acronym{ASCII} control characters are normally displayed as a caret
1041(@samp{^}) followed by the non-control version of the character; thus,
1042control-A is displayed as @samp{^A}. The caret appears in face
1043@code{escape-glyph}.
1044
1045 Non-@acronym{ASCII} characters 0200 through 0237 (octal) are
1046displayed with octal escape sequences; thus, character code 0230
1047(octal) is displayed as @samp{\230}. The backslash appears in face
1048@code{escape-glyph}.
1049
1050@vindex ctl-arrow
1051 If the variable @code{ctl-arrow} is @code{nil}, control characters in
1052the buffer are displayed with octal escape sequences, except for newline
1053and tab. Altering the value of @code{ctl-arrow} makes it local to the
1054current buffer; until that time, the default value is in effect. The
1055default is initially @code{t}.
1056
1057 The display of character codes 0240 through 0377 (octal) may be
1058either as escape sequences or as graphics. They do not normally occur
1059in multibyte buffers, but if they do, they are displayed as Latin-1
1060graphics. In unibyte mode, if you enable European display they are
1061displayed using their graphics (assuming your terminal supports them),
1062otherwise as escape sequences. @xref{Unibyte Mode}.
1063
1064@vindex nobreak-char-display
1065@cindex no-break space, display
1066@cindex no-break hyphen, display
1067@cindex soft hyphen, display
1068 Some character sets define ``no-break'' versions of the space and
1069hyphen characters, which are used where a line should not be broken.
1070Emacs normally displays these characters with special faces
1071(respectively, @code{nobreak-space} and @code{escape-glyph}) to
1072distinguish them from ordinary spaces and hyphens. You can turn off
1073this feature by setting the variable @code{nobreak-char-display} to
1074@code{nil}. If you set the variable to any other value, that means to
1075prefix these characters with an escape character.
1076
1077@vindex tab-width
1078@vindex default-tab-width
1079 Normally, a tab character in the buffer is displayed as whitespace which
1080extends to the next display tab stop position, and display tab stops come
1081at intervals equal to eight spaces. The number of spaces per tab is
1082controlled by the variable @code{tab-width}, which is made local by
1083changing it. Note that how the tab character
1084in the buffer is displayed has nothing to do with the definition of
1085@key{TAB} as a command. The variable @code{tab-width} must have an
1086integer value between 1 and 1000, inclusive. The variable
1087@code{default-tab-width} controls the default value of this variable
1088for buffers where you have not set it locally.
1089
1090 You can customize the way any particular character code is displayed
1091by means of a display table. @xref{Display Tables,, Display Tables,
1092elisp, The Emacs Lisp Reference Manual}.
1093
1094@node Cursor Display
1095@section Displaying the Cursor
1096
1097@findex blink-cursor-mode
1098@vindex blink-cursor-alist
1099@cindex cursor, locating visually
1100@cindex cursor, blinking
1101 You can customize the cursor's color, and whether it blinks, using
1102the @code{cursor} Custom group (@pxref{Easy Customization}). On
1103a graphical display, the command @kbd{M-x blink-cursor-mode} enables
1104or disables the blinking of the cursor. (On text terminals, the
1105terminal itself blinks the cursor, and Emacs has no control over it.)
1106You can control how the cursor appears when it blinks off by setting
1107the variable @code{blink-cursor-alist}.
1108
1109@vindex visible-cursor
1110 Some text terminals offer two different cursors: the normal cursor
1111and the very visible cursor, where the latter may be e.g. bigger or
1112blinking. By default Emacs uses the very visible cursor, and switches
1113to it when you start or resume Emacs. If the variable
1114@code{visible-cursor} is @code{nil} when Emacs starts or resumes, it
1115doesn't switch, so it uses the normal cursor.
1116
1117@cindex cursor in non-selected windows
1118@vindex cursor-in-non-selected-windows
1119 Normally, the cursor appears in non-selected windows in the ``off''
1120state, with the same appearance as when the blinking cursor blinks
1121``off.'' For a box cursor, this is a hollow box; for a bar cursor,
1122this is a thinner bar. To turn off cursors in non-selected windows,
1123customize the variable @code{cursor-in-non-selected-windows} and assign
1124it a @code{nil} value.
1125
1126@vindex x-stretch-cursor
1127@cindex wide block cursor
1128 On graphical displays, Emacs can optionally draw the block cursor
1129as wide as the character under the cursor---for example, if the cursor
1130is on a tab character, it would cover the full width occupied by that
1131tab character. To enable this feature, set the variable
1132@code{x-stretch-cursor} to a non-@code{nil} value.
1133
1134@findex hl-line-mode
1135@findex global-hl-line-mode
1136@cindex highlight current line
1137 To make the cursor even more visible, you can use HL Line mode, a
1138minor mode that highlights the line containing point. Use @kbd{M-x
1139hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x
1140global-hl-line-mode} enables or disables the same mode globally.
1141
1142@node Line Truncation
1143@section Truncation of Lines
1144
1145@cindex truncation
1146@cindex line truncation, and fringes
1147 As an alternative to continuation, Emacs can display long lines by
1148@dfn{truncation}. This means that all the characters that do not fit
1149in the width of the screen or window do not appear at all. On
1150graphical displays, a small straight arrow in the fringe indicates
1151truncation at either end of the line. On text-only terminals, @samp{$}
1152appears in the first column when there is text truncated to the left,
1153and in the last column when there is text truncated to the right.
1154
1155@vindex truncate-lines
1156@findex toggle-truncate-lines
1157 Horizontal scrolling automatically causes line truncation
1158(@pxref{Horizontal Scrolling}). You can explicitly enable line
1159truncation for a particular buffer with the command @kbd{M-x
1160toggle-truncate-lines}. This works by locally changing the variable
1161@code{truncate-lines}. If that variable is non-@code{nil}, long lines
1162are truncated; if it is @code{nil}, they are continued onto multiple
1163screen lines. Setting the variable @code{truncate-lines} in any way
1164makes it local to the current buffer; until that time, the default
1165value is in effect. The default value is normally @code{nil}.
1166
1167@c @vindex truncate-partial-width-windows @c Idx entry is in Split Windows.
1168 If the variable @code{truncate-partial-width-windows} is
1169non-@code{nil}, it forces truncation rather than continuation in any
1170window less than the full width of the screen or frame, regardless of
1171the value of @code{truncate-lines}. For information about side-by-side
1172windows, see @ref{Split Window}. See also @ref{Display,, Display,
1173elisp, The Emacs Lisp Reference Manual}.
1174
1175@vindex overflow-newline-into-fringe
1176 If the variable @code{overflow-newline-into-fringe} is
1177non-@code{nil} on a graphical display, then Emacs does not continue or
1178truncate a line which is exactly as wide as the window. Instead, the
1179newline overflows into the right fringe, and the cursor appears in the
1180fringe when positioned on that newline.
1181
1182@node Display Custom
1183@section Customization of Display
1184
1185 This section describes variables (@pxref{Variables}) that you can
1186change to customize how Emacs displays. Beginning users can skip
1187it.
1188@c the reason for that pxref is because an xref early in the
1189@c ``echo area'' section leads here.
1190
1191@vindex inverse-video
1192 If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts
1193to invert all the lines of the display from what they normally are.
1194
1195@vindex visible-bell
1196 If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
1197to make the whole screen blink when it would normally make an audible bell
1198sound. This variable has no effect if your terminal does not have a way
1199to make the screen blink.
1200
1201@vindex echo-keystrokes
1202 The variable @code{echo-keystrokes} controls the echoing of multi-character
1203keys; its value is the number of seconds of pause required to cause echoing
1204to start, or zero, meaning don't echo at all. The value takes effect when
1205there is someting to echo. @xref{Echo Area}.
1206
1207@vindex baud-rate
1208 The variable @anchor{baud-rate}@code{baud-rate} holds the output
1209speed of the terminal, as far as Emacs knows. Setting this variable
1210does not change the speed of actual data transmission, but the value
1211is used for calculations. On text-only terminals, it affects padding,
1212and decisions about whether to scroll part of the screen or redraw it
1213instead. It also affects the behavior of incremental search.
1214
1215 On graphical displays, @code{baud-rate} is only used to determine
1216how frequently to look for pending input during display updating. A
1217higher value of @code{baud-rate} means that check for pending input
1218will be done less frequently.
1219
1220@cindex hourglass pointer display
1221@vindex hourglass-delay
1222 On graphical display, Emacs can optionally display the mouse pointer
1223in a special shape to say that Emacs is busy. To turn this feature on
1224or off, customize the group @code{cursor}. You can also control the
1225amount of time Emacs must remain busy before the busy indicator is
1226displayed, by setting the variable @code{hourglass-delay}.
1227
1228@vindex overline-margin
1229 On graphical display, this variables specifies the vertical position
1230of an overline above the text, including the height of the overline
1231itself (1 pixel). The default value is 2 pixels.
1232
1233@vindex x-underline-at-descent-line
1234 On graphical display, Emacs normally draws an underline at the
1235baseline level of the font. If @code{x-underline-at-descent-line} is
1236non-@code{nil}, Emacs draws the underline at the same height as the
1237font's descent line.
1238
1239@findex tty-suppress-bold-inverse-default-colors
1240 On some text-only terminals, bold face and inverse video together
1241result in text that is hard to read. Call the function
1242@code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil}
1243argument to suppress the effect of bold-face in this case.
1244
1245@vindex no-redraw-on-reenter
1246 On a text-only terminal, when you reenter Emacs after suspending, Emacs
1247normally clears the screen and redraws the entire display. On some
1248terminals with more than one page of memory, it is possible to arrange
1249the termcap entry so that the @samp{ti} and @samp{te} strings (output
1250to the terminal when Emacs is entered and exited, respectively) switch
1251between pages of memory so as to use one page for Emacs and another
1252page for other output. On such terminals, you might want to set the variable
1253@code{no-redraw-on-reenter} non-@code{nil}; this tells Emacs to
1254assume, when resumed, that the screen page it is using still contains
1255what Emacs last wrote there.
1256
1257@ignore
1258 arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4
1259@end ignore
diff --git a/doc/emacs/doclicense.texi b/doc/emacs/doclicense.texi
new file mode 100644
index 00000000000..83e9d6b5579
--- /dev/null
+++ b/doc/emacs/doclicense.texi
@@ -0,0 +1,416 @@
1@c -*-texinfo-*-
2@center Version 1.2, November 2002
3
4@display
5Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
651 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7
8Everyone is permitted to copy and distribute verbatim copies
9of this license document, but changing it is not allowed.
10@end display
11@sp 1
12@enumerate 0
13@item
14PREAMBLE
15
16The purpose of this License is to make a manual, textbook, or other
17functional and useful document ``free'' in the sense of freedom: to
18assure everyone the effective freedom to copy and redistribute it,
19with or without modifying it, either commercially or noncommercially.
20Secondarily, this License preserves for the author and publisher a way
21to get credit for their work, while not being considered responsible
22for modifications made by others.
23
24This License is a kind of ``copyleft,'' which means that derivative
25works of the document must themselves be free in the same sense. It
26complements the GNU General Public License, which is a copyleft
27license designed for free software.
28
29We have designed this License in order to use it for manuals for free
30software, because free software needs free documentation: a free
31program should come with manuals providing the same freedoms that the
32software does. But this License is not limited to software manuals;
33it can be used for any textual work, regardless of subject matter or
34whether it is published as a printed book. We recommend this License
35principally for works whose purpose is instruction or reference.
36
37@sp 1
38@item
39APPLICABILITY AND DEFINITIONS
40
41This License applies to any manual or other work, in any medium, that
42contains a notice placed by the copyright holder saying it can be
43distributed under the terms of this License. Such a notice grants a
44world-wide, royalty-free license, unlimited in duration, to use that
45work under the conditions stated herein. The ``Document,'' below,
46refers to any such manual or work. Any member of the public is a
47licensee, and is addressed as ``you.'' You accept the license if you
48copy, modify or distribute the work in a way requiring permission
49under copyright law.
50
51A ``Modified Version'' of the Document means any work containing the
52Document or a portion of it, either copied verbatim, or with
53modifications and/or translated into another language.
54
55A ``Secondary Section'' is a named appendix or a front-matter section of
56the Document that deals exclusively with the relationship of the
57publishers or authors of the Document to the Document's overall subject
58(or to related matters) and contains nothing that could fall directly
59within that overall subject. (Thus, if the Document is in part a
60textbook of mathematics, a Secondary Section may not explain any
61mathematics.) The relationship could be a matter of historical
62connection with the subject or with related matters, or of legal,
63commercial, philosophical, ethical or political position regarding
64them.
65
66The ``Invariant Sections'' are certain Secondary Sections whose titles
67are designated, as being those of Invariant Sections, in the notice
68that says that the Document is released under this License. If a
69section does not fit the above definition of Secondary then it is not
70allowed to be designated as Invariant. The Document may contain zero
71Invariant Sections. If the Document does not identify any Invariant
72Sections then there are none.
73
74The ``Cover Texts'' are certain short passages of text that are listed,
75as Front-Cover Texts or Back-Cover Texts, in the notice that says that
76the Document is released under this License. A Front-Cover Text may
77be at most 5 words, and a Back-Cover Text may be at most 25 words.
78
79A ``Transparent'' copy of the Document means a machine-readable copy,
80represented in a format whose specification is available to the
81general public, that is suitable for revising the document
82straightforwardly with generic text editors or (for images composed of
83pixels) generic paint programs or (for drawings) some widely available
84drawing editor, and that is suitable for input to text formatters or
85for automatic translation to a variety of formats suitable for input
86to text formatters. A copy made in an otherwise Transparent file
87format whose markup, or absence of markup, has been arranged to thwart
88or discourage subsequent modification by readers is not Transparent.
89An image format is not Transparent if used for any substantial amount
90of text. A copy that is not ``Transparent'' is called ``Opaque.''
91
92
93Examples of suitable formats for Transparent copies include plain
94ASCII without markup, Texinfo input format, LaTeX input format, SGML
95or XML using a publicly available DTD, and standard-conforming simple
96HTML, PostScript or PDF designed for human modification. Examples of
97transparent image formats include PNG, XCF and JPG. Opaque formats
98include proprietary formats that can be read and edited only by
99proprietary word processors, SGML or XML for which the DTD and/or
100processing tools are not generally available, and the
101machine-generated HTML, PostScript or PDF produced by some word
102processors for output purposes only.
103
104The ``Title Page'' means, for a printed book, the title page itself,
105plus such following pages as are needed to hold, legibly, the material
106this License requires to appear in the title page. For works in
107formats which do not have any title page as such, ``Title Page'' means
108the text near the most prominent appearance of the work's title,
109preceding the beginning of the body of the text.
110
111A section ``Entitled XYZ'' means a named subunit of the Document whose
112title either is precisely XYZ or contains XYZ in parentheses following
113text that translates XYZ in another language. (Here XYZ stands for a
114specific section name mentioned below, such as ``Acknowledgements,''
115``Dedications,'' ``Endorsements,'' or ``History.'') To ``Preserve the Title''
116of such a section when you modify the Document means that it remains a
117section ``Entitled XYZ'' according to this definition.
118
119The Document may include Warranty Disclaimers next to the notice which
120states that this License applies to the Document. These Warranty
121Disclaimers are considered to be included by reference in this
122License, but only as regards disclaiming warranties: any other
123implication that these Warranty Disclaimers may have is void and has
124no effect on the meaning of this License.
125@sp 1
126@item
127VERBATIM COPYING
128
129You may copy and distribute the Document in any medium, either
130commercially or noncommercially, provided that this License, the
131copyright notices, and the license notice saying this License applies
132to the Document are reproduced in all copies, and that you add no other
133conditions whatsoever to those of this License. You may not use
134technical measures to obstruct or control the reading or further
135copying of the copies you make or distribute. However, you may accept
136compensation in exchange for copies. If you distribute a large enough
137number of copies you must also follow the conditions in section 3.
138
139You may also lend copies, under the same conditions stated above, and
140you may publicly display copies.
141@sp 1
142@item
143COPYING IN QUANTITY
144
145If you publish printed copies (or copies in media that commonly have
146printed covers) of the Document, numbering more than 100, and the
147Document's license notice requires Cover Texts, you must enclose the
148copies in covers that carry, clearly and legibly, all these Cover
149Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
150the back cover. Both covers must also clearly and legibly identify
151you as the publisher of these copies. The front cover must present
152the full title with all words of the title equally prominent and
153visible. You may add other material on the covers in addition.
154Copying with changes limited to the covers, as long as they preserve
155the title of the Document and satisfy these conditions, can be treated
156as verbatim copying in other respects.
157
158If the required texts for either cover are too voluminous to fit
159legibly, you should put the first ones listed (as many as fit
160reasonably) on the actual cover, and continue the rest onto adjacent
161pages.
162
163If you publish or distribute Opaque copies of the Document numbering
164more than 100, you must either include a machine-readable Transparent
165copy along with each Opaque copy, or state in or with each Opaque copy
166a computer-network location from which the general network-using
167public has access to download using public-standard network protocols
168a complete Transparent copy of the Document, free of added material.
169If you use the latter option, you must take reasonably prudent steps,
170when you begin distribution of Opaque copies in quantity, to ensure
171that this Transparent copy will remain thus accessible at the stated
172location until at least one year after the last time you distribute an
173Opaque copy (directly or through your agents or retailers) of that
174edition to the public.
175
176It is requested, but not required, that you contact the authors of the
177Document well before redistributing any large number of copies, to give
178them a chance to provide you with an updated version of the Document.
179@sp 1
180@item
181MODIFICATIONS
182
183You may copy and distribute a Modified Version of the Document under
184the conditions of sections 2 and 3 above, provided that you release
185the Modified Version under precisely this License, with the Modified
186Version filling the role of the Document, thus licensing distribution
187and modification of the Modified Version to whoever possesses a copy
188of it. In addition, you must do these things in the Modified Version:
189
190A. Use in the Title Page (and on the covers, if any) a title distinct
191 from that of the Document, and from those of previous versions
192 (which should, if there were any, be listed in the History section
193 of the Document). You may use the same title as a previous version
194 if the original publisher of that version gives permission.@*
195B. List on the Title Page, as authors, one or more persons or entities
196 responsible for authorship of the modifications in the Modified
197 Version, together with at least five of the principal authors of the
198 Document (all of its principal authors, if it has fewer than five),
199 unless they release you from this requirement.@*
200C. State on the Title page the name of the publisher of the
201 Modified Version, as the publisher.@*
202D. Preserve all the copyright notices of the Document.@*
203E. Add an appropriate copyright notice for your modifications
204 adjacent to the other copyright notices.@*
205F. Include, immediately after the copyright notices, a license notice
206 giving the public permission to use the Modified Version under the
207 terms of this License, in the form shown in the Addendum below.@*
208G. Preserve in that license notice the full lists of Invariant Sections
209 and required Cover Texts given in the Document's license notice.@*
210H. Include an unaltered copy of this License.@*
211I. Preserve the section Entitled ``History,'' Preserve its Title, and add
212 to it an item stating at least the title, year, new authors, and
213 publisher of the Modified Version as given on the Title Page. If
214 there is no section Entitled ``History'' in the Document, create one
215 stating the title, year, authors, and publisher of the Document as
216 given on its Title Page, then add an item describing the Modified
217 Version as stated in the previous sentence.@*
218J. Preserve the network location, if any, given in the Document for
219 public access to a Transparent copy of the Document, and likewise
220 the network locations given in the Document for previous versions
221 it was based on. These may be placed in the ``History'' section.
222 You may omit a network location for a work that was published at
223 least four years before the Document itself, or if the original
224 publisher of the version it refers to gives permission.@*
225K. For any section Entitled ``Acknowledgements'' or ``Dedications,''
226 Preserve the Title of the section, and preserve in the section all
227 the substance and tone of each of the contributor acknowledgements
228 and/or dedications given therein.@*
229L. Preserve all the Invariant Sections of the Document,
230 unaltered in their text and in their titles. Section numbers
231 or the equivalent are not considered part of the section titles.@*
232M. Delete any section Entitled ``Endorsements.'' Such a section
233 may not be included in the Modified Version.@*
234N. Do not retitle any existing section to be Entitled ``Endorsements''
235 or to conflict in title with any Invariant Section.@*
236O. Preserve any Warranty Disclaimers.@*
237@sp 1
238If the Modified Version includes new front-matter sections or
239appendices that qualify as Secondary Sections and contain no material
240copied from the Document, you may at your option designate some or all
241of these sections as invariant. To do this, add their titles to the
242list of Invariant Sections in the Modified Version's license notice.
243These titles must be distinct from any other section titles.
244
245You may add a section Entitled ``Endorsements,'' provided it contains
246nothing but endorsements of your Modified Version by various
247parties--for example, statements of peer review or that the text has
248been approved by an organization as the authoritative definition of a
249standard.
250
251You may add a passage of up to five words as a Front-Cover Text, and a
252passage of up to 25 words as a Back-Cover Text, to the end of the list
253of Cover Texts in the Modified Version. Only one passage of
254Front-Cover Text and one of Back-Cover Text may be added by (or
255through arrangements made by) any one entity. If the Document already
256includes a cover text for the same cover, previously added by you or
257by arrangement made by the same entity you are acting on behalf of,
258you may not add another; but you may replace the old one, on explicit
259permission from the previous publisher that added the old one.
260
261The author(s) and publisher(s) of the Document do not by this License
262give permission to use their names for publicity for or to assert or
263imply endorsement of any Modified Version.
264@sp 1
265@item
266COMBINING DOCUMENTS
267
268You may combine the Document with other documents released under this
269License, under the terms defined in section 4 above for modified
270versions, provided that you include in the combination all of the
271Invariant Sections of all of the original documents, unmodified, and
272list them all as Invariant Sections of your combined work in its
273license notice, and that you preserve all their Warranty Disclaimers.
274
275The combined work need only contain one copy of this License, and
276multiple identical Invariant Sections may be replaced with a single
277copy. If there are multiple Invariant Sections with the same name but
278different contents, make the title of each such section unique by
279adding at the end of it, in parentheses, the name of the original
280author or publisher of that section if known, or else a unique number.
281Make the same adjustment to the section titles in the list of
282Invariant Sections in the license notice of the combined work.
283
284In the combination, you must combine any sections Entitled ``History''
285in the various original documents, forming one section Entitled
286``History''; likewise combine any sections Entitled ``Acknowledgements,''
287and any sections Entitled ``Dedications.'' You must delete all sections
288Entitled ``Endorsements.''
289@sp 1
290@item
291COLLECTIONS OF DOCUMENTS
292
293You may make a collection consisting of the Document and other documents
294released under this License, and replace the individual copies of this
295License in the various documents with a single copy that is included in
296the collection, provided that you follow the rules of this License for
297verbatim copying of each of the documents in all other respects.
298
299You may extract a single document from such a collection, and distribute
300it individually under this License, provided you insert a copy of this
301License into the extracted document, and follow this License in all
302other respects regarding verbatim copying of that document.
303@sp 1
304@item
305AGGREGATION WITH INDEPENDENT WORKS
306
307A compilation of the Document or its derivatives with other separate
308and independent documents or works, in or on a volume of a storage or
309distribution medium, is called an ``aggregate'' if the copyright
310resulting from the compilation is not used to limit the legal rights
311of the compilation's users beyond what the individual works permit.
312When the Document is included in an aggregate, this License does not
313apply to the other works in the aggregate which are not themselves
314derivative works of the Document.
315
316If the Cover Text requirement of section 3 is applicable to these
317copies of the Document, then if the Document is less than one half of
318the entire aggregate, the Document's Cover Texts may be placed on
319covers that bracket the Document within the aggregate, or the
320electronic equivalent of covers if the Document is in electronic form.
321Otherwise they must appear on printed covers that bracket the whole
322aggregate.
323@sp 1
324@item
325TRANSLATION
326
327Translation is considered a kind of modification, so you may
328distribute translations of the Document under the terms of section 4.
329Replacing Invariant Sections with translations requires special
330permission from their copyright holders, but you may include
331translations of some or all Invariant Sections in addition to the
332original versions of these Invariant Sections. You may include a
333translation of this License, and all the license notices in the
334Document, and any Warranty Disclaimers, provided that you also include
335the original English version of this License and the original versions
336of those notices and disclaimers. In case of a disagreement between
337the translation and the original version of this License or a notice
338or disclaimer, the original version will prevail.
339
340If a section in the Document is Entitled ``Acknowledgements,''
341``Dedications,'' or ``History,'' the requirement (section 4) to Preserve
342its Title (section 1) will typically require changing the actual
343title.
344@sp 1
345@item
346TERMINATION
347
348You may not copy, modify, sublicense, or distribute the Document except
349as expressly provided for under this License. Any other attempt to
350copy, modify, sublicense or distribute the Document is void, and will
351automatically terminate your rights under this License. However,
352parties who have received copies, or rights, from you under this
353License will not have their licenses terminated so long as such
354parties remain in full compliance.
355@sp 1
356@item
357FUTURE REVISIONS OF THIS LICENSE
358
359The Free Software Foundation may publish new, revised versions
360of the GNU Free Documentation License from time to time. Such new
361versions will be similar in spirit to the present version, but may
362differ in detail to address new problems or concerns. See
363http://www.gnu.org/copyleft/.
364
365Each version of the License is given a distinguishing version number.
366If the Document specifies that a particular numbered version of this
367License ``or any later version'' applies to it, you have the option of
368following the terms and conditions either of that specified version or
369of any later version that has been published (not as a draft) by the
370Free Software Foundation. If the Document does not specify a version
371number of this License, you may choose any version ever published (not
372as a draft) by the Free Software Foundation.
373
374@end enumerate
375
376@unnumberedsec ADDENDUM: How to use this License for your documents
377
378To use this License in a document you have written, include a copy of
379the License in the document and put the following copyright and
380license notices just after the title page:
381
382@smallexample
383@group
384Copyright (C) @var{year} @var{your name}.
385Permission is granted to copy, distribute and/or modify this document
386under the terms of the GNU Free Documentation License, Version 1.2
387or any later version published by the Free Software Foundation;
388with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
389A copy of the license is included in the section entitled ``GNU
390Free Documentation License.''
391@end group
392@end smallexample
393
394If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
395replace the ``with...Texts.'' line with this:
396
397@smallexample
398@group
399with the Invariant Sections being @var{list their titles}, with the
400Front-Cover Texts being @var{list}, and with the Back-Cover Texts being
401@var{list}.
402@end group
403@end smallexample
404
405If you have Invariant Sections without Cover Texts, or some other
406combination of the three, merge those two alternatives to suit the
407situation.
408
409If your document contains nontrivial examples of program code, we
410recommend releasing these examples in parallel under your choice of
411free software license, such as the GNU General Public License,
412to permit their use in free software.
413
414@ignore
415 arch-tag: c1679162-1d8a-4f02-bc52-2e71765f0165
416@end ignore
diff --git a/doc/emacs/emacs-xtra.texi b/doc/emacs/emacs-xtra.texi
new file mode 100644
index 00000000000..841c62a527f
--- /dev/null
+++ b/doc/emacs/emacs-xtra.texi
@@ -0,0 +1,126 @@
1\input texinfo @c -*-texinfo-*-
2@comment %**start of header
3@setfilename ../info/emacs-xtra
4@settitle Specialized Emacs Features
5@syncodeindex fn cp
6@syncodeindex vr cp
7@syncodeindex ky cp
8@comment %**end of header
9
10@copying
11This manual describes specialized features of Emacs.
12
13Copyright @copyright{} 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
14
15@quotation
16Permission is granted to copy, distribute and/or modify this document
17under the terms of the GNU Free Documentation License, Version 1.2 or
18any later version published by the Free Software Foundation; with no
19Invariant Sections, with the Front-Cover texts being ``A GNU
20Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the
21license is included in the section entitled ``GNU Free Documentation
22License'' in the Emacs manual.
23
24(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
25this GNU Manual, like GNU software. Copies published by the Free
26Software Foundation raise funds for GNU development.''
27
28This document is part of a collection distributed under the GNU Free
29Documentation License. If you want to distribute this document
30separately from the collection, you can do so by adding a copy of the
31license to the document, as described in section 6 of the license.
32@end quotation
33@end copying
34
35@dircategory Emacs
36@direntry
37* Emacs-Xtra: (emacs-xtra). Specialized Emacs features.
38@end direntry
39
40@titlepage
41@title Specialized Emacs Features
42@page
43@vskip 0pt plus 1filll
44@insertcopying
45@end titlepage
46
47@contents
48
49@ifnottex
50@node Top
51@top Specialized Emacs Features
52
53@insertcopying
54
55@end ifnottex
56
57@menu
58* Introduction:: What documentation belongs here?
59@iftex
60* Picture Mode:: Editing pictures made up of characters using
61 the quarter-plane screen model.
62
63* Autorevert:: Auto Reverting non-file buffers.
64* Subdir Switches:: Subdirectory switches in Dired.
65* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
66* Emerge:: A convenient way of merging two versions of a program.
67* Advanced VC Usage:: Advanced VC (version control) features.
68* Fortran:: Fortran mode and its special features.
69* MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}).
70@end iftex
71* Index::
72@end menu
73
74@node Introduction
75@unnumbered Introduction
76
77This manual contains detailed information about various features that
78are too specialized to be included in the printed Emacs manual. It is
79intended to be readable by anyone having a basic knowledge of Emacs.
80However, certain sections may be intended for a more specialized
81audience, such as Elisp authors. This should be clearly pointed out
82at the beginning of these sections.
83
84Certain packages, or collections of related features, have their own
85manuals, separate from the main Emacs User's manual. This manual is
86intended as a complement, rather than an alternative, to reading those
87additional manuals; in a nutshell, it is a collection of smaller
88specialized features, too small or too obscure to justify their own
89manual.
90
91Sections intended specifically for Elisp programmers can follow the
92style of the Elisp manual. Other sections should follow the style of
93the Emacs manual.
94
95@iftex
96@c ``Picture Mode'' is a chapter, not a section, so it's outside @raisesections.
97@include picture-xtra.texi
98
99@raisesections
100@include arevert-xtra.texi
101
102@include dired-xtra.texi
103
104@include cal-xtra.texi
105
106@include emerge-xtra.texi
107
108@include vc-xtra.texi
109
110@include fortran-xtra.texi
111
112@include msdog-xtra.texi
113
114@lowersections
115@end iftex
116
117@node Index
118@unnumbered Index
119
120@printindex cp
121
122@bye
123
124@ignore
125 arch-tag: 75c33f13-32c6-41b6-9537-847a312e2e49
126@end ignore
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
new file mode 100644
index 00000000000..1e6fd8461c3
--- /dev/null
+++ b/doc/emacs/emacs.texi
@@ -0,0 +1,1365 @@
1\input texinfo
2
3@setfilename ../info/emacs
4@settitle GNU Emacs Manual
5
6@c The edition number appears in several places in this file
7@set EDITION Sixteenth
8@set EMACSVER 23.0.50
9
10@copying
11This is the @value{EDITION} edition of the @cite{GNU Emacs Manual},@*
12updated for Emacs version @value{EMACSVER}.
13
14Copyright @copyright{} 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997,
151998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
16Foundation, Inc.
17
18@quotation
19Permission is granted to copy, distribute and/or modify this document
20under the terms of the GNU Free Documentation License, Version 1.2 or
21any later version published by the Free Software Foundation; with the
22Invariant Sections being ``The GNU Manifesto,'' ``Distribution'' and
23``GNU GENERAL PUBLIC LICENSE,'' with the Front-Cover texts being ``A GNU
24Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the
25license is included in the section entitled ``GNU Free Documentation
26License.''
27
28(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
29this GNU Manual. Buying copies from GNU Press supports the FSF in
30developing GNU and promoting software freedom.''
31@end quotation
32@end copying
33
34@dircategory Emacs
35@direntry
36* Emacs: (emacs). The extensible self-documenting text editor.
37@end direntry
38
39@c in general, keep the following line commented out, unless doing a
40@c copy of this manual that will be published. The manual should go
41@c onto the distribution in the full, 8.5 x 11" size.
42@c set smallbook
43
44@ifset smallbook
45@smallbook
46@end ifset
47
48@c per rms and peterb, use 10pt fonts for the main text, mostly to
49@c save on paper cost.
50@c Do this inside @tex for now, so current makeinfo does not complain.
51@tex
52@ifset smallbook
53@fonttextsize 10
54@set EMACSVER 22
55\global\let\urlcolor=\Black % don't print links in grayscale
56\global\let\linkcolor=\Black
57@end ifset
58\global\hbadness=6666 % don't worry about not-too-underfull boxes
59@end tex
60
61@defcodeindex op
62@synindex pg cp
63
64@iftex
65@kbdinputstyle code
66
67@shorttitlepage GNU Emacs Manual
68@end iftex
69
70@titlepage
71@sp 6
72@center @titlefont{GNU Emacs Manual}
73@sp 4
74@center @value{EDITION} Edition, Updated for Emacs Version @value{EMACSVER}.
75@sp 5
76@center Richard Stallman
77@page
78@vskip 0pt plus 1filll
79@insertcopying
80
81@sp 2
82Published by the Free Software Foundation @*
8351 Franklin Street, Fifth Floor @*
84Boston, MA 02110-1301 USA @*
85ISBN 1-882114-86-8
86
87@sp 2
88Cover art by Etienne Suvasa.
89
90@end titlepage
91
92
93@summarycontents
94@contents
95
96
97@ifnottex
98@node Top, Distrib, (dir), (dir)
99@top The Emacs Editor
100
101Emacs is the extensible, customizable, self-documenting real-time
102display editor. This Info file describes how to edit with Emacs and
103some of how to customize it; it corresponds to GNU Emacs version
104@value{EMACSVER}.
105
106@ifinfo
107To learn more about the Info documentation system, type @kbd{h}, and
108Emacs will take you to a programmed instruction sequence for the Info
109commands.
110@end ifinfo
111
112For information on extending Emacs, see @ref{Top, Emacs Lisp,, elisp, The
113Emacs Lisp Reference Manual}.
114@end ifnottex
115
116@ignore
117These subcategories have been deleted for simplicity
118and to avoid conflicts.
119Completion
120Backup Files
121Auto-Saving: Protection Against Disasters
122Snapshots
123Text Mode
124Outline Mode
125@TeX{} Mode
126Formatted Text
127Shell Command History
128
129The ones for Dired and Rmail have had the items turned into :: items
130to avoid conflicts.
131Also Running Shell Commands from Emacs
132and Sending Mail and Registers and Minibuffer.
133@end ignore
134
135@menu
136* Distrib:: How to get the latest Emacs distribution.
137* Copying:: The GNU General Public License gives you permission
138 to redistribute GNU Emacs on certain terms;
139 it also explains that there is no warranty.
140* GNU Free Documentation License:: The license for this documentation.
141* Intro:: An introduction to Emacs concepts.
142* Glossary:: The glossary.
143* Antinews:: Information about Emacs version 21.
144* Mac OS:: Using Emacs in the Mac.
145* Microsoft Windows:: Using Emacs on Microsoft Windows and MS-DOS.
146* Manifesto:: What's GNU? Gnu's Not Unix!
147* Acknowledgments:: Major contributors to GNU Emacs.
148
149Indexes (each index contains a large menu)
150* Key Index:: An item for each standard Emacs key sequence.
151* Option Index:: An item for every command-line option.
152* Command Index:: An item for each command name.
153* Variable Index:: An item for each documented variable.
154* Concept Index:: An item for each concept.
155
156Important General Concepts
157* Screen:: How to interpret what you see on the screen.
158* User Input:: Kinds of input events (characters, buttons,
159 function keys).
160* Keys:: Key sequences: what you type to request one
161 editing action.
162* Commands:: Named functions run by key sequences to do editing.
163* Text Characters:: Character set for text (the contents of buffers
164 and strings).
165* Entering Emacs:: Starting Emacs from the shell.
166* Exiting:: Stopping or killing Emacs.
167* Emacs Invocation:: Hairy startup options.
168
169Fundamental Editing Commands
170* Basic:: The most basic editing commands.
171* Minibuffer:: Entering arguments that are prompted for.
172* M-x:: Invoking commands by their names.
173* Help:: Commands for asking Emacs about its commands.
174
175Important Text-Changing Commands
176* Mark:: The mark: how to delimit a ``region'' of text.
177* Killing:: Killing (cutting) text.
178* Yanking:: Recovering killed text. Moving text. (Pasting.)
179* Accumulating Text:: Other ways of copying text.
180* Rectangles:: Operating on the text inside a rectangle on the screen.
181* Registers:: Saving a text string or a location in the buffer.
182* Display:: Controlling what text is displayed.
183* Search:: Finding or replacing occurrences of a string.
184* Fixit:: Commands especially useful for fixing typos.
185* Keyboard Macros:: A keyboard macro records a sequence of
186 keystrokes to be replayed with a single command.
187
188Major Structures of Emacs
189* Files:: All about handling files.
190* Buffers:: Multiple buffers; editing several files at once.
191* Windows:: Viewing two pieces of text at once.
192* Frames:: Running the same Emacs session in multiple X windows.
193* International:: Using non-@acronym{ASCII} character sets (the MULE features).
194
195Advanced Features
196* Major Modes:: Text mode vs. Lisp mode vs. C mode ...
197* Indentation:: Editing the white space at the beginnings of lines.
198* Text:: Commands and modes for editing English.
199* Programs:: Commands and modes for editing programs.
200* Building:: Compiling, running and debugging programs.
201* Maintaining:: Features for maintaining large programs.
202* Abbrevs:: How to define text abbreviations to reduce
203 the number of characters you must type.
204@ifnottex
205* Picture Mode:: Editing pictures made up of characters using
206 the quarter-plane screen model.
207@end ifnottex
208* Sending Mail:: Sending mail in Emacs.
209* Rmail:: Reading mail in Emacs.
210* Dired:: You can ``edit'' a directory to manage files in it.
211* Calendar/Diary:: The calendar and diary facilities.
212* Gnus:: How to read netnews with Emacs.
213* Shell:: Executing shell commands from Emacs.
214* Emacs Server:: Using Emacs as an editing server for @code{mail}, etc.
215* Printing:: Printing hardcopies of buffers or regions.
216* Sorting:: Sorting lines, paragraphs or pages within Emacs.
217* Narrowing:: Restricting display and editing to a portion
218 of the buffer.
219* Two-Column:: Splitting apart columns to edit them
220 in side-by-side windows.
221* Editing Binary Files::Using Hexl mode to edit binary files.
222* Saving Emacs Sessions:: Saving Emacs state from one session to the next.
223* Recursive Edit:: A command can allow you to do editing
224 "within the command". This is called a
225 "recursive editing level".
226* Emulation:: Emulating some other editors with Emacs.
227* Hyperlinking:: Following links in buffers.
228* Dissociated Press:: Dissociating text for fun.
229* Amusements:: Various games and hacks.
230* Customization:: Modifying the behavior of Emacs.
231* X Resources:: X resources for customizing Emacs.
232
233Recovery from Problems
234* Quitting:: Quitting and aborting.
235* Lossage:: What to do if Emacs is hung or malfunctioning.
236* Bugs:: How and when to report a bug.
237* Contributing:: How to contribute improvements to Emacs.
238* Service:: How to get help for your own Emacs needs.
239
240@c Do NOT modify the following 3 lines! They must have this form to
241@c be correctly identified by `texinfo-multiple-files-update'. In
242@c particular, the detailed menu header line MUST be identical to the
243@c value of `texinfo-master-menu-header'. See texnfo-upd.el.
244
245@detailmenu
246 --- The Detailed Node Listing ---
247 ---------------------------------
248
249Here are some other nodes which are really inferiors of the ones
250already listed, mentioned here so you can get to them in one step:
251
252The Organization of the Screen
253
254* Point:: The place in the text where editing commands operate.
255* Echo Area:: Short messages appear at the bottom of the screen.
256* Mode Line:: Interpreting the mode line.
257* Menu Bar:: How to use the menu bar.
258
259Basic Editing Commands
260
261* Inserting Text:: Inserting text by simply typing it.
262* Moving Point:: How to move the cursor to the place where you want to
263 change something.
264* Erasing:: Deleting and killing text.
265* Basic Undo:: Undoing recent changes in the text.
266* Basic Files:: Visiting, creating, and saving files.
267* Basic Help:: Asking what a character does.
268* Blank Lines:: Commands to make or delete blank lines.
269* Continuation Lines:: Lines too wide for the screen.
270* Position Info:: What page, line, row, or column is point on?
271* Arguments:: Numeric arguments for repeating a command.
272* Repeating:: A short-cut for repeating the previous command.
273
274The Minibuffer
275
276* Minibuffer File:: Entering file names with the minibuffer.
277* Minibuffer Edit:: How to edit in the minibuffer.
278* Completion:: An abbreviation facility for minibuffer input.
279* Minibuffer History:: Reusing recent minibuffer arguments.
280* Repetition:: Re-executing commands that used the minibuffer.
281
282Completion
283
284* Example: Completion Example. Examples of using completion.
285* Commands: Completion Commands. A list of completion commands.
286* Strict Completion:: Different types of completion.
287* Options: Completion Options. Options for completion.
288
289Help
290
291* Help Summary:: Brief list of all Help commands.
292* Key Help:: Asking what a key does in Emacs.
293* Name Help:: Asking about a command, variable or function name.
294* Apropos:: Asking what pertains to a given topic.
295* Help Mode:: Special features of Help mode and Help buffers.
296* Library Keywords:: Finding Lisp libraries by keywords (topics).
297* Language Help:: Help relating to international language support.
298* Misc Help:: Other help commands.
299* Help Files:: Commands to display pre-written help files.
300* Help Echo:: Help on active text and tooltips (`balloon help')
301
302The Mark and the Region
303
304* Setting Mark:: Commands to set the mark.
305* Transient Mark:: How to make Emacs highlight the region--
306 when there is one.
307* Momentary Mark:: Enabling Transient Mark mode momentarily.
308* Using Region:: Summary of ways to operate on contents of the region.
309* Marking Objects:: Commands to put region around textual units.
310* Mark Ring:: Previous mark positions saved so you can go back there.
311* Global Mark Ring:: Previous mark positions in various buffers.
312
313Killing and Moving Text
314
315* Deletion:: Commands for deleting small amounts of text and
316 blank areas.
317* Killing by Lines:: How to kill entire lines of text at one time.
318* Other Kill Commands:: Commands to kill large regions of text and
319 syntactic units such as words and sentences.
320* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy
321 and paste, with enhanced rectangle support.
322
323Yanking
324
325* Kill Ring:: Where killed text is stored. Basic yanking.
326* Appending Kills:: Several kills in a row all yank together.
327* Earlier Kills:: Yanking something killed some time ago.
328
329Registers
330
331* RegPos:: Saving positions in registers.
332* RegText:: Saving text in registers.
333* RegRect:: Saving rectangles in registers.
334* RegConfig:: Saving window configurations in registers.
335* RegNumbers:: Numbers in registers.
336* RegFiles:: File names in registers.
337* Bookmarks:: Bookmarks are like registers, but persistent.
338
339Controlling the Display
340
341* Scrolling:: Moving text up and down in a window.
342* Auto Scrolling:: Redisplay scrolls text automatically when needed.
343* Horizontal Scrolling:: Moving text left and right in a window.
344* Follow Mode:: Follow mode lets two windows scroll as one.
345* Faces:: How to change the display style using faces.
346* Standard Faces:: Emacs' predefined faces.
347* Font Lock:: Minor mode for syntactic highlighting using faces.
348* Highlight Interactively:: Tell Emacs what text to highlight.
349* Fringes:: Enabling or disabling window fringes.
350* Displaying Boundaries:: Displaying top and bottom of the buffer.
351* Useless Whitespace:: Showing possibly-spurious trailing whitespace.
352* Selective Display:: Hiding lines with lots of indentation.
353* Optional Mode Line:: Optional mode line display features.
354* Text Display:: How text characters are normally displayed.
355* Cursor Display:: Features for displaying the cursor.
356* Line Truncation:: Truncating lines to fit the screen width instead
357 of continuing them to multiple screen lines.
358* Display Custom:: Information on variables for customizing display.
359
360Searching and Replacement
361
362* Incremental Search:: Search happens as you type the string.
363* Nonincremental Search:: Specify entire string and then search.
364* Word Search:: Search for sequence of words.
365* Regexp Search:: Search for match for a regexp.
366* Regexps:: Syntax of regular expressions.
367* Regexp Backslash:: Regular expression constructs starting with `\'.
368* Regexp Example:: A complex regular expression explained.
369* Search Case:: To ignore case while searching, or not.
370* Replace:: Search, and replace some or all matches.
371* Other Repeating Search:: Operating on all matches for some regexp.
372
373Incremental Search
374
375* Basic Isearch:: Basic incremental search commands.
376* Repeat Isearch:: Searching for the same string again.
377* Error in Isearch:: When your string is not found.
378* Special Isearch:: Special input in incremental search.
379* Non-ASCII Isearch:: How to search for non-ASCII characters.
380* Isearch Yank:: Commands that grab text into the search string
381 or else edit the search string.
382* Highlight Isearch:: Isearch highlights the other possible matches.
383* Isearch Scroll:: Scrolling during an incremental search.
384* Slow Isearch:: Incremental search features for slow terminals.
385
386Replacement Commands
387
388* Unconditional Replace:: Replacing all matches for a string.
389* Regexp Replace:: Replacing all matches for a regexp.
390* Replacement and Case:: How replacements preserve case of letters.
391* Query Replace:: How to use querying.
392
393Commands for Fixing Typos
394
395* Undo:: Full details of Emacs undo commands.
396* Kill Errors:: Commands to kill a batch of recently entered text.
397* Transpose:: Exchanging two characters, words, lines, lists...
398* Fixing Case:: Correcting case of last word entered.
399* Spelling:: Apply spelling checker to a word or a whole buffer.
400
401Keyboard Macros
402
403* Basic Keyboard Macro:: Defining and running keyboard macros.
404* Keyboard Macro Ring:: Where previous keyboard macros are saved.
405* Keyboard Macro Counter:: Inserting incrementing numbers in macros.
406* Keyboard Macro Query:: Making keyboard macros do different things each time.
407* Save Keyboard Macro:: Giving keyboard macros names; saving them in files.
408* Edit Keyboard Macro:: Editing keyboard macros.
409* Keyboard Macro Step-Edit:: Interactively executing and editing a keyboard
410 macro.
411
412File Handling
413
414* File Names:: How to type and edit file-name arguments.
415* Visiting:: Visiting a file prepares Emacs to edit the file.
416* Saving:: Saving makes your changes permanent.
417* Reverting:: Reverting cancels all the changes not saved.
418* Autorevert:: Auto Reverting non-file buffers.
419* Auto Save:: Auto Save periodically protects against loss of data.
420* File Aliases:: Handling multiple names for one file.
421* Version Control:: Version control systems (RCS, CVS and SCCS).
422* Directories:: Creating, deleting, and listing file directories.
423* Comparing Files:: Finding where two files differ.
424* Diff Mode:: Editing diff output.
425* Misc File Ops:: Other things you can do on files.
426* Compressed Files:: Accessing compressed files.
427* File Archives:: Operating on tar, zip, jar etc. archive files.
428* Remote Files:: Accessing files on other sites.
429* Quoted File Names:: Quoting special characters in file names.
430* File Name Cache:: Completion against a list of files you often use.
431* File Conveniences:: Convenience Features for Finding Files.
432* Filesets:: Handling sets of files.
433
434Saving Files
435
436* Save Commands:: Commands for saving files.
437* Backup:: How Emacs saves the old version of your file.
438* Customize Save:: Customizing the saving of files.
439* Interlocking:: How Emacs protects against simultaneous editing
440 of one file by two users.
441* File Shadowing:: Copying files to "shadows" automatically.
442* Time Stamps:: Emacs can update time stamps on saved files.
443
444Backup Files
445
446* One or Many: Numbered Backups. Whether to make one backup file or many.
447* Names: Backup Names. How backup files are named.
448* Deletion: Backup Deletion. Emacs deletes excess numbered backups.
449* Copying: Backup Copying. Backups can be made by copying or renaming.
450
451Auto-Saving: Protection Against Disasters
452
453* Files: Auto Save Files. The file where auto-saved changes are
454 actually made until you save the file.
455* Control: Auto Save Control. Controlling when and how often to auto-save.
456* Recover:: Recovering text from auto-save files.
457
458Version Control
459
460* Introduction to VC:: How version control works in general.
461* VC Mode Line:: How the mode line shows version control status.
462* Basic VC Editing:: How to edit a file under version control.
463* Old Versions:: Examining and comparing old versions.
464* Secondary VC Commands:: The commands used a little less frequently.
465* Branches:: Multiple lines of development.
466* Remote Repositories:: Efficient access to remote CVS servers.
467* Snapshots:: Sets of file versions treated as a unit.
468* Miscellaneous VC:: Various other commands and features of VC.
469* Customizing VC:: Variables that change VC's behavior.
470
471Using Multiple Buffers
472
473* Select Buffer:: Creating a new buffer or reselecting an old one.
474* List Buffers:: Getting a list of buffers that exist.
475* Misc Buffer:: Renaming; changing read-onliness; copying text.
476* Kill Buffer:: Killing buffers you no longer need.
477* Several Buffers:: How to go through the list of all buffers
478 and operate variously on several of them.
479* Indirect Buffers:: An indirect buffer shares the text of another buffer.
480* Buffer Convenience:: Convenience and customization features for
481 buffer handling.
482
483Multiple Windows
484
485* Basic Window:: Introduction to Emacs windows.
486* Split Window:: New windows are made by splitting existing windows.
487* Other Window:: Moving to another window or doing something to it.
488* Pop Up Window:: Finding a file or buffer in another window.
489* Force Same Window:: Forcing certain buffers to appear in the selected
490 window rather than in another window.
491* Change Window:: Deleting windows and changing their sizes.
492* Window Convenience:: Convenience functions for window handling.
493
494Frames and Graphical Displays
495
496* Cut and Paste:: Mouse commands for cut and paste.
497* Mouse References:: Using the mouse to select an item from a list.
498* Menu Mouse Clicks:: Mouse clicks that bring up menus.
499* Mode Line Mouse:: Mouse clicks on the mode line.
500* Creating Frames:: Creating additional Emacs frames with various contents.
501* Frame Commands:: Iconifying, deleting, and switching frames.
502* Speedbar:: How to make and use a speedbar frame.
503* Multiple Displays:: How one Emacs job can talk to several displays.
504* Special Buffer Frames:: You can make certain buffers have their own frames.
505* Frame Parameters:: Changing the colors and other modes of frames.
506* Scroll Bars:: How to enable and disable scroll bars; how to use them.
507* Wheeled Mice:: Using mouse wheels for scrolling.
508* Drag and Drop:: Using drag and drop to open files and insert text.
509* Menu Bars:: Enabling and disabling the menu bar.
510* Tool Bars:: Enabling and disabling the tool bar.
511* Dialog Boxes:: Controlling use of dialog boxes.
512* Tooltips:: Showing "tooltips", AKA "balloon help" for active text.
513* Mouse Avoidance:: Moving the mouse pointer out of the way.
514* Non-Window Terminals:: Multiple frames on terminals that show only one.
515* Text-Only Mouse:: Using the mouse in text-only terminals.
516
517International Character Set Support
518
519* International Chars:: Basic concepts of multibyte characters.
520* Enabling Multibyte:: Controlling whether to use multibyte characters.
521* Language Environments:: Setting things up for the language you use.
522* Input Methods:: Entering text characters not on your keyboard.
523* Select Input Method:: Specifying your choice of input methods.
524* Multibyte Conversion:: How single-byte characters convert to multibyte.
525* Coding Systems:: Character set conversion when you read and
526 write files, and so on.
527* Recognize Coding:: How Emacs figures out which conversion to use.
528* Specify Coding:: Specifying a file's coding system explicitly.
529* Output Coding:: Choosing coding systems for output.
530* Text Coding:: Choosing conversion to use for file text.
531* Communication Coding:: Coding systems for interprocess communication.
532* File Name Coding:: Coding systems for file @emph{names}.
533* Terminal Coding:: Specifying coding systems for converting
534 terminal input and output.
535* Fontsets:: Fontsets are collections of fonts
536 that cover the whole spectrum of characters.
537* Defining Fontsets:: Defining a new fontset.
538* Undisplayable Characters::When characters don't display.
539* Unibyte Mode:: You can pick one European character set
540 to use without multibyte characters.
541* Charsets:: How Emacs groups its internal character codes.
542
543Major Modes
544
545* Choosing Modes:: How major modes are specified or chosen.
546
547Indentation
548
549* Indentation Commands:: Various commands and techniques for indentation.
550* Tab Stops:: You can set arbitrary "tab stops" and then
551 indent to the next tab stop when you want to.
552* Just Spaces:: You can request indentation using just spaces.
553
554Commands for Human Languages
555
556* Words:: Moving over and killing words.
557* Sentences:: Moving over and killing sentences.
558* Paragraphs:: Moving over paragraphs.
559* Pages:: Moving over pages.
560* Filling:: Filling or justifying text.
561* Case:: Changing the case of text.
562* Text Mode:: The major modes for editing text files.
563* Outline Mode:: Editing outlines.
564* TeX Mode:: Editing input to the formatter TeX.
565* HTML Mode:: Editing HTML, SGML, and XML files.
566* Nroff Mode:: Editing input to the formatter nroff.
567* Formatted Text:: Editing formatted text directly in WYSIWYG fashion.
568* Text Based Tables:: Editing text-based tables in WYSIWYG fashion.
569
570Filling Text
571
572* Auto Fill:: Auto Fill mode breaks long lines automatically.
573* Refill:: Keeping paragraphs filled.
574* Fill Commands:: Commands to refill paragraphs and center lines.
575* Fill Prefix:: Filling paragraphs that are indented
576 or in a comment, etc.
577* Adaptive Fill:: How Emacs can determine the fill prefix automatically.
578* Longlines:: Editing text with very long lines.
579
580Outline Mode
581
582* Format: Outline Format. What the text of an outline looks like.
583* Motion: Outline Motion. Special commands for moving through
584 outlines.
585* Visibility: Outline Visibility. Commands to control what is visible.
586* Views: Outline Views. Outlines and multiple views.
587* Foldout:: Folding means zooming in on outlines.
588
589@TeX{} Mode
590
591* Editing: TeX Editing. Special commands for editing in TeX mode.
592* LaTeX: LaTeX Editing. Additional commands for LaTeX input files.
593* Printing: TeX Print. Commands for printing part of a file with TeX.
594* Misc: TeX Misc. Customization of TeX mode, and related features.
595
596Editing Formatted Text
597
598* Requesting Formatted Text:: Entering and exiting Enriched mode.
599* Hard and Soft Newlines:: There are two different kinds of newlines.
600* Editing Format Info:: How to edit text properties.
601* Faces: Format Faces. Bold, italic, underline, etc.
602* Color: Format Colors. Changing the color of text.
603* Indent: Format Indentation. Changing the left and right margins.
604* Justification: Format Justification.
605 Centering, setting text flush with the
606 left or right margin, etc.
607* Other: Format Properties. The "special" text properties submenu.
608* Forcing Enriched Mode:: How to force use of Enriched mode.
609
610Editing Text-based Tables
611
612* Table Definition:: What is a text based table.
613* Table Creation:: How to create a table.
614* Table Recognition:: How to activate and deactivate tables.
615* Cell Commands:: Cell-oriented commands in a table.
616* Cell Justification:: Justifying cell contents.
617* Row Commands:: Manipulating rows of table cell.
618* Column Commands:: Manipulating columns of table cell.
619* Fixed Width Mode:: Fixing cell width.
620* Table Conversion:: Converting between plain text and tables.
621* Measuring Tables:: Analyzing table dimension.
622* Table Misc:: Table miscellany.
623
624Editing Programs
625
626* Program Modes:: Major modes for editing programs.
627* Defuns:: Commands to operate on major top-level parts
628 of a program.
629* Program Indent:: Adjusting indentation to show the nesting.
630* Parentheses:: Commands that operate on parentheses.
631* Comments:: Inserting, killing, and aligning comments.
632* Documentation:: Getting documentation of functions you plan to call.
633* Hideshow:: Displaying blocks selectively.
634* Symbol Completion:: Completion on symbol names of your program or language.
635* Glasses:: Making identifiersLikeThis more readable.
636* Misc for Programs:: Other Emacs features useful for editing programs.
637* C Modes:: Special commands of C, C++, Objective-C,
638 Java, and Pike modes.
639* Asm Mode:: Asm mode and its special features.
640* Fortran:: Fortran mode and its special features.
641
642Top-Level Definitions, or Defuns
643
644* Left Margin Paren:: An open-paren or similar opening delimiter
645 starts a defun if it is at the left margin.
646* Moving by Defuns:: Commands to move over or mark a major definition.
647* Imenu:: Making buffer indexes as menus.
648* Which Function:: Which Function mode shows which function you are in.
649
650Indentation for Programs
651
652* Basic Indent:: Indenting a single line.
653* Multi-line Indent:: Commands to reindent many lines at once.
654* Lisp Indent:: Specifying how each Lisp function should be indented.
655* C Indent:: Extra features for indenting C and related modes.
656* Custom C Indent:: Controlling indentation style for C and related modes.
657
658Commands for Editing with Parentheses
659
660* Expressions:: Expressions with balanced parentheses.
661* Moving by Parens:: Commands for moving up, down and across
662 in the structure of parentheses.
663* Matching:: Insertion of a close-delimiter flashes matching open.
664
665Manipulating Comments
666
667* Comment Commands:: Inserting, killing, and aligning comments.
668* Multi-Line Comments:: Commands for adding and editing multi-line comments.
669* Options for Comments::Customizing the comment features.
670
671Documentation Lookup
672
673* Info Lookup:: Looking up library functions and commands
674 in Info files.
675* Man Page:: Looking up man pages of library functions and commands.
676* Lisp Doc:: Looking up Emacs Lisp functions, etc.
677
678C and Related Modes
679
680* Motion in C:: Commands to move by C statements, etc.
681* Electric C:: Colon and other chars can automatically reindent.
682* Hungry Delete:: A more powerful DEL command.
683* Other C Commands:: Filling comments, viewing expansion of macros,
684 and other neat features.
685
686Compiling and Testing Programs
687
688* Compilation:: Compiling programs in languages other
689 than Lisp (C, Pascal, etc.).
690* Compilation Mode:: The mode for visiting compiler errors.
691* Compilation Shell:: Customizing your shell properly
692 for use in the compilation buffer.
693* Grep Searching:: Searching with grep.
694* Flymake:: Finding syntax errors on the fly.
695* Debuggers:: Running symbolic debuggers for non-Lisp programs.
696* Executing Lisp:: Various modes for editing Lisp programs,
697 with different facilities for running
698 the Lisp programs.
699* Lisp Libraries:: Creating Lisp programs to run in Emacs.
700* Lisp Eval:: Executing a single Lisp expression in Emacs.
701* Lisp Interaction:: Executing Lisp in an Emacs buffer.
702* External Lisp:: Communicating through Emacs with a separate Lisp.
703
704Running Debuggers Under Emacs
705
706* Starting GUD:: How to start a debugger subprocess.
707* Debugger Operation:: Connection between the debugger and source buffers.
708* Commands of GUD:: Key bindings for common commands.
709* GUD Customization:: Defining your own commands for GUD.
710* GDB Graphical Interface:: An enhanced mode that uses GDB features to
711 implement a graphical debugging environment through
712 Emacs.
713
714Maintaining Large Programs
715
716* Change Log:: Maintaining a change history for your program.
717* Format of ChangeLog:: What the change log file looks like.
718* Tags:: Go direct to any function in your program in one
719 command. Tags remembers which file it is in.
720* Emerge:: A convenient way of merging two versions of a program.
721
722Tags Tables
723
724* Tag Syntax:: Tag syntax for various types of code and text files.
725* Create Tags Table:: Creating a tags table with @code{etags}.
726* Etags Regexps:: Create arbitrary tags using regular expressions.
727* Select Tags Table:: How to visit a tags table.
728* Find Tag:: Commands to find the definition of a specific tag.
729* Tags Search:: Using a tags table for searching and replacing.
730* List Tags:: Listing and finding tags defined in a file.
731
732Abbrevs
733
734* Abbrev Concepts:: Fundamentals of defined abbrevs.
735* Defining Abbrevs:: Defining an abbrev, so it will expand when typed.
736* Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion.
737* Editing Abbrevs:: Viewing or editing the entire list of defined abbrevs.
738* Saving Abbrevs:: Saving the entire list of abbrevs for another session.
739* Dynamic Abbrevs:: Abbreviations for words already in the buffer.
740* Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling.
741
742@ifnottex
743Editing Pictures
744
745* Basic Picture:: Basic concepts and simple commands of Picture Mode.
746* Insert in Picture:: Controlling direction of cursor motion
747 after "self-inserting" characters.
748* Tabs in Picture:: Various features for tab stops and indentation.
749* Rectangles in Picture:: Clearing and superimposing rectangles.
750@end ifnottex
751
752Sending Mail
753
754* Mail Format:: Format of the mail being composed.
755* Mail Headers:: Details of permitted mail header fields.
756* Mail Aliases:: Abbreviating and grouping mail addresses.
757* Mail Mode:: Special commands for editing mail being composed.
758* Mail Amusements:: Distract the NSA's attention; add a fortune to a msg.
759* Mail Methods:: Using alternative mail-composition methods.
760
761Reading Mail with Rmail
762
763* Rmail Basics:: Basic concepts of Rmail, and simple use.
764* Rmail Scrolling:: Scrolling through a message.
765* Rmail Motion:: Moving to another message.
766* Rmail Deletion:: Deleting and expunging messages.
767* Rmail Inbox:: How mail gets into the Rmail file.
768* Rmail Files:: Using multiple Rmail files.
769* Rmail Output:: Copying message out to files.
770* Rmail Labels:: Classifying messages by labeling them.
771* Rmail Attributes:: Certain standard labels, called attributes.
772* Rmail Reply:: Sending replies to messages you are viewing.
773* Rmail Summary:: Summaries show brief info on many messages.
774* Rmail Sorting:: Sorting messages in Rmail.
775* Rmail Display:: How Rmail displays a message; customization.
776* Rmail Coding:: How Rmail handles decoding character sets.
777* Rmail Editing:: Editing message text and headers in Rmail.
778* Rmail Digest:: Extracting the messages from a digest message.
779* Out of Rmail:: Converting an Rmail file to mailbox format.
780* Rmail Rot13:: Reading messages encoded in the rot13 code.
781* Movemail:: More details of fetching new mail.
782* Remote Mailboxes:: Retrieving Mail from Remote Mailboxes.
783* Other Mailbox Formats:: Retrieving Mail from Local Mailboxes in
784 Various Formats
785
786Dired, the Directory Editor
787
788* Dired Enter:: How to invoke Dired.
789* Dired Navigation:: How to move in the Dired buffer.
790* Dired Deletion:: Deleting files with Dired.
791* Flagging Many Files:: Flagging files based on their names.
792* Dired Visiting:: Other file operations through Dired.
793* Marks vs Flags:: Flagging for deletion vs marking.
794* Operating on Files:: How to copy, rename, print, compress, etc.
795 either one file or several files.
796* Shell Commands in Dired:: Running a shell command on the marked files.
797* Transforming File Names:: Using patterns to rename multiple files.
798* Comparison in Dired:: Running `diff' by way of Dired.
799* Subdirectories in Dired:: Adding subdirectories to the Dired buffer.
800* Subdir Switches:: Subdirectory switches in Dired.
801* Subdirectory Motion:: Moving across subdirectories, and up and down.
802* Hiding Subdirectories:: Making subdirectories visible or invisible.
803* Dired Updating:: Discarding lines for files of no interest.
804* Dired and Find:: Using `find' to choose the files for Dired.
805* Wdired:: Operating on files by editing the Dired buffer.
806* Image-Dired:: Viewing image thumbnails in Dired
807* Misc Dired Features:: Various other features.
808
809The Calendar and the Diary
810
811* Calendar Motion:: Moving through the calendar; selecting a date.
812* Scroll Calendar:: Bringing earlier or later months onto the screen.
813* Counting Days:: How many days are there between two dates?
814* General Calendar:: Exiting or recomputing the calendar.
815* Writing Calendar Files:: Writing calendars to files of various formats.
816* Holidays:: Displaying dates of holidays.
817* Sunrise/Sunset:: Displaying local times of sunrise and sunset.
818* Lunar Phases:: Displaying phases of the moon.
819* Other Calendars:: Converting dates to other calendar systems.
820* Diary:: Displaying events from your diary.
821* Appointments:: Reminders when it's time to do something.
822* Importing Diary:: Converting diary events to/from other formats.
823* Daylight Saving:: How to specify when daylight saving time is active.
824* Time Intervals:: Keeping track of time intervals.
825* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
826
827Movement in the Calendar
828
829* Calendar Unit Motion:: Moving by days, weeks, months, and years.
830* Move to Beginning or End:: Moving to start/end of weeks, months, and years.
831* Specified Dates:: Moving to the current date or another
832 specific date.
833
834Conversion To and From Other Calendars
835
836* Calendar Systems:: The calendars Emacs understands
837 (aside from Gregorian).
838* To Other Calendar:: Converting the selected date to various calendars.
839* From Other Calendar:: Moving to a date specified in another calendar.
840* Mayan Calendar:: Moving to a date specified in a Mayan calendar.
841
842The Diary
843
844* Displaying the Diary:: Viewing diary entries and associated calendar dates.
845* Format of Diary File:: Entering events in your diary.
846* Date Formats:: Various ways you can specify dates.
847* Adding to Diary:: Commands to create diary entries.
848* Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc.
849
850Gnus
851
852* Buffers of Gnus:: The group, summary, and article buffers.
853* Gnus Startup:: What you should know about starting Gnus.
854* Summary of Gnus:: A short description of the basic Gnus commands.
855
856Running Shell Commands from Emacs
857
858* Single Shell:: How to run one shell command and return.
859* Interactive Shell:: Permanent shell taking input via Emacs.
860* Shell Mode:: Special Emacs commands used with permanent shell.
861* Shell Prompts:: Two ways to recognize shell prompts.
862* Shell History:: Repeating previous commands in a shell buffer.
863* Directory Tracking:: Keeping track when the subshell changes directory.
864* Shell Options:: Options for customizing Shell mode.
865* Terminal emulator:: An Emacs window as a terminal emulator.
866* Term Mode:: Special Emacs commands used in Term mode.
867* Paging in Term:: Paging in the terminal emulator.
868* Remote Host:: Connecting to another computer.
869
870Using Emacs as a Server
871
872* Invoking emacsclient:: Emacs client startup options.
873
874Printing Hard Copies
875
876* PostScript:: Printing buffers or regions as PostScript.
877* PostScript Variables:: Customizing the PostScript printing commands.
878* Printing Package:: An optional advanced printing interface.
879
880Hyperlinking and Navigation Features
881
882* Browse-URL:: Following URLs.
883* Goto-address:: Activating URLs.
884* FFAP:: Finding files etc. at point.
885
886Customization
887
888* Minor Modes:: Each minor mode is one feature you can turn on
889 independently of any others.
890* Easy Customization:: Convenient way to browse and change user options.
891* Variables:: Many Emacs commands examine Emacs variables
892 to decide what to do; by setting variables,
893 you can control their functioning.
894* Key Bindings:: The keymaps say what command each key runs.
895 By changing them, you can "redefine keys".
896* Syntax:: The syntax table controls how words and
897 expressions are parsed.
898* Init File:: How to write common customizations in the
899 @file{.emacs} file.
900
901Variables
902
903* Examining:: Examining or setting one variable's value.
904* Hooks:: Hook variables let you specify programs for parts
905 of Emacs to run on particular occasions.
906* Locals:: Per-buffer values of variables.
907* File Variables:: How files can specify variable values.
908
909Customizing Key Bindings
910
911* Keymaps:: Generalities. The global keymap.
912* Prefix Keymaps:: Keymaps for prefix keys.
913* Local Keymaps:: Major and minor modes have their own keymaps.
914* Minibuffer Maps:: The minibuffer uses its own local keymaps.
915* Rebinding:: How to redefine one key's meaning conveniently.
916* Init Rebinding:: Rebinding keys with your init file, @file{.emacs}.
917* Function Keys:: Rebinding terminal function keys.
918* Named ASCII Chars:: Distinguishing @key{TAB} from @kbd{C-i}, and so on.
919* Mouse Buttons:: Rebinding mouse buttons in Emacs.
920* Disabling:: Disabling a command means confirmation is required
921 before it can be executed. This is done to protect
922 beginners from surprises.
923
924The Init File, @file{~/.emacs}
925
926* Init Syntax:: Syntax of constants in Emacs Lisp.
927* Init Examples:: How to do some things with an init file.
928* Terminal Init:: Each terminal type can have an init file.
929* Find Init:: How Emacs finds the init file.
930* Init Non-ASCII:: Using non-@acronym{ASCII} characters in an init file.
931
932Dealing with Emacs Trouble
933
934* DEL Does Not Delete:: What to do if @key{DEL} doesn't delete.
935* Stuck Recursive:: `[...]' in mode line around the parentheses.
936* Screen Garbled:: Garbage on the screen.
937* Text Garbled:: Garbage in the text.
938* Memory Full:: How to cope when you run out of memory.
939* After a Crash:: Recovering editing in an Emacs session that crashed.
940* Emergency Escape:: Emergency escape---
941 What to do if Emacs stops responding.
942* Total Frustration:: When you are at your wits' end.
943
944Reporting Bugs
945
946* Bug Criteria:: Have you really found a bug?
947* Understanding Bug Reporting:: How to report a bug effectively.
948* Checklist:: Steps to follow for a good bug report.
949* Sending Patches:: How to send a patch for GNU Emacs.
950
951Command Line Arguments for Emacs Invocation
952
953* Action Arguments:: Arguments to visit files, load libraries,
954 and call functions.
955* Initial Options:: Arguments that take effect while starting Emacs.
956* Command Example:: Examples of using command line arguments.
957* Resume Arguments:: Specifying arguments when you resume a running Emacs.
958* Environment:: Environment variables that Emacs uses.
959* Display X:: Changing the default display and using remote login.
960* Font X:: Choosing a font for text, under X.
961* Colors:: Choosing display colors.
962* Window Size X:: Start-up window size, under X.
963* Borders X:: Internal and external borders, under X.
964* Title X:: Specifying the initial frame's title.
965* Icons X:: Choosing what sort of icon to use, under X.
966* Misc X:: Other display options.
967
968Environment Variables
969
970* General Variables:: Environment variables that all versions of Emacs use.
971* Misc Variables:: Certain system specific variables.
972* MS-Windows Registry:: An alternative to the environment on MS-Windows.
973
974X Options and Resources
975
976* Resources:: Using X resources with Emacs (in general).
977* Table of Resources:: Table of specific X resources that affect Emacs.
978* Face Resources:: X resources for customizing faces.
979* Lucid Resources:: X resources for Lucid menus.
980* LessTif Resources:: X resources for LessTif and Motif menus.
981* GTK resources:: Resources for GTK widgets.
982
983Emacs and Mac OS
984
985* Mac Input:: Keyboard and mouse input on Mac.
986* Mac International:: International character sets on Mac.
987* Mac Environment Variables:: Setting environment variables for Emacs.
988* Mac Directories:: Volumes and directories on Mac.
989* Mac Font Specs:: Specifying fonts on Mac.
990* Mac Functions:: Mac-specific Lisp functions.
991
992Emacs and Microsoft Windows/MS-DOS
993
994* Text and Binary:: Text files use CRLF to terminate lines.
995* Windows Files:: File-name conventions on Windows.
996* ls in Lisp:: Emulation of @code{ls} for Dired.
997* Windows HOME:: Where Emacs looks for your @file{.emacs}.
998* Windows Keyboard:: Windows-specific keyboard features.
999* Windows Mouse:: Windows-specific mouse features.
1000* Windows Processes:: Running subprocesses on Windows.
1001* Windows Printing:: How to specify the printer on MS-Windows.
1002* Windows Misc:: Miscellaneous Windows features.
1003* MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}).
1004@end detailmenu
1005@end menu
1006
1007@iftex
1008@unnumbered Preface
1009
1010 This manual documents the use and simple customization of the Emacs
1011editor. Simple Emacs customizations do not require you to be a
1012programmer, but if you are not interested in customizing, you can
1013ignore the customization hints.
1014
1015 This is primarily a reference manual, but can also be used as a
1016primer. If you are new to Emacs, we recommend you start with
1017the on-line, learn-by-doing tutorial, before reading the manual. To
1018run the tutorial, start Emacs and type @kbd{C-h t}. The tutorial
1019describes commands, tells you when to try them, and explains the
1020results.
1021
1022 On first reading, just skim chapters 1 and 2, which describe the
1023notational conventions of the manual and the general appearance of the
1024Emacs display screen. Note which questions are answered in these
1025chapters, so you can refer back later. After reading chapter 4, you
1026should practice the commands shown there. The next few chapters
1027describe fundamental techniques and concepts that are used constantly.
1028You need to understand them thoroughly, so experiment with them
1029until you are fluent.
1030
1031 Chapters 14 through 19 describe intermediate-level features that are
1032useful for many kinds of editing. Chapter 20 and following chapters
1033describe optional but useful features; read those chapters when you
1034need them.
1035
1036 Read the Trouble chapter if Emacs does not seem to be working
1037properly. It explains how to cope with several common problems
1038(@pxref{Lossage}), as well as when and how to report Emacs bugs
1039(@pxref{Bugs}).
1040
1041 To find the documentation of a particular command, look in the index.
1042Keys (character commands) and command names have separate indexes.
1043There is also a glossary, with a cross reference for each term.
1044
1045 This manual is available as a printed book and also as an Info file.
1046The Info file is for on-line perusal with the Info program, which is
1047the principal means of accessing on-line documentation in the GNU
1048system. Both the Emacs Info file and an Info reader are included with
1049GNU Emacs. The Info file and the printed book contain substantially
1050the same text and are generated from the same source files, which are
1051also distributed with GNU Emacs.
1052
1053 GNU Emacs is a member of the Emacs editor family. There are many
1054Emacs editors, all sharing common principles of organization. For
1055information on the underlying philosophy of Emacs and the lessons
1056learned from its development, see @cite{Emacs, the Extensible,
1057Customizable Self-Documenting Display Editor}, available from
1058@url{ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-519A.pdf}.
1059
1060This edition of the manual is intended for use with GNU Emacs
1061installed on GNU and Unix systems. GNU Emacs can also be used on VMS,
1062MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems.
1063Those systems use different file name syntax; in addition, VMS and
1064MS-DOS do not support all GNU Emacs features. @xref{Microsoft
1065Windows}, for information about using Emacs on Windows.
1066@xref{Mac OS}, for information about using Emacs on Macintosh. We
1067don't try to describe VMS usage in this manual.
1068@end iftex
1069
1070@node Distrib, Intro, Top, Top
1071@unnumbered Distribution
1072
1073GNU Emacs is @dfn{free software}; this means that everyone is free to
1074use it and free to redistribute it on certain conditions. GNU Emacs
1075is not in the public domain; it is copyrighted and there are
1076restrictions on its distribution, but these restrictions are designed
1077to permit everything that a good cooperating citizen would want to do.
1078What is not allowed is to try to prevent others from further sharing
1079any version of GNU Emacs that they might get from you. The precise
1080conditions are found in the GNU General Public License that comes with
1081Emacs and also appears in this manual@footnote{This manual is itself
1082covered by the GNU Free Documentation License. This license is
1083similar in spirit to the General Public License, but is more suitable
1084for documentation. @xref{GNU Free Documentation License}.}.
1085@xref{Copying}.
1086
1087One way to get a copy of GNU Emacs is from someone else who has it.
1088You need not ask for our permission to do so, or tell any one else;
1089just copy it. If you have access to the Internet, you can get the
1090latest distribution version of GNU Emacs by anonymous FTP; see
1091@url{http://www.gnu.org/software/emacs} on our website for more
1092information.
1093
1094You may also receive GNU Emacs when you buy a computer. Computer
1095manufacturers are free to distribute copies on the same terms that apply to
1096everyone else. These terms require them to give you the full sources,
1097including whatever changes they may have made, and to permit you to
1098redistribute the GNU Emacs received from them under the usual terms of the
1099General Public License. In other words, the program must be free for you
1100when you get it, not just free for the manufacturer.
1101
1102You can also order copies of GNU Emacs from the Free Software
1103Foundation. This is a convenient and reliable way to get a copy; it is
1104also a good way to help fund our work. We also sell hardcopy versions
1105of this manual and @cite{An Introduction to Programming in Emacs Lisp},
1106by Robert J. Chassell. You can find an order form on our web site at
1107@url{http://www.gnu.org/order/order.html}. For further information,
1108write to
1109
1110@display
1111Free Software Foundation
111251 Franklin Street, Fifth Floor
1113Boston, MA 02110-1301
1114USA
1115@end display
1116
1117The income from distribution fees goes to support the foundation's
1118purpose: the development of new free software, and improvements to our
1119existing programs including GNU Emacs.
1120
1121If you find GNU Emacs useful, please @strong{send a donation} to the
1122Free Software Foundation to support our work. Donations to the Free
1123Software Foundation are tax deductible in the US. If you use GNU Emacs
1124at your workplace, please suggest that the company make a donation. If
1125company policy is unsympathetic to the idea of donating to charity, you
1126might instead suggest ordering a CD-ROM from the Foundation
1127occasionally, or subscribing to periodic updates.
1128
1129@iftex
1130@node Acknowledgments, Intro, Distrib, Top
1131@unnumberedsec Acknowledgments
1132
1133Contributors to GNU Emacs include Jari Aalto, Per Abrahamsen, Tomas
1134Abrahamsson, Jay K.@: Adams, Michael Albinus, Nagy Andras, Ralf
1135Angeli, Joe Arceneaux, Miles Bader, David Bakhash, Juanma Barranquero,
1136Eli Barzilay, Steven L.@: Baur, Jay Belanger, Alexander L.@: Belikoff,
1137Boaz Ben-Zvi, Karl Berry, Anna M.@: Bigatti, Ray Blaak, Jim Blandy, Johan Bockg@aa{}rd,
1138Per Bothner, Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel
1139Briot, Kevin Broadey, Vincent Broman, David M.@: Brown, Georges
1140Brun-Cottan, Joe Buehler, W@l{}odek Bzyl, Bill Carpenter, Per
1141Cederqvist, Hans Chalupsky, Chris Chase, Bob Chassell, Andrew Choi,
1142Sacha Chua, James Clark, Mike Clarkson, Glynn Clements, Andrew
1143Csillag, Doug Cutting, Mathias Dahl, Satyaki Das, Michael DeCorte,
1144Gary Delp, Matthieu Devin, Eri Ding, Jan Dj@"{a}rv, Carsten Dominik,
1145Scott Draves, Benjamin Drieu, Viktor Dukhovni, John Eaton, Rolf Ebert,
1146Paul Eggert, Stephen Eglen, Torbj@"orn Einarsson, Tsugutomo Enami,
1147Hans Henrik Eriksen, Michael Ernst, Ata Etemadi, Frederick Farnbach,
1148Oscar Figueiredo, Fred Fish, Karl Fogel, Gary Foster, Romain
1149Francoise, Noah Friedman, Andreas Fuchs, Hallvard Furuseth, Keith
1150Gabryelski, Peter S.@: Galbraith, Kevin Gallagher, Kevin Gallo, Juan
1151Le@'{o}n Lahoz Garc@'{@dotless{i}}a, Howard Gayle, Stephen Gildea, Julien
1152Gilles, David Gillespie, Bob Glickstein, Deepak Goel, Boris Goldowsky,
1153Michelangelo Grigni, Odd Gripenstam, Kai Gro@ss{}johann, Michael
1154Gschwind, Henry Guillaume, Doug Gwyn, Ken'ichi Handa, Lars Hansen,
1155Chris Hanson, K. Shane Hartman, John Heidemann, Jon K.@: Hellan,
1156Jesper Harder, Markus Heritsch, Karl Heuer, Manabu Higashida, Anders
1157Holst, Jeffrey C.@: Honig, Kurt Hornik, Tom Houlder, Joakim Hove,
1158Denis Howe, Lars Ingebrigtsen, Andrew Innes, Seiichiro Inoue, Pavel
1159Janik, Paul Jarc, Ulf Jasper, Michael K. Johnson, Kyle Jones, Terry
1160Jones, Simon Josefsson, Arne J@o{}rgensen, Tomoji Kagatani, Brewster
1161Kahle, Lute Kamstra, David Kastrup, David Kaufman, Henry Kautz, Taichi
1162Kawabata, Howard Kaye, Michael Kifer, Richard King, Peter Kleiweg,
1163Shuhei Kobayashi, Pavel Kobiakov, Larry K.@: Kolodney, David M.@:
1164Koppelman, Koseki Yoshinori, Robert Krawitz, Sebastian Kremer, Ryszard
1165Kubiak, Geoff Kuenning, David K@aa{}gedal, Daniel LaLiberte, Mario
1166Lang, Aaron Larson, James R.@: Larus, Vinicius Jose Latorre, Werner
1167Lemberg, Frederic Lepied, Peter Liljenberg, Lars Lindberg, Chris
1168Lindblad, Anders Lindgren, Thomas Link, Juri Linkov, Francis Litterio,
1169Emilio C. Lopes, Dave Love, Sascha L@"{u}decke, Eric Ludlam,Alan
1170Mackenzie, Christopher J.@: Madsen, Neil M.@: Mager, Ken Manheimer,
1171Bill Mann, Brian Marick, Simon Marshall, Bengt Martensson, Charlie
1172Martin, Thomas May, Roland McGrath, Will Mengarini, David Megginson,
1173Ben A. Mesander, Wayne Mesard, Brad Miller, Lawrence Mitchell, Richard
1174Mlynarik, Gerd Moellmann, Stefan Monnier, Morioka Tomohiko, Keith
1175Moore, Glenn Morris, Diane Murray, Sen Nagata, Erik Naggum, Thomas
1176Neumann, Thien-Thi Nguyen, Mike Newton, Jurgen Nickelsen, Dan
1177Nicolaescu, Hrvoje Niksic, Jeff Norden, Andrew Norman, Alexandre
1178Oliva, Bob Olson, Michael Olson, Takaaki Ota, Pieter E.@: J.@: Pareit,
1179David Pearson, Jeff Peck, Damon Anton Permezel, Tom Perrine, William
1180M.@: Perry, Per Persson, Jens Petersen, Daniel Pfeiffer, Richard L.@:
1181Pieri, Fred Pierresteguy, Christian Plaunt, David Ponce, Francesco
1182A.@: Potorti, Michael D. Prange, Mukesh Prasad, Ken Raeburn, Marko
1183Rahamaa, Ashwin Ram, Eric S. Raymond, Paul Reilly, Edward M. Reingold,
1184Alex Rezinsky, Rob Riepel, David Reitter, Nick Roberts, Roland B.@:
1185Roberts, John Robinson, Danny Roozendaal, William Rosenblatt,
1186Guillermo J.@: Rozas, Martin Rudalics, Ivar Rummelhoff, Jason Rumney,
1187Wolfgang Rupprecht, Kevin Ryde, James B. Salem, Masahiko Sato, Jorgen
1188Schaefer, Holger Schauer, William Schelter, Ralph Schleicher, Gregor
1189Schmid, Michael Schmidt, Ronald S. Schnell, Philippe Schnoebelen, Jan
1190Schormann, Alex Schroeder, Stephen Schoef, Raymond Scholz, Randal
1191Schwartz, Oliver Seidel, Manuel Serrano, Hovav Shacham, Stanislav
1192Shalunov, Marc Shapiro, Richard Sharman, Olin Shivers, Espen Skoglund,
1193Rick Sladkey, Lynn Slater, Chris Smith, David Smith, Paul D.@: Smith,
1194Andre Spiegel, Michael Staats, William Sommerfeld, Michael Staats,
1195Reiner Steib, Sam Steingold, Ake Stenhoff, Peter Stephenson, Ken
1196Stevens, Jonathan Stigelman, Martin Stjernholm, Kim F.@: Storm, Steve
1197Strassman, Olaf Sylvester, Naoto Takahashi, Steven Tamm, Jean-Philippe
1198Theberge, Jens T.@: Berger Thielemann, Spencer Thomas, Jim Thompson,
1199Luc Teirlinck, Tom Tromey, Enami Tsugutomo, Eli Tziperman, Daiki Ueno,
1200Masanobu Umeda, Rajesh Vaidheeswarran, Neil W.@: Van Dyke, Didier
1201Verna, Ulrik Vieth, Geoffrey Voelker, Johan Vromans, Inge Wallin, John
1202Paul Wallington, Colin Walters, Barry Warsaw, Morten Welinder, Joseph
1203Brian Wells, Rodney Whitby, John Wiegley, Ed Wilkinson, Mike Williams,
1204Bill Wohler, Steven A. Wood, Dale R.@: Worley, Francis J.@: Wright,
1205Felix S. T. Wu, Tom Wurgler, Katsumi Yamaoka, Masatake Yamato,
1206Jonathan Yavner, Ryan Yeske, Chong Yidong, Ilya Zakharevich, Milan
1207Zamazal, Victor Zandy, Eli Zaretskii, Jamie Zawinski, Shenghuo Zhu,
1208Ian T.@: Zimmermann, Reto Zimmermann, Neal Ziring, Teodor Zlatanov,
1209and Detlev Zundel.
1210@end iftex
1211
1212@node Intro, Glossary, Distrib, Top
1213@unnumbered Introduction
1214
1215 You are reading about GNU Emacs, the GNU incarnation of the
1216advanced, self-documenting, customizable, extensible editor Emacs.
1217(The `G' in `GNU' is not silent.)
1218
1219 We call Emacs advanced because it provides much more than simple
1220insertion and deletion. It can control subprocesses, indent programs
1221automatically, show two or more files at once, and edit formatted
1222text. Emacs editing commands operate in terms of characters, words,
1223lines, sentences, paragraphs, and pages, as well as expressions and
1224comments in various programming languages.
1225
1226 @dfn{Self-documenting} means that at any time you can type a special
1227character, @kbd{Control-h}, to find out what your options are. You can
1228also use it to find out what any command does, or to find all the commands
1229that pertain to a topic. @xref{Help}.
1230
1231 @dfn{Customizable} means that you can alter Emacs commands' behavior
1232in simple ways. For example, if you use a programming language in
1233which comments start with @samp{<**} and end with @samp{**>}, you can
1234tell the Emacs comment manipulation commands to use those strings
1235(@pxref{Comments}). Another sort of customization is rearrangement of
1236the command set. For example, you can rebind the basic cursor motion
1237commands (up, down, left and right) to any keys on the keyboard that
1238you find comfortable. @xref{Customization}.
1239
1240 @dfn{Extensible} means that you can go beyond simple customization
1241and write entirely new commands---programs in the Lisp language to be
1242run by Emacs's own Lisp interpreter. Emacs is an ``on-line
1243extensible'' system, which means that it is divided into many
1244functions that call each other, any of which can be redefined in the
1245middle of an editing session. Almost any part of Emacs can be
1246replaced without making a separate copy of all of Emacs. Most of the
1247editing commands of Emacs are written in Lisp; the few exceptions
1248could have been written in Lisp but use C instead for efficiency.
1249Writing an extension is programming, but non-programmers can use it
1250afterwards. @xref{Top, Emacs Lisp Intro, Preface, eintr, An
1251Introduction to Programming in Emacs Lisp}, if you want to learn Emacs
1252Lisp programming.
1253
1254 When running on a graphical display, Emacs provides its own menus
1255and convenient handling of mouse buttons. In addition, Emacs provides
1256many of the benefits of a graphical display even on a text-only
1257terminal. For instance, it can highlight parts of a file, display and
1258edit several files at once, move text between files, and edit files
1259while running shell commands.
1260
1261@include screen.texi
1262@include commands.texi
1263@include entering.texi
1264@include basic.texi
1265@include mini.texi
1266@include m-x.texi
1267@include help.texi
1268@include mark.texi
1269@include killing.texi
1270@include regs.texi
1271@include display.texi
1272@include search.texi
1273@include fixit.texi
1274@include kmacro.texi
1275@include files.texi
1276@include buffers.texi
1277@include windows.texi
1278@include frames.texi
1279@include mule.texi
1280@include major.texi
1281@include indent.texi
1282@include text.texi
1283@include programs.texi
1284@include building.texi
1285@include maintaining.texi
1286@include abbrevs.texi
1287@ifnottex
1288@include picture-xtra.texi
1289@end ifnottex
1290@include sending.texi
1291@include rmail.texi
1292@include dired.texi
1293@include calendar.texi
1294@include misc.texi
1295@include custom.texi
1296@include trouble.texi
1297
1298@node Copying, GNU Free Documentation License, Service, Top
1299@appendix GNU GENERAL PUBLIC LICENSE
1300@include gpl.texi
1301
1302@node GNU Free Documentation License, Emacs Invocation, Copying, Top
1303@appendix GNU Free Documentation License
1304@include doclicense.texi
1305
1306@include cmdargs.texi
1307@include xresources.texi
1308
1309@include anti.texi
1310@include macos.texi
1311@include msdog.texi
1312@include gnu.texi
1313@include glossary.texi
1314@ifnottex
1315@include ack.texi
1316@end ifnottex
1317
1318@c The Option Index is produced only in the on-line version,
1319@c because the index entries related to command-line options
1320@c tend to point to the same pages and all begin with a dash.
1321@c This, and the need to keep the node links consistent, are
1322@c the reasons for the funky @iftex/@ifnottex dance below.
1323@c The Option Index is _not_ before Key Index, because that
1324@c would require changes in the glossary.texi's @node line.
1325@c It is not after Concept Index for similar reasons.
1326
1327@iftex
1328@node Key Index, Command Index, Glossary, Top
1329@unnumbered Key (Character) Index
1330@printindex ky
1331@end iftex
1332
1333@ifnottex
1334@node Key Index, Option Index, Glossary, Top
1335@unnumbered Key (Character) Index
1336@printindex ky
1337
1338@node Option Index, Command Index, Key Index, Top
1339@unnumbered Command-Line Options Index
1340@printindex op
1341
1342@node Command Index, Variable Index, Option Index, Top
1343@unnumbered Command and Function Index
1344@printindex fn
1345@end ifnottex
1346
1347@iftex
1348@node Command Index, Variable Index, Key Index, Top
1349@unnumbered Command and Function Index
1350@printindex fn
1351@end iftex
1352
1353@node Variable Index, Concept Index, Command Index, Top
1354@unnumbered Variable Index
1355@printindex vr
1356
1357@node Concept Index, Acknowledgments, Variable Index, Top
1358@unnumbered Concept Index
1359@printindex cp
1360
1361@bye
1362
1363@ignore
1364 arch-tag: ed48740a-410b-46ea-9387-c9a9252a3392
1365@end ignore
diff --git a/doc/emacs/emerge-xtra.texi b/doc/emacs/emerge-xtra.texi
new file mode 100644
index 00000000000..e78f17e59d6
--- /dev/null
+++ b/doc/emacs/emerge-xtra.texi
@@ -0,0 +1,414 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Emerge
8@section Merging Files with Emerge
9@cindex Emerge
10@cindex merging files
11
12 It's not unusual for programmers to get their signals crossed and
13modify the same program in two different directions. To recover from
14this confusion, you need to merge the two versions. Emerge makes this
15easier. For other ways to compare files, see
16@iftex
17@ref{Comparing Files,,, emacs, the Emacs Manual},
18@end iftex
19@ifnottex
20@ref{Comparing Files},
21@end ifnottex
22and @ref{Top, Ediff,, ediff, The Ediff Manual}.
23
24@menu
25* Overview of Emerge:: How to start Emerge. Basic concepts.
26* Submodes of Emerge:: Fast mode vs. Edit mode.
27 Skip Prefers mode and Auto Advance mode.
28* State of Difference:: You do the merge by specifying state A or B
29 for each difference.
30* Merge Commands:: Commands for selecting a difference,
31 changing states of differences, etc.
32* Exiting Emerge:: What to do when you've finished the merge.
33* Combining in Emerge:: How to keep both alternatives for a difference.
34* Fine Points of Emerge:: Misc.
35@end menu
36
37@node Overview of Emerge
38@subsection Overview of Emerge
39
40 To start Emerge, run one of these four commands:
41
42@table @kbd
43@item M-x emerge-files
44@findex emerge-files
45Merge two specified files.
46
47@item M-x emerge-files-with-ancestor
48@findex emerge-files-with-ancestor
49Merge two specified files, with reference to a common ancestor.
50
51@item M-x emerge-buffers
52@findex emerge-buffers
53Merge two buffers.
54
55@item M-x emerge-buffers-with-ancestor
56@findex emerge-buffers-with-ancestor
57Merge two buffers with reference to a common ancestor in a third
58buffer.
59@end table
60
61@cindex merge buffer (Emerge)
62@cindex A and B buffers (Emerge)
63 The Emerge commands compare two files or buffers, and display the
64comparison in three buffers: one for each input text (the @dfn{A buffer}
65and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging
66takes place. The merge buffer shows the full merged text, not just the
67differences. Wherever the two input texts differ, you can choose which
68one of them to include in the merge buffer.
69
70 The Emerge commands that take input from existing buffers use only
71the accessible portions of those buffers, if they are narrowed.
72@iftex
73@xref{Narrowing,,, emacs, the Emacs Manual}.
74@end iftex
75@ifnottex
76@xref{Narrowing}.
77@end ifnottex
78
79
80 If a common ancestor version is available, from which the two texts to
81be merged were both derived, Emerge can use it to guess which
82alternative is right. Wherever one current version agrees with the
83ancestor, Emerge presumes that the other current version is a deliberate
84change which should be kept in the merged version. Use the
85@samp{with-ancestor} commands if you want to specify a common ancestor
86text. These commands read three file or buffer names---variant A,
87variant B, and the common ancestor.
88
89 After the comparison is done and the buffers are prepared, the
90interactive merging starts. You control the merging by typing special
91@dfn{merge commands} in the merge buffer (@pxref{Merge Commands}).
92For each run of differences between the input texts, you can choose
93which one of them to keep, or edit them both together.
94
95 The merge buffer uses a special major mode, Emerge mode, with commands
96for making these choices. But you can also edit the buffer with
97ordinary Emacs commands.
98
99 At any given time, the attention of Emerge is focused on one
100particular difference, called the @dfn{selected} difference. This
101difference is marked off in the three buffers like this:
102
103@example
104vvvvvvvvvvvvvvvvvvvv
105@var{text that differs}
106^^^^^^^^^^^^^^^^^^^^
107@end example
108
109@noindent
110Emerge numbers all the differences sequentially and the mode
111line always shows the number of the selected difference.
112
113 Normally, the merge buffer starts out with the A version of the text.
114But when the A version of a difference agrees with the common ancestor,
115then the B version is initially preferred for that difference.
116
117 Emerge leaves the merged text in the merge buffer when you exit. At
118that point, you can save it in a file with @kbd{C-x C-w}. If you give a
119numeric argument to @code{emerge-files} or
120@code{emerge-files-with-ancestor}, it reads the name of the output file
121using the minibuffer. (This is the last file name those commands read.)
122Then exiting from Emerge saves the merged text in the output file.
123
124 Normally, Emerge commands save the output buffer in its file when you
125exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not
126save the output buffer, but you can save it yourself if you wish.
127
128@node Submodes of Emerge
129@subsection Submodes of Emerge
130
131 You can choose between two modes for giving merge commands: Fast mode
132and Edit mode. In Fast mode, basic merge commands are single
133characters, but ordinary Emacs commands are disabled. This is
134convenient if you use only merge commands. In Edit mode, all merge
135commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs
136commands are also available. This allows editing the merge buffer, but
137slows down Emerge operations.
138
139 Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to
140Fast mode. The mode line indicates Edit and Fast modes with @samp{E}
141and @samp{F}.
142
143 Emerge has two additional submodes that affect how particular merge
144commands work: Auto Advance mode and Skip Prefers mode.
145
146 If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands
147advance to the next difference. This lets you go through the merge
148faster as long as you simply choose one of the alternatives from the
149input. The mode line indicates Auto Advance mode with @samp{A}.
150
151 If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands
152skip over differences in states prefer-A and prefer-B (@pxref{State of
153Difference}). Thus you see only differences for which neither version
154is presumed ``correct.'' The mode line indicates Skip Prefers mode with
155@samp{S}.
156
157@findex emerge-auto-advance-mode
158@findex emerge-skip-prefers-mode
159 Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or
160clear Auto Advance mode. Use @kbd{s s}
161(@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode.
162These commands turn on the mode with a positive argument, turns it off
163with a negative or zero argument, and toggle the mode with no argument.
164
165@node State of Difference
166@subsection State of a Difference
167
168 In the merge buffer, a difference is marked with lines of @samp{v} and
169@samp{^} characters. Each difference has one of these seven states:
170
171@table @asis
172@item A
173The difference is showing the A version. The @kbd{a} command always
174produces this state; the mode line indicates it with @samp{A}.
175
176@item B
177The difference is showing the B version. The @kbd{b} command always
178produces this state; the mode line indicates it with @samp{B}.
179
180@item default-A
181@itemx default-B
182The difference is showing the A or the B state by default, because you
183haven't made a choice. All differences start in the default-A state
184(and thus the merge buffer is a copy of the A buffer), except those for
185which one alternative is ``preferred'' (see below).
186
187When you select a difference, its state changes from default-A or
188default-B to plain A or B. Thus, the selected difference never has
189state default-A or default-B, and these states are never displayed in
190the mode line.
191
192The command @kbd{d a} chooses default-A as the default state, and @kbd{d
193b} chooses default-B. This chosen default applies to all differences
194which you haven't ever selected and for which no alternative is preferred.
195If you are moving through the merge sequentially, the differences you
196haven't selected are those following the selected one. Thus, while
197moving sequentially, you can effectively make the A version the default
198for some sections of the merge buffer and the B version the default for
199others by using @kbd{d a} and @kbd{d b} between sections.
200
201@item prefer-A
202@itemx prefer-B
203The difference is showing the A or B state because it is
204@dfn{preferred}. This means that you haven't made an explicit choice,
205but one alternative seems likely to be right because the other
206alternative agrees with the common ancestor. Thus, where the A buffer
207agrees with the common ancestor, the B version is preferred, because
208chances are it is the one that was actually changed.
209
210These two states are displayed in the mode line as @samp{A*} and @samp{B*}.
211
212@item combined
213The difference is showing a combination of the A and B states, as a
214result of the @kbd{x c} or @kbd{x C} commands.
215
216Once a difference is in this state, the @kbd{a} and @kbd{b} commands
217don't do anything to it unless you give them a numeric argument.
218
219The mode line displays this state as @samp{comb}.
220@end table
221
222@node Merge Commands
223@subsection Merge Commands
224
225 Here are the Merge commands for Fast mode; in Edit mode, precede them
226with @kbd{C-c C-c}:
227
228@table @kbd
229@item p
230Select the previous difference.
231
232@item n
233Select the next difference.
234
235@item a
236Choose the A version of this difference.
237
238@item b
239Choose the B version of this difference.
240
241@item C-u @var{n} j
242Select difference number @var{n}.
243
244@item .
245Select the difference containing point. You can use this command in the
246merge buffer or in the A or B buffer.
247
248@item q
249Quit---finish the merge.
250
251@item C-]
252Abort---exit merging and do not save the output.
253
254@item f
255Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.)
256
257@item e
258Go into Edit mode.
259
260@item l
261Recenter (like @kbd{C-l}) all three windows.
262
263@item -
264Specify part of a prefix numeric argument.
265
266@item @var{digit}
267Also specify part of a prefix numeric argument.
268
269@item d a
270Choose the A version as the default from here down in
271the merge buffer.
272
273@item d b
274Choose the B version as the default from here down in
275the merge buffer.
276
277@item c a
278Copy the A version of this difference into the kill ring.
279
280@item c b
281Copy the B version of this difference into the kill ring.
282
283@item i a
284Insert the A version of this difference at point.
285
286@item i b
287Insert the B version of this difference at point.
288
289@item m
290Put point and mark around the difference.
291
292@item ^
293Scroll all three windows down (like @kbd{M-v}).
294
295@item v
296Scroll all three windows up (like @kbd{C-v}).
297
298@item <
299Scroll all three windows left (like @kbd{C-x <}).
300
301@item >
302Scroll all three windows right (like @kbd{C-x >}).
303
304@item |
305Reset horizontal scroll on all three windows.
306
307@item x 1
308Shrink the merge window to one line. (Use @kbd{C-u l} to restore it
309to full size.)
310
311@item x c
312Combine the two versions of this difference (@pxref{Combining in
313Emerge}).
314
315@item x f
316Show the names of the files/buffers Emerge is operating on, in a Help
317window. (Use @kbd{C-u l} to restore windows.)
318
319@item x j
320Join this difference with the following one.
321(@kbd{C-u x j} joins this difference with the previous one.)
322
323@item x s
324Split this difference into two differences. Before you use this
325command, position point in each of the three buffers at the place where
326you want to split the difference.
327
328@item x t
329Trim identical lines off the top and bottom of the difference.
330Such lines occur when the A and B versions are
331identical but differ from the ancestor version.
332@end table
333
334@node Exiting Emerge
335@subsection Exiting Emerge
336
337 The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing
338the results into the output file if you specified one. It restores the
339A and B buffers to their proper contents, or kills them if they were
340created by Emerge and you haven't changed them. It also disables the
341Emerge commands in the merge buffer, since executing them later could
342damage the contents of the various buffers.
343
344 @kbd{C-]} aborts the merge. This means exiting without writing the
345output file. If you didn't specify an output file, then there is no
346real difference between aborting and finishing the merge.
347
348 If the Emerge command was called from another Lisp program, then its
349return value is @code{t} for successful completion, or @code{nil} if you
350abort.
351
352@node Combining in Emerge
353@subsection Combining the Two Versions
354
355 Sometimes you want to keep @emph{both} alternatives for a particular
356difference. To do this, use @kbd{x c}, which edits the merge buffer
357like this:
358
359@example
360@group
361#ifdef NEW
362@var{version from A buffer}
363#else /* not NEW */
364@var{version from B buffer}
365#endif /* not NEW */
366@end group
367@end example
368
369@noindent
370@vindex emerge-combine-versions-template
371While this example shows C preprocessor conditionals delimiting the two
372alternative versions, you can specify the strings to use by setting
373the variable @code{emerge-combine-versions-template} to a string of your
374choice. In the string, @samp{%a} says where to put version A, and
375@samp{%b} says where to put version B. The default setting, which
376produces the results shown above, looks like this:
377
378@example
379@group
380"#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n"
381@end group
382@end example
383
384@node Fine Points of Emerge
385@subsection Fine Points of Emerge
386
387 During the merge, you mustn't try to edit the A and B buffers yourself.
388Emerge modifies them temporarily, but ultimately puts them back the way
389they were.
390
391 You can have any number of merges going at once---just don't use any one
392buffer as input to more than one merge at once, since the temporary
393changes made in these buffers would get in each other's way.
394
395 Starting Emerge can take a long time because it needs to compare the
396files fully. Emacs can't do anything else until @code{diff} finishes.
397Perhaps in the future someone will change Emerge to do the comparison in
398the background when the input files are large---then you could keep on
399doing other things with Emacs until Emerge is ready to accept
400commands.
401
402@vindex emerge-startup-hook
403 After setting up the merge, Emerge runs the hook
404@code{emerge-startup-hook}.
405@iftex
406@xref{Hooks,,, emacs, the Emacs Manual}.
407@end iftex
408@ifnottex
409@xref{Hooks}.
410@end ifnottex
411
412@ignore
413 arch-tag: cda63f09-9c5f-4ea1-adb9-4a820fdfb24e
414@end ignore
diff --git a/doc/emacs/entering.texi b/doc/emacs/entering.texi
new file mode 100644
index 00000000000..e338a6a8619
--- /dev/null
+++ b/doc/emacs/entering.texi
@@ -0,0 +1,170 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 2001, 2002, 2003,
3@c 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Entering Emacs, Exiting, Text Characters, Top
6@chapter Entering and Exiting Emacs
7@cindex entering Emacs
8@cindex starting Emacs
9
10 The usual way to invoke Emacs is with the shell command
11@command{emacs}. Emacs clears the screen, then displays an initial
12help message and copyright notice. Some operating systems discard
13your type-ahead when Emacs starts up; they give Emacs no way to
14prevent this. On those systems, wait for Emacs to clear the screen
15before you start typing.
16
17 From a shell window under the X Window System, run Emacs in the
18background with @command{emacs&}. This way, Emacs won't tie up the
19shell window, so you can use it to run other shell commands while
20Emacs is running. You can type Emacs commands as soon as you direct
21your keyboard input to an Emacs frame.
22
23@vindex initial-major-mode
24 When Emacs starts up, it creates a buffer named @samp{*scratch*}.
25That's the buffer you start out in. The @samp{*scratch*} buffer uses
26Lisp Interaction mode; you can use it to type Lisp expressions and
27evaluate them. You can also ignore that capability and just write notes
28there. You can specify a different major mode for this buffer by
29setting the variable @code{initial-major-mode} in your init file.
30@xref{Init File}.
31
32 It is possible to specify files to be visited, Lisp files to be
33loaded, and functions to be called through Emacs command-line
34arguments. @xref{Emacs Invocation}. The feature exists mainly for
35compatibility with other editors, and for scripts.
36
37 Many editors are designed to edit one file. When done with that
38file, you exit the editor. The next time you want to edit a file, you
39must start the editor again. Working this way, it is convenient to
40use a command-line argument to say which file to edit.
41
42 However, killing Emacs after editing one each and starting it afresh
43for the next file is both unnecessary and harmful, since it denies you
44the full power of Emacs. Emacs can visit more than one file in a
45single editing session, and that is the right way to use it. Exiting
46the Emacs session loses valuable accumulated context, such as the kill
47ring, registers, undo history, and mark ring. These features are
48useful for operating on multiple files, or even continuing to edit one
49file. If you kill Emacs after each file, you don't take advantage of
50them.
51
52 The recommended way to use GNU Emacs is to start it only once, just
53after you log in, and do all your editing in the same Emacs session.
54Each time you edit a file, you visit it with the existing Emacs, which
55eventually has many files in it ready for editing. Usually you do not
56kill Emacs until you are about to log out. @xref{Files}, for more
57information on visiting more than one file.
58
59 To edit a file from another program while Emacs is running, you can
60use the @command{emacsclient} helper program to open a file in the
61already running Emacs. @xref{Emacs Server}.
62
63@ifnottex
64@raisesections
65@end ifnottex
66
67@node Exiting, Basic, Entering Emacs, Top
68@section Exiting Emacs
69@cindex exiting
70@cindex killing Emacs
71@cindex suspending
72@cindex leaving Emacs
73@cindex quitting Emacs
74
75 There are two commands for exiting Emacs, and three kinds of
76exiting: @dfn{iconifying} Emacs, @dfn{suspending} Emacs, and
77@dfn{killing} Emacs.
78
79 @dfn{Iconifying} means replacing the Emacs frame with a small box or
80``icon'' on the screen. This is the usual way to exit Emacs when
81you're using a graphical display---if you bother to ``exit'' at all.
82(Just switching to another application is usually sufficient.)
83
84 @dfn{Suspending} means stopping Emacs temporarily and returning
85control to its parent process (usually a shell), allowing you to
86resume editing later in the same Emacs job. This is the usual way to
87exit Emacs when running it on a text terminal.
88
89 @dfn{Killing} Emacs means destroying the Emacs job. You can run Emacs
90again later, but you will get a fresh Emacs; there is no way to resume
91the same editing session after it has been killed.
92
93@table @kbd
94@item C-z
95Suspend Emacs (@code{suspend-emacs}) or iconify a frame
96(@code{iconify-or-deiconify-frame}).
97@item C-x C-c
98Kill Emacs (@code{save-buffers-kill-emacs}).
99@end table
100
101@kindex C-z
102@findex iconify-or-deiconify-frame
103 On graphical displays, @kbd{C-z} runs the command
104@code{iconify-or-deiconify-frame}, which temporarily iconifies (or
105``minimizes'') the selected Emacs frame (@pxref{Frames}). You can
106then use the window manager to select some other application. (You
107could select another application without iconifying Emacs first, but
108getting the Emacs frame out of the way can make it more convenient to
109find the other application.)
110
111@findex suspend-emacs
112 On a text terminal, @kbd{C-z} runs the command @code{suspend-emacs}.
113Suspending Emacs takes you back to the shell from which you invoked
114Emacs. You can resume Emacs with the shell command @command{%emacs}
115in most common shells. On systems that don't support suspending
116programs, @kbd{C-z} starts an inferior shell that communicates
117directly with the terminal, and Emacs waits until you exit the
118subshell. (The way to do that is probably with @kbd{C-d} or
119@command{exit}, but it depends on which shell you use.) On these
120systems, you can only get back to the shell from which Emacs was run
121(to log out, for example) when you kill Emacs.
122
123@vindex cannot-suspend
124 Suspending can fail if you run Emacs under a shell that doesn't
125support suspendion of its subjobs, even if the system itself does
126support it. In such a case, you can set the variable
127@code{cannot-suspend} to a non-@code{nil} value to force @kbd{C-z} to
128start an inferior shell.
129
130@kindex C-x C-c
131@findex save-buffers-kill-emacs
132 To exit and kill Emacs, type @kbd{C-x C-c}
133(@code{save-buffers-kill-emacs}). A two-character key is used to make
134it harder to type by accident. This command first offers to save any
135modified file-visiting buffers. If you do not save them all, it asks
136for confirmation with @kbd{yes} before killing Emacs, since any
137changes not saved now will be lost forever. Also, if any subprocesses are
138still running, @kbd{C-x C-c} asks for confirmation about them, since
139killing Emacs will also kill the subprocesses.
140
141@vindex confirm-kill-emacs
142 If the value of the variable @code{confirm-kill-emacs} is
143non-@code{nil}, @kbd{C-x C-c} assumes that its value is a predicate
144function, and calls that function. If the result is non-@code{nil}, the
145session is killed, otherwise Emacs continues to run. One convenient
146function to use as the value of @code{confirm-kill-emacs} is the
147function @code{yes-or-no-p}. The default value of
148@code{confirm-kill-emacs} is @code{nil}.
149
150 You can't resume an Emacs session after killing it. Emacs can,
151however, record certain session information when you kill it, such as
152which files you visited, so the next time you start Emacs it will try
153to visit the same files. @xref{Saving Emacs Sessions}.
154
155 The operating system usually listens for certain special characters
156whose meaning is to kill or suspend the program you are running.
157@b{This operating system feature is turned off while you are in Emacs.}
158The meanings of @kbd{C-z} and @kbd{C-x C-c} as keys in Emacs were
159inspired by the use of @kbd{C-z} and @kbd{C-c} on several operating
160systems as the characters for stopping or killing a program, but that is
161their only relationship with the operating system. You can customize
162these keys to run any commands of your choice (@pxref{Keymaps}).
163
164@ifnottex
165@lowersections
166@end ifnottex
167
168@ignore
169 arch-tag: df798d8b-f253-4113-b585-f528f078a944
170@end ignore
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
new file mode 100644
index 00000000000..7ba36916684
--- /dev/null
+++ b/doc/emacs/files.texi
@@ -0,0 +1,2950 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
3@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Files, Buffers, Keyboard Macros, Top
6@chapter File Handling
7@cindex files
8
9 The operating system stores data permanently in named @dfn{files}, so
10most of the text you edit with Emacs comes from a file and is ultimately
11stored in a file.
12
13 To edit a file, you must tell Emacs to read the file and prepare a
14buffer containing a copy of the file's text. This is called
15@dfn{visiting} the file. Editing commands apply directly to text in the
16buffer; that is, to the copy inside Emacs. Your changes appear in the
17file itself only when you @dfn{save} the buffer back into the file.
18
19 In addition to visiting and saving files, Emacs can delete, copy,
20rename, and append to files, keep multiple versions of them, and operate
21on file directories.
22
23@menu
24* File Names:: How to type and edit file-name arguments.
25* Visiting:: Visiting a file prepares Emacs to edit the file.
26* Saving:: Saving makes your changes permanent.
27* Reverting:: Reverting cancels all the changes not saved.
28@ifnottex
29* Autorevert:: Auto Reverting non-file buffers.
30@end ifnottex
31* Auto Save:: Auto Save periodically protects against loss of data.
32* File Aliases:: Handling multiple names for one file.
33* Version Control:: Version control systems (RCS, CVS and SCCS).
34* Directories:: Creating, deleting, and listing file directories.
35* Comparing Files:: Finding where two files differ.
36* Diff Mode:: Mode for editing file differences.
37* Misc File Ops:: Other things you can do on files.
38* Compressed Files:: Accessing compressed files.
39* File Archives:: Operating on tar, zip, jar etc. archive files.
40* Remote Files:: Accessing files on other sites.
41* Quoted File Names:: Quoting special characters in file names.
42* File Name Cache:: Completion against a list of files you often use.
43* File Conveniences:: Convenience Features for Finding Files.
44* Filesets:: Handling sets of files.
45@end menu
46
47@node File Names
48@section File Names
49@cindex file names
50
51 Most Emacs commands that operate on a file require you to specify the
52file name. (Saving and reverting are exceptions; the buffer knows which
53file name to use for them.) You enter the file name using the
54minibuffer (@pxref{Minibuffer}). @dfn{Completion} is available
55(@pxref{Completion}) to make it easier to specify long file names. When
56completing file names, Emacs ignores those whose file-name extensions
57appear in the variable @code{completion-ignored-extensions}; see
58@ref{Completion Options}.
59
60 For most operations, there is a @dfn{default file name} which is used
61if you type just @key{RET} to enter an empty argument. Normally the
62default file name is the name of the file visited in the current buffer;
63this makes it easy to operate on that file with any of the Emacs file
64commands.
65
66@vindex default-directory
67 Each buffer has a default directory which is normally the same as the
68directory of the file visited in that buffer. When you enter a file
69name without a directory, the default directory is used. If you specify
70a directory in a relative fashion, with a name that does not start with
71a slash, it is interpreted with respect to the default directory. The
72default directory is kept in the variable @code{default-directory},
73which has a separate value in every buffer.
74
75@findex cd
76@findex pwd
77 The command @kbd{M-x pwd} displays the current buffer's default
78directory, and the command @kbd{M-x cd} sets it (to a value read using
79the minibuffer). A buffer's default directory changes only when the
80@code{cd} command is used. A file-visiting buffer's default directory
81is initialized to the directory of the file it visits. If you create
82a buffer with @kbd{C-x b}, its default directory is copied from that
83of the buffer that was current at the time.
84
85 For example, if the default file name is @file{/u/rms/gnu/gnu.tasks}
86then the default directory is normally @file{/u/rms/gnu/}. If you
87type just @samp{foo}, which does not specify a directory, it is short
88for @file{/u/rms/gnu/foo}. @samp{../.login} would stand for
89@file{/u/rms/.login}. @samp{new/foo} would stand for the file name
90@file{/u/rms/gnu/new/foo}.
91
92@vindex insert-default-directory
93 The default directory actually appears in the minibuffer when the
94minibuffer becomes active to read a file name. This serves two
95purposes: it @emph{shows} you what the default is, so that you can type
96a relative file name and know with certainty what it will mean, and it
97allows you to @emph{edit} the default to specify a different directory.
98This insertion of the default directory is inhibited if the variable
99@code{insert-default-directory} is set to @code{nil}.
100
101 Note that it is legitimate to type an absolute file name after you
102enter the minibuffer, ignoring the presence of the default directory
103name as part of the text. The final minibuffer contents may look
104invalid, but that is not so. For example, if the minibuffer starts out
105with @samp{/usr/tmp/} and you add @samp{/x1/rms/foo}, you get
106@samp{/usr/tmp//x1/rms/foo}; but Emacs ignores everything through the
107first slash in the double slash; the result is @samp{/x1/rms/foo}.
108@xref{Minibuffer File}.
109
110@cindex home directory shorthand
111 You can use @file{~/} in a file name to mean your home directory,
112or @file{~@var{user-id}/} to mean the home directory of a user whose
113login name is @code{user-id}@footnote{
114On MS-Windows and MS-DOS systems, where a user doesn't have a home
115directory, Emacs replaces @file{~/} with the value of the
116environment variable @code{HOME}; see @ref{General Variables}. On
117these systems, the @file{~@var{user-id}/} construct is supported only
118for the current user, i.e., only if @var{user-id} is the current
119user's login name.}.
120
121@cindex environment variables in file names
122@cindex expansion of environment variables
123@cindex @code{$} in file names
124 @anchor{File Names with $}@samp{$} in a file name is used to
125substitute an environment variable. The environment variable name
126consists of all the alphanumeric characters after the @samp{$};
127alternatively, it can be enclosed in braces after the @samp{$}. For
128example, if you have used the shell command @command{export
129FOO=rms/hacks} to set up an environment variable named @env{FOO}, then
130you can use @file{/u/$FOO/test.c} or @file{/u/$@{FOO@}/test.c} as an
131abbreviation for @file{/u/rms/hacks/test.c}. If the environment
132variable is not defined, no substitution occurs: @file{/u/$notdefined}
133stands for itself (assuming the environment variable @env{notdefined}
134is not defined).
135
136 Note that shell commands to set environment variables affect Emacs
137only when done before Emacs is started.
138
139 To access a file with @samp{$} in its name, if the @samp{$} causes
140expansion, type @samp{$$}. This pair is converted to a single
141@samp{$} at the same time as variable substitution is performed for a
142single @samp{$}. Alternatively, quote the whole file name with
143@samp{/:} (@pxref{Quoted File Names}). File names which begin with a
144literal @samp{~} should also be quoted with @samp{/:}.
145
146@findex substitute-in-file-name
147 The Lisp function that performs the @samp{$}-substitution is called
148@code{substitute-in-file-name}. The substitution is performed only on
149file names read as such using the minibuffer.
150
151 You can include non-@acronym{ASCII} characters in file names if you set the
152variable @code{file-name-coding-system} to a non-@code{nil} value.
153@xref{File Name Coding}.
154
155@node Visiting
156@section Visiting Files
157@cindex visiting files
158@cindex open file
159
160@table @kbd
161@item C-x C-f
162Visit a file (@code{find-file}).
163@item C-x C-r
164Visit a file for viewing, without allowing changes to it
165(@code{find-file-read-only}).
166@item C-x C-v
167Visit a different file instead of the one visited last
168(@code{find-alternate-file}).
169@item C-x 4 f
170Visit a file, in another window (@code{find-file-other-window}). Don't
171alter what is displayed in the selected window.
172@item C-x 5 f
173Visit a file, in a new frame (@code{find-file-other-frame}). Don't
174alter what is displayed in the selected frame.
175@item M-x find-file-literally
176Visit a file with no conversion of the contents.
177@end table
178
179@cindex files, visiting and saving
180@cindex saving files
181 @dfn{Visiting} a file means reading its contents into an Emacs
182buffer so you can edit them. Emacs makes a new buffer for each file
183that you visit. We often say that this buffer ``is visiting'' that
184file, or that the buffer's ``visited file'' is that file. Emacs
185constructs the buffer name from the file name by throwing away the
186directory, keeping just the name proper. For example, a file named
187@file{/usr/rms/emacs.tex} would get a buffer named @samp{emacs.tex}.
188If there is already a buffer with that name, Emacs constructs a unique
189name---the normal method is to append @samp{<2>}, @samp{<3>}, and so
190on, but you can select other methods (@pxref{Uniquify}).
191
192 Each window's mode line shows the name of the buffer that is being displayed
193in that window, so you can always tell what buffer you are editing.
194
195 The changes you make with editing commands are made in the Emacs
196buffer. They do not take effect in the file that you visited, or any
197permanent place, until you @dfn{save} the buffer. Saving the buffer
198means that Emacs writes the current contents of the buffer into its
199visited file. @xref{Saving}.
200
201@cindex modified (buffer)
202 If a buffer contains changes that have not been saved, we say the
203buffer is @dfn{modified}. This is important because it implies that
204some changes will be lost if the buffer is not saved. The mode line
205displays two stars near the left margin to indicate that the buffer is
206modified.
207
208@kindex C-x C-f
209@findex find-file
210 To visit a file, use the command @kbd{C-x C-f} (@code{find-file}). Follow
211the command with the name of the file you wish to visit, terminated by a
212@key{RET}.
213
214 The file name is read using the minibuffer (@pxref{Minibuffer}), with
215defaulting and completion in the standard manner (@pxref{File Names}).
216While in the minibuffer, you can abort @kbd{C-x C-f} by typing
217@kbd{C-g}. File-name completion ignores certain file names; for more
218about this, see @ref{Completion Options}.
219
220 Your confirmation that @kbd{C-x C-f} has completed successfully is
221the appearance of new text on the screen and a new buffer name in the
222mode line. If the specified file does not exist and you could not
223create it, or exists but you can't read it, then you get an error,
224with an error message displayed in the echo area.
225
226 If you visit a file that is already in Emacs, @kbd{C-x C-f} does not make
227another copy. It selects the existing buffer containing that file.
228However, before doing so, it checks whether the file itself has changed
229since you visited or saved it last. If the file has changed, Emacs offers
230to reread it.
231
232@vindex large-file-warning-threshold
233@cindex maximum buffer size exceeded, error message
234 If you try to visit a file larger than
235@code{large-file-warning-threshold} (the default is 10000000, which is
236about 10 megabytes), Emacs will ask you for confirmation first. You
237can answer @kbd{y} to proceed with visiting the file. Note, however,
238that Emacs cannot visit files that are larger than the maximum Emacs
239buffer size, which is around 256 megabytes on 32-bit machines
240(@pxref{Buffers}). If you try, Emacs will display an error message
241saying that the maximum buffer size has been exceeded.
242
243@cindex file selection dialog
244 On graphical displays there are two additional methods for
245visiting files. Firstly, when Emacs is built with a suitable GUI
246toolkit, commands invoked with the mouse (by clicking on the menu bar
247or tool bar) use the toolkit's standard File Selection dialog instead
248of prompting for the file name in the minibuffer. On Unix and
249GNU/Linux platforms, Emacs does that when built with GTK, LessTif, and
250Motif toolkits; on MS-Windows and Mac, the GUI version does that by default.
251For information on how to customize this, see @ref{Dialog Boxes}.
252
253 Secondly, Emacs supports ``drag and drop''; dropping a file into an
254ordinary Emacs window visits the file using that window. However,
255dropping a file into a window displaying a Dired buffer moves or
256copies the file into the displayed directory. For details, see
257@ref{Drag and Drop}, and @ref{Misc Dired Features}.
258
259@cindex creating files
260 What if you want to create a new file? Just visit it. Emacs displays
261@samp{(New file)} in the echo area, but in other respects behaves as if
262you had visited an existing empty file. If you make any changes and
263save them, the file is created.
264
265 Emacs recognizes from the contents of a file which end-of-line
266convention it uses to separate lines---newline (used on GNU/Linux and
267on Unix), carriage-return linefeed (used on Microsoft systems), or
268just carriage-return (used on the Macintosh)---and automatically
269converts the contents to the normal Emacs convention, which is that
270the newline character separates lines. This is a part of the general
271feature of coding system conversion (@pxref{Coding Systems}), and
272makes it possible to edit files imported from different operating
273systems with equal convenience. If you change the text and save the
274file, Emacs performs the inverse conversion, changing newlines back
275into carriage-return linefeed or just carriage-return if appropriate.
276
277@vindex find-file-run-dired
278 If the file you specify is actually a directory, @kbd{C-x C-f} invokes
279Dired, the Emacs directory browser, so that you can ``edit'' the contents
280of the directory (@pxref{Dired}). Dired is a convenient way to view, delete,
281or operate on the files in the directory. However, if the variable
282@code{find-file-run-dired} is @code{nil}, then it is an error to try
283to visit a directory.
284
285 Files which are actually collections of other files, or @dfn{file
286archives}, are visited in special modes which invoke a Dired-like
287environment to allow operations on archive members. @xref{File
288Archives}, for more about these features.
289
290@cindex wildcard characters in file names
291@vindex find-file-wildcards
292 If the file name you specify contains shell-style wildcard
293characters, Emacs visits all the files that match it. (On
294case-insensitive filesystems, Emacs matches the wildcards disregarding
295the letter case.) Wildcards include @samp{?}, @samp{*}, and
296@samp{[@dots{}]} sequences. To enter the wild card @samp{?} in a file
297name in the minibuffer, you need to type @kbd{C-q ?}. @xref{Quoted
298File Names}, for information on how to visit a file whose name
299actually contains wildcard characters. You can disable the wildcard
300feature by customizing @code{find-file-wildcards}.
301
302 If you visit a file that the operating system won't let you modify,
303or that is marked read-only, Emacs makes the buffer read-only too, so
304that you won't go ahead and make changes that you'll have trouble
305saving afterward. You can make the buffer writable with @kbd{C-x C-q}
306(@code{toggle-read-only}). @xref{Misc Buffer}.
307
308@kindex C-x C-r
309@findex find-file-read-only
310 If you want to visit a file as read-only in order to protect
311yourself from entering changes accidentally, visit it with the command
312@kbd{C-x C-r} (@code{find-file-read-only}) instead of @kbd{C-x C-f}.
313
314@kindex C-x C-v
315@findex find-alternate-file
316 If you visit a nonexistent file unintentionally (because you typed the
317wrong file name), use the @kbd{C-x C-v} command
318(@code{find-alternate-file}) to visit the file you really wanted.
319@kbd{C-x C-v} is similar to @kbd{C-x C-f}, but it kills the current
320buffer (after first offering to save it if it is modified). When
321@kbd{C-x C-v} reads the file name to visit, it inserts the entire
322default file name in the buffer, with point just after the directory
323part; this is convenient if you made a slight error in typing the name.
324
325@kindex C-x 4 f
326@findex find-file-other-window
327 @kbd{C-x 4 f} (@code{find-file-other-window}) is like @kbd{C-x C-f}
328except that the buffer containing the specified file is selected in another
329window. The window that was selected before @kbd{C-x 4 f} continues to
330show the same buffer it was already showing. If this command is used when
331only one window is being displayed, that window is split in two, with one
332window showing the same buffer as before, and the other one showing the
333newly requested file. @xref{Windows}.
334
335@kindex C-x 5 f
336@findex find-file-other-frame
337 @kbd{C-x 5 f} (@code{find-file-other-frame}) is similar, but opens a
338new frame, or makes visible any existing frame showing the file you
339seek. This feature is available only when you are using a window
340system. @xref{Frames}.
341
342@findex find-file-literally
343 If you wish to edit a file as a sequence of @acronym{ASCII} characters with no special
344encoding or conversion, use the @kbd{M-x find-file-literally} command.
345It visits a file, like @kbd{C-x C-f}, but does not do format conversion
346(@pxref{Formatted Text}), character code conversion (@pxref{Coding
347Systems}), or automatic uncompression (@pxref{Compressed Files}), and
348does not add a final newline because of @code{require-final-newline}.
349If you already have visited the same file in the usual (non-literal)
350manner, this command asks you whether to visit it literally instead.
351
352@vindex find-file-hook
353@vindex find-file-not-found-functions
354 Two special hook variables allow extensions to modify the operation of
355visiting files. Visiting a file that does not exist runs the functions
356in the list @code{find-file-not-found-functions}; this variable holds a list
357of functions, and the functions are called one by one (with no
358arguments) until one of them returns non-@code{nil}. This is not a
359normal hook, and the name ends in @samp{-functions} rather than @samp{-hook}
360to indicate that fact.
361
362 Successful visiting of any file, whether existing or not, calls the
363functions in the list @code{find-file-hook}, with no arguments.
364This variable is a normal hook. In the case of a nonexistent file, the
365@code{find-file-not-found-functions} are run first. @xref{Hooks}.
366
367 There are several ways to specify automatically the major mode for
368editing the file (@pxref{Choosing Modes}), and to specify local
369variables defined for that file (@pxref{File Variables}).
370
371@node Saving
372@section Saving Files
373
374 @dfn{Saving} a buffer in Emacs means writing its contents back into the file
375that was visited in the buffer.
376
377@menu
378* Save Commands:: Commands for saving files.
379* Backup:: How Emacs saves the old version of your file.
380* Customize Save:: Customizing the saving of files.
381* Interlocking:: How Emacs protects against simultaneous editing
382 of one file by two users.
383* Shadowing: File Shadowing. Copying files to "shadows" automatically.
384* Time Stamps:: Emacs can update time stamps on saved files.
385@end menu
386
387@node Save Commands
388@subsection Commands for Saving Files
389
390 These are the commands that relate to saving and writing files.
391
392@table @kbd
393@item C-x C-s
394Save the current buffer in its visited file on disk (@code{save-buffer}).
395@item C-x s
396Save any or all buffers in their visited files (@code{save-some-buffers}).
397@item M-~
398Forget that the current buffer has been changed (@code{not-modified}).
399With prefix argument (@kbd{C-u}), mark the current buffer as changed.
400@item C-x C-w
401Save the current buffer with a specified file name (@code{write-file}).
402@item M-x set-visited-file-name
403Change the file name under which the current buffer will be saved.
404@end table
405
406@kindex C-x C-s
407@findex save-buffer
408 When you wish to save the file and make your changes permanent, type
409@kbd{C-x C-s} (@code{save-buffer}). After saving is finished, @kbd{C-x C-s}
410displays a message like this:
411
412@example
413Wrote /u/rms/gnu/gnu.tasks
414@end example
415
416@noindent
417If the selected buffer is not modified (no changes have been made in it
418since the buffer was created or last saved), saving is not really done,
419because it would have no effect. Instead, @kbd{C-x C-s} displays a message
420like this in the echo area:
421
422@example
423(No changes need to be saved)
424@end example
425
426@kindex C-x s
427@findex save-some-buffers
428 The command @kbd{C-x s} (@code{save-some-buffers}) offers to save any
429or all modified buffers. It asks you what to do with each buffer. The
430possible responses are analogous to those of @code{query-replace}:
431
432@table @kbd
433@item y
434Save this buffer and ask about the rest of the buffers.
435@item n
436Don't save this buffer, but ask about the rest of the buffers.
437@item !
438Save this buffer and all the rest with no more questions.
439@c following generates acceptable underfull hbox
440@item @key{RET}
441Terminate @code{save-some-buffers} without any more saving.
442@item .
443Save this buffer, then exit @code{save-some-buffers} without even asking
444about other buffers.
445@item C-r
446View the buffer that you are currently being asked about. When you exit
447View mode, you get back to @code{save-some-buffers}, which asks the
448question again.
449@item d
450Diff the buffer against its corresponding file, so you can see
451what changes you would be saving.
452@item C-h
453Display a help message about these options.
454@end table
455
456 @kbd{C-x C-c}, the key sequence to exit Emacs, invokes
457@code{save-some-buffers} and therefore asks the same questions.
458
459@kindex M-~
460@findex not-modified
461 If you have changed a buffer but you do not want to save the changes,
462you should take some action to prevent it. Otherwise, each time you use
463@kbd{C-x s} or @kbd{C-x C-c}, you are liable to save this buffer by
464mistake. One thing you can do is type @kbd{M-~} (@code{not-modified}),
465which clears out the indication that the buffer is modified. If you do
466this, none of the save commands will believe that the buffer needs to be
467saved. (@samp{~} is often used as a mathematical symbol for `not'; thus
468@kbd{M-~} is `not', metafied.) You could also use
469@code{set-visited-file-name} (see below) to mark the buffer as visiting
470a different file name, one which is not in use for anything important.
471Alternatively, you can cancel all the changes made since the file was
472visited or saved, by reading the text from the file again. This is
473called @dfn{reverting}. @xref{Reverting}. (You could also undo all the
474changes by repeating the undo command @kbd{C-x u} until you have undone
475all the changes; but reverting is easier.) You can also kill the buffer.
476
477@findex set-visited-file-name
478 @kbd{M-x set-visited-file-name} alters the name of the file that the
479current buffer is visiting. It reads the new file name using the
480minibuffer. Then it marks the buffer as visiting that file name, and
481changes the buffer name correspondingly. @code{set-visited-file-name}
482does not save the buffer in the newly visited file; it just alters the
483records inside Emacs in case you do save later. It also marks the
484buffer as ``modified'' so that @kbd{C-x C-s} in that buffer
485@emph{will} save.
486
487@kindex C-x C-w
488@findex write-file
489 If you wish to mark the buffer as visiting a different file and save it
490right away, use @kbd{C-x C-w} (@code{write-file}). It is
491equivalent to @code{set-visited-file-name} followed by @kbd{C-x C-s}
492(except that @kbd{C-x C-w} asks for confirmation if the file exists).
493@kbd{C-x C-s} used on a buffer that is not visiting a file has the
494same effect as @kbd{C-x C-w}; that is, it reads a file name, marks the
495buffer as visiting that file, and saves it there. The default file name in
496a buffer that is not visiting a file is made by combining the buffer name
497with the buffer's default directory (@pxref{File Names}).
498
499 If the new file name implies a major mode, then @kbd{C-x C-w} switches
500to that major mode, in most cases. The command
501@code{set-visited-file-name} also does this. @xref{Choosing Modes}.
502
503 If Emacs is about to save a file and sees that the date of the latest
504version on disk does not match what Emacs last read or wrote, Emacs
505notifies you of this fact, because it probably indicates a problem caused
506by simultaneous editing and requires your immediate attention.
507@xref{Interlocking,, Simultaneous Editing}.
508
509@node Backup
510@subsection Backup Files
511@cindex backup file
512@vindex make-backup-files
513@vindex vc-make-backup-files
514
515 On most operating systems, rewriting a file automatically destroys all
516record of what the file used to contain. Thus, saving a file from Emacs
517throws away the old contents of the file---or it would, except that
518Emacs carefully copies the old contents to another file, called the
519@dfn{backup} file, before actually saving.
520
521 For most files, the variable @code{make-backup-files} determines
522whether to make backup files. On most operating systems, its default
523value is @code{t}, so that Emacs does write backup files.
524
525 For files managed by a version control system (@pxref{Version
526Control}), the variable @code{vc-make-backup-files} determines whether
527to make backup files. By default it is @code{nil}, since backup files
528are redundant when you store all the previous versions in a version
529control system.
530@iftex
531@xref{General VC Options,,,emacs-xtra, Specialized Emacs Features}.
532@end iftex
533@ifnottex
534@xref{General VC Options}.
535@end ifnottex
536
537
538 At your option, Emacs can keep either a single backup for each file,
539or make a series of numbered backup files for each file that you edit.
540
541@vindex backup-enable-predicate
542@vindex temporary-file-directory
543@vindex small-temporary-file-directory
544 The default value of the @code{backup-enable-predicate} variable
545prevents backup files being written for files in the directories used
546for temporary files, specified by @code{temporary-file-directory} or
547@code{small-temporary-file-directory}.
548
549 Emacs makes a backup for a file only the first time the file is saved
550from one buffer. No matter how many times you save a file, its backup file
551continues to contain the contents from before the file was visited.
552Normally this means that the backup file contains the contents from before
553the current editing session; however, if you kill the buffer and then visit
554the file again, a new backup file will be made by the next save.
555
556 You can also explicitly request making another backup file from a
557buffer even though it has already been saved at least once. If you save
558the buffer with @kbd{C-u C-x C-s}, the version thus saved will be made
559into a backup file if you save the buffer again. @kbd{C-u C-u C-x C-s}
560saves the buffer, but first makes the previous file contents into a new
561backup file. @kbd{C-u C-u C-u C-x C-s} does both things: it makes a
562backup from the previous contents, and arranges to make another from the
563newly saved contents if you save again.
564
565@menu
566* One or Many: Numbered Backups. Whether to make one backup file or many.
567* Names: Backup Names. How backup files are named.
568* Deletion: Backup Deletion. Emacs deletes excess numbered backups.
569* Copying: Backup Copying. Backups can be made by copying or renaming.
570@end menu
571
572@node Numbered Backups
573@subsubsection Numbered Backups
574
575@vindex version-control
576 The choice of single backup file or multiple numbered backup files
577is controlled by the variable @code{version-control}. Its possible
578values are:
579
580@table @code
581@item t
582Make numbered backups.
583@item nil
584Make numbered backups for files that have numbered backups already.
585Otherwise, make single backups.
586@item never
587Never make numbered backups; always make single backups.
588@end table
589
590@noindent
591The usual way to set this variable is globally, through your
592@file{.emacs} file or the customization buffer. However, you can set
593@code{version-control} locally in an individual buffer to control the
594making of backups for that buffer's file. For example, Rmail mode
595locally sets @code{version-control} to @code{never} to make sure that
596there is only one backup for an Rmail file. @xref{Locals}.
597
598@cindex @env{VERSION_CONTROL} environment variable
599 If you set the environment variable @env{VERSION_CONTROL}, to tell
600various GNU utilities what to do with backup files, Emacs also obeys the
601environment variable by setting the Lisp variable @code{version-control}
602accordingly at startup. If the environment variable's value is @samp{t}
603or @samp{numbered}, then @code{version-control} becomes @code{t}; if the
604value is @samp{nil} or @samp{existing}, then @code{version-control}
605becomes @code{nil}; if it is @samp{never} or @samp{simple}, then
606@code{version-control} becomes @code{never}.
607
608@node Backup Names
609@subsubsection Single or Numbered Backups
610
611 When Emacs makes a single backup file, its name is normally
612constructed by appending @samp{~} to the file name being edited; thus,
613the backup file for @file{eval.c} would be @file{eval.c~}.
614
615@vindex make-backup-file-name-function
616@vindex backup-directory-alist
617 You can change this behavior by defining the variable
618@code{make-backup-file-name-function} to a suitable function.
619Alternatively you can customize the variable
620@code{backup-directory-alist} to specify that files matching certain
621patterns should be backed up in specific directories.
622
623 A typical use is to add an element @code{("." . @var{dir})} to make
624all backups in the directory with absolute name @var{dir}; Emacs
625modifies the backup file names to avoid clashes between files with the
626same names originating in different directories. Alternatively,
627adding, say, @code{("." . ".~")} would make backups in the invisible
628subdirectory @file{.~} of the original file's directory. Emacs
629creates the directory, if necessary, to make the backup.
630
631 If access control stops Emacs from writing backup files under the usual
632names, it writes the backup file as @file{%backup%~} in your home
633directory. Only one such file can exist, so only the most recently
634made such backup is available.
635
636 If you choose to have a series of numbered backup files, backup file
637names contain @samp{.~}, the number, and another @samp{~} after the
638original file name. Thus, the backup files of @file{eval.c} would be
639called @file{eval.c.~1~}, @file{eval.c.~2~}, and so on, all the way
640through names like @file{eval.c.~259~} and beyond. The variable
641@code{backup-directory-alist} applies to numbered backups just as
642usual.
643
644@node Backup Deletion
645@subsubsection Automatic Deletion of Backups
646
647 To prevent excessive consumption of disk space, Emacs can delete numbered
648backup versions automatically. Generally Emacs keeps the first few backups
649and the latest few backups, deleting any in between. This happens every
650time a new backup is made.
651
652@vindex kept-old-versions
653@vindex kept-new-versions
654 The two variables @code{kept-old-versions} and
655@code{kept-new-versions} control this deletion. Their values are,
656respectively, the number of oldest (lowest-numbered) backups to keep
657and the number of newest (highest-numbered) ones to keep, each time a
658new backup is made. The backups in the middle (excluding those oldest
659and newest) are the excess middle versions---those backups are
660deleted. These variables' values are used when it is time to delete
661excess versions, just after a new backup version is made; the newly
662made backup is included in the count in @code{kept-new-versions}. By
663default, both variables are 2.
664
665@vindex delete-old-versions
666 If @code{delete-old-versions} is @code{t}, Emacs deletes the excess
667backup files silently. If it is @code{nil}, the default, Emacs asks
668you whether it should delete the excess backup versions. If it has
669any other value, then Emacs never automatically deletes backups.
670
671 Dired's @kbd{.} (Period) command can also be used to delete old versions.
672@xref{Dired Deletion}.
673
674@node Backup Copying
675@subsubsection Copying vs.@: Renaming
676
677 Backup files can be made by copying the old file or by renaming it.
678This makes a difference when the old file has multiple names (hard
679links). If the old file is renamed into the backup file, then the
680alternate names become names for the backup file. If the old file is
681copied instead, then the alternate names remain names for the file
682that you are editing, and the contents accessed by those names will be
683the new contents.
684
685 The method of making a backup file may also affect the file's owner
686and group. If copying is used, these do not change. If renaming is used,
687you become the file's owner, and the file's group becomes the default
688(different operating systems have different defaults for the group).
689
690 Having the owner change is usually a good idea, because then the owner
691always shows who last edited the file. Also, the owners of the backups
692show who produced those versions. Occasionally there is a file whose
693owner should not change; it is a good idea for such files to contain
694local variable lists to set @code{backup-by-copying-when-mismatch}
695locally (@pxref{File Variables}).
696
697@vindex backup-by-copying
698@vindex backup-by-copying-when-linked
699@vindex backup-by-copying-when-mismatch
700@vindex backup-by-copying-when-privileged-mismatch
701@cindex file ownership, and backup
702@cindex backup, and user-id
703 The choice of renaming or copying is controlled by four variables.
704Renaming is the default choice. If the variable
705@code{backup-by-copying} is non-@code{nil}, copying is used. Otherwise,
706if the variable @code{backup-by-copying-when-linked} is non-@code{nil},
707then copying is used for files that have multiple names, but renaming
708may still be used when the file being edited has only one name. If the
709variable @code{backup-by-copying-when-mismatch} is non-@code{nil}, then
710copying is used if renaming would cause the file's owner or group to
711change. @code{backup-by-copying-when-mismatch} is @code{t} by default
712if you start Emacs as the superuser. The fourth variable,
713@code{backup-by-copying-when-privileged-mismatch}, gives the highest
714numeric user-id for which @code{backup-by-copying-when-mismatch} will be
715forced on. This is useful when low-numbered user-ids are assigned to
716special system users, such as @code{root}, @code{bin}, @code{daemon},
717etc., which must maintain ownership of files.
718
719 When a file is managed with a version control system (@pxref{Version
720Control}), Emacs does not normally make backups in the usual way for
721that file. But check-in and check-out are similar in some ways to
722making backups. One unfortunate similarity is that these operations
723typically break hard links, disconnecting the file name you visited from
724any alternate names for the same file. This has nothing to do with
725Emacs---the version control system does it.
726
727@node Customize Save
728@subsection Customizing Saving of Files
729
730@vindex require-final-newline
731 If the value of the variable @code{require-final-newline} is
732@code{t}, saving or writing a file silently puts a newline at the end
733if there isn't already one there. If the value is @code{visit}, Emacs
734adds a newline at the end of any file that doesn't have one, just
735after it visits the file. (This marks the buffer as modified, and you
736can undo it.) If the value is @code{visit-save}, that means to add
737newlines both on visiting and on saving. If the value is @code{nil},
738Emacs leaves the end of the file unchanged; if it's neither @code{nil}
739nor @code{t}, Emacs asks you whether to add a newline. The default is
740@code{nil}.
741
742@vindex mode-require-final-newline
743 Many major modes are designed for specific kinds of files that are
744always supposed to end in newlines. These major modes set the
745variable @code{require-final-newline} according to
746@code{mode-require-final-newline}. By setting the latter variable,
747you can control how these modes handle final newlines.
748
749@vindex write-region-inhibit-fsync
750 When Emacs saves a file, it invokes the @code{fsync} system call to
751force the data immediately out to disk. This is important for safety
752if the system crashes or in case of power outage. However, it can be
753disruptive on laptops using power saving, because it requires the disk
754to spin up each time you save a file. Setting
755@code{write-region-inhibit-fsync} to a non-@code{nil} value disables
756this synchronization. Be careful---this means increased risk of data
757loss.
758
759@node Interlocking
760@subsection Protection against Simultaneous Editing
761
762@cindex file dates
763@cindex simultaneous editing
764 Simultaneous editing occurs when two users visit the same file, both
765make changes, and then both save them. If nobody were informed that
766this was happening, whichever user saved first would later find that his
767changes were lost.
768
769 On some systems, Emacs notices immediately when the second user starts
770to change the file, and issues an immediate warning. On all systems,
771Emacs checks when you save the file, and warns if you are about to
772overwrite another user's changes. You can prevent loss of the other
773user's work by taking the proper corrective action instead of saving the
774file.
775
776@findex ask-user-about-lock
777@cindex locking files
778 When you make the first modification in an Emacs buffer that is
779visiting a file, Emacs records that the file is @dfn{locked} by you.
780(It does this by creating a symbolic link in the same directory with a
781different name.) Emacs removes the lock when you save the changes. The
782idea is that the file is locked whenever an Emacs buffer visiting it has
783unsaved changes.
784
785@cindex collision
786 If you begin to modify the buffer while the visited file is locked by
787someone else, this constitutes a @dfn{collision}. When Emacs detects a
788collision, it asks you what to do, by calling the Lisp function
789@code{ask-user-about-lock}. You can redefine this function for the sake
790of customization. The standard definition of this function asks you a
791question and accepts three possible answers:
792
793@table @kbd
794@item s
795Steal the lock. Whoever was already changing the file loses the lock,
796and you gain the lock.
797@item p
798Proceed. Go ahead and edit the file despite its being locked by someone else.
799@item q
800Quit. This causes an error (@code{file-locked}), and the buffer
801contents remain unchanged---the modification you were trying to make
802does not actually take place.
803@end table
804
805 Note that locking works on the basis of a file name; if a file has
806multiple names, Emacs does not realize that the two names are the same file
807and cannot prevent two users from editing it simultaneously under different
808names. However, basing locking on names means that Emacs can interlock the
809editing of new files that will not really exist until they are saved.
810
811 Some systems are not configured to allow Emacs to make locks, and
812there are cases where lock files cannot be written. In these cases,
813Emacs cannot detect trouble in advance, but it still can detect the
814collision when you try to save a file and overwrite someone else's
815changes.
816
817 If Emacs or the operating system crashes, this may leave behind lock
818files which are stale, so you may occasionally get warnings about
819spurious collisions. When you determine that the collision is spurious,
820just use @kbd{p} to tell Emacs to go ahead anyway.
821
822 Every time Emacs saves a buffer, it first checks the last-modification
823date of the existing file on disk to verify that it has not changed since the
824file was last visited or saved. If the date does not match, it implies
825that changes were made in the file in some other way, and these changes are
826about to be lost if Emacs actually does save. To prevent this, Emacs
827displays a warning message and asks for confirmation before saving.
828Occasionally you will know why the file was changed and know that it does
829not matter; then you can answer @kbd{yes} and proceed. Otherwise, you should
830cancel the save with @kbd{C-g} and investigate the situation.
831
832 The first thing you should do when notified that simultaneous editing
833has already taken place is to list the directory with @kbd{C-u C-x C-d}
834(@pxref{Directories}). This shows the file's current author. You
835should attempt to contact him to warn him not to continue editing.
836Often the next step is to save the contents of your Emacs buffer under a
837different name, and use @code{diff} to compare the two files.@refill
838
839@node File Shadowing
840@subsection Shadowing Files
841@cindex shadow files
842@cindex file shadows
843@findex shadow-initialize
844
845@table @kbd
846@item M-x shadow-initialize
847Set up file shadowing.
848@item M-x shadow-define-literal-group
849Declare a single file to be shared between sites.
850@item M-x shadow-define-regexp-group
851Make all files that match each of a group of files be shared between hosts.
852@item M-x shadow-define-cluster @key{RET} @var{name} @key{RET}
853Define a shadow file cluster @var{name}.
854@item M-x shadow-copy-files
855Copy all pending shadow files.
856@item M-x shadow-cancel
857Cancel the instruction to shadow some files.
858@end table
859
860You can arrange to keep identical @dfn{shadow} copies of certain files
861in more than one place---possibly on different machines. To do this,
862first you must set up a @dfn{shadow file group}, which is a set of
863identically-named files shared between a list of sites. The file
864group is permanent and applies to further Emacs sessions as well as
865the current one. Once the group is set up, every time you exit Emacs,
866it will copy the file you edited to the other files in its group. You
867can also do the copying without exiting Emacs, by typing @kbd{M-x
868shadow-copy-files}.
869
870To set up a shadow file group, use @kbd{M-x
871shadow-define-literal-group} or @kbd{M-x shadow-define-regexp-group}.
872See their documentation strings for further information.
873
874Before copying a file to its shadows, Emacs asks for confirmation.
875You can answer ``no'' to bypass copying of this file, this time. If
876you want to cancel the shadowing permanently for a certain file, use
877@kbd{M-x shadow-cancel} to eliminate or change the shadow file group.
878
879A @dfn{shadow cluster} is a group of hosts that share directories, so
880that copying to or from one of them is sufficient to update the file
881on all of them. Each shadow cluster has a name, and specifies the
882network address of a primary host (the one we copy files to), and a
883regular expression that matches the host names of all the other hosts
884in the cluster. You can define a shadow cluster with @kbd{M-x
885shadow-define-cluster}.
886
887@node Time Stamps
888@subsection Updating Time Stamps Automatically
889@cindex time stamps
890@cindex modification dates
891@cindex locale, date format
892
893You can arrange to put a time stamp in a file, so that it will be updated
894automatically each time you edit and save the file. The time stamp
895has to be in the first eight lines of the file, and you should
896insert it like this:
897
898@example
899Time-stamp: <>
900@end example
901
902@noindent
903or like this:
904
905@example
906Time-stamp: " "
907@end example
908
909@findex time-stamp
910 Then add the hook function @code{time-stamp} to the hook
911@code{before-save-hook}; that hook function will automatically update
912the time stamp, inserting the current date and time when you save the
913file. You can also use the command @kbd{M-x time-stamp} to update the
914time stamp manually. For other customizations, see the Custom group
915@code{time-stamp}. Note that non-numeric fields in the time stamp are
916formatted according to your locale setting (@pxref{Environment}).
917
918@node Reverting
919@section Reverting a Buffer
920@findex revert-buffer
921@cindex drastic changes
922@cindex reread a file
923
924 If you have made extensive changes to a file and then change your mind
925about them, you can get rid of them by reading in the previous version
926of the file. To do this, use @kbd{M-x revert-buffer}, which operates on
927the current buffer. Since reverting a buffer unintentionally could lose
928a lot of work, you must confirm this command with @kbd{yes}.
929
930 @code{revert-buffer} tries to position point in such a way that, if
931the file was edited only slightly, you will be at approximately the
932same piece of text after reverting as before. However, if you have made
933drastic changes, point may wind up in a totally different piece of text.
934
935 Reverting marks the buffer as ``not modified'' until another change is
936made.
937
938 Some kinds of buffers whose contents reflect data bases other than files,
939such as Dired buffers, can also be reverted. For them, reverting means
940recalculating their contents from the appropriate data base. Buffers
941created explicitly with @kbd{C-x b} cannot be reverted; @code{revert-buffer}
942reports an error when asked to do so.
943
944@vindex revert-without-query
945 When you edit a file that changes automatically and frequently---for
946example, a log of output from a process that continues to run---it may be
947useful for Emacs to revert the file without querying you, whenever you
948visit the file again with @kbd{C-x C-f}.
949
950 To request this behavior, set the variable @code{revert-without-query}
951to a list of regular expressions. When a file name matches one of these
952regular expressions, @code{find-file} and @code{revert-buffer} will
953revert it automatically if it has changed---provided the buffer itself
954is not modified. (If you have edited the text, it would be wrong to
955discard your changes.)
956
957@cindex Global Auto-Revert mode
958@cindex mode, Global Auto-Revert
959@cindex Auto-Revert mode
960@cindex mode, Auto-Revert
961@findex global-auto-revert-mode
962@findex auto-revert-mode
963@findex auto-revert-tail-mode
964
965 You may find it useful to have Emacs revert files automatically when
966they change. Three minor modes are available to do this.
967
968 @kbd{M-x global-auto-revert-mode} enables Global Auto-Revert mode,
969which periodically checks all file buffers and reverts when the
970corresponding file has changed. @kbd{M-x auto-revert-mode} enables a
971local version, Auto-Revert mode, which applies only to the current
972buffer.
973
974 You can use Auto-Revert mode to ``tail'' a file such as a system
975log, so that changes made to that file by other programs are
976continuously displayed. To do this, just move the point to the end of
977the buffer, and it will stay there as the file contents change.
978However, if you are sure that the file will only change by growing at
979the end, use Auto-Revert Tail mode instead
980(@code{auto-revert-tail-mode}). It is more efficient for this.
981
982@vindex auto-revert-interval
983 The variable @code{auto-revert-interval} controls how often to check
984for a changed file. Since checking a remote file is too slow, these
985modes do not check or revert remote files.
986
987 @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that
988visit files under version control.
989
990@ifnottex
991@include arevert-xtra.texi
992@end ifnottex
993
994@node Auto Save
995@section Auto-Saving: Protection Against Disasters
996@cindex Auto Save mode
997@cindex mode, Auto Save
998@cindex crashes
999
1000 Emacs saves all the visited files from time to time (based on counting
1001your keystrokes) without being asked. This is called @dfn{auto-saving}.
1002It prevents you from losing more than a limited amount of work if the
1003system crashes.
1004
1005 When Emacs determines that it is time for auto-saving, it considers
1006each buffer, and each is auto-saved if auto-saving is enabled for it
1007and it has been changed since the last time it was auto-saved. The
1008message @samp{Auto-saving...} is displayed in the echo area during
1009auto-saving, if any files are actually auto-saved. Errors occurring
1010during auto-saving are caught so that they do not interfere with the
1011execution of commands you have been typing.
1012
1013@menu
1014* Files: Auto Save Files. The file where auto-saved changes are
1015 actually made until you save the file.
1016* Control: Auto Save Control. Controlling when and how often to auto-save.
1017* Recover:: Recovering text from auto-save files.
1018@end menu
1019
1020@node Auto Save Files
1021@subsection Auto-Save Files
1022
1023 Auto-saving does not normally save in the files that you visited, because
1024it can be very undesirable to save a program that is in an inconsistent
1025state when you have made half of a planned change. Instead, auto-saving
1026is done in a different file called the @dfn{auto-save file}, and the
1027visited file is changed only when you request saving explicitly (such as
1028with @kbd{C-x C-s}).
1029
1030 Normally, the auto-save file name is made by appending @samp{#} to the
1031front and rear of the visited file name. Thus, a buffer visiting file
1032@file{foo.c} is auto-saved in a file @file{#foo.c#}. Most buffers that
1033are not visiting files are auto-saved only if you request it explicitly;
1034when they are auto-saved, the auto-save file name is made by appending
1035@samp{#} to the front and rear of buffer name, then
1036adding digits and letters at the end for uniqueness. For
1037example, the @samp{*mail*} buffer in which you compose messages to be
1038sent might be auto-saved in a file named @file{#*mail*#704juu}. Auto-save file
1039names are made this way unless you reprogram parts of Emacs to do
1040something different (the functions @code{make-auto-save-file-name} and
1041@code{auto-save-file-name-p}). The file name to be used for auto-saving
1042in a buffer is calculated when auto-saving is turned on in that buffer.
1043
1044@cindex auto-save for remote files
1045@vindex auto-save-file-name-transforms
1046 The variable @code{auto-save-file-name-transforms} allows a degree
1047of control over the auto-save file name. It lets you specify a series
1048of regular expressions and replacements to transform the auto save
1049file name. The default value puts the auto-save files for remote
1050files (@pxref{Remote Files}) into the temporary file directory on the
1051local machine.
1052
1053 When you delete a substantial part of the text in a large buffer, auto
1054save turns off temporarily in that buffer. This is because if you
1055deleted the text unintentionally, you might find the auto-save file more
1056useful if it contains the deleted text. To reenable auto-saving after
1057this happens, save the buffer with @kbd{C-x C-s}, or use @kbd{C-u 1 M-x
1058auto-save-mode}.
1059
1060@vindex auto-save-visited-file-name
1061 If you want auto-saving to be done in the visited file rather than
1062in a separate auto-save file, set the variable
1063@code{auto-save-visited-file-name} to a non-@code{nil} value. In this
1064mode, there is no real difference between auto-saving and explicit
1065saving.
1066
1067@vindex delete-auto-save-files
1068 A buffer's auto-save file is deleted when you save the buffer in its
1069visited file. (You can inhibit this by setting the variable
1070@code{delete-auto-save-files} to @code{nil}.) Changing the visited
1071file name with @kbd{C-x C-w} or @code{set-visited-file-name} renames
1072any auto-save file to go with the new visited name.
1073
1074@node Auto Save Control
1075@subsection Controlling Auto-Saving
1076
1077@vindex auto-save-default
1078@findex auto-save-mode
1079 Each time you visit a file, auto-saving is turned on for that file's
1080buffer if the variable @code{auto-save-default} is non-@code{nil} (but not
1081in batch mode; @pxref{Entering Emacs}). The default for this variable is
1082@code{t}, so auto-saving is the usual practice for file-visiting buffers.
1083Auto-saving can be turned on or off for any existing buffer with the
1084command @kbd{M-x auto-save-mode}. Like other minor mode commands, @kbd{M-x
1085auto-save-mode} turns auto-saving on with a positive argument, off with a
1086zero or negative argument; with no argument, it toggles.
1087
1088@vindex auto-save-interval
1089 Emacs does auto-saving periodically based on counting how many characters
1090you have typed since the last time auto-saving was done. The variable
1091@code{auto-save-interval} specifies how many characters there are between
1092auto-saves. By default, it is 300. Emacs doesn't accept values that are
1093too small: if you customize @code{auto-save-interval} to a value less
1094than 20, Emacs will behave as if the value is 20.
1095
1096@vindex auto-save-timeout
1097 Auto-saving also takes place when you stop typing for a while. The
1098variable @code{auto-save-timeout} says how many seconds Emacs should
1099wait before it does an auto save (and perhaps also a garbage
1100collection). (The actual time period is longer if the current buffer is
1101long; this is a heuristic which aims to keep out of your way when you
1102are editing long buffers, in which auto-save takes an appreciable amount
1103of time.) Auto-saving during idle periods accomplishes two things:
1104first, it makes sure all your work is saved if you go away from the
1105terminal for a while; second, it may avoid some auto-saving while you
1106are actually typing.
1107
1108 Emacs also does auto-saving whenever it gets a fatal error. This
1109includes killing the Emacs job with a shell command such as @samp{kill
1110%emacs}, or disconnecting a phone line or network connection.
1111
1112@findex do-auto-save
1113 You can request an auto-save explicitly with the command @kbd{M-x
1114do-auto-save}.
1115
1116@node Recover
1117@subsection Recovering Data from Auto-Saves
1118
1119@findex recover-file
1120 You can use the contents of an auto-save file to recover from a loss
1121of data with the command @kbd{M-x recover-file @key{RET} @var{file}
1122@key{RET}}. This visits @var{file} and then (after your confirmation)
1123restores the contents from its auto-save file @file{#@var{file}#}.
1124You can then save with @kbd{C-x C-s} to put the recovered text into
1125@var{file} itself. For example, to recover file @file{foo.c} from its
1126auto-save file @file{#foo.c#}, do:@refill
1127
1128@example
1129M-x recover-file @key{RET} foo.c @key{RET}
1130yes @key{RET}
1131C-x C-s
1132@end example
1133
1134 Before asking for confirmation, @kbd{M-x recover-file} displays a
1135directory listing describing the specified file and the auto-save file,
1136so you can compare their sizes and dates. If the auto-save file
1137is older, @kbd{M-x recover-file} does not offer to read it.
1138
1139@findex recover-session
1140 If Emacs or the computer crashes, you can recover all the files you
1141were editing from their auto save files with the command @kbd{M-x
1142recover-session}. This first shows you a list of recorded interrupted
1143sessions. Move point to the one you choose, and type @kbd{C-c C-c}.
1144
1145 Then @code{recover-session} asks about each of the files that were
1146being edited during that session, asking whether to recover that file.
1147If you answer @kbd{y}, it calls @code{recover-file}, which works in its
1148normal fashion. It shows the dates of the original file and its
1149auto-save file, and asks once again whether to recover that file.
1150
1151 When @code{recover-session} is done, the files you've chosen to
1152recover are present in Emacs buffers. You should then save them. Only
1153this---saving them---updates the files themselves.
1154
1155@vindex auto-save-list-file-prefix
1156 Emacs records information about interrupted sessions for later
1157recovery in files named
1158@file{~/.emacs.d/auto-save-list/.saves-@var{pid}-@var{hostname}}. All
1159of this name except the @file{@var{pid}-@var{hostname}} part comes
1160from the value of @code{auto-save-list-file-prefix}. You can record
1161sessions in a different place by customizing that variable. If you
1162set @code{auto-save-list-file-prefix} to @code{nil} in your
1163@file{.emacs} file, sessions are not recorded for recovery.
1164
1165@node File Aliases
1166@section File Name Aliases
1167@cindex symbolic links (visiting)
1168@cindex hard links (visiting)
1169
1170 Symbolic links and hard links both make it possible for several file
1171names to refer to the same file. Hard links are alternate names that
1172refer directly to the file; all the names are equally valid, and no one
1173of them is preferred. By contrast, a symbolic link is a kind of defined
1174alias: when @file{foo} is a symbolic link to @file{bar}, you can use
1175either name to refer to the file, but @file{bar} is the real name, while
1176@file{foo} is just an alias. More complex cases occur when symbolic
1177links point to directories.
1178
1179@vindex find-file-existing-other-name
1180@vindex find-file-suppress-same-file-warnings
1181
1182 Normally, if you visit a file which Emacs is already visiting under
1183a different name, Emacs displays a message in the echo area and uses
1184the existing buffer visiting that file. This can happen on systems
1185that support hard or symbolic links, or if you use a long file name on
1186a system that truncates long file names, or on a case-insensitive file
1187system. You can suppress the message by setting the variable
1188@code{find-file-suppress-same-file-warnings} to a non-@code{nil}
1189value. You can disable this feature entirely by setting the variable
1190@code{find-file-existing-other-name} to @code{nil}: then if you visit
1191the same file under two different names, you get a separate buffer for
1192each file name.
1193
1194@vindex find-file-visit-truename
1195@cindex truenames of files
1196@cindex file truenames
1197 If the variable @code{find-file-visit-truename} is non-@code{nil},
1198then the file name recorded for a buffer is the file's @dfn{truename}
1199(made by replacing all symbolic links with their target names), rather
1200than the name you specify. Setting @code{find-file-visit-truename} also
1201implies the effect of @code{find-file-existing-other-name}.
1202
1203@node Version Control
1204@section Version Control
1205@cindex version control
1206
1207 @dfn{Version control systems} are packages that can record multiple
1208versions of a source file, usually storing the unchanged parts of the
1209file just once. Version control systems also record history information
1210such as the creation time of each version, who created it, and a
1211description of what was changed in that version.
1212
1213 The Emacs version control interface is called VC. Its commands work
1214with different version control systems---currently, it supports CVS,
1215GNU Arch, RCS, Meta-CVS, Subversion, and SCCS. Of these, the GNU
1216project distributes CVS, GNU Arch, and RCS; we recommend that you use
1217either CVS or GNU Arch for your projects, and RCS for individual
1218files. We also have free software to replace SCCS, known as CSSC; if
1219you are using SCCS and don't want to make the incompatible change to
1220RCS or CVS, you can switch to CSSC.
1221
1222 VC is enabled by default in Emacs. To disable it, set the
1223customizable variable @code{vc-handled-backends} to @code{nil}
1224@iftex
1225(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
1226@end iftex
1227@ifnottex
1228(@pxref{Customizing VC}).
1229@end ifnottex
1230
1231
1232@menu
1233* Introduction to VC:: How version control works in general.
1234* VC Mode Line:: How the mode line shows version control status.
1235* Basic VC Editing:: How to edit a file under version control.
1236* Old Versions:: Examining and comparing old versions.
1237* Secondary VC Commands:: The commands used a little less frequently.
1238* Branches:: Multiple lines of development.
1239@ifnottex
1240* Remote Repositories:: Efficient access to remote CVS servers.
1241* Snapshots:: Sets of file versions treated as a unit.
1242* Miscellaneous VC:: Various other commands and features of VC.
1243* Customizing VC:: Variables that change VC's behavior.
1244@end ifnottex
1245@end menu
1246
1247@node Introduction to VC
1248@subsection Introduction to Version Control
1249
1250 VC allows you to use a version control system from within Emacs,
1251integrating the version control operations smoothly with editing. VC
1252provides a uniform interface to version control, so that regardless of
1253which version control system is in use, you can use it the same way.
1254
1255 This section provides a general overview of version control, and
1256describes the version control systems that VC supports. You can skip
1257this section if you are already familiar with the version control system
1258you want to use.
1259
1260@menu
1261* Why Version Control?:: Understanding the problems it addresses
1262* Version Systems:: Supported version control back-end systems.
1263* VC Concepts:: Words and concepts related to version control.
1264* Types of Log File:: The per-file VC log in contrast to the ChangeLog.
1265@end menu
1266
1267@node Why Version Control?
1268@subsubsection Understanding the problems it addresses
1269
1270 Version control systems provide you with three important capabilities:
1271reversibility, concurrency, and history.
1272
1273 The most basic capability you get from a version-control system is
1274reversibility, the ability to back up to a saved, known-good state when
1275you discover that some modification you did was a mistake or a bad idea.
1276
1277 Version-control systems also support concurrency, the ability to
1278have many people modifying the same collection of code or documents
1279knowing that conflicting modifications can be detected and resolved.
1280
1281 Version-control systems give you the capability to attach a history
1282to your data, explanatory comments about the intention behind each
1283change to it. Even for a programmer working solo change histories
1284are an important aid to memory; for a multi-person project they
1285become a vitally important form of communication among developers.
1286
1287@node Version Systems
1288@subsubsection Supported Version Control Systems
1289
1290@cindex back end (version control)
1291 VC currently works with six different version control systems or
1292``back ends'': CVS, GNU Arch, RCS, Meta-CVS, Subversion, and SCCS.
1293
1294@cindex CVS
1295 CVS is a free version control system that is used for the majority
1296of free software projects today. It allows concurrent multi-user
1297development either locally or over the network. Some of its
1298shortcomings, corrected by newer systems such as GNU Arch, are that it
1299lacks atomic commits or support for renaming files. VC supports all
1300basic editing operations under CVS, but for some less common tasks you
1301still need to call CVS from the command line. Note also that before
1302using CVS you must set up a repository, which is a subject too complex
1303to treat here.
1304
1305@cindex GNU Arch
1306@cindex Arch
1307 GNU Arch is a new version control system that is designed for
1308distributed work. It differs in many ways from old well-known
1309systems, such as CVS and RCS. It supports different transports for
1310interoperating between users, offline operations, and it has good
1311branching and merging features. It also supports atomic commits, and
1312history of file renaming and moving. VC does not support all
1313operations provided by GNU Arch, so you must sometimes invoke it from
1314the command line, or use a specialized module.
1315
1316@cindex RCS
1317 RCS is the free version control system around which VC was initially
1318built. The VC commands are therefore conceptually closest to RCS.
1319Almost everything you can do with RCS can be done through VC. You
1320cannot use RCS over the network though, and it only works at the level
1321of individual files, rather than projects. You should use it if you
1322want a simple, yet reliable tool for handling individual files.
1323
1324@cindex SVN
1325@cindex Subversion
1326 Subversion is a free version control system designed to be similar
1327to CVS but without CVS's problems. Subversion supports atomic commits,
1328and versions directories, symbolic links, meta-data, renames, copies,
1329and deletes. It can be used via http or via its own protocol.
1330
1331@cindex MCVS
1332@cindex Meta-CVS
1333 Meta-CVS is another attempt to solve problems arising in CVS. It
1334supports directory structure versioning, improved branching and
1335merging, and use of symbolic links and meta-data in repositories.
1336
1337@cindex SCCS
1338 SCCS is a proprietary but widely used version control system. In
1339terms of capabilities, it is the weakest of the six that VC supports.
1340VC compensates for certain features missing in SCCS (snapshots, for
1341example) by implementing them itself, but some other VC features, such
1342as multiple branches, are not available with SCCS. Since SCCS is
1343non-free, not respecting its users freedom, you should not use it;
1344use its free replacement CSSC instead. But you should use CSSC only
1345if for some reason you cannot use RCS, or one of the higher-level
1346systems such as CVS or GNU Arch.
1347
1348In the following, we discuss mainly RCS, SCCS and CVS. Nearly
1349everything said about CVS applies to GNU Arch, Subversion and Meta-CVS
1350as well.
1351
1352@node VC Concepts
1353@subsubsection Concepts of Version Control
1354
1355@cindex master file
1356@cindex registered file
1357 When a file is under version control, we also say that it is
1358@dfn{registered} in the version control system. Each registered file
1359has a corresponding @dfn{master file} which represents the file's
1360present state plus its change history---enough to reconstruct the
1361current version or any earlier version. Usually the master file also
1362records a @dfn{log entry} for each version, describing in words what was
1363changed in that version.
1364
1365@cindex work file
1366@cindex checking out files
1367 The file that is maintained under version control is sometimes called
1368the @dfn{work file} corresponding to its master file. You edit the work
1369file and make changes in it, as you would with an ordinary file. (With
1370SCCS and RCS, you must @dfn{lock} the file before you start to edit it.)
1371After you are done with a set of changes, you @dfn{check the file in},
1372which records the changes in the master file, along with a log entry for
1373them.
1374
1375 To go beyond these basic concepts, you will need to understand three
1376ways in which version-control systems can differ from each other. They
1377can be locking or merging; they can be file-based or changeset-based;
1378and they can be centralized or decentralized. VC handles all these
1379choices, but they lead to differing behaviors which you will need
1380to understand as you use it.
1381
1382@cindex locking versus merging
1383 A version control system typically has some mechanism to coordinate
1384between users who want to change the same file. One method is
1385@dfn{locking} (analogous to the locking that Emacs uses to detect
1386simultaneous editing of a file, but distinct from it). In a locking
1387system, such as SCCS, you must @dfn{lock} a file before you start to
1388edit it. The other method is @dfn{merging}; the system tries to
1389merge your changes with other people's changes when you check them in.
1390
1391 With version control locking, work files are normally read-only so
1392that you cannot change them. You ask the version control system to make
1393a work file writable for you by locking it; only one user can do
1394this at any given time. When you check in your changes, that unlocks
1395the file, making the work file read-only again. This allows other users
1396to lock the file to make further changes.
1397
1398 By contrast, a merging system lets each user check out and modify a
1399work file at any time. When you check in a a file, the system will
1400attempt to merge your changes with any others checked into the
1401repository since you checked out the file.
1402
1403 Both locking and merging systems can have problems when multiple users
1404try to modify the same file at the same time. Locking systems have
1405@dfn{lock conflicts}; a user may try to check a file out and be unable
1406to because it is locked. In merging systems, @dfn{merge conflicts}
1407happen when you check in a change to a file that conflicts with a change
1408checked in by someone else after your checkout. Both kinds of conflict
1409have to be resolved by human judgment and communication.
1410
1411 SCCS always uses locking. RCS is lock-based by default but can be told
1412to operate in a merging style. CVS is merge-based by default but can
1413be told to operate in a locking mode. Most later version-control
1414systems, such as Subversion and GNU Arch, have been fundamentally
1415merging-based rather than locking-based. This is because experience
1416has shown that the merging-based approach is generally superior to
1417the locking one, both in convenience to developers and in minimizing
1418the number and severity of conflicts that actually occur.
1419
1420 While it is rather unlikely that anyone will ever again build a
1421fundamentally locking-based rather than merging-based version-control
1422system in the future, merging-based version-systems sometimes have locks
1423retrofitted onto them for reasons having nothing to do with technology.
1424@footnote{Usually the control-freak instincts of managers.} For this
1425reason, and to support older systems still in use, VC mode supports
1426both locking and merging version control and tries to hide the differences
1427between them as much as possible.
1428
1429@cindex files versus changesets.
1430 On SCCS, RCS, CVS, and other early version-control systems, checkins
1431and other operations are @dfn{file-based}; each file has its own
1432@dfn{master file} with its own comment- and revision history separate
1433from that of all other files in the system. Later systems, beginning
1434with Subversion, are @dfn{changeset-based}; a checkin may include
1435changes to several files and that change set is treated as a unit by the
1436system. Any comment associated with the change doesn't belong to any
1437one file, but is attached to the changeset itself.
1438
1439 Changeset-based version control is in general both more flexible and
1440more powerful than file-based version control; usually, when a change to
1441multiple files has to be backed out, it's good to be able to easily
1442identify and remove all of it.
1443
1444@cindex centralized vs. decentralized
1445 Early version-control systems were designed around a @dfn{centralized}
1446model in which each project has only one repository used by all
1447developers. SCCS, RCS, CVS, and Subversion share this kind of model.
1448It has two important problems. One is that a single repository is a
1449single point of failure---if the repository server is down all work
1450stops. The other is that you need to be connected live to the server to
1451do checkins and checkouts; if you're offline, you can't work.
1452
1453 Newer version-control systems like GNU Arch are @dfn{decentralized}.
1454A project may have several different repositories, and these systems
1455support a sort of super-merge between repositories that tries to
1456reconcile their change histories. At the limit, each developer has
1457his/her own repository, and repository merges replace checkin/commit
1458operations.
1459
1460 VC's job is to help you manage the traffic between your personal
1461workfiles and a repository. Whether that repository is a single master
1462or one of a network of peer repositories is not something VC has to care
1463about. Thus, the difference between a centralized and a decentralized
1464version-control system is invisible to VC mode.
1465
1466@iftex
1467(@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}).
1468@end iftex
1469@ifnottex
1470(@pxref{CVS Options}).
1471@end ifnottex
1472
1473
1474@node Types of Log File
1475@subsubsection Types of Log File
1476@cindex types of log file
1477@cindex log File, types of
1478@cindex version control log
1479
1480 Projects that use a revision control system can have @emph{two}
1481types of log for changes. One is the per-file log maintained by the
1482revision control system: each time you check in a change, you must
1483fill out a @dfn{log entry} for the change (@pxref{Log Buffer}). This
1484kind of log is called the @dfn{version control log}, also the
1485@dfn{revision control log}, @dfn{RCS log}, or @dfn{CVS log}.
1486
1487 The other kind of log is the file @file{ChangeLog} (@pxref{Change
1488Log}). It provides a chronological record of all changes to a large
1489portion of a program---typically one directory and its subdirectories.
1490A small program would use one @file{ChangeLog} file; a large program
1491may well merit a @file{ChangeLog} file in each major directory.
1492@xref{Change Log}.
1493
1494 A project maintained with version control can use just the per-file
1495log, or it can use both kinds of logs. It can handle some files one
1496way and some files the other way. Each project has its policy, which
1497you should follow.
1498
1499 When the policy is to use both, you typically want to write an entry
1500for each change just once, then put it into both logs. You can write
1501the entry in @file{ChangeLog}, then copy it to the log buffer when you
1502check in the change. Or you can write the entry in the log buffer
1503while checking in the change, and later use the @kbd{C-x v a} command
1504to copy it to @file{ChangeLog}
1505@iftex
1506(@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}).
1507@end iftex
1508@ifnottex
1509(@pxref{Change Logs and VC}).
1510@end ifnottex
1511
1512
1513@node VC Mode Line
1514@subsection Version Control and the Mode Line
1515
1516 When you visit a file that is under version control, Emacs indicates
1517this on the mode line. For example, @samp{RCS-1.3} says that RCS is
1518used for that file, and the current version is 1.3.
1519
1520 The character between the back-end name and the version number
1521indicates the version control status of the file. @samp{-} means that
1522the work file is not locked (if locking is in use), or not modified (if
1523locking is not in use). @samp{:} indicates that the file is locked, or
1524that it is modified. If the file is locked by some other user (for
1525instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}.
1526
1527@vindex auto-revert-check-vc-info
1528 When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is
1529under version control, it updates the version control information in
1530the mode line. However, Auto Revert mode may not properly update this
1531information if the version control status changes without changes to
1532the work file, from outside the current Emacs session. If you set
1533@code{auto-revert-check-vc-info} to @code{t}, Auto Revert mode updates
1534the version control status information every
1535@code{auto-revert-interval} seconds, even if the work file itself is
1536unchanged. The resulting CPU usage depends on the version control
1537system, but is usually not excessive.
1538
1539@node Basic VC Editing
1540@subsection Basic Editing under Version Control
1541
1542 The principal VC command is an all-purpose command that performs
1543either locking or check-in, depending on the situation.
1544
1545@table @kbd
1546@itemx C-x v v
1547Perform the next logical version control operation on this file.
1548@end table
1549
1550@findex vc-next-action
1551@kindex C-x v v
1552 The precise action of this command depends on the state of the file,
1553and whether the version control system uses locking or not. SCCS and
1554RCS normally use locking; CVS normally does not use locking.
1555
1556@findex vc-toggle-read-only
1557@kindex C-x C-q @r{(Version Control)}
1558 As a special convenience that is particularly useful for files with
1559locking, you can let Emacs check a file in or out whenever you change
1560its read-only flag. This means, for example, that you cannot
1561accidentally edit a file without properly checking it out first. To
1562achieve this, bind the key @kbd{C-x C-q} to @kbd{vc-toggle-read-only}
1563in your @file{~/.emacs} file. (@xref{Init Rebinding}.)
1564
1565@menu
1566* VC with Locking:: RCS in its default mode, SCCS, and optionally CVS.
1567* Without Locking:: Without locking: default mode for CVS.
1568* Advanced C-x v v:: Advanced features available with a prefix argument.
1569* Log Buffer:: Features available in log entry buffers.
1570@end menu
1571
1572@node VC with Locking
1573@subsubsection Basic Version Control with Locking
1574
1575 If locking is used for the file (as with SCCS, and RCS in its default
1576mode), @kbd{C-x v v} can either lock a file or check it in:
1577
1578@itemize @bullet
1579@item
1580If the file is not locked, @kbd{C-x v v} locks it, and
1581makes it writable so that you can change it.
1582
1583@item
1584If the file is locked by you, and contains changes, @kbd{C-x v v} checks
1585in the changes. In order to do this, it first reads the log entry
1586for the new version. @xref{Log Buffer}.
1587
1588@item
1589If the file is locked by you, but you have not changed it since you
1590locked it, @kbd{C-x v v} releases the lock and makes the file read-only
1591again.
1592
1593@item
1594If the file is locked by some other user, @kbd{C-x v v} asks you whether
1595you want to ``steal the lock'' from that user. If you say yes, the file
1596becomes locked by you, but a message is sent to the person who had
1597formerly locked the file, to inform him of what has happened.
1598@end itemize
1599
1600 These rules also apply when you use CVS in locking mode, except
1601that there is no such thing as stealing a lock.
1602
1603@node Without Locking
1604@subsubsection Basic Version Control without Locking
1605
1606 When there is no locking---the default for CVS---work files are always
1607writable; you do not need to do anything before you begin to edit a
1608file. The status indicator on the mode line is @samp{-} if the file is
1609unmodified; it flips to @samp{:} as soon as you save any changes in the
1610work file.
1611
1612 Here is what @kbd{C-x v v} does when using CVS:
1613
1614@itemize @bullet
1615@item
1616If some other user has checked in changes into the master file, Emacs
1617asks you whether you want to merge those changes into your own work
1618file. You must do this before you can check in your own changes. (To
1619pick up any recent changes from the master file @emph{without} trying
1620to commit your own changes, type @kbd{C-x v m @key{RET}}.)
1621@xref{Merging}.
1622
1623@item
1624If there are no new changes in the master file, but you have made
1625modifications in your work file, @kbd{C-x v v} checks in your changes.
1626In order to do this, it first reads the log entry for the new version.
1627@xref{Log Buffer}.
1628
1629@item
1630If the file is not modified, the @kbd{C-x v v} does nothing.
1631@end itemize
1632
1633 These rules also apply when you use RCS in the mode that does not
1634require locking, except that automatic merging of changes from the
1635master file is not implemented. Unfortunately, this means that nothing
1636informs you if another user has checked in changes in the same file
1637since you began editing it, and when this happens, his changes will be
1638effectively removed when you check in your version (though they will
1639remain in the master file, so they will not be entirely lost). You must
1640therefore verify that the current version is unchanged, before you
1641check in your changes. We hope to eliminate this risk and provide
1642automatic merging with RCS in a future Emacs version.
1643
1644 In addition, locking is possible with RCS even in this mode, although
1645it is not required; @kbd{C-x v v} with an unmodified file locks the
1646file, just as it does with RCS in its normal (locking) mode.
1647
1648@node Advanced C-x v v
1649@subsubsection Advanced Control in @kbd{C-x v v}
1650
1651@cindex version number to check in/out
1652 When you give a prefix argument to @code{vc-next-action} (@kbd{C-u
1653C-x v v}), it still performs the next logical version control
1654operation, but accepts additional arguments to specify precisely how
1655to do the operation.
1656
1657@itemize @bullet
1658@item
1659If the file is modified (or locked), you can specify the version
1660number to use for the new version that you check in. This is one way
1661to create a new branch (@pxref{Branches}).
1662
1663@item
1664If the file is not modified (and unlocked), you can specify the
1665version to select; this lets you start working from an older version,
1666or on another branch. If you do not enter any version, that takes you
1667to the highest version on the current branch; therefore @kbd{C-u C-x
1668v v @key{RET}} is a convenient way to get the latest version of a file from
1669the repository.
1670
1671@item
1672@cindex specific version control system
1673Instead of the version number, you can also specify the name of a
1674version control system. This is useful when one file is being managed
1675with two version control systems at the same time
1676@iftex
1677(@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs
1678Features}).
1679@end iftex
1680@ifnottex
1681(@pxref{Local Version Control}).
1682@end ifnottex
1683
1684@end itemize
1685
1686@node Log Buffer
1687@subsubsection Features of the Log Entry Buffer
1688
1689 When you check in changes, @kbd{C-x v v} first reads a log entry. It
1690pops up a buffer called @samp{*VC-Log*} for you to enter the log entry.
1691
1692 Sometimes the @samp{*VC-Log*} buffer contains default text when you enter it,
1693typically the last log message entered. If it does, mark and point
1694are set around the entire contents of the buffer so that it is easy to
1695kill the contents of the buffer with @kbd{C-w}.
1696
1697@findex log-edit-insert-changelog
1698 If you work by writing entries in the @file{ChangeLog}
1699(@pxref{Change Log}) and then commit the change under revision
1700control, you can generate the Log Edit text from the ChangeLog using
1701@kbd{C-c C-a} (@kbd{log-edit-insert-changelog}). This looks for
1702entries for the file(s) concerned in the top entry in the ChangeLog
1703and uses those paragraphs as the log text. This text is only inserted
1704if the top entry was made under your user name on the current date.
1705@iftex
1706@xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features},
1707@end iftex
1708@ifnottex
1709@xref{Change Logs and VC},
1710@end ifnottex
1711for the opposite way of working---generating ChangeLog entries from
1712the revision control log.
1713
1714 In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x
1715log-edit-show-files}) shows the list of files to be committed in case
1716you need to check that. (This can be a list of more than one file if
1717you use VC Dired mode or PCL-CVS.
1718@iftex
1719@xref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features},
1720@end iftex
1721@ifnottex
1722@xref{VC Dired Mode},
1723@end ifnottex
1724and @ref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs
1725Front-End to CVS}.)
1726
1727 When you have finished editing the log message, type @kbd{C-c C-c} to
1728exit the buffer and commit the change.
1729
1730 To abort check-in, just @strong{don't} type @kbd{C-c C-c} in that
1731buffer. You can switch buffers and do other editing. As long as you
1732don't try to check in another file, the entry you were editing remains
1733in the @samp{*VC-Log*} buffer, and you can go back to that buffer at any
1734time to complete the check-in.
1735
1736 If you change several source files for the same reason, it is often
1737convenient to specify the same log entry for many of the files. To do
1738this, use the history of previous log entries. The commands @kbd{M-n},
1739@kbd{M-p}, @kbd{M-s} and @kbd{M-r} for doing this work just like the
1740minibuffer history commands (except that these versions are used outside
1741the minibuffer).
1742
1743@vindex vc-log-mode-hook
1744 Each time you check in a file, the log entry buffer is put into VC Log
1745mode, which involves running two hooks: @code{text-mode-hook} and
1746@code{vc-log-mode-hook}. @xref{Hooks}.
1747
1748@node Old Versions
1749@subsection Examining And Comparing Old Versions
1750
1751 One of the convenient features of version control is the ability
1752to examine any version of a file, or compare two versions.
1753
1754@table @kbd
1755@item C-x v ~ @var{version} @key{RET}
1756Examine version @var{version} of the visited file, in a buffer of its
1757own.
1758
1759@item C-x v =
1760Compare the current buffer contents with the master version from which
1761you started editing.
1762
1763@item C-u C-x v = @var{file} @key{RET} @var{oldvers} @key{RET} @var{newvers} @key{RET}
1764Compare the specified two versions of @var{file}.
1765
1766@item C-x v g
1767Display the file with per-line version information and using colors.
1768@end table
1769
1770@findex vc-version-other-window
1771@kindex C-x v ~
1772 To examine an old version in its entirety, visit the file and then type
1773@kbd{C-x v ~ @var{version} @key{RET}} (@code{vc-version-other-window}).
1774This puts the text of version @var{version} in a file named
1775@file{@var{filename}.~@var{version}~}, and visits it in its own buffer
1776in a separate window. (In RCS, you can also select an old version
1777and create a branch from it. @xref{Branches}.)
1778
1779@findex vc-diff
1780@kindex C-x v =
1781 It is usually more convenient to compare two versions of the file,
1782with the command @kbd{C-x v =} (@code{vc-diff}). Plain @kbd{C-x v =}
1783compares the current buffer contents (saving them in the file if
1784necessary) with the master version from which you started editing the
1785file (this is not necessarily the latest version of the file).
1786@kbd{C-u C-x v =}, with a numeric argument, reads a file name and two
1787version numbers, then compares those versions of the specified file.
1788Both forms display the output in a special buffer in another window.
1789
1790 You can specify a checked-in version by its number; an empty input
1791specifies the current contents of the work file (which may be different
1792from all the checked-in versions). You can also specify a snapshot name
1793@iftex
1794(@pxref{Snapshots,,,emacs-xtra, Specialized Emacs Features})
1795@end iftex
1796@ifnottex
1797(@pxref{Snapshots})
1798@end ifnottex
1799instead of one or both version numbers.
1800
1801 If you supply a directory name instead of the name of a registered
1802file, this command compares the two specified versions of all registered
1803files in that directory and its subdirectories.
1804
1805@vindex vc-diff-switches
1806@vindex vc-rcs-diff-switches
1807 @kbd{C-x v =} works by running a variant of the @code{diff} utility
1808designed to work with the version control system in use. When you
1809invoke @code{diff} this way, in addition to the options specified by
1810@code{diff-switches} (@pxref{Comparing Files}), it receives those
1811specified by @code{vc-diff-switches}, plus those specified for the
1812specific back end by @code{vc-@var{backend}-diff-switches}. For
1813instance, when the version control back end is RCS, @code{diff} uses
1814the options in @code{vc-rcs-diff-switches}. The
1815@samp{vc@dots{}diff-switches} variables are @code{nil} by default.
1816
1817 The buffer produced by @kbd{C-x v =} supports the commands of
1818Compilation mode (@pxref{Compilation Mode}), such as @kbd{C-x `} and
1819@kbd{C-c C-c}, in both the ``old'' and ``new'' text, and they always
1820find the corresponding locations in the current work file. (Older
1821versions are not, in general, present as files on your disk.)
1822
1823@findex vc-annotate
1824@kindex C-x v g
1825 For some back ends, you can display the file @dfn{annotated} with
1826per-line version information and using colors to enhance the visual
1827appearance, with the command @kbd{M-x vc-annotate}. It creates a new
1828buffer (the ``annotate buffer'') displaying the file's text, with each
1829part colored to show how old it is. Text colored red is new, blue means
1830old, and intermediate colors indicate intermediate ages. By default,
1831the color is scaled over the full range of ages, such that the oldest
1832changes are blue, and the newest changes are red.
1833
1834 When you give a prefix argument to this command, it uses the
1835minibuffer to read two arguments: which version number to display and
1836annotate (instead of the current file contents), and the time span in
1837days the color range should cover.
1838
1839 From the annotate buffer, these and other color scaling options are
1840available from the @samp{VC-Annotate} menu. In this buffer, you can
1841also use the following keys to browse the annotations of past revisions,
1842view diffs, or view log entries:
1843
1844@table @kbd
1845@item P
1846Annotate the previous revision, that is to say, the revision before
1847the one currently annotated. A numeric prefix argument is a repeat
1848count, so @kbd{C-u 10 P} would take you back 10 revisions.
1849
1850@item N
1851Annotate the next revision---the one after the revision currently
1852annotated. A numeric prefix argument is a repeat count.
1853
1854@item J
1855Annotate the revision indicated by the current line.
1856
1857@item A
1858Annotate the revision before the one indicated by the current line.
1859This is useful to see the state the file was in before the change on
1860the current line was made.
1861
1862@item D
1863Display the diff between the current line's revision and the previous
1864revision. This is useful to see what the current line's revision
1865actually changed in the file.
1866
1867@item L
1868Show the log of the current line's revision. This is useful to see
1869the author's description of the changes in the revision on the current
1870line.
1871
1872@item W
1873Annotate the workfile version--the one you are editing. If you used
1874@kbd{P} and @kbd{N} to browse to other revisions, use this key to
1875return to your current version.
1876@end table
1877
1878@node Secondary VC Commands
1879@subsection The Secondary Commands of VC
1880
1881 This section explains the secondary commands of VC; those that you might
1882use once a day.
1883
1884@menu
1885* Registering:: Putting a file under version control.
1886* VC Status:: Viewing the VC status of files.
1887* VC Undo:: Canceling changes before or after check-in.
1888@ifnottex
1889* VC Dired Mode:: Listing files managed by version control.
1890* VC Dired Commands:: Commands to use in a VC Dired buffer.
1891@end ifnottex
1892@end menu
1893
1894@node Registering
1895@subsubsection Registering a File for Version Control
1896
1897@kindex C-x v i
1898@findex vc-register
1899 You can put any file under version control by simply visiting it, and
1900then typing @w{@kbd{C-x v i}} (@code{vc-register}).
1901
1902@table @kbd
1903@item C-x v i
1904Register the visited file for version control.
1905@end table
1906
1907 To register the file, Emacs must choose which version control system
1908to use for it. If the file's directory already contains files
1909registered in a version control system, Emacs uses that system. If
1910there is more than one system in use for a directory, Emacs uses the
1911one that appears first in @code{vc-handled-backends}
1912@iftex
1913(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
1914@end iftex
1915@ifnottex
1916(@pxref{Customizing VC}).
1917@end ifnottex
1918On the other hand, if there are no files already registered, Emacs uses
1919the first system from @code{vc-handled-backends} that could register
1920the file (for example, you cannot register a file under CVS if its
1921directory is not already part of a CVS tree); with the default value
1922of @code{vc-handled-backends}, this means that Emacs uses RCS in this
1923situation.
1924
1925 If locking is in use, @kbd{C-x v i} leaves the file unlocked and
1926read-only. Type @kbd{C-x v v} if you wish to start editing it. After
1927registering a file with CVS, you must subsequently commit the initial
1928version by typing @kbd{C-x v v}. Until you do that, the version
1929appears as @samp{@@@@} in the mode line.
1930
1931@vindex vc-default-init-version
1932@cindex initial version number to register
1933 The initial version number for a newly registered file is 1.1, by
1934default. You can specify a different default by setting the variable
1935@code{vc-default-init-version}, or you can give @kbd{C-x v i} a numeric
1936argument; then it reads the initial version number for this particular
1937file using the minibuffer.
1938
1939@vindex vc-initial-comment
1940 If @code{vc-initial-comment} is non-@code{nil}, @kbd{C-x v i} reads an
1941initial comment to describe the purpose of this source file. Reading
1942the initial comment works like reading a log entry (@pxref{Log Buffer}).
1943
1944@node VC Status
1945@subsubsection VC Status Commands
1946
1947@table @kbd
1948@item C-x v l
1949Display version control state and change history.
1950@end table
1951
1952@kindex C-x v l
1953@findex vc-print-log
1954 To view the detailed version control status and history of a file,
1955type @kbd{C-x v l} (@code{vc-print-log}). It displays the history of
1956changes to the current file, including the text of the log entries. The
1957output appears in a separate window. The point is centered at the
1958revision of the file that is currently being visited.
1959
1960 In the change log buffer, you can use the following keys to move
1961between the logs of revisions and of files, to view past revisions, and
1962to view diffs:
1963
1964@table @kbd
1965@item p
1966Move to the previous revision-item in the buffer. (Revision entries in the log
1967buffer are usually in reverse-chronological order, so the previous
1968revision-item usually corresponds to a newer revision.) A numeric
1969prefix argument is a repeat count.
1970
1971@item n
1972Move to the next revision-item (which most often corresponds to the
1973previous revision of the file). A numeric prefix argument is a repeat
1974count.
1975
1976@item P
1977Move to the log of the previous file, when the logs of multiple files
1978are in the log buffer
1979@iftex
1980(@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}).
1981@end iftex
1982@ifnottex
1983(@pxref{VC Dired Mode}).
1984@end ifnottex
1985Otherwise, just move to the beginning of the log. A numeric prefix
1986argument is a repeat count, so @kbd{C-u 10 P} would move backward 10
1987files.
1988
1989@item N
1990Move to the log of the next file, when the logs of multiple files are
1991in the log buffer
1992@iftex
1993(@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}).
1994@end iftex
1995@ifnottex
1996(@pxref{VC Dired Mode}).
1997@end ifnottex
1998It also takes a numeric prefix argument as a repeat count.
1999
2000@item f
2001Visit the revision indicated at the current line, like typing @kbd{C-x
2002v ~} and specifying this revision's number (@pxref{Old Versions}).
2003
2004@item d
2005Display the diff (@pxref{Comparing Files}) between the revision
2006indicated at the current line and the next earlier revision. This is
2007useful to see what actually changed when the revision indicated on the
2008current line was committed.
2009@end table
2010
2011@node VC Undo
2012@subsubsection Undoing Version Control Actions
2013
2014@table @kbd
2015@item C-x v u
2016Revert the buffer and the file to the version from which you started
2017editing the file.
2018
2019@item C-x v c
2020Remove the last-entered change from the master for the visited file.
2021This undoes your last check-in.
2022@end table
2023
2024@kindex C-x v u
2025@findex vc-revert-buffer
2026 If you want to discard your current set of changes and revert to the
2027version from which you started editing the file, use @kbd{C-x v u}
2028(@code{vc-revert-buffer}). This leaves the file unlocked; if locking
2029is in use, you must first lock the file again before you change it
2030again. @kbd{C-x v u} requires confirmation, unless it sees that you
2031haven't made any changes with respect to the master version.
2032
2033 @kbd{C-x v u} is also the command to unlock a file if you lock it and
2034then decide not to change it.
2035
2036@kindex C-x v c
2037@findex vc-cancel-version
2038 To cancel a change that you already checked in, use @kbd{C-x v c}
2039(@code{vc-cancel-version}). This command discards all record of the
2040most recent checked-in version, but only if your work file corresponds
2041to that version---you cannot use @kbd{C-x v c} to cancel a version
2042that is not the latest on its branch. @kbd{C-x v c} also offers to
2043revert your work file and buffer to the previous version (the one that
2044precedes the version that is deleted).
2045
2046 If you answer @kbd{no}, VC keeps your changes in the buffer, and locks
2047the file. The no-revert option is useful when you have checked in a
2048change and then discover a trivial error in it; you can cancel the
2049erroneous check-in, fix the error, and check the file in again.
2050
2051 When @kbd{C-x v c} does not revert the buffer, it unexpands all
2052version control headers in the buffer instead
2053@iftex
2054(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
2055@end iftex
2056@ifnottex
2057(@pxref{Version Headers}).
2058@end ifnottex
2059This is because the buffer no longer corresponds to any existing
2060version. If you check it in again, the check-in process will expand
2061the headers properly for the new version number.
2062
2063 However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header
2064automatically. If you use that header feature, you have to unexpand it
2065by hand---by deleting the entry for the version that you just canceled.
2066
2067 Be careful when invoking @kbd{C-x v c}, as it is easy to lose a lot of
2068work with it. To help you be careful, this command always requires
2069confirmation with @kbd{yes}. Note also that this command is disabled
2070under CVS, because canceling versions is very dangerous and discouraged
2071with CVS.
2072
2073@ifnottex
2074@c vc1-xtra.texi needs extra level of lowering.
2075@lowersections
2076@include vc1-xtra.texi
2077@raisesections
2078@end ifnottex
2079
2080@node Branches
2081@subsection Multiple Branches of a File
2082@cindex branch (version control)
2083@cindex trunk (version control)
2084
2085 One use of version control is to maintain multiple ``current''
2086versions of a file. For example, you might have different versions of a
2087program in which you are gradually adding various unfinished new
2088features. Each such independent line of development is called a
2089@dfn{branch}. VC allows you to create branches, switch between
2090different branches, and merge changes from one branch to another.
2091Please note, however, that branches are not supported for SCCS.
2092
2093 A file's main line of development is usually called the @dfn{trunk}.
2094The versions on the trunk are normally numbered 1.1, 1.2, 1.3, etc. At
2095any such version, you can start an independent branch. A branch
2096starting at version 1.2 would have version number 1.2.1.1, and consecutive
2097versions on this branch would have numbers 1.2.1.2, 1.2.1.3, 1.2.1.4,
2098and so on. If there is a second branch also starting at version 1.2, it
2099would consist of versions 1.2.2.1, 1.2.2.2, 1.2.2.3, etc.
2100
2101@cindex head version
2102 If you omit the final component of a version number, that is called a
2103@dfn{branch number}. It refers to the highest existing version on that
2104branch---the @dfn{head version} of that branch. The branches in the
2105example above have branch numbers 1.2.1 and 1.2.2.
2106
2107@menu
2108* Switching Branches:: How to get to another existing branch.
2109* Creating Branches:: How to start a new branch.
2110* Merging:: Transferring changes between branches.
2111* Multi-User Branching:: Multiple users working at multiple branches
2112 in parallel.
2113@end menu
2114
2115@node Switching Branches
2116@subsubsection Switching between Branches
2117
2118 To switch between branches, type @kbd{C-u C-x v v} and specify the
2119version number you want to select. This version is then visited
2120@emph{unlocked} (write-protected), so you can examine it before locking
2121it. Switching branches in this way is allowed only when the file is not
2122locked.
2123
2124 You can omit the minor version number, thus giving only the branch
2125number; this takes you to the head version on the chosen branch. If you
2126only type @key{RET}, Emacs goes to the highest version on the trunk.
2127
2128 After you have switched to any branch (including the main branch), you
2129stay on it for subsequent VC commands, until you explicitly select some
2130other branch.
2131
2132@node Creating Branches
2133@subsubsection Creating New Branches
2134
2135 To create a new branch from a head version (one that is the latest in
2136the branch that contains it), first select that version if necessary,
2137lock it with @kbd{C-x v v}, and make whatever changes you want. Then,
2138when you check in the changes, use @kbd{C-u C-x v v}. This lets you
2139specify the version number for the new version. You should specify a
2140suitable branch number for a branch starting at the current version.
2141For example, if the current version is 2.5, the branch number should be
21422.5.1, 2.5.2, and so on, depending on the number of existing branches at
2143that point.
2144
2145 To create a new branch at an older version (one that is no longer the
2146head of a branch), first select that version (@pxref{Switching
2147Branches}), then lock it with @kbd{C-x v v}. You'll be asked to
2148confirm, when you lock the old version, that you really mean to create a
2149new branch---if you say no, you'll be offered a chance to lock the
2150latest version instead.
2151
2152 Then make your changes and type @kbd{C-x v v} again to check in a new
2153version. This automatically creates a new branch starting from the
2154selected version. You need not specially request a new branch, because
2155that's the only way to add a new version at a point that is not the head
2156of a branch.
2157
2158 After the branch is created, you ``stay'' on it. That means that
2159subsequent check-ins create new versions on that branch. To leave the
2160branch, you must explicitly select a different version with @kbd{C-u C-x
2161v v}. To transfer changes from one branch to another, use the merge
2162command, described in the next section.
2163
2164@node Merging
2165@subsubsection Merging Branches
2166
2167@cindex merging changes
2168 When you have finished the changes on a certain branch, you will
2169often want to incorporate them into the file's main line of development
2170(the trunk). This is not a trivial operation, because development might
2171also have proceeded on the trunk, so that you must @dfn{merge} the
2172changes into a file that has already been changed otherwise. VC allows
2173you to do this (and other things) with the @code{vc-merge} command.
2174
2175@table @kbd
2176@item C-x v m (vc-merge)
2177Merge changes into the work file.
2178@end table
2179
2180@kindex C-x v m
2181@findex vc-merge
2182 @kbd{C-x v m} (@code{vc-merge}) takes a set of changes and merges it
2183into the current version of the work file. It firsts asks you in the
2184minibuffer where the changes should come from. If you just type
2185@key{RET}, Emacs merges any changes that were made on the same branch
2186since you checked the file out (we call this @dfn{merging the news}).
2187This is the common way to pick up recent changes from the repository,
2188regardless of whether you have already changed the file yourself.
2189
2190 You can also enter a branch number or a pair of version numbers in
2191the minibuffer. Then @kbd{C-x v m} finds the changes from that
2192branch, or the differences between the two versions you specified, and
2193merges them into the current version of the current file.
2194
2195 As an example, suppose that you have finished a certain feature on
2196branch 1.3.1. In the meantime, development on the trunk has proceeded
2197to version 1.5. To merge the changes from the branch to the trunk,
2198first go to the head version of the trunk, by typing @kbd{C-u C-x v v
2199@key{RET}}. Version 1.5 is now current. If locking is used for the file,
2200type @kbd{C-x v v} to lock version 1.5 so that you can change it. Next,
2201type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on
2202branch 1.3.1 (relative to version 1.3, where the branch started, up to
2203the last version on the branch) and merges it into the current version
2204of the work file. You can now check in the changed file, thus creating
2205version 1.6 containing the changes from the branch.
2206
2207 It is possible to do further editing after merging the branch, before
2208the next check-in. But it is usually wiser to check in the merged
2209version, then lock it and make the further changes. This will keep
2210a better record of the history of changes.
2211
2212@cindex conflicts
2213@cindex resolving conflicts
2214 When you merge changes into a file that has itself been modified, the
2215changes might overlap. We call this situation a @dfn{conflict}, and
2216reconciling the conflicting changes is called @dfn{resolving a
2217conflict}.
2218
2219 Whenever conflicts occur during merging, VC detects them, tells you
2220about them in the echo area, and asks whether you want help in merging.
2221If you say yes, it starts an Ediff session (@pxref{Top,
2222Ediff, Ediff, ediff, The Ediff Manual}).
2223
2224 If you say no, the conflicting changes are both inserted into the
2225file, surrounded by @dfn{conflict markers}. The example below shows how
2226a conflict region looks; the file is called @samp{name} and the current
2227master file version with user B's changes in it is 1.11.
2228
2229@c @w here is so CVS won't think this is a conflict.
2230@smallexample
2231@group
2232@w{<}<<<<<< name
2233 @var{User A's version}
2234=======
2235 @var{User B's version}
2236@w{>}>>>>>> 1.11
2237@end group
2238@end smallexample
2239
2240@cindex vc-resolve-conflicts
2241 Then you can resolve the conflicts by editing the file manually. Or
2242you can type @code{M-x vc-resolve-conflicts} after visiting the file.
2243This starts an Ediff session, as described above. Don't forget to
2244check in the merged version afterwards.
2245
2246@node Multi-User Branching
2247@subsubsection Multi-User Branching
2248
2249 It is often useful for multiple developers to work simultaneously on
2250different branches of a file. CVS allows this by default; for RCS, it
2251is possible if you create multiple source directories. Each source
2252directory should have a link named @file{RCS} which points to a common
2253directory of RCS master files. Then each source directory can have its
2254own choice of selected versions, but all share the same common RCS
2255records.
2256
2257 This technique works reliably and automatically, provided that the
2258source files contain RCS version headers
2259@iftex
2260(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
2261@end iftex
2262@ifnottex
2263(@pxref{Version Headers}).
2264@end ifnottex
2265The headers enable Emacs to be sure, at all times, which version
2266number is present in the work file.
2267
2268 If the files do not have version headers, you must instead tell Emacs
2269explicitly in each session which branch you are working on. To do this,
2270first find the file, then type @kbd{C-u C-x v v} and specify the correct
2271branch number. This ensures that Emacs knows which branch it is using
2272during this particular editing session.
2273
2274@ifnottex
2275@include vc2-xtra.texi
2276@end ifnottex
2277
2278@node Directories
2279@section File Directories
2280
2281@cindex file directory
2282@cindex directory listing
2283 The file system groups files into @dfn{directories}. A @dfn{directory
2284listing} is a list of all the files in a directory. Emacs provides
2285commands to create and delete directories, and to make directory
2286listings in brief format (file names only) and verbose format (sizes,
2287dates, and authors included). Emacs also includes a directory browser
2288feature called Dired; see @ref{Dired}.
2289
2290@table @kbd
2291@item C-x C-d @var{dir-or-pattern} @key{RET}
2292Display a brief directory listing (@code{list-directory}).
2293@item C-u C-x C-d @var{dir-or-pattern} @key{RET}
2294Display a verbose directory listing.
2295@item M-x make-directory @key{RET} @var{dirname} @key{RET}
2296Create a new directory named @var{dirname}.
2297@item M-x delete-directory @key{RET} @var{dirname} @key{RET}
2298Delete the directory named @var{dirname}. It must be empty,
2299or you get an error.
2300@end table
2301
2302@findex list-directory
2303@kindex C-x C-d
2304 The command to display a directory listing is @kbd{C-x C-d}
2305(@code{list-directory}). It reads using the minibuffer a file name
2306which is either a directory to be listed or a wildcard-containing
2307pattern for the files to be listed. For example,
2308
2309@example
2310C-x C-d /u2/emacs/etc @key{RET}
2311@end example
2312
2313@noindent
2314lists all the files in directory @file{/u2/emacs/etc}. Here is an
2315example of specifying a file name pattern:
2316
2317@example
2318C-x C-d /u2/emacs/src/*.c @key{RET}
2319@end example
2320
2321 Normally, @kbd{C-x C-d} displays a brief directory listing containing
2322just file names. A numeric argument (regardless of value) tells it to
2323make a verbose listing including sizes, dates, and owners (like
2324@samp{ls -l}).
2325
2326@vindex list-directory-brief-switches
2327@vindex list-directory-verbose-switches
2328 The text of a directory listing is mostly obtained by running
2329@code{ls} in an inferior process. Two Emacs variables control the
2330switches passed to @code{ls}: @code{list-directory-brief-switches} is
2331a string giving the switches to use in brief listings (@code{"-CF"} by
2332default), and @code{list-directory-verbose-switches} is a string
2333giving the switches to use in a verbose listing (@code{"-l"} by
2334default).
2335
2336@vindex directory-free-space-program
2337@vindex directory-free-space-args
2338 In verbose directory listings, Emacs adds information about the
2339amount of free space on the disk that contains the directory. To do
2340this, it runs the program specified by
2341@code{directory-free-space-program} with arguments
2342@code{directory-free-space-args}.
2343
2344@node Comparing Files
2345@section Comparing Files
2346@cindex comparing files
2347
2348@findex diff
2349@vindex diff-switches
2350 The command @kbd{M-x diff} compares two files, displaying the
2351differences in an Emacs buffer named @samp{*diff*}. It works by
2352running the @code{diff} program, using options taken from the variable
2353@code{diff-switches}. The value of @code{diff-switches} should be a
2354string; the default is @code{"-c"} to specify a context diff.
2355@xref{Top,, Diff, diff, Comparing and Merging Files}, for more
2356information about @command{diff} output formats.
2357
2358@findex diff-backup
2359 The command @kbd{M-x diff-backup} compares a specified file with its most
2360recent backup. If you specify the name of a backup file,
2361@code{diff-backup} compares it with the source file that it is a backup
2362of.
2363
2364@findex compare-windows
2365 The command @kbd{M-x compare-windows} compares the text in the
2366current window with that in the next window. (For more information
2367about windows in Emacs, @ref{Windows}.) Comparison starts at point in
2368each window, after pushing each initial point value on the mark ring
2369in its respective buffer. Then it moves point forward in each window,
2370one character at a time, until it reaches characters that don't match.
2371Then the command exits.
2372
2373 If point in the two windows is followed by non-matching text when
2374the command starts, @kbd{M-x compare-windows} tries heuristically to
2375advance up to matching text in the two windows, and then exits. So if
2376you use @kbd{M-x compare-windows} repeatedly, each time it either
2377skips one matching range or finds the start of another.
2378
2379@vindex compare-ignore-case
2380@vindex compare-ignore-whitespace
2381 With a numeric argument, @code{compare-windows} ignores changes in
2382whitespace. If the variable @code{compare-ignore-case} is
2383non-@code{nil}, the comparison ignores differences in case as well.
2384If the variable @code{compare-ignore-whitespace} is non-@code{nil},
2385@code{compare-windows} normally ignores changes in whitespace, and a
2386prefix argument turns that off.
2387
2388@cindex Smerge mode
2389@findex smerge-mode
2390@cindex failed merges
2391@cindex merges, failed
2392@cindex comparing 3 files (@code{diff3})
2393 You can use @kbd{M-x smerge-mode} to turn on Smerge mode, a minor
2394mode for editing output from the @command{diff3} program. This is
2395typically the result of a failed merge from a version control system
2396``update'' outside VC, due to conflicting changes to a file. Smerge
2397mode provides commands to resolve conflicts by selecting specific
2398changes.
2399
2400@iftex
2401@xref{Emerge,,, emacs-xtra, Specialized Emacs Features},
2402@end iftex
2403@ifnottex
2404@xref{Emerge},
2405@end ifnottex
2406for the Emerge facility, which provides a powerful interface for
2407merging files.
2408
2409@node Diff Mode
2410@section Diff Mode
2411@cindex Diff mode
2412@findex diff-mode
2413@cindex patches, editing
2414
2415 Diff mode is used for the output of @kbd{M-x diff}; it is also
2416useful for editing patches and comparisons produced by the
2417@command{diff} program. To select Diff mode manually, type @kbd{M-x
2418diff-mode}.
2419
2420 One general feature of Diff mode is that manual edits to the patch
2421automatically correct line numbers, including those in the hunk
2422header, so that you can actually apply the edited patch. Diff mode
2423treats each hunk location as an ``error message,'' so that you can use
2424commands such as @kbd{C-x '} to visit the corresponding source
2425locations. It also provides the following commands to navigate,
2426manipulate and apply parts of patches:
2427
2428@table @kbd
2429@item M-n
2430Move to the next hunk-start (@code{diff-hunk-next}).
2431
2432@item M-p
2433Move to the previous hunk-start (@code{diff-hunk-prev}).
2434
2435@item M-@}
2436Move to the next file-start, in a multi-file patch
2437(@code{diff-file-next}).
2438
2439@item M-@{
2440Move to the previous file-start, in a multi-file patch
2441(@code{diff-file-prev}).
2442
2443@item M-k
2444Kill the hunk at point (@code{diff-hunk-kill}).
2445
2446@item M-K
2447In a multi-file patch, kill the current file part.
2448(@code{diff-file-kill}).
2449
2450@item C-c C-a
2451Apply this hunk to its target file (@code{diff-apply-hunk}). With a
2452prefix argument of @kbd{C-u}, revert this hunk.
2453
2454@item C-c C-c
2455Go to the source corresponding to this hunk (@code{diff-goto-source}).
2456
2457@item C-c C-e
2458Start an Ediff session with the patch (@code{diff-ediff-patch}).
2459@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
2460
2461@item C-c C-n
2462Restrict the view to the current hunk (@code{diff-restrict-view}).
2463@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
2464view to the current patch of a multiple file patch. To widen again,
2465use @kbd{C-x n w}.
2466
2467@item C-c C-r
2468Reverse the direction of comparison for the entire buffer
2469(@code{diff-reverse-direction}).
2470
2471@item C-c C-s
2472Split the hunk at point (@code{diff-split-hunk}). This is for
2473manually editing patches, and only works with the unified diff format.
2474
2475@item C-c C-u
2476Convert the entire buffer to unified format
2477(@code{diff-context->unified}). With a prefix argument, convert
2478unified format to context format. In Transient Mark mode, when the
2479mark is active, this command operates only on the region.
2480
2481@item C-c C-w
2482Refine the current hunk so that it disregards changes in whitespace
2483(@code{diff-refine-hunk}).
2484@end table
2485
2486 @kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
2487but gets the function name from the patch itself. @xref{Change Log}.
2488This is useful for making log entries for functions that are deleted
2489by the patch.
2490
2491@node Misc File Ops
2492@section Miscellaneous File Operations
2493
2494 Emacs has commands for performing many other operations on files.
2495All operate on one file; they do not accept wildcard file names.
2496
2497@findex view-file
2498@cindex viewing
2499@cindex View mode
2500@cindex mode, View
2501 @kbd{M-x view-file} allows you to scan or read a file by sequential
2502screenfuls. It reads a file name argument using the minibuffer. After
2503reading the file into an Emacs buffer, @code{view-file} displays the
2504beginning. You can then type @key{SPC} to scroll forward one windowful,
2505or @key{DEL} to scroll backward. Various other commands are provided
2506for moving around in the file, but none for changing it; type @kbd{?}
2507while viewing for a list of them. They are mostly the same as normal
2508Emacs cursor motion commands. To exit from viewing, type @kbd{q}.
2509The commands for viewing are defined by a special minor mode called View
2510mode.
2511
2512 A related command, @kbd{M-x view-buffer}, views a buffer already present
2513in Emacs. @xref{Misc Buffer}.
2514
2515@kindex C-x i
2516@findex insert-file
2517 @kbd{M-x insert-file} (also @kbd{C-x i}) inserts a copy of the
2518contents of the specified file into the current buffer at point,
2519leaving point unchanged before the contents and the mark after them.
2520
2521@findex insert-file-literally
2522 @kbd{M-x insert-file-literally} is like @kbd{M-x insert-file},
2523except the file is inserted ``literally'': it is treated as a sequence
2524of @acronym{ASCII} characters with no special encoding or conversion,
2525similar to the @kbd{M-x find-file-literally} command
2526(@pxref{Visiting}).
2527
2528@findex write-region
2529 @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it
2530copies the contents of the region into the specified file. @kbd{M-x
2531append-to-file} adds the text of the region to the end of the
2532specified file. @xref{Accumulating Text}. The variable
2533@code{write-region-inhibit-fsync} applies to these commands, as well
2534as saving files; see @ref{Customize Save}.
2535
2536@findex delete-file
2537@cindex deletion (of files)
2538 @kbd{M-x delete-file} deletes the specified file, like the @code{rm}
2539command in the shell. If you are deleting many files in one directory, it
2540may be more convenient to use Dired (@pxref{Dired}).
2541
2542@findex rename-file
2543 @kbd{M-x rename-file} reads two file names @var{old} and @var{new} using
2544the minibuffer, then renames file @var{old} as @var{new}. If the file name
2545@var{new} already exists, you must confirm with @kbd{yes} or renaming is not
2546done; this is because renaming causes the old meaning of the name @var{new}
2547to be lost. If @var{old} and @var{new} are on different file systems, the
2548file @var{old} is copied and deleted.
2549
2550 If the argument @var{new} is just a directory name, the real new
2551name is in that directory, with the same non-directory component as
2552@var{old}. For example, @kbd{M-x rename-file RET ~/foo RET /tmp RET}
2553renames @file{~/foo} to @file{/tmp/foo}. The same rule applies to all
2554the remaining commands in this section. All of them ask for
2555confirmation when the new file name already exists, too.
2556
2557@findex add-name-to-file
2558@cindex hard links (creation)
2559 The similar command @kbd{M-x add-name-to-file} is used to add an
2560additional name to an existing file without removing its old name.
2561The new name is created as a ``hard link'' to the existing file.
2562The new name must belong on the same file system that the file is on.
2563On MS-Windows, this command works only if the file resides in an NTFS
2564file system. On MS-DOS, it works by copying the file.
2565
2566@findex copy-file
2567@cindex copying files
2568 @kbd{M-x copy-file} reads the file @var{old} and writes a new file
2569named @var{new} with the same contents.
2570
2571@findex make-symbolic-link
2572@cindex symbolic links (creation)
2573 @kbd{M-x make-symbolic-link} reads two file names @var{target} and
2574@var{linkname}, then creates a symbolic link named @var{linkname},
2575which points at @var{target}. The effect is that future attempts to
2576open file @var{linkname} will refer to whatever file is named
2577@var{target} at the time the opening is done, or will get an error if
2578the name @var{target} is nonexistent at that time. This command does
2579not expand the argument @var{target}, so that it allows you to specify
2580a relative name as the target of the link.
2581
2582 Not all systems support symbolic links; on systems that don't
2583support them, this command is not defined.
2584
2585@node Compressed Files
2586@section Accessing Compressed Files
2587@cindex compression
2588@cindex uncompression
2589@cindex Auto Compression mode
2590@cindex mode, Auto Compression
2591@pindex gzip
2592
2593 Emacs automatically uncompresses compressed files when you visit
2594them, and automatically recompresses them if you alter them and save
2595them. Emacs recognizes compressed files by their file names. File
2596names ending in @samp{.gz} indicate a file compressed with
2597@code{gzip}. Other endings indicate other compression programs.
2598
2599 Automatic uncompression and compression apply to all the operations in
2600which Emacs uses the contents of a file. This includes visiting it,
2601saving it, inserting its contents into a buffer, loading it, and byte
2602compiling it.
2603
2604@findex auto-compression-mode
2605@vindex auto-compression-mode
2606 To disable this feature, type the command @kbd{M-x
2607auto-compression-mode}. You can disable it permanently by
2608customizing the variable @code{auto-compression-mode}.
2609
2610@node File Archives
2611@section File Archives
2612@cindex mode, tar
2613@cindex Tar mode
2614@cindex file archives
2615
2616 A file whose name ends in @samp{.tar} is normally an @dfn{archive}
2617made by the @code{tar} program. Emacs views these files in a special
2618mode called Tar mode which provides a Dired-like list of the contents
2619(@pxref{Dired}). You can move around through the list just as you
2620would in Dired, and visit the subfiles contained in the archive.
2621However, not all Dired commands are available in Tar mode.
2622
2623 If Auto Compression mode is enabled (@pxref{Compressed Files}), then
2624Tar mode is used also for compressed archives---files with extensions
2625@samp{.tgz}, @code{.tar.Z} and @code{.tar.gz}.
2626
2627 The keys @kbd{e}, @kbd{f} and @key{RET} all extract a component file
2628into its own buffer. You can edit it there, and if you save the
2629buffer, the edited version will replace the version in the Tar buffer.
2630@kbd{v} extracts a file into a buffer in View mode. @kbd{o} extracts
2631the file and displays it in another window, so you could edit the file
2632and operate on the archive simultaneously. @kbd{d} marks a file for
2633deletion when you later use @kbd{x}, and @kbd{u} unmarks a file, as in
2634Dired. @kbd{C} copies a file from the archive to disk and @kbd{R}
2635renames a file within the archive. @kbd{g} reverts the buffer from
2636the archive on disk.
2637
2638 The keys @kbd{M}, @kbd{G}, and @kbd{O} change the file's permission
2639bits, group, and owner, respectively.
2640
2641 If your display supports colors and the mouse, moving the mouse
2642pointer across a file name highlights that file name, indicating that
2643you can click on it. Clicking @kbd{Mouse-2} on the highlighted file
2644name extracts the file into a buffer and displays that buffer.
2645
2646 Saving the Tar buffer writes a new version of the archive to disk with
2647the changes you made to the components.
2648
2649 You don't need the @code{tar} program to use Tar mode---Emacs reads
2650the archives directly. However, accessing compressed archives
2651requires the appropriate uncompression program.
2652
2653@cindex Archive mode
2654@cindex mode, archive
2655@cindex @code{arc}
2656@cindex @code{jar}
2657@cindex @code{zip}
2658@cindex @code{lzh}
2659@cindex @code{zoo}
2660@pindex arc
2661@pindex jar
2662@pindex zip
2663@pindex lzh
2664@pindex zoo
2665@cindex Java class archives
2666@cindex unzip archives
2667 A separate but similar Archive mode is used for archives produced by
2668the programs @code{arc}, @code{jar}, @code{lzh}, @code{zip}, and
2669@code{zoo}, which have extensions corresponding to the program names.
2670Archive mode also works for those @code{exe} files that are
2671self-extracting executables.
2672
2673 The key bindings of Archive mode are similar to those in Tar mode,
2674with the addition of the @kbd{m} key which marks a file for subsequent
2675operations, and @kbd{M-@key{DEL}} which unmarks all the marked files.
2676Also, the @kbd{a} key toggles the display of detailed file
2677information, for those archive types where it won't fit in a single
2678line. Operations such as renaming a subfile, or changing its mode or
2679owner, are supported only for some of the archive formats.
2680
2681 Unlike Tar mode, Archive mode runs the archiving program to unpack
2682and repack archives. Details of the program names and their options
2683can be set in the @samp{Archive} Customize group. However, you don't
2684need these programs to look at the archive table of contents, only to
2685extract or manipulate the subfiles in the archive.
2686
2687@node Remote Files
2688@section Remote Files
2689
2690@cindex Tramp
2691@cindex FTP
2692@cindex remote file access
2693 You can refer to files on other machines using a special file name
2694syntax:
2695
2696@example
2697@group
2698/@var{host}:@var{filename}
2699/@var{user}@@@var{host}:@var{filename}
2700/@var{user}@@@var{host}#@var{port}:@var{filename}
2701/@var{method}:@var{user}@@@var{host}:@var{filename}
2702/@var{method}:@var{user}@@@var{host}#@var{port}:@var{filename}
2703@end group
2704@end example
2705
2706@noindent
2707To carry out this request, Emacs uses either the FTP program or a
2708remote-login program such as @command{ssh}, @command{rlogin}, or
2709@command{telnet}. You can always specify in the file name which
2710method to use---for example,
2711@file{/ftp:@var{user}@@@var{host}:@var{filename}} uses FTP, whereas
2712@file{/ssh:@var{user}@@@var{host}:@var{filename}} uses @command{ssh}.
2713When you don't specify a method in the file name, Emacs chooses
2714the method as follows:
2715
2716@enumerate
2717@item
2718If the host name starts with @samp{ftp.} (with dot), then Emacs uses
2719FTP.
2720@item
2721If the user name is @samp{ftp} or @samp{anonymous}, then Emacs uses
2722FTP.
2723@item
2724Otherwise, Emacs uses @command{ssh}.
2725@end enumerate
2726
2727@noindent
2728Remote file access through FTP is handled by the Ange-FTP package, which
2729is documented in the following. Remote file access through the other
2730methods is handled by the Tramp package, which has its own manual.
2731@xref{Top, The Tramp Manual,, tramp, The Tramp Manual}.
2732
2733When the Ange-FTP package is used, Emacs logs in through FTP using your
2734user name or the name @var{user}. It may ask you for a password from
2735time to time; this is used for logging in on @var{host}. The form using
2736@var{port} allows you to access servers running on a non-default TCP
2737port.
2738
2739@cindex backups for remote files
2740@vindex ange-ftp-make-backup-files
2741 If you want to disable backups for remote files, set the variable
2742@code{ange-ftp-make-backup-files} to @code{nil}.
2743
2744 By default, the auto-save files (@pxref{Auto Save Files}) for remote
2745files are made in the temporary file directory on the local machine.
2746This is achieved using the variable @code{auto-save-file-name-transforms}.
2747
2748@cindex ange-ftp
2749@vindex ange-ftp-default-user
2750@cindex user name for remote file access
2751 Normally, if you do not specify a user name in a remote file name,
2752that means to use your own user name. But if you set the variable
2753@code{ange-ftp-default-user} to a string, that string is used instead.
2754
2755@cindex anonymous FTP
2756@vindex ange-ftp-generate-anonymous-password
2757 To visit files accessible by anonymous FTP, you use special user
2758names @samp{anonymous} or @samp{ftp}. Passwords for these user names
2759are handled specially. The variable
2760@code{ange-ftp-generate-anonymous-password} controls what happens: if
2761the value of this variable is a string, then that string is used as
2762the password; if non-@code{nil} (the default), then the value of
2763@code{user-mail-address} is used; if @code{nil}, then Emacs prompts
2764you for a password as usual.
2765
2766@cindex firewall, and accessing remote files
2767@cindex gateway, and remote file access with @code{ange-ftp}
2768@vindex ange-ftp-smart-gateway
2769@vindex ange-ftp-gateway-host
2770 Sometimes you may be unable to access files on a remote machine
2771because a @dfn{firewall} in between blocks the connection for security
2772reasons. If you can log in on a @dfn{gateway} machine from which the
2773target files @emph{are} accessible, and whose FTP server supports
2774gatewaying features, you can still use remote file names; all you have
2775to do is specify the name of the gateway machine by setting the
2776variable @code{ange-ftp-gateway-host}, and set
2777@code{ange-ftp-smart-gateway} to @code{t}. Otherwise you may be able
2778to make remote file names work, but the procedure is complex. You can
2779read the instructions by typing @kbd{M-x finder-commentary @key{RET}
2780ange-ftp @key{RET}}.
2781
2782@vindex file-name-handler-alist
2783@cindex disabling remote files
2784 You can entirely turn off the FTP file name feature by removing the
2785entries @code{ange-ftp-completion-hook-function} and
2786@code{ange-ftp-hook-function} from the variable
2787@code{file-name-handler-alist}. You can turn off the feature in
2788individual cases by quoting the file name with @samp{/:} (@pxref{Quoted
2789File Names}).
2790
2791@node Quoted File Names
2792@section Quoted File Names
2793
2794@cindex quoting file names
2795@cindex file names, quote special characters
2796 You can @dfn{quote} an absolute file name to prevent special
2797characters and syntax in it from having their special effects.
2798The way to do this is to add @samp{/:} at the beginning.
2799
2800 For example, you can quote a local file name which appears remote, to
2801prevent it from being treated as a remote file name. Thus, if you have
2802a directory named @file{/foo:} and a file named @file{bar} in it, you
2803can refer to that file in Emacs as @samp{/:/foo:/bar}.
2804
2805 @samp{/:} can also prevent @samp{~} from being treated as a special
2806character for a user's home directory. For example, @file{/:/tmp/~hack}
2807refers to a file whose name is @file{~hack} in directory @file{/tmp}.
2808
2809 Quoting with @samp{/:} is also a way to enter in the minibuffer a
2810file name that contains @samp{$}. In order for this to work, the
2811@samp{/:} must be at the beginning of the minibuffer contents. (You
2812can also double each @samp{$}; see @ref{File Names with $}.)
2813
2814 You can also quote wildcard characters with @samp{/:}, for visiting.
2815For example, @file{/:/tmp/foo*bar} visits the file
2816@file{/tmp/foo*bar}.
2817
2818 Another method of getting the same result is to enter
2819@file{/tmp/foo[*]bar}, which is a wildcard specification that matches
2820only @file{/tmp/foo*bar}. However, in many cases there is no need to
2821quote the wildcard characters because even unquoted they give the
2822right result. For example, if the only file name in @file{/tmp} that
2823starts with @samp{foo} and ends with @samp{bar} is @file{foo*bar},
2824then specifying @file{/tmp/foo*bar} will visit only
2825@file{/tmp/foo*bar}.
2826
2827@node File Name Cache
2828@section File Name Cache
2829
2830@cindex file name caching
2831@cindex cache of file names
2832@pindex find
2833@kindex C-@key{TAB}
2834@findex file-cache-minibuffer-complete
2835 You can use the @dfn{file name cache} to make it easy to locate a
2836file by name, without having to remember exactly where it is located.
2837When typing a file name in the minibuffer, @kbd{C-@key{tab}}
2838(@code{file-cache-minibuffer-complete}) completes it using the file
2839name cache. If you repeat @kbd{C-@key{tab}}, that cycles through the
2840possible completions of what you had originally typed. (However, note
2841that the @kbd{C-@key{tab}} character cannot be typed on most text-only
2842terminals.)
2843
2844 The file name cache does not fill up automatically. Instead, you
2845load file names into the cache using these commands:
2846
2847@findex file-cache-add-directory
2848@table @kbd
2849@item M-x file-cache-add-directory @key{RET} @var{directory} @key{RET}
2850Add each file name in @var{directory} to the file name cache.
2851@item M-x file-cache-add-directory-using-find @key{RET} @var{directory} @key{RET}
2852Add each file name in @var{directory} and all of its nested
2853subdirectories to the file name cache.
2854@item M-x file-cache-add-directory-using-locate @key{RET} @var{directory} @key{RET}
2855Add each file name in @var{directory} and all of its nested
2856subdirectories to the file name cache, using @command{locate} to find
2857them all.
2858@item M-x file-cache-add-directory-list @key{RET} @var{variable} @key{RET}
2859Add each file name in each directory listed in @var{variable}
2860to the file name cache. @var{variable} should be a Lisp variable
2861such as @code{load-path} or @code{exec-path}, whose value is a list
2862of directory names.
2863@item M-x file-cache-clear-cache @key{RET}
2864Clear the cache; that is, remove all file names from it.
2865@end table
2866
2867 The file name cache is not persistent: it is kept and maintained
2868only for the duration of the Emacs session. You can view the contents
2869of the cache with the @code{file-cache-display} command.
2870
2871@node File Conveniences
2872@section Convenience Features for Finding Files
2873
2874 In this section, we introduce some convenient facilities for finding
2875recently-opened files, reading file names from a buffer, and viewing
2876image files.
2877
2878@findex recentf-mode
2879@vindex recentf-mode
2880@findex recentf-save-list
2881@findex recentf-edit-list
2882 If you enable Recentf mode, with @kbd{M-x recentf-mode}, the
2883@samp{File} menu includes a submenu containing a list of recently
2884opened files. @kbd{M-x recentf-save-list} saves the current
2885@code{recent-file-list} to a file, and @kbd{M-x recentf-edit-list}
2886edits it.
2887
2888 The @kbd{M-x ffap} command generalizes @code{find-file} with more
2889powerful heuristic defaults (@pxref{FFAP}), often based on the text at
2890point. Partial Completion mode offers other features extending
2891@code{find-file}, which can be used with @code{ffap}.
2892@xref{Completion Options}.
2893
2894@findex image-mode
2895@findex image-toggle-display
2896@cindex images, viewing
2897 Visiting image files automatically selects Image mode. This major
2898mode allows you to toggle between displaying the file as an image in
2899the Emacs buffer, and displaying its underlying text representation,
2900using the command @kbd{C-c C-c} (@code{image-toggle-display}). This
2901works only when Emacs can display the specific image type. If the
2902displayed image is wider or taller than the frame, the usual point
2903motion keys (@kbd{C-f}, @kbd{C-p}, and so forth) cause different parts
2904of the image to be displayed.
2905
2906@findex thumbs-mode
2907@findex mode, thumbs
2908 See also the Image-Dired package (@pxref{Image-Dired}) for viewing
2909images as thumbnails.
2910
2911@node Filesets
2912@section Filesets
2913@cindex filesets
2914
2915@findex filesets-init
2916 If you regularly edit a certain group of files, you can define them
2917as a @dfn{fileset}. This lets you perform certain operations, such as
2918visiting, @code{query-replace}, and shell commands on all the files
2919at once. To make use of filesets, you must first add the expression
2920@code{(filesets-init)} to your @file{.emacs} file (@pxref{Init File}).
2921This adds a @samp{Filesets} menu to the menu bar.
2922
2923@findex filesets-add-buffer
2924@findex filesets-remove-buffer
2925 The simplest way to define a fileset is by adding files to it one
2926at a time. To add a file to fileset @var{name}, visit the file and
2927type @kbd{M-x filesets-add-buffer @kbd{RET} @var{name} @kbd{RET}}. If
2928there is no fileset @var{name}, this creates a new one, which
2929initially creates only the current file. The command @kbd{M-x
2930filesets-remove-buffer} removes the current file from a fileset.
2931
2932 You can also edit the list of filesets directly, with @kbd{M-x
2933filesets-edit} (or by choosing @samp{Edit Filesets} from the
2934@samp{Filesets} menu). The editing is performed in a Customize buffer
2935(@pxref{Easy Customization}). Filesets need not be a simple list of
2936files---you can also define filesets using regular expression matching
2937file names. Some examples of these more complicated filesets are
2938shown in the Customize buffer. Remember to select @samp{Save for
2939future sessions} if you want to use the same filesets in future Emacs
2940sessions.
2941
2942 You can use the command @kbd{M-x filesets-open} to visit all the
2943files in a fileset, and @kbd{M-x filesets-close} to close them. Use
2944@kbd{M-x filesets-run-cmd} to run a shell command on all the files in
2945a fileset. These commands are also available from the @samp{Filesets}
2946menu, where each existing fileset is represented by a submenu.
2947
2948@ignore
2949 arch-tag: 768d32cb-e15a-4cc1-b7bf-62c00ee12250
2950@end ignore
diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi
new file mode 100644
index 00000000000..d1577e2f528
--- /dev/null
+++ b/doc/emacs/fixit.texi
@@ -0,0 +1,471 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Fixit, Keyboard Macros, Search, Top
6@chapter Commands for Fixing Typos
7@cindex typos, fixing
8@cindex mistakes, correcting
9
10 In this chapter we describe the commands that are especially useful for
11the times when you catch a mistake in your text just after you have made
12it, or change your mind while composing text on the fly.
13
14 The most fundamental command for correcting erroneous editing is the
15undo command, @kbd{C-x u} or @kbd{C-_} or @kbd{C-/}. This command
16undoes a single command (usually), a part of a command (in the case of
17@code{query-replace}), or several consecutive self-inserting
18characters. Consecutive repetitions of the undo command undo earlier
19and earlier changes, back to the limit of the undo information
20available. @xref{Undo}, for more information.
21
22@menu
23* Undo:: The Undo commands.
24* Kill Errors:: Commands to kill a batch of recently entered text.
25* Transpose:: Exchanging two characters, words, lines, lists...
26* Fixing Case:: Correcting case of last word entered.
27* Spelling:: Apply spelling checker to a word, or a whole file.
28@end menu
29
30@node Undo
31@section Undo
32@cindex undo
33@cindex changes, undoing
34
35 The @dfn{undo} commands undo recent changes in the buffer's text.
36Each buffer records changes individually, and the undo command always
37applies to the current buffer. You can undo all the changes in a
38buffer for as far as back these records go. Usually each editing
39command makes a separate entry in the undo records, but some commands
40such as @code{query-replace} divide their changes into multiple
41entries for flexibility in undoing. Meanwhile, self-inserting
42characters are usually grouped to make undoing less tedious.
43
44@table @kbd
45@item C-x u
46@itemx C-_
47@itemx C-/
48Undo one entry in the current buffer's undo records (@code{undo}).
49@end table
50
51@kindex C-x u
52@kindex C-_
53@kindex C-/
54@findex undo
55 To begin to undo, type the command @kbd{C-x u} (or its aliases,
56@kbd{C-_} or @kbd{C-/}). This undoes the most recent change in the
57buffer, and moves point back to where it was before that change.
58
59 Consecutive repetitions of @kbd{C-x u} (or its aliases) undo earlier
60and earlier changes in the current buffer, back to the limit of the
61current buffer's undo records. If all the recorded changes have
62already been undone, the undo command just signals an error.
63
64 If you notice that a buffer has been modified accidentally, the
65easiest way to recover is to type @kbd{C-_} repeatedly until the stars
66disappear from the front of the mode line. At this time, all the
67modifications you made have been canceled. Whenever an undo command
68makes the stars disappear from the mode line, it means that the buffer
69contents are the same as they were when the file was last read in or
70saved.
71
72 If you do not remember whether you changed the buffer deliberately,
73type @kbd{C-_} once. When you see the last change you made undone, you
74will see whether it was an intentional change. If it was an accident,
75leave it undone. If it was deliberate, redo the change as described
76below.
77
78@findex undo-only
79 Any command other than an undo command breaks the sequence of undo
80commands. Starting from that moment, the previous undo commands
81become ordinary changes that you can undo. Thus, to redo changes you
82have undone, type @kbd{C-f} or any other command that will harmlessly
83break the sequence of undoing, then type undo commands again. On the
84other hand, if you want to resume undoing, without redoing previous
85undo commands, use @kbd{M-x undo-only}. This is like @code{undo}, but
86will not redo changes you have just undone.
87
88@cindex selective undo
89@kindex C-u C-x u
90 Ordinary undo applies to all changes made in the current buffer. You
91can also perform @dfn{selective undo}, limited to the region.
92
93 To do this, specify the region you want, then run the @code{undo}
94command with a prefix argument (the value does not matter): @kbd{C-u
95C-x u} or @kbd{C-u C-_}. This undoes the most recent change in the
96region. To undo further changes in the same region, repeat the
97@code{undo} command (no prefix argument is needed). In Transient Mark
98mode (@pxref{Transient Mark}), any use of @code{undo} when there is an
99active region performs selective undo; you do not need a prefix
100argument.
101
102 Some specialized buffers do not make undo records. Buffers
103whose names start with spaces never do; these buffers are used
104internally by Emacs and its extensions to hold text that users don't
105normally look at or edit.
106
107@vindex undo-limit
108@vindex undo-strong-limit
109@vindex undo-outer-limit
110@cindex undo limit
111 When the undo records for a buffer becomes too large, Emacs
112discards the oldest undo records from time to time (during garbage
113collection). You can specify how much undo records to keep by
114setting three variables: @code{undo-limit}, @code{undo-strong-limit},
115and @code{undo-outer-limit}. Their values are expressed in units of
116bytes of space.
117
118 The variable @code{undo-limit} sets a soft limit: Emacs keeps undo
119data for enough commands to reach this size, and perhaps exceed it,
120but does not keep data for any earlier commands beyond that. Its
121default value is 20000. The variable @code{undo-strong-limit} sets a
122stricter limit: a previous command (not the most recent one) which
123pushes the size past this amount is itself forgotten. The default
124value of @code{undo-strong-limit} is 30000.
125
126 Regardless of the values of those variables, the most recent change
127is never discarded unless it gets bigger than @code{undo-outer-limit}
128(normally 3,000,000). At that point, Emacs discards the undo data and
129warns you about it. This is the only situation in which you cannot
130undo the last command. If this happens, you can increase the value of
131@code{undo-outer-limit} to make it even less likely to happen in the
132future. But if you didn't expect the command to create such large
133undo data, then it is probably a bug and you should report it.
134@xref{Bugs,, Reporting Bugs}.
135
136 The reason the @code{undo} command has three key bindings, @kbd{C-x
137u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a
138single-character key, but @kbd{C-x u} is more straightforward for
139beginners to remember and type. Meanwhile, @kbd{C--} on a text-only
140terminal is really @kbd{C-_}, which makes it a natural and easily
141typed binding for undoing.
142
143@node Kill Errors
144@section Killing Your Mistakes
145
146@table @kbd
147@item @key{DEL}
148Delete last character (@code{delete-backward-char}).
149@item M-@key{DEL}
150Kill last word (@code{backward-kill-word}).
151@item C-x @key{DEL}
152Kill to beginning of sentence (@code{backward-kill-sentence}).
153@end table
154
155 The @key{DEL} character (@code{delete-backward-char}) is the most
156important correction command. It deletes the character before point.
157When @key{DEL} follows a self-inserting character command, you can think
158of it as canceling that command. However, avoid the confusion of thinking
159of @key{DEL} as a general way to cancel a command!
160
161 When your mistake is longer than a couple of characters, it might be
162more convenient to use @kbd{M-@key{DEL}} or @kbd{C-x @key{DEL}}.
163@kbd{M-@key{DEL}} kills back to the start of the last word, and @kbd{C-x
164@key{DEL}} kills back to the start of the last sentence. @kbd{C-x
165@key{DEL}} is particularly useful when you change your mind about the
166phrasing of the text you are writing. @kbd{M-@key{DEL}} and @kbd{C-x
167@key{DEL}} save the killed text for @kbd{C-y} and @kbd{M-y} to
168retrieve. @xref{Yanking}.@refill
169
170 @kbd{M-@key{DEL}} is often useful even when you have typed only a few
171characters wrong, if you know you are confused in your typing and aren't
172sure exactly what you typed. At such a time, you cannot correct with
173@key{DEL} except by looking at the screen to see what you did. Often it
174requires less thought to kill the whole word and start again.
175
176@node Transpose
177@section Transposing Text
178
179@table @kbd
180@item C-t
181Transpose two characters (@code{transpose-chars}).
182@item M-t
183Transpose two words (@code{transpose-words}).
184@item C-M-t
185Transpose two balanced expressions (@code{transpose-sexps}).
186@item C-x C-t
187Transpose two lines (@code{transpose-lines}).
188@end table
189
190@kindex C-t
191@findex transpose-chars
192 The common error of transposing two characters can be fixed, when they
193are adjacent, with the @kbd{C-t} command (@code{transpose-chars}). Normally,
194@kbd{C-t} transposes the two characters on either side of point. When
195given at the end of a line, rather than transposing the last character of
196the line with the newline, which would be useless, @kbd{C-t} transposes the
197last two characters on the line. So, if you catch your transposition error
198right away, you can fix it with just a @kbd{C-t}. If you don't catch it so
199fast, you must move the cursor back between the two transposed
200characters before you type @kbd{C-t}. If you transposed a space with
201the last character of the word before it, the word motion commands are
202a good way of getting there. Otherwise, a reverse search (@kbd{C-r})
203is often the best way. @xref{Search}.
204
205@kindex C-x C-t
206@findex transpose-lines
207@kindex M-t
208@findex transpose-words
209@c Don't index C-M-t and transpose-sexps here, they are indexed in
210@c programs.texi, in the "List Commands" node.
211@c @kindex C-M-t
212@c @findex transpose-sexps
213 @kbd{M-t} transposes the word before point with the word after point
214(@code{transpose-words}). It moves point forward over a word,
215dragging the word preceding or containing point forward as well. The
216punctuation characters between the words do not move. For example,
217@w{@samp{FOO, BAR}} transposes into @w{@samp{BAR, FOO}} rather than
218@samp{@w{BAR FOO,}}.
219
220 @kbd{C-M-t} (@code{transpose-sexps}) is a similar command for
221transposing two expressions (@pxref{Expressions}), and @kbd{C-x C-t}
222(@code{transpose-lines}) exchanges lines. They work like @kbd{M-t}
223except as regards what units of text they transpose.
224
225 A numeric argument to a transpose command serves as a repeat count: it
226tells the transpose command to move the character (word, expression, line)
227before or containing point across several other characters (words,
228expressions, lines). For example, @kbd{C-u 3 C-t} moves the character before
229point forward across three other characters. It would change
230@samp{f@point{}oobar} into @samp{oobf@point{}ar}. This is equivalent to
231repeating @kbd{C-t} three times. @kbd{C-u - 4 M-t} moves the word
232before point backward across four words. @kbd{C-u - C-M-t} would cancel
233the effect of plain @kbd{C-M-t}.@refill
234
235 A numeric argument of zero is assigned a special meaning (because
236otherwise a command with a repeat count of zero would do nothing): to
237transpose the character (word, expression, line) ending after point
238with the one ending after the mark.
239
240@node Fixing Case
241@section Case Conversion
242
243@table @kbd
244@item M-- M-l
245Convert last word to lower case. Note @kbd{Meta--} is Meta-minus.
246@item M-- M-u
247Convert last word to all upper case.
248@item M-- M-c
249Convert last word to lower case with capital initial.
250@end table
251
252@kindex M-@t{-} M-l
253@kindex M-@t{-} M-u
254@kindex M-@t{-} M-c
255 A very common error is to type words in the wrong case. Because of this,
256the word case-conversion commands @kbd{M-l}, @kbd{M-u} and @kbd{M-c} have a
257special feature when used with a negative argument: they do not move the
258cursor. As soon as you see you have mistyped the last word, you can simply
259case-convert it and go on typing. @xref{Case}.@refill
260
261@node Spelling
262@section Checking and Correcting Spelling
263@cindex spelling, checking and correcting
264@cindex checking spelling
265@cindex correcting spelling
266
267 This section describes the commands to check the spelling of a single
268word or of a portion of a buffer. These commands work with the spelling
269checker programs Aspell and Ispell, which are not part of Emacs.
270@ifnottex
271@xref{Top, Aspell,, aspell, The Aspell Manual}.
272@end ifnottex
273
274@table @kbd
275@item M-x flyspell-mode
276Enable Flyspell mode, which highlights all misspelled words.
277@item M-x flyspell-prog-mode
278Enable Flyspell mode for comments and strings only.
279@item M-$
280Check and correct spelling of the word at point (@code{ispell-word}).
281@item M-@key{TAB}
282@itemx @key{ESC} @key{TAB}
283Complete the word before point based on the spelling dictionary
284(@code{ispell-complete-word}).
285@item M-x ispell
286Spell-check the active region or the current buffer.
287@item M-x ispell-buffer
288Check and correct spelling of each word in the buffer.
289@item M-x ispell-region
290Check and correct spelling of each word in the region.
291@item M-x ispell-message
292Check and correct spelling of each word in a draft mail message,
293excluding cited material.
294@item M-x ispell-change-dictionary @key{RET} @var{dict} @key{RET}
295Restart the Aspell or Ispell process, using @var{dict} as the dictionary.
296@item M-x ispell-kill-ispell
297Kill the Aspell or Ispell subprocess.
298@end table
299
300@cindex Flyspell mode
301@findex flyspell-mode
302 Flyspell mode is a fully-automatic way to check spelling as you edit
303in Emacs. It operates by checking words as you change or insert them.
304When it finds a word that it does not recognize, it highlights that
305word. This does not interfere with your editing, but when you see the
306highlighted word, you can move to it and fix it. Type @kbd{M-x
307flyspell-mode} to enable or disable this mode in the current buffer.
308
309 When Flyspell mode highlights a word as misspelled, you can click on
310it with @kbd{Mouse-2} to display a menu of possible corrections and
311actions. You can also correct the word by editing it manually in any
312way you like.
313
314@findex flyspell-prog-mode
315Flyspell Prog mode works just like ordinary Flyspell mode, except that
316it only checks words in comments and string constants. This feature
317is useful for editing programs. Type @kbd{M-x flyspell-prog-mode} to
318enable or disable this mode in the current buffer.
319
320 The other Emacs spell-checking features check or look up words when
321you give an explicit command to do so.
322
323@kindex M-$
324@findex ispell-word
325 To check the spelling of the word around or before point, and
326optionally correct it as well, use the command @kbd{M-$}
327(@code{ispell-word}). If the word is not correct, the command offers
328you various alternatives for what to do about it.
329
330@findex ispell-buffer
331@findex ispell-region
332 To check the entire current buffer, use @kbd{M-x ispell-buffer}. Use
333@kbd{M-x ispell-region} to check just the current region. To check
334spelling in an email message you are writing, use @kbd{M-x
335ispell-message}; that command checks the whole buffer, except for
336material that is indented or appears to be cited from other messages.
337
338@findex ispell
339@cindex spell-checking the active region
340 The @kbd{M-x ispell} command spell-checks the active region if the
341Transient Mark mode is on (@pxref{Transient Mark}), otherwise it
342spell-checks the current buffer.
343
344 Each time these commands encounter an incorrect word, they ask you
345what to do. They display a list of alternatives, usually including
346several ``near-misses''---words that are close to the word being
347checked. Then you must type a single-character response. Here are
348the valid responses:
349
350@table @kbd
351@item @key{SPC}
352Skip this word---continue to consider it incorrect, but don't change it
353here.
354
355@item r @var{new} @key{RET}
356Replace the word (just this time) with @var{new}. (The replacement
357string will be rescanned for more spelling errors.)
358
359@item R @var{new} @key{RET}
360Replace the word with @var{new}, and do a @code{query-replace} so you
361can replace it elsewhere in the buffer if you wish. (The replacements
362will be rescanned for more spelling errors.)
363
364@item @var{digit}
365Replace the word (just this time) with one of the displayed
366near-misses. Each near-miss is listed with a digit; type that digit to
367select it.
368
369@item a
370Accept the incorrect word---treat it as correct, but only in this
371editing session.
372
373@item A
374Accept the incorrect word---treat it as correct, but only in this
375editing session and for this buffer.
376
377@item i
378Insert this word in your private dictionary file so that Aspell or Ispell will
379consider it correct from now on, even in future sessions.
380
381@item u
382Insert the lower-case version of this word in your private dic@-tion@-ary
383file.
384
385@item m
386Like @kbd{i}, but you can also specify dictionary completion
387information.
388
389@item l @var{word} @key{RET}
390Look in the dictionary for words that match @var{word}. These words
391become the new list of ``near-misses''; you can select one of them as
392the replacement by typing a digit. You can use @samp{*} in @var{word} as a
393wildcard.
394
395@item C-g
396Quit interactive spell checking, leaving point at the word that was
397being checked. You can restart checking again afterward with @kbd{C-u
398M-$}.
399
400@item X
401Same as @kbd{C-g}.
402
403@item x
404Quit interactive spell checking and move point back to where it was
405when you started spell checking.
406
407@item q
408Quit interactive spell checking and kill the Ispell subprocess.
409
410@item C-l
411Refresh the screen.
412
413@item C-z
414This key has its normal command meaning (suspend Emacs or iconify this
415frame).
416
417@item ?
418Show the list of options.
419@end table
420
421@findex ispell-complete-word
422 The command @code{ispell-complete-word}, which is bound to the key
423@kbd{M-@key{TAB}} in Text mode and related modes, shows a list of
424completions based on spelling correction. Insert the beginning of a
425word, and then type @kbd{M-@key{TAB}}; the command displays a
426completion list window. (If your window manager intercepts
427@kbd{M-@key{TAB}}, type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) To
428choose one of the completions listed, click @kbd{Mouse-2} or
429@kbd{Mouse-1} fast on it, or move the cursor there in the completions
430window and type @key{RET}. @xref{Text Mode}.
431
432@ignore
433@findex reload-ispell
434 The first time you use any of the spell checking commands, it starts
435an Ispell subprocess. The first thing the subprocess does is read your
436private dictionary, which defaults to the file @file{~/ispell.words}.
437Words that you ``insert'' with the @kbd{i} command are added to that
438file, but not right away---only at the end of the interactive
439replacement procedure. Use the @kbd{M-x reload-ispell} command to
440reload your private dictionary if you edit the file outside of Ispell.
441@end ignore
442
443@cindex @code{ispell} program
444@findex ispell-kill-ispell
445 Once started, the Aspell or Ispell subprocess continues to run
446(waiting for something to do), so that subsequent spell checking
447commands complete more quickly. If you want to get rid of the
448process, use @kbd{M-x ispell-kill-ispell}. This is not usually
449necessary, since the process uses no time except when you do spelling
450correction.
451
452@vindex ispell-dictionary
453 Ispell and Aspell use two dictionaries together for spell checking: the
454standard dictionary and your private dictionary. The variable
455@code{ispell-dictionary} specifies the file name to use for the
456standard dictionary; a value of @code{nil} selects the default
457dictionary. The command @kbd{M-x ispell-change-dictionary} sets this
458variable and then restarts the subprocess, so that it will use
459a different standard dictionary.
460
461@vindex ispell-complete-word-dict
462 Aspell and Ispell use a separate dictionary for word completion.
463The variable @code{ispell-complete-word-dict} specifies the file name
464of this dictionary. The completion dictionary must be different
465because it cannot use root and affix information. For some languages
466there is a spell checking dictionary but no word completion
467dictionary.
468
469@ignore
470 arch-tag: 3359a443-96ed-448f-9f05-c8111ba8eac0
471@end ignore
diff --git a/doc/emacs/fortran-xtra.texi b/doc/emacs/fortran-xtra.texi
new file mode 100644
index 00000000000..9249f5f006c
--- /dev/null
+++ b/doc/emacs/fortran-xtra.texi
@@ -0,0 +1,548 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Fortran
8@section Fortran Mode
9@cindex Fortran mode
10@cindex mode, Fortran
11
12 Fortran mode provides special motion commands for Fortran statements
13and subprograms, and indentation commands that understand Fortran
14conventions of nesting, line numbers and continuation statements.
15Fortran mode has support for Auto Fill mode that breaks long lines into
16proper Fortran continuation lines.
17
18 Special commands for comments are provided because Fortran comments
19are unlike those of other languages. Built-in abbrevs optionally save
20typing when you insert Fortran keywords.
21
22 Use @kbd{M-x fortran-mode} to switch to this major mode. This
23command runs the hook @code{fortran-mode-hook}.
24@iftex
25@xref{Hooks,,, emacs, the Emacs Manual}.
26@end iftex
27@ifnottex
28@xref{Hooks}.
29@end ifnottex
30
31@cindex Fortran77 and Fortran90
32@findex f90-mode
33@findex fortran-mode
34 Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
35``tab format'') source code. For editing the modern Fortran90 or
36Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
37Emacs normally uses Fortran mode for files with extension @samp{.f},
38@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
39@samp{.f95}. GNU Fortran supports both kinds of format.
40
41@menu
42* Motion: Fortran Motion. Moving point by statements or subprograms.
43* Indent: Fortran Indent. Indentation commands for Fortran.
44* Comments: Fortran Comments. Inserting and aligning comments.
45* Autofill: Fortran Autofill. Auto fill support for Fortran.
46* Columns: Fortran Columns. Measuring columns for valid Fortran.
47* Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords.
48@end menu
49
50@node Fortran Motion
51@subsection Motion Commands
52
53 In addition to the normal commands for moving by and operating on
54``defuns'' (Fortran subprograms---functions and subroutines, as well as
55modules for F90 mode), Fortran mode provides special commands to move by
56statements and other program units.
57
58@table @kbd
59@kindex C-c C-n @r{(Fortran mode)}
60@findex fortran-next-statement
61@findex f90-next-statement
62@item C-c C-n
63Move to the beginning of the next statement
64(@code{fortran-next-statement}/@code{f90-next-statement}).
65
66@kindex C-c C-p @r{(Fortran mode)}
67@findex fortran-previous-statement
68@findex f90-previous-statement
69@item C-c C-p
70Move to the beginning of the previous statement
71(@code{fortran-previous-statement}/@code{f90-previous-statement}).
72If there is no previous statement (i.e. if called from the first
73statement in the buffer), move to the start of the buffer.
74
75@kindex C-c C-e @r{(F90 mode)}
76@findex f90-next-block
77@item C-c C-e
78Move point forward to the start of the next code block
79(@code{f90-next-block}). A code block is a subroutine,
80@code{if}--@code{endif} statement, and so forth. This command exists
81for F90 mode only, not Fortran mode. With a numeric argument, this
82moves forward that many blocks.
83
84@kindex C-c C-a @r{(F90 mode)}
85@findex f90-previous-block
86@item C-c C-a
87Move point backward to the previous code block
88(@code{f90-previous-block}). This is like @code{f90-next-block}, but
89moves backwards.
90
91@kindex C-M-n @r{(Fortran mode)}
92@findex fortran-end-of-block
93@findex f90-end-of-block
94@item C-M-n
95Move to the end of the current code block
96(@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric
97argument, move forward that number of blocks. The mark is set before
98moving point. The F90 mode version of this command checks for
99consistency of block types and labels (if present), but it does not
100check the outermost block since that may be incomplete.
101
102@kindex C-M-p @r{(Fortran mode)}
103@findex fortran-beginning-of-block
104@findex f90-beginning-of-block
105@item C-M-p
106Move to the start of the current code block
107(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
108is like @code{fortran-end-of-block}, but moves backwards.
109@end table
110
111@node Fortran Indent
112@subsection Fortran Indentation
113
114 Special commands and features are needed for indenting Fortran code in
115order to make sure various syntactic entities (line numbers, comment line
116indicators and continuation line flags) appear in the columns that are
117required for standard, fixed (or tab) format Fortran.
118
119@menu
120* Commands: ForIndent Commands. Commands for indenting and filling Fortran.
121* Contline: ForIndent Cont. How continuation lines indent.
122* Numbers: ForIndent Num. How line numbers auto-indent.
123* Conv: ForIndent Conv. Conventions you must obey to avoid trouble.
124* Vars: ForIndent Vars. Variables controlling Fortran indent style.
125@end menu
126
127@node ForIndent Commands
128@subsubsection Fortran Indentation and Filling Commands
129
130@table @kbd
131@item C-M-j
132Break the current line at point and set up a continuation line
133(@code{fortran-split-line}).
134@item M-^
135Join this line to the previous line (@code{fortran-join-line}).
136@item C-M-q
137Indent all the lines of the subprogram point is in
138(@code{fortran-indent-subprogram}).
139@item M-q
140Fill a comment block or statement.
141@end table
142
143@kindex C-M-q @r{(Fortran mode)}
144@findex fortran-indent-subprogram
145 The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
146to reindent all the lines of the Fortran subprogram (function or
147subroutine) containing point.
148
149@kindex C-M-j @r{(Fortran mode)}
150@findex fortran-split-line
151 The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
152a line in the appropriate fashion for Fortran. In a non-comment line,
153the second half becomes a continuation line and is indented
154accordingly. In a comment line, both halves become separate comment
155lines.
156
157@kindex M-^ @r{(Fortran mode)}
158@kindex C-c C-d @r{(Fortran mode)}
159@findex fortran-join-line
160 @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
161which joins a continuation line back to the previous line, roughly as
162the inverse of @code{fortran-split-line}. The point must be on a
163continuation line when this command is invoked.
164
165@kindex M-q @r{(Fortran mode)}
166@kbd{M-q} in Fortran mode fills the comment block or statement that
167point is in. This removes any excess statement continuations.
168
169@node ForIndent Cont
170@subsubsection Continuation Lines
171@cindex Fortran continuation lines
172
173@vindex fortran-continuation-string
174 Most Fortran77 compilers allow two ways of writing continuation lines.
175If the first non-space character on a line is in column 5, then that
176line is a continuation of the previous line. We call this @dfn{fixed
177format}. (In GNU Emacs we always count columns from 0; but note that
178the Fortran standard counts from 1.) The variable
179@code{fortran-continuation-string} specifies what character to put in
180column 5. A line that starts with a tab character followed by any digit
181except @samp{0} is also a continuation line. We call this style of
182continuation @dfn{tab format}. (Fortran90 introduced ``free format,''
183with another style of continuation lines).
184
185@vindex indent-tabs-mode @r{(Fortran mode)}
186@vindex fortran-analyze-depth
187@vindex fortran-tab-mode-default
188 Fortran mode can use either style of continuation line. When you
189enter Fortran mode, it tries to deduce the proper continuation style
190automatically from the buffer contents. It does this by scanning up to
191@code{fortran-analyze-depth} (default 100) lines from the start of the
192buffer. The first line that begins with either a tab character or six
193spaces determines the choice. If the scan fails (for example, if the
194buffer is new and therefore empty), the value of
195@code{fortran-tab-mode-default} (@code{nil} for fixed format, and
196non-@code{nil} for tab format) is used. @samp{/t} in the mode line
197indicates tab format is selected. Fortran mode sets the value of
198@code{indent-tabs-mode} accordingly.
199
200 If the text on a line starts with the Fortran continuation marker
201@samp{$}, or if it begins with any non-whitespace character in column
2025, Fortran mode treats it as a continuation line. When you indent a
203continuation line with @key{TAB}, it converts the line to the current
204continuation style. When you split a Fortran statement with
205@kbd{C-M-j}, the continuation marker on the newline is created according
206to the continuation style.
207
208 The setting of continuation style affects several other aspects of
209editing in Fortran mode. In fixed format mode, the minimum column
210number for the body of a statement is 6. Lines inside of Fortran
211blocks that are indented to larger column numbers always use only the
212space character for whitespace. In tab format mode, the minimum
213column number for the statement body is 8, and the whitespace before
214column 8 must always consist of one tab character.
215
216@node ForIndent Num
217@subsubsection Line Numbers
218
219 If a number is the first non-whitespace in the line, Fortran
220indentation assumes it is a line number and moves it to columns 0
221through 4. (Columns always count from 0 in GNU Emacs.)
222
223@vindex fortran-line-number-indent
224 Line numbers of four digits or less are normally indented one space.
225The variable @code{fortran-line-number-indent} controls this; it
226specifies the maximum indentation a line number can have. The default
227value of the variable is 1. Fortran mode tries to prevent line number
228digits passing column 4, reducing the indentation below the specified
229maximum if necessary. If @code{fortran-line-number-indent} has the
230value 5, line numbers are right-justified to end in column 4.
231
232@vindex fortran-electric-line-number
233 Simply inserting a line number is enough to indent it according to
234these rules. As each digit is inserted, the indentation is recomputed.
235To turn off this feature, set the variable
236@code{fortran-electric-line-number} to @code{nil}.
237
238
239@node ForIndent Conv
240@subsubsection Syntactic Conventions
241
242 Fortran mode assumes that you follow certain conventions that simplify
243the task of understanding a Fortran program well enough to indent it
244properly:
245
246@itemize @bullet
247@item
248Two nested @samp{do} loops never share a @samp{continue} statement.
249
250@item
251Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
252and others are written without embedded whitespace or line breaks.
253
254Fortran compilers generally ignore whitespace outside of string
255constants, but Fortran mode does not recognize these keywords if they
256are not contiguous. Constructs such as @samp{else if} or @samp{end do}
257are acceptable, but the second word should be on the same line as the
258first and not on a continuation line.
259@end itemize
260
261@noindent
262If you fail to follow these conventions, the indentation commands may
263indent some lines unaesthetically. However, a correct Fortran program
264retains its meaning when reindented even if the conventions are not
265followed.
266
267@node ForIndent Vars
268@subsubsection Variables for Fortran Indentation
269
270@vindex fortran-do-indent
271@vindex fortran-if-indent
272@vindex fortran-structure-indent
273@vindex fortran-continuation-indent
274@vindex fortran-check-all-num@dots{}
275@vindex fortran-minimum-statement-indent@dots{}
276 Several additional variables control how Fortran indentation works:
277
278@table @code
279@item fortran-do-indent
280Extra indentation within each level of @samp{do} statement (default 3).
281
282@item fortran-if-indent
283Extra indentation within each level of @samp{if}, @samp{select case}, or
284@samp{where} statements (default 3).
285
286@item fortran-structure-indent
287Extra indentation within each level of @samp{structure}, @samp{union},
288@samp{map}, or @samp{interface} statements (default 3).
289
290@item fortran-continuation-indent
291Extra indentation for bodies of continuation lines (default 5).
292
293@item fortran-check-all-num-for-matching-do
294In Fortran77, a numbered @samp{do} statement is ended by any statement
295with a matching line number. It is common (but not compulsory) to use a
296@samp{continue} statement for this purpose. If this variable has a
297non-@code{nil} value, indenting any numbered statement must check for a
298@samp{do} that ends there. If you always end @samp{do} statements with
299a @samp{continue} line (or if you use the more modern @samp{enddo}),
300then you can speed up indentation by setting this variable to
301@code{nil}. The default is @code{nil}.
302
303@item fortran-blink-matching-if
304If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
305statement moves the cursor momentarily to the matching @samp{if} (or
306@samp{do}) statement to show where it is. The default is @code{nil}.
307
308@item fortran-minimum-statement-indent-fixed
309Minimum indentation for Fortran statements when using fixed format
310continuation line style. Statement bodies are never indented less than
311this much. The default is 6.
312
313@item fortran-minimum-statement-indent-tab
314Minimum indentation for Fortran statements for tab format continuation line
315style. Statement bodies are never indented less than this much. The
316default is 8.
317@end table
318
319The variables controlling the indentation of comments are described in
320the following section.
321
322@node Fortran Comments
323@subsection Fortran Comments
324
325 The usual Emacs comment commands assume that a comment can follow a
326line of code. In Fortran77, the standard comment syntax requires an
327entire line to be just a comment. Therefore, Fortran mode replaces the
328standard Emacs comment commands and defines some new variables.
329
330@vindex fortran-comment-line-start
331 Fortran mode can also handle the Fortran90 comment syntax where comments
332start with @samp{!} and can follow other text. Because only some Fortran77
333compilers accept this syntax, Fortran mode will not insert such comments
334unless you have said in advance to do so. To do this, set the variable
335@code{fortran-comment-line-start} to @samp{"!"}.
336
337@table @kbd
338@item M-;
339Align comment or insert new comment (@code{fortran-indent-comment}).
340
341@item C-x ;
342Applies to nonstandard @samp{!} comments only.
343
344@item C-c ;
345Turn all lines of the region into comments, or (with argument) turn them back
346into real code (@code{fortran-comment-region}).
347@end table
348
349@findex fortran-indent-comment
350 @kbd{M-;} in Fortran mode is redefined as the command
351@code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this
352recognizes any kind of existing comment and aligns its text appropriately;
353if there is no existing comment, a comment is inserted and aligned. But
354inserting and aligning comments are not the same in Fortran mode as in
355other modes.
356
357 When a new comment must be inserted, if the current line is blank, a
358full-line comment is inserted. On a non-blank line, a nonstandard @samp{!}
359comment is inserted if you have said you want to use them. Otherwise a
360full-line comment is inserted on a new line before the current line.
361
362 Nonstandard @samp{!} comments are aligned like comments in other
363languages, but full-line comments are different. In a standard full-line
364comment, the comment delimiter itself must always appear in column zero.
365What can be aligned is the text within the comment. You can choose from
366three styles of alignment by setting the variable
367@code{fortran-comment-indent-style} to one of these values:
368
369@vindex fortran-comment-indent-style
370@vindex fortran-comment-line-extra-indent
371@table @code
372@item fixed
373Align the text at a fixed column, which is the sum of
374@code{fortran-comment-line-extra-indent} and the minimum statement
375indentation. This is the default.
376
377The minimum statement indentation is
378@code{fortran-minimum-statement-indent-fixed} for fixed format
379continuation line style and @code{fortran-minimum-statement-indent-tab}
380for tab format style.
381
382@item relative
383Align the text as if it were a line of code, but with an additional
384@code{fortran-comment-line-extra-indent} columns of indentation.
385
386@item nil
387Don't move text in full-line comments automatically.
388@end table
389
390@vindex fortran-comment-indent-char
391 In addition, you can specify the character to be used to indent within
392full-line comments by setting the variable
393@code{fortran-comment-indent-char} to the single-character string you want
394to use.
395
396@vindex fortran-directive-re
397 Compiler directive lines, or preprocessor lines, have much the same
398appearance as comment lines. It is important, though, that such lines
399never be indented at all, no matter what the value of
400@code{fortran-comment-indent-style}. The variable
401@code{fortran-directive-re} is a regular expression that specifies which
402lines are directives. Matching lines are never indented, and receive
403distinctive font-locking.
404
405 The normal Emacs comment command @kbd{C-x ;} has not been redefined. If
406you use @samp{!} comments, this command can be used with them. Otherwise
407it is useless in Fortran mode.
408
409@kindex C-c ; @r{(Fortran mode)}
410@findex fortran-comment-region
411@vindex fortran-comment-region
412 The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
413lines of the region into comments by inserting the string @samp{C$$$} at
414the front of each one. With a numeric argument, it turns the region
415back into live code by deleting @samp{C$$$} from the front of each line
416in it. The string used for these comments can be controlled by setting
417the variable @code{fortran-comment-region}. Note that here we have an
418example of a command and a variable with the same name; these two uses
419of the name never conflict because in Lisp and in Emacs it is always
420clear from the context which one is meant.
421
422@node Fortran Autofill
423@subsection Auto Fill in Fortran Mode
424
425 Fortran mode has specialized support for Auto Fill mode, which is a
426minor mode that automatically splits statements as you insert them
427when they become too wide. Splitting a statement involves making
428continuation lines using @code{fortran-continuation-string}
429(@pxref{ForIndent Cont}). This splitting happens when you type
430@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran
431indentation commands. You activate Auto Fill in Fortran mode in the
432normal way.
433@iftex
434@xref{Auto Fill,,, emacs, the Emacs Manual}.
435@end iftex
436@ifnottex
437@xref{Auto Fill}.
438@end ifnottex
439
440@vindex fortran-break-before-delimiters
441 Auto Fill breaks lines at spaces or delimiters when the lines get
442longer than the desired width (the value of @code{fill-column}). The
443delimiters (besides whitespace) that Auto Fill can break at are
444@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
445and @samp{,}. The line break comes after the delimiter if the
446variable @code{fortran-break-before-delimiters} is @code{nil}.
447Otherwise (and by default), the break comes before the delimiter.
448
449 To enable Auto Fill in all Fortran buffers, add
450@code{turn-on-auto-fill} to @code{fortran-mode-hook}.
451@iftex
452@xref{Hooks,,, emacs, the Emacs Manual}.
453@end iftex
454@ifnottex
455@xref{Hooks}.
456@end ifnottex
457
458@node Fortran Columns
459@subsection Checking Columns in Fortran
460
461@table @kbd
462@item C-c C-r
463Display a ``column ruler'' momentarily above the current line
464(@code{fortran-column-ruler}).
465@item C-c C-w
466Split the current window horizontally temporarily so that it is 72
467columns wide (@code{fortran-window-create-momentarily}). This may
468help you avoid making lines longer than the 72-character limit that
469some Fortran compilers impose.
470@item C-u C-c C-w
471Split the current window horizontally so that it is 72 columns wide
472(@code{fortran-window-create}). You can then continue editing.
473@item M-x fortran-strip-sequence-nos
474Delete all text in column 72 and beyond.
475@end table
476
477@kindex C-c C-r @r{(Fortran mode)}
478@findex fortran-column-ruler
479 The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
480ruler momentarily above the current line. The comment ruler is two lines
481of text that show you the locations of columns with special significance in
482Fortran programs. Square brackets show the limits of the columns for line
483numbers, and curly brackets show the limits of the columns for the
484statement body. Column numbers appear above them.
485
486 Note that the column numbers count from zero, as always in GNU Emacs.
487As a result, the numbers may be one less than those you are familiar
488with; but the positions they indicate in the line are standard for
489Fortran.
490
491@vindex fortran-column-ruler-fixed
492@vindex fortran-column-ruler-tabs
493 The text used to display the column ruler depends on the value of the
494variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is
495@code{nil}, then the value of the variable
496@code{fortran-column-ruler-fixed} is used as the column ruler.
497Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
498displayed. By changing these variables, you can change the column ruler
499display.
500
501@kindex C-c C-w @r{(Fortran mode)}
502@findex fortran-window-create-momentarily
503 @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
504splits the current window horizontally, making a window 72 columns
505wide, so you can see any lines that are too long. Type a space to
506restore the normal width.
507
508@kindex C-u C-c C-w @r{(Fortran mode)}
509@findex fortran-window-create
510 You can also split the window horizontally and continue editing with
511the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x
512fortran-window-create}). By editing in this window you can
513immediately see when you make a line too wide to be correct Fortran.
514
515@findex fortran-strip-sequence-nos
516 The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
517column 72 and beyond, on all lines in the current buffer. This is the
518easiest way to get rid of old sequence numbers.
519
520@node Fortran Abbrev
521@subsection Fortran Keyword Abbrevs
522
523 Fortran mode provides many built-in abbrevs for common keywords and
524declarations. These are the same sort of abbrev that you can define
525yourself. To use them, you must turn on Abbrev mode.
526@iftex
527@xref{Abbrevs,,, emacs, the Emacs Manual}.
528@end iftex
529@ifnottex
530@xref{Abbrevs}.
531@end ifnottex
532
533 The built-in abbrevs are unusual in one way: they all start with a
534semicolon. You cannot normally use semicolon in an abbrev, but Fortran
535mode makes this possible by changing the syntax of semicolon to ``word
536constituent.''
537
538 For example, one built-in Fortran abbrev is @samp{;c} for
539@samp{continue}. If you insert @samp{;c} and then insert a punctuation
540character such as a space or a newline, the @samp{;c} expands automatically
541to @samp{continue}, provided Abbrev mode is enabled.@refill
542
543 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
544Fortran abbrevs and what they stand for.
545
546@ignore
547 arch-tag: 23ed7c36-1517-4646-9235-2d5ade5f06f6
548@end ignore
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
new file mode 100644
index 00000000000..a45b582b455
--- /dev/null
+++ b/doc/emacs/frames.texi
@@ -0,0 +1,1113 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
3@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Frames, International, Windows, Top
6@chapter Frames and Graphical Displays
7@cindex frames
8
9 When using a graphical display, you can create multiple windows at
10the system in a single Emacs session. Each system-level window that
11belongs to Emacs displays a @dfn{frame} which can contain one or
12several Emacs windows. A frame initially contains a single
13general-purpose Emacs window which you can subdivide vertically or
14horizontally into smaller windows. A frame normally contains its own
15echo area and minibuffer, but you can make frames that don't have
16these---they use the echo area and minibuffer of another frame.
17
18 To avoid confusion, we reserve the word ``window'' for the
19subdivisions that Emacs implements, and never use it to refer to a
20frame.
21
22 Editing you do in one frame affects the other frames. For
23instance, if you put text in the kill ring in one frame, you can yank it
24in another frame. If you exit Emacs through @kbd{C-x C-c} in one frame,
25it terminates all the frames. To delete just one frame, use @kbd{C-x 5
260} (that is zero, not @kbd{o}).
27
28 Emacs compiled for MS-DOS emulates some windowing functionality,
29so that you can use many of the features described in this chapter.
30@iftex
31@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}.
32@end iftex
33@ifnottex
34@xref{MS-DOS Mouse}.
35@end ifnottex
36
37@menu
38* Cut and Paste:: Mouse commands for cut and paste.
39* Mouse References:: Using the mouse to select an item from a list.
40* Menu Mouse Clicks:: Mouse clicks that bring up menus.
41* Mode Line Mouse:: Mouse clicks on the mode line.
42* Creating Frames:: Creating additional Emacs frames with various contents.
43* Frame Commands:: Iconifying, deleting, and switching frames.
44* Speedbar:: How to make and use a speedbar frame.
45* Multiple Displays:: How one Emacs job can talk to several displays.
46* Special Buffer Frames:: You can make certain buffers have their own frames.
47* Frame Parameters:: Changing the colors and other modes of frames.
48* Scroll Bars:: How to enable and disable scroll bars; how to use them.
49* Wheeled Mice:: Using mouse wheels for scrolling.
50* Drag and Drop:: Using drag and drop to open files and insert text.
51* Menu Bars:: Enabling and disabling the menu bar.
52* Tool Bars:: Enabling and disabling the tool bar.
53* Dialog Boxes:: Controlling use of dialog boxes.
54* Tooltips:: Displaying information at the current mouse position.
55* Mouse Avoidance:: Moving the mouse pointer out of the way.
56* Non-Window Terminals:: Multiple frames on terminals that show only one.
57* Text-Only Mouse:: Using the mouse in text-only terminals.
58@end menu
59
60@node Cut and Paste
61@section Killing and Yanking on Graphical Displays
62
63 This section describes facilities for selecting a region, killing,
64and yanking using the mouse.
65
66@menu
67* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
68* Cut/Paste Other App:: Transfering text between Emacs and other apps.
69* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
70* Secondary Selection:: Cutting without altering point and mark.
71* Clipboard:: Using the clipboard for selections.
72@end menu
73
74@node Mouse Commands
75@subsection Mouse Commands for Editing
76@cindex mouse buttons (what they do)
77
78 The mouse commands for selecting and copying a region are mostly
79compatible with the @code{xterm} program. You can use the same mouse
80commands for copying between Emacs and other window-based programs.
81Most of these commands also work in Emacs when you run it under an
82@code{xterm} terminal.
83
84@kindex DELETE @r{(and mouse selection)}
85 If you select a region with any of these mouse commands, and then
86immediately afterward type the @key{DELETE} function key, it deletes the
87region that you selected. The @key{BACKSPACE} function key and the
88@acronym{ASCII} character @key{DEL} do not do this; if you type any other key
89in between the mouse command and @key{DELETE}, it does not do this.
90
91@findex mouse-set-region
92@findex mouse-set-point
93@findex mouse-yank-at-click
94@findex mouse-save-then-click
95@kindex Mouse-1
96@kindex Mouse-2
97@kindex Mouse-3
98@table @kbd
99@item Mouse-1
100Move point to where you click (@code{mouse-set-point}).
101This is normally the left button.
102
103@vindex x-mouse-click-focus-ignore-position
104Normally, Emacs does not distinguish between ordinary mouse clicks and
105clicks that select a frame. When you click on a frame to select it,
106that also changes the selected window and cursor position according to
107the mouse click position. On the X window system, you can change this
108behavior by setting the variable
109@code{x-mouse-click-focus-ignore-position} to @code{t}. Then the
110first click selects the frame, but does not affect the selected window
111or cursor position. If you click again in the same place, since that
112click will be in the selected frame, it will change the window or
113cursor position.
114
115@item Drag-Mouse-1
116Set the region to the text you select by dragging, and copy it to the
117kill ring (@code{mouse-set-region}). You can specify both ends of the
118region with this single command.
119
120@vindex mouse-scroll-min-lines
121If you move the mouse off the top or bottom of the window while
122dragging, the window scrolls at a steady rate until you move the mouse
123back into the window. This way, you can select regions that don't fit
124entirely on the screen. The number of lines scrolled per step depends
125on how far away from the window edge the mouse has gone; the variable
126@code{mouse-scroll-min-lines} specifies a minimum step size.
127
128@vindex mouse-drag-copy-region
129If the variable @code{mouse-drag-copy-region} is @code{nil}, this
130mouse command does not copy the selected region into the kill ring.
131
132@item Mouse-2
133Yank the last killed text, where you click (@code{mouse-yank-at-click}).
134This is normally the middle button.
135
136@item Mouse-3
137This command, @code{mouse-save-then-kill}, has several functions
138depending on where you click and the status of the region.
139
140The most basic case is when you click @kbd{Mouse-1} in one place and
141then @kbd{Mouse-3} in another. This selects the text between those two
142positions as the region. It also copies the new region to the kill
143ring, so that you can copy it to someplace else.
144
145If you click @kbd{Mouse-1} in the text, scroll with the scroll bar, and
146then click @kbd{Mouse-3}, it remembers where point was before scrolling
147(where you put it with @kbd{Mouse-1}), and uses that position as the
148other end of the region. This is so that you can select a region that
149doesn't fit entirely on the screen.
150
151More generally, if you do not have a highlighted region, @kbd{Mouse-3}
152selects the text between point and the click position as the region. It
153does this by setting the mark where point was, and moving point to where
154you click.
155
156If you have a highlighted region, or if the region was set just before
157by dragging button 1, @kbd{Mouse-3} adjusts the nearer end of the region
158by moving it to where you click. The adjusted region's text also
159replaces the old region's text in the kill ring.
160
161If you originally specified the region using a double or triple
162@kbd{Mouse-1}, so that the region is defined to consist of entire words
163or lines, then adjusting the region with @kbd{Mouse-3} also proceeds by
164entire words or lines.
165
166If you use @kbd{Mouse-3} a second time consecutively, at the same place,
167that kills the region already selected.
168@end table
169
170 The simplest way to kill text with the mouse is to press @kbd{Mouse-1}
171at one end, then press @kbd{Mouse-3} twice at the other end.
172@xref{Killing}. To copy the text into the kill ring without deleting it
173from the buffer, press @kbd{Mouse-3} just once---or just drag across the
174text with @kbd{Mouse-1}. Then you can copy it elsewhere by yanking it.
175
176@vindex mouse-yank-at-point
177 To yank the killed or copied text somewhere else, move the mouse there
178and press @kbd{Mouse-2}. @xref{Yanking}. However, if
179@code{mouse-yank-at-point} is non-@code{nil}, @kbd{Mouse-2} yanks at
180point. Then it does not matter where you click, or even which of the
181frame's windows you click on. The default value is @code{nil}. This
182variable also affects yanking the secondary selection.
183
184@cindex Delete Selection mode
185@cindex mode, Delete Selection
186@findex delete-selection-mode
187 Many graphical applications follow the convention that insertion while text
188is selected deletes the selected text. You can make Emacs behave this
189way by enabling Delete Selection mode---with @kbd{M-x
190delete-selection-mode} or using Custom. Another effect of this mode
191is that @key{DEL}, @kbd{C-d} and some other keys, when a selection
192exists, will kill the whole selection. It also enables Transient Mark
193mode (@pxref{Transient Mark}).
194
195@node Cut/Paste Other App
196@subsection Cut and Paste with Other Window Applications
197
198@cindex cutting
199@cindex pasting
200@cindex X cutting and pasting
201 To copy text to another windowing application, kill it or save it in
202the kill ring. Then use the ``paste'' or ``yank'' command of the
203other application to insert the text.
204
205 To copy text from another windowing application, use its ``cut'' or
206``copy'' command to select the text you want. Then yank it in Emacs
207with @kbd{C-y} or @kbd{Mouse-2}.
208
209@cindex primary selection
210@cindex cut buffer
211@cindex selection, primary
212@vindex x-cut-buffer-max
213 When Emacs puts text into the kill ring, or rotates text to the
214front of the kill ring, it sets the @dfn{primary selection} in the
215window system. This is how other windowing applications can access
216the text. On the X Window System, emacs also stores the text in the
217cut buffer, but only if the text is short enough (the value of
218@code{x-cut-buffer-max} specifies the maximum number of characters);
219putting long strings in the cut buffer can be slow.
220
221 The commands to yank the first entry in the kill ring actually check
222first for a primary selection in another program; after that, they check
223for text in the cut buffer. If neither of those sources provides text
224to yank, the kill ring contents are used.
225
226 The standard coding system for X Window System selections is
227@code{compound-text-with-extensions}. To specify another coding
228system for selections, use @kbd{C-x @key{RET} x} or @kbd{C-x @key{RET}
229X}. @xref{Communication Coding}.
230
231@node Word and Line Mouse
232@subsection Mouse Commands for Words and Lines
233
234 These variants of @kbd{Mouse-1} select entire words or lines at a time.
235
236@table @kbd
237@item Double-Mouse-1
238This key sets the region around the word which you click on. If you
239click on a character with ``symbol'' syntax (such as underscore, in C
240mode), it sets the region around the symbol surrounding that character.
241
242If you click on a character with open-parenthesis or close-parenthesis
243syntax, it sets the region around the parenthetical grouping
244which that character starts or ends. If you click on a character with
245string-delimiter syntax (such as a singlequote or doublequote in C), it
246sets the region around the string constant (using heuristics to figure
247out whether that character is the beginning or the end of it).
248
249@item Double-Drag-Mouse-1
250This key selects a region made up of the words you drag across.
251
252@item Triple-Mouse-1
253This key sets the region around the line you click on.
254
255@item Triple-Drag-Mouse-1
256This key selects a region made up of the lines you drag across.
257@end table
258
259@node Secondary Selection
260@subsection Secondary Selection
261@cindex secondary selection
262
263 The @dfn{secondary selection} is another way of selecting text using
264the X Window System. It does not use point or the mark, so you can
265use it to kill text without setting point or the mark.
266
267@table @kbd
268@findex mouse-set-secondary
269@kindex M-Drag-Mouse-1
270@item M-Drag-Mouse-1
271Set the secondary selection, with one end at the place where you press
272down the button, and the other end at the place where you release it
273(@code{mouse-set-secondary}). The highlighting appears and changes as
274you drag. You can control the appearance of the highlighting by
275customizing the @code{secondary-selection} face (@pxref{Face
276Customization}).
277
278If you move the mouse off the top or bottom of the window while
279dragging, the window scrolls at a steady rate until you move the mouse
280back into the window. This way, you can mark regions that don't fit
281entirely on the screen.
282
283This way of setting the secondary selection does not alter the kill ring.
284
285@findex mouse-start-secondary
286@kindex M-Mouse-1
287@item M-Mouse-1
288Set one endpoint for the @dfn{secondary selection}
289(@code{mouse-start-secondary}).
290
291@findex mouse-secondary-save-then-kill
292@kindex M-Mouse-3
293@item M-Mouse-3
294Make a secondary selection, using the place specified with @kbd{M-Mouse-1}
295as the other end (@code{mouse-secondary-save-then-kill}). This also
296puts the selected text in the kill ring. A second click at the same
297place kills the secondary selection just made.
298
299@findex mouse-yank-secondary
300@kindex M-Mouse-2
301@item M-Mouse-2
302Insert the secondary selection where you click
303(@code{mouse-yank-secondary}). This places point at the end of the
304yanked text.
305@end table
306
307Double or triple clicking of @kbd{M-Mouse-1} operates on words and
308lines, much like @kbd{Mouse-1}.
309
310If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks
311at point. Then it does not matter precisely where you click, or even
312which of the frame's windows you click on. @xref{Mouse Commands}.
313
314@node Clipboard
315@subsection Using the Clipboard
316@cindex clipboard
317@vindex x-select-enable-clipboard
318@findex menu-bar-enable-clipboard
319@cindex OpenWindows
320@cindex Gnome
321
322 Apart from the primary and secondary selection types, Emacs can
323handle the @dfn{clipboard} selection type which is used by some
324applications, particularly under OpenWindows and Gnome.
325
326 The command @kbd{M-x menu-bar-enable-clipboard} makes the @code{Cut},
327@code{Paste} and @code{Copy} menu items, as well as the keys of the same
328names, all use the clipboard.
329
330 You can customize the variable @code{x-select-enable-clipboard} to make
331the Emacs yank functions consult the clipboard before the primary
332selection, and to make the kill functions to store in the clipboard as
333well as the primary selection. Otherwise they do not access the
334clipboard at all. Using the clipboard is the default on MS-Windows and Mac,
335but not on other systems.
336
337@node Mouse References
338@section Following References with the Mouse
339@kindex Mouse-1 @r{(selection)}
340@kindex Mouse-2 @r{(selection)}
341
342 Some read-only Emacs buffers include references you can follow, or
343commands you can activate. These include names of files, of buffers,
344of possible completions, of matches for a pattern, as well as the
345buttons in Help buffers and customization buffers. You can follow the
346reference or activate the command by moving point to it and typing
347@key{RET}. You can also do this with the mouse, using either
348@kbd{Mouse-1} or @kbd{Mouse-2}.
349
350 Since yanking text into a read-only buffer is not allowed, these
351buffers generally define @kbd{Mouse-2} to follow a reference or
352activate a command. For example, if you click @kbd{Mouse-2} on a file
353name in a Dired buffer, you visit that file. If you click
354@kbd{Mouse-2} on an error message in the @samp{*Compilation*} buffer,
355you go to the source code for that error message. If you click
356@kbd{Mouse-2} on a completion in the @samp{*Completions*} buffer, you
357choose that completion.
358
359 However, most applications use @kbd{Mouse-1} to do this sort of
360thing, so Emacs implements this too. If you click @kbd{Mouse-1}
361quickly on a reference or button, it follows or activates. If you
362click slowly, it moves point as usual. Dragging, meaning moving the
363mouse while it is held down, also has its usual behavior of setting
364the region.
365
366@vindex mouse-1-click-in-non-selected-windows
367 Normally, the @kbd{Mouse-1} click behavior is performed on links in
368any window. The variable @code{mouse-1-click-in-non-selected-windows}
369controls whether @kbd{Mouse-1} has this behavior even in non-selected
370windows, or only in the selected window.
371
372@vindex mouse-highlight
373 You can usually tell when @kbd{Mouse-1} and @kbd{Mouse-2} have this
374special sort of meaning because the sensitive text highlights when you
375move the mouse over it. The variable @code{mouse-highlight} controls
376whether to do this highlighting always (even when such text appears
377where the mouse already is), never, or only immediately after you move
378the mouse.
379
380@vindex mouse-1-click-follows-link
381 In Emacs versions before 22, only @kbd{Mouse-2} follows links and
382@kbd{Mouse-1} always sets point. If you prefer this older behavior,
383set the variable @code{mouse-1-click-follows-link} to @code{nil}.
384This variable also lets you choose various other alternatives for
385following links with the mouse. Type @kbd{C-h v
386mouse-1-click-follows-link @key{RET}} for more details.
387
388@node Menu Mouse Clicks
389@section Mouse Clicks for Menus
390
391 Several mouse clicks with the @key{CTRL} and @key{SHIFT} modifiers
392bring up menus.
393
394@table @kbd
395@item C-Mouse-1
396@kindex C-Mouse-1
397This menu is for selecting a buffer.
398
399The MSB (``mouse select buffer'') global minor mode makes this
400menu smarter and more customizable. @xref{Buffer Menus}.
401
402@item C-Mouse-2
403@kindex C-Mouse-2
404This menu is for specifying faces and other text properties
405for editing formatted text. @xref{Formatted Text}.
406
407@item C-Mouse-3
408@kindex C-Mouse-3
409This menu is mode-specific. For most modes if Menu-bar mode is on,
410this menu has the same items as all the mode-specific menu-bar menus
411put together. Some modes may specify a different menu for this
412button.@footnote{Some systems use @kbd{Mouse-3} for a mode-specific
413menu. We took a survey of users, and found they preferred to keep
414@kbd{Mouse-3} for selecting and killing regions. Hence the decision
415to use @kbd{C-Mouse-3} for this menu. To use @kbd{Mouse-3} instead,
416do @code{(global-set-key [mouse-3] 'mouse-popup-menubar-stuff)}.} If
417Menu-bar mode is off, this menu contains all the items which would be
418present in the menu bar---not just the mode-specific ones---so that
419you can access them without having to display the menu bar.
420
421@item S-Mouse-1
422This menu is for specifying the frame's default font.
423@end table
424
425@node Mode Line Mouse
426@section Mode Line Mouse Commands
427@cindex mode line, mouse
428@cindex mouse on mode line
429
430 You can use mouse clicks on window mode lines to select and manipulate
431windows.
432
433 Some areas of the mode line, such as the buffer name and the major
434mode name, have their own special mouse bindings. These areas are
435highlighted when you hold the mouse over them, and information about
436the special bindings will be displayed (@pxref{Tooltips}). This
437section's commands do not apply in those areas.
438
439@table @kbd
440@item Mouse-1
441@kindex Mouse-1 @r{(mode line)}
442@kbd{Mouse-1} on a mode line selects the window it belongs to. By
443dragging @kbd{Mouse-1} on the mode line, you can move it, thus
444changing the height of the windows above and below. Changing heights
445with the mouse in this way never deletes windows, it just refuses to
446make any window smaller than the minimum height.
447
448@item Mouse-2
449@kindex Mouse-2 @r{(mode line)}
450@kbd{Mouse-2} on a mode line expands that window to fill its frame.
451
452@item Mouse-3
453@kindex Mouse-3 @r{(mode line)}
454@kbd{Mouse-3} on a mode line deletes the window it belongs to. If the
455frame has only one window, it buries the current buffer instead, and
456switches to another buffer.
457
458@item C-Mouse-2
459@kindex C-mouse-2 @r{(mode line)}
460@kbd{C-Mouse-2} on a mode line splits the window above
461horizontally, above the place in the mode line where you click.
462@end table
463
464@kindex C-Mouse-2 @r{(scroll bar)}
465@kindex Mouse-1 @r{(scroll bar)}
466 Using @kbd{Mouse-1} on the divider between two side-by-side mode
467lines, you can move the vertical boundary left or right. Using
468@kbd{C-Mouse-2} on a scroll bar splits the corresponding window
469vertically. @xref{Split Window}.
470
471@node Creating Frames
472@section Creating Frames
473@cindex creating frames
474
475@kindex C-x 5
476 The prefix key @kbd{C-x 5} is analogous to @kbd{C-x 4}, with parallel
477subcommands. The difference is that @kbd{C-x 5} commands create a new
478frame rather than just a new window in the selected frame (@pxref{Pop
479Up Window}). If an existing visible or iconified frame already displays
480the requested material, these commands use the existing frame, after
481raising or deiconifying as necessary.
482
483 The various @kbd{C-x 5} commands differ in how they find or create the
484buffer to select:
485
486@table @kbd
487@item C-x 5 2
488@kindex C-x 5 2
489@findex make-frame-command
490Create a new frame (@code{make-frame-command}).
491@item C-x 5 b @var{bufname} @key{RET}
492Select buffer @var{bufname} in another frame. This runs
493@code{switch-to-buffer-other-frame}.
494@item C-x 5 f @var{filename} @key{RET}
495Visit file @var{filename} and select its buffer in another frame. This
496runs @code{find-file-other-frame}. @xref{Visiting}.
497@item C-x 5 d @var{directory} @key{RET}
498Select a Dired buffer for directory @var{directory} in another frame.
499This runs @code{dired-other-frame}. @xref{Dired}.
500@item C-x 5 m
501Start composing a mail message in another frame. This runs
502@code{mail-other-frame}. It is the other-frame variant of @kbd{C-x m}.
503@xref{Sending Mail}.
504@item C-x 5 .
505Find a tag in the current tag table in another frame. This runs
506@code{find-tag-other-frame}, the multiple-frame variant of @kbd{M-.}.
507@xref{Tags}.
508@item C-x 5 r @var{filename} @key{RET}
509@kindex C-x 5 r
510@findex find-file-read-only-other-frame
511Visit file @var{filename} read-only, and select its buffer in another
512frame. This runs @code{find-file-read-only-other-frame}.
513@xref{Visiting}.
514@end table
515
516@cindex default-frame-alist
517@cindex initial-frame-alist
518@cindex face customization, in @file{~/.emacs}
519@cindex color customization, in @file{~/.emacs}
520 You can control the appearance of new frames you create by setting the
521frame parameters in @code{default-frame-alist}. You can use the
522variable @code{initial-frame-alist} to specify parameters that affect
523only the initial frame. @xref{Initial Parameters,,, elisp, The Emacs
524Lisp Reference Manual}, for more information.
525
526@cindex font (default)
527 The easiest way to specify the principal font for all your Emacs
528frames is with an X resource (@pxref{Font X}), but you can also do it by
529modifying @code{default-frame-alist} to specify the @code{font}
530parameter, as shown here:
531
532@example
533(add-to-list 'default-frame-alist '(font . "10x20"))
534@end example
535
536@noindent
537Here's a similar example for specifying a foreground color:
538
539@example
540(add-to-list 'default-frame-alist '(foreground-color . "blue"))
541@end example
542
543@noindent
544By putting such customizations in your @file{~/.emacs} init file, you
545can control the appearance of all the frames Emacs creates, including
546the initial one.
547
548@node Frame Commands
549@section Frame Commands
550
551 The following commands let you create, delete and operate on frames:
552
553@table @kbd
554@item C-z
555@kindex C-z @r{(X windows)}
556@findex iconify-or-deiconify-frame
557Iconify the selected Emacs frame (@code{iconify-or-deiconify-frame}).
558When typed on an Emacs frame's icon, deiconify instead.
559
560The normal meaning of @kbd{C-z}, to suspend Emacs, is not useful under
561a graphical display that allows multiple applications to operate
562simultaneously in their own windows, so Emacs gives @kbd{C-z} a
563different binding in that case.
564
565@item C-x 5 0
566@kindex C-x 5 0
567@findex delete-frame
568Delete the selected frame (@code{delete-frame}). This is not allowed if
569there is only one frame.
570
571@item C-x 5 o
572@kindex C-x 5 o
573@findex other-frame
574Select another frame, raise it, and warp the mouse to it so that it
575stays selected. If you repeat this command, it cycles through all the
576frames on your terminal.
577
578@item C-x 5 1
579@kindex C-x 5 1
580@findex delete-other-frames
581Delete all frames except the selected one.
582@end table
583
584@vindex focus-follows-mouse
585 To make the command @kbd{C-x 5 o} work properly, you must tell Emacs
586how the system (or the window manager) generally handles
587focus-switching between windows. There are two possibilities: either
588simply moving the mouse onto a window selects it (gives it focus), or
589you have to click on it in a suitable way to do so. On X, this focus
590policy also affects whether the focus is given to a frame that Emacs
591raises. Unfortunately there is no way Emacs can find out
592automatically which way the system handles this, so you have to
593explicitly say, by setting the variable @code{focus-follows-mouse}.
594If just moving the mouse onto a window selects it, that variable
595should be @code{t}; if a click is necessary, the variable should be
596@code{nil}.
597
598The window manager that is part of MS-Windows always gives focus to a
599frame that raises, so this variable has no effect in the native
600MS-Windows build of Emacs.
601
602@node Speedbar
603@section Speedbar Frames
604@cindex speedbar
605
606@cindex attached frame (of speedbar)
607 The @dfn{speedbar} is a special frame for conveniently navigating in
608or operating on another frame. The speedbar, when it exists, is
609always associated with a specific frame, called its @dfn{attached
610frame}; all speedbar operations act on that frame.
611
612 Type @kbd{M-x speedbar} to create the speedbar and associate it with
613the current frame. To dismiss the speedbar, type @kbd{M-x speedbar}
614again, or select the speedbar and type @kbd{q}. (You can also delete
615the speedbar frame like any other Emacs frame.) If you wish to
616associate the speedbar with a different frame, dismiss it and call
617@kbd{M-x speedbar} from that frame.
618
619 The speedbar can operate in various modes. Its default mode is
620@dfn{File Display} mode, which shows the files in the current
621directory of the selected window of the attached frame, one file per
622line. Clicking on a file name visits that file in the selected window
623of the attached frame, and clicking on a directory name shows that
624directory in the speedbar (@pxref{Mouse References}). Each line also
625has a box, @samp{[+]} or @samp{<+>}, that you can click on to
626@dfn{expand} the contents of that item. Expanding a directory adds
627the contents of that directory to the speedbar display, underneath the
628directory's own line. Expanding an ordinary file adds a list of the
629tags in that file to the speedbar display; you can click on a tag name
630to jump to that tag in the selected window of the attached frame.
631When a file or directory is expanded, the @samp{[+]} changes to
632@samp{[-]}; you can click on that box to @dfn{contract} the item,
633hiding its contents.
634
635 You navigate through the speedbar using the keyboard, too. Typing
636@kbd{RET} while point is on a line in the speedbar is equivalent to
637clicking the item on the current line, and @kbd{SPC} expands or
638contracts the item. @kbd{U} displays the parent directory of the
639current directory. To copy, delete, or rename the file on the current
640line, type @kbd{C}, @kbd{D}, and @kbd{R} respectively. To create a
641new directory, type @kbd{M}.
642
643 Another general-purpose speedbar mode is @dfn{Buffer Display} mode;
644in this mode, the speedbar displays a list of Emacs buffers. To
645switch to this mode, type @kbd{b} in the speedbar. To return to File
646Display mode, type @kbd{f}. You can also change the display mode by
647clicking @kbd{mouse-3} anywhere in the speedbar window (or
648@kbd{mouse-1} on the mode-line) and selecting @samp{Displays} in the
649pop-up menu.
650
651 Some major modes, including Rmail mode, Info, and GUD, have
652specialized ways of putting useful items into the speedbar for you to
653select. For example, in Rmail mode, the speedbar shows a list of Rmail
654files, and lets you move the current message to another Rmail file by
655clicking on its @samp{<M>} box.
656
657 For more details on using and programming the speedbar, @xref{Top,
658Speedbar,,speedbar, Speedbar Manual}.
659
660@node Multiple Displays
661@section Multiple Displays
662@cindex multiple displays
663
664 A single Emacs can talk to more than one X display. Initially, Emacs
665uses just one display---the one specified with the @env{DISPLAY}
666environment variable or with the @samp{--display} option (@pxref{Initial
667Options}). To connect to another display, use the command
668@code{make-frame-on-display}:
669
670@findex make-frame-on-display
671@table @kbd
672@item M-x make-frame-on-display @key{RET} @var{display} @key{RET}
673Create a new frame on display @var{display}.
674@end table
675
676 A single X server can handle more than one screen. When you open
677frames on two screens belonging to one server, Emacs knows they share a
678single keyboard, and it treats all the commands arriving from these
679screens as a single stream of input.
680
681 When you open frames on different X servers, Emacs makes a separate
682input stream for each server. This way, two users can type
683simultaneously on the two displays, and Emacs will not garble their
684input. Each server also has its own selected frame. The commands you
685enter with a particular X server apply to that server's selected frame.
686
687 Despite these features, people using the same Emacs job from different
688displays can still interfere with each other if they are not careful.
689For example, if any one types @kbd{C-x C-c}, that exits the Emacs job
690for all of them!
691
692@node Special Buffer Frames
693@section Special Buffer Frames
694
695@vindex special-display-buffer-names
696 You can make certain chosen buffers, which Emacs normally displays
697in ``another window,'' appear in special frames of their own. To do
698this, set the variable @code{special-display-buffer-names} to a list
699of buffer names; any buffer whose name is in that list automatically
700gets a special frame, when an Emacs command wants to display it ``in
701another window.''
702
703 For example, if you set the variable this way,
704
705@example
706(setq special-display-buffer-names
707 '("*Completions*" "*grep*" "*tex-shell*"))
708@end example
709
710@noindent
711then completion lists, @code{grep} output and the @TeX{} mode shell
712buffer get individual frames of their own. These frames, and the
713windows in them, are never automatically split or reused for any other
714buffers. They continue to show the buffers they were created for,
715unless you alter them by hand. Killing the special buffer deletes its
716frame automatically.
717
718@vindex special-display-regexps
719 More generally, you can set @code{special-display-regexps} to a list
720of regular expressions; then a buffer gets its own frame if its name
721matches any of those regular expressions. (Once again, this applies only
722to buffers that normally get displayed for you in ``another window.'')
723
724@vindex special-display-frame-alist
725 The variable @code{special-display-frame-alist} specifies the frame
726parameters for these frames. It has a default value, so you don't need
727to set it.
728
729 For those who know Lisp, an element of
730@code{special-display-buffer-names} or @code{special-display-regexps}
731can also be a list. Then the first element is the buffer name or
732regular expression; the rest of the list specifies how to create the
733frame. It can be an association list specifying frame parameter
734values; these values take precedence over parameter values specified
735in @code{special-display-frame-alist}. If you specify the symbol
736@code{same-window} as a ``frame parameter'' in this list, with a
737non-@code{nil} value, that means to use the selected window if
738possible. If you use the symbol @code{same-frame} as a ``frame
739parameter'' in this list, with a non-@code{nil} value, that means to
740use the selected frame if possible.
741
742 Alternatively, the value can have this form:
743
744@example
745(@var{function} @var{args}...)
746@end example
747
748@noindent
749where @var{function} is a symbol. Then the frame is constructed by
750calling @var{function}; its first argument is the buffer, and its
751remaining arguments are @var{args}.
752
753 An analogous feature lets you specify buffers which should be
754displayed in the selected window. @xref{Force Same Window}. The
755same-window feature takes precedence over the special-frame feature;
756therefore, if you add a buffer name to
757@code{special-display-buffer-names} and it has no effect, check to see
758whether that feature is also in use for the same buffer name.
759
760@node Frame Parameters
761@section Setting Frame Parameters
762@cindex Auto-Raise mode
763@cindex Auto-Lower mode
764
765@kindex S-Mouse-1
766 You can specify the font and colors used for text display, and the
767colors for the frame borders, the cursor, and the mouse cursor, by
768customizing the faces @code{default}, @code{border}, @code{cursor} and
769@code{mouse}. @xref{Face Customization}. You can also set a frame's
770default font through a pop-up menu. Press @kbd{S-Mouse-1} to activate
771this menu.
772
773 These commands are available for controlling the window management
774behavior of the selected frame.
775
776@table @kbd
777@findex auto-raise-mode
778@item M-x auto-raise-mode
779Toggle whether or not the selected frame should auto-raise. Auto-raise
780means that every time you move the mouse onto the frame, it raises the
781frame.
782
783Some window managers also implement auto-raise. If you enable
784auto-raise for Emacs frames in your window manager, it will work, but
785it is beyond Emacs' control, so @code{auto-raise-mode} has no effect
786on it.
787
788@findex auto-lower-mode
789@item M-x auto-lower-mode
790Toggle whether or not the selected frame should auto-lower.
791Auto-lower means that every time you move the mouse off the frame,
792the frame moves to the bottom of the stack on the screen.
793
794The command @code{auto-lower-mode} has no effect on auto-lower
795implemented by the window manager. To control that, you must use the
796appropriate window manager features.
797@end table
798
799 In Emacs versions that use an X toolkit, the color-setting and
800font-setting functions don't affect menus and the menu bar, since they
801are displayed by their own widget classes. To change the appearance of
802the menus and menu bar, you must use X resources (@pxref{Resources}).
803@xref{Colors}, regarding colors. @xref{Font X}, regarding choice of
804font.
805
806 Colors, fonts, and other attributes of the frame's display can also
807be customized by setting frame parameters in the variable
808@code{default-frame-alist} (@pxref{Creating Frames}). For a detailed
809description of frame parameters and customization, see @ref{Frame
810Parameters,,, elisp, The Emacs Lisp Reference Manual}.
811
812@node Scroll Bars
813@section Scroll Bars
814@cindex Scroll Bar mode
815@cindex mode, Scroll Bar
816
817 On graphical displays, Emacs normally makes a @dfn{scroll bar} at
818the left of each Emacs window.@footnote{Placing it at the left is
819usually more useful with overlapping frames with text starting at the
820left margin.} The scroll bar runs the height of the window, and shows
821a moving rectangular inner box which represents the portion of the
822buffer currently displayed. The entire height of the scroll bar
823represents the entire length of the buffer.
824
825 You can use @kbd{Mouse-2} (normally, the middle button) in the scroll
826bar to move or drag the inner box up and down. If you move it to the
827top of the scroll bar, you see the top of the buffer. If you move it to
828the bottom of the scroll bar, you see the bottom of the buffer.
829
830 The left and right buttons in the scroll bar scroll by controlled
831increments. @kbd{Mouse-1} (normally, the left button) moves the line at
832the level where you click up to the top of the window. @kbd{Mouse-3}
833(normally, the right button) moves the line at the top of the window
834down to the level where you click. By clicking repeatedly in the same
835place, you can scroll by the same distance over and over.
836
837 You can also click @kbd{C-Mouse-2} in the scroll bar to split a
838window vertically. The split occurs on the line where you click.
839
840@findex scroll-bar-mode
841@vindex scroll-bar-mode
842 You can enable or disable Scroll Bar mode with the command @kbd{M-x
843scroll-bar-mode}. With no argument, it toggles the use of scroll
844bars. With an argument, it turns use of scroll bars on if and only if
845the argument is positive. This command applies to all frames,
846including frames yet to be created. Customize the variable
847@code{scroll-bar-mode} to control the use of scroll bars at startup.
848You can use it to specify that they are placed at the right of windows
849if you prefer that. You have to set this variable through the
850@samp{Customize} interface (@pxref{Easy Customization}), or it will
851not work properly.
852
853 You can also use the X resource @samp{verticalScrollBars} to control
854the initial setting of Scroll Bar mode. @xref{Resources}.
855
856@findex toggle-scroll-bar
857 To enable or disable scroll bars for just the selected frame, use the
858command @kbd{M-x toggle-scroll-bar}.
859
860@vindex scroll-bar-width
861@cindex width of the scroll bar
862 You can control the scroll bar width by changing the value of the
863@code{scroll-bar-width} frame parameter.
864
865@node Wheeled Mice
866@section Scrolling With ``Wheeled'' Mice
867
868@cindex mouse wheel
869@cindex wheel, mouse
870@findex mouse-wheel-mode
871@cindex Mouse Wheel minor mode
872@cindex mode, Mouse Wheel
873 Some mice have a ``wheel'' instead of a third button. You can
874usually click the wheel to act as either @kbd{Mouse-2} or
875@kbd{Mouse-3}, depending on the setup. You can also use the wheel to
876scroll windows instead of using the scroll bar or keyboard commands.
877Mouse wheel support only works if the system generates appropriate
878events; whenever possible, it is turned on by default. To toggle this
879feature, use @kbd{M-x mouse-wheel-mode}.
880
881@vindex mouse-wheel-follow-mouse
882@vindex mouse-wheel-scroll-amount
883@vindex mouse-wheel-progressive-speed
884 The two variables @code{mouse-wheel-follow-mouse} and
885@code{mouse-wheel-scroll-amount} determine where and by how much
886buffers are scrolled. The variable
887@code{mouse-wheel-progressive-speed} determines whether the scroll
888speed is linked to how fast you move the wheel.
889
890@node Drag and Drop
891@section Drag and Drop
892@cindex drag and drop
893
894 Emacs supports @dfn{drag and drop} using the mouse. For instance,
895dropping text onto an Emacs frame inserts the text where it is dropped.
896Dropping a file onto an Emacs frame visits that file. As a special
897case, dropping the file on a Dired buffer moves or copies the file
898(according to the conventions of the application it came from) into the
899directory displayed in that buffer.
900
901@vindex dnd-open-file-other-window
902 Dropping a file normally visits it in the window you drop it on. If
903you prefer to visit the file in a new window in such cases, customize
904the variable @code{dnd-open-file-other-window}.
905
906 The XDND and Motif drag and drop protocols, and the old KDE 1.x
907protocol, are currently supported.
908
909@node Menu Bars
910@section Menu Bars
911@cindex Menu Bar mode
912@cindex mode, Menu Bar
913@findex menu-bar-mode
914@vindex menu-bar-mode
915
916 You can turn display of menu bars on or off with @kbd{M-x
917menu-bar-mode} or by customizing the variable @code{menu-bar-mode}.
918With no argument, this command toggles Menu Bar mode, a
919minor mode. With an argument, the command turns Menu Bar mode on if the
920argument is positive, off if the argument is not positive. You can use
921the X resource @samp{menuBarLines} to control the initial setting of
922Menu Bar mode. @xref{Resources}.
923
924@kindex C-Mouse-3 @r{(when menu bar is disabled)}
925 Expert users often turn off the menu bar, especially on text-only
926terminals, where this makes one additional line available for text.
927If the menu bar is off, you can still pop up a menu of its contents
928with @kbd{C-Mouse-3} on a display which supports pop-up menus.
929@xref{Menu Mouse Clicks}.
930
931 @xref{Menu Bar}, for information on how to invoke commands with the
932menu bar. @xref{X Resources}, for how to customize the menu bar
933menus' visual appearance.
934
935@node Tool Bars
936@section Tool Bars
937@cindex Tool Bar mode
938@cindex mode, Tool Bar
939@cindex icons, toolbar
940
941 The @dfn{tool bar} is a line (or lines) of icons at the top of the
942Emacs window, just below the menu bar. You can click on these icons
943with the mouse to do various jobs.
944
945 The global tool bar contains general commands. Some major modes
946define their own tool bars to replace it. A few ``special'' modes
947that are not designed for ordinary editing remove some items from the
948global tool bar.
949
950 Tool bars work only on a graphical display. The tool bar uses colored
951XPM icons if Emacs was built with XPM support. Otherwise, the tool
952bar uses monochrome icons (PBM or XBM format).
953
954@findex tool-bar-mode
955@vindex tool-bar-mode
956 You can turn display of tool bars on or off with @kbd{M-x
957tool-bar-mode} or by customizing the option @code{tool-bar-mode}.
958
959@node Dialog Boxes
960@section Using Dialog Boxes
961@cindex dialog boxes
962
963@vindex use-dialog-box
964 A dialog box is a special kind of menu for asking you a yes-or-no
965question or some other special question. Many Emacs commands use a
966dialog box to ask a yes-or-no question, if you used the mouse to
967invoke the command to begin with.
968
969 You can customize the variable @code{use-dialog-box} to suppress the
970use of dialog boxes. This also controls whether to use file selection
971windows (but those are not supported on all platforms).
972
973@vindex use-file-dialog
974 A file selection window is a special kind of dialog box for asking
975for file names. You can customize the variable @code{use-file-dialog}
976to suppress the use of file selection windows, even if you still want
977other kinds of dialogs. This variable has no effect if you have
978suppressed all dialog boxes with the variable @code{use-dialog-box}.
979
980@vindex x-gtk-show-hidden-files
981 For Gtk+ version 2.4 and newer, Emacs use the Gtk+ file chooser
982dialog. Emacs adds a toggle button that enables and disables showing
983of hidden files (files starting with a dot) in that dialog. The
984variable @code{x-gtk-show-hidden-files} controls whether to show
985hidden files by default.
986
987@vindex x-gtk-use-old-file-dialog
988 For Gtk+ versions 2.4 through 2.10, you can select the old file
989dialog (@code{gtk-file-selector}) by setting the variable
990@code{x-gtk-use-old-file-dialog} to a non-@code{nil} value. If it is
991@code{nil}, Emacs uses @code{gtk-file-chooser}. If Emacs is built
992with a Gtk+ version that has only one file dialog, this variable has
993no effect.
994
995@vindex x-gtk-file-dialog-help-text
996 Emacs adds help text to the Gtk+ file chooser dialog. The variable
997@code{x-gtk-file-dialog-help-text} specifies the text to add; if it is
998@code{nil}, that disables the added text.
999
1000@node Tooltips
1001@section Tooltips
1002@cindex tooltips
1003
1004 @dfn{Tooltips} are small windows that display text information at the
1005current mouse position. They activate when there is a pause in mouse
1006movement. There are two types of tooltip: help tooltips and GUD
1007tooltips.
1008
1009 @dfn{Help tooltips} typically display over text---including the mode
1010line---but are also available for other parts of the Emacs frame, such
1011as the tool bar and menu items.
1012
1013@findex tooltip-mode
1014 You can toggle display of help tooltips (Tooltip mode) with the
1015command @kbd{M-x tooltip-mode}. When Tooltip mode is disabled, the
1016help text is displayed in the echo area instead.
1017
1018 @dfn{GUD tooltips} show values of variables. They are useful when
1019you are debugging a program. @xref{Debugger Operation}.
1020
1021@vindex tooltip-delay
1022 The variables @code{tooltip-delay} specifies how long Emacs should
1023wait before displaying a tooltip. For additional customization
1024options for displaying tooltips, use @kbd{M-x customize-group
1025@key{RET} tooltip @key{RET}}. @xref{X Resources}, for information on
1026customizing the windows that display tooltips.
1027
1028@node Mouse Avoidance
1029@section Mouse Avoidance
1030@cindex avoiding mouse in the way of your typing
1031@cindex mouse avoidance
1032
1033@vindex mouse-avoidance-mode
1034Mouse Avoidance mode keeps the mouse pointer away from point, to avoid
1035obscuring text you want to edit. Whenever it moves the mouse, it also
1036raises the frame. To use Mouse Avoidance mode, customize the variable
1037@code{mouse-avoidance-mode}. You can set this to various values to
1038move the mouse in several ways:
1039
1040@table @code
1041@item banish
1042Move the mouse to the upper-right corner on any key-press;
1043@item exile
1044Move the mouse to the corner only if the cursor gets too close,
1045and allow it to return once the cursor is out of the way;
1046@item jump
1047If the cursor gets too close to the mouse, displace the mouse
1048a random distance & direction;
1049@item animate
1050As @code{jump}, but shows steps along the way for illusion of motion;
1051@item cat-and-mouse
1052The same as @code{animate};
1053@item proteus
1054As @code{animate}, but changes the shape of the mouse pointer too.
1055@end table
1056
1057@findex mouse-avoidance-mode
1058You can also use the command @kbd{M-x mouse-avoidance-mode} to enable
1059the mode.
1060
1061@node Non-Window Terminals
1062@section Non-Window Terminals
1063@cindex non-window terminals
1064@cindex single-frame terminals
1065
1066 On a text-only terminal, Emacs can display only one Emacs frame at a
1067time. However, you can still create multiple Emacs frames, and switch
1068between them. Switching frames on these terminals is much like
1069switching between different window configurations.
1070
1071 Use @kbd{C-x 5 2} to create a new frame and switch to it; use @kbd{C-x
10725 o} to cycle through the existing frames; use @kbd{C-x 5 0} to delete
1073the current frame.
1074
1075 Each frame has a number to distinguish it. If your terminal can
1076display only one frame at a time, the selected frame's number @var{n}
1077appears near the beginning of the mode line, in the form
1078@samp{F@var{n}}.
1079
1080@findex set-frame-name
1081@findex select-frame-by-name
1082 @samp{F@var{n}} is in fact the frame's initial name. You can give
1083frames more meaningful names if you wish, and you can select a frame
1084by its name. Use the command @kbd{M-x set-frame-name @key{RET}
1085@var{name} @key{RET}} to specify a new name for the selected frame,
1086and use @kbd{M-x select-frame-by-name @key{RET} @var{name} @key{RET}}
1087to select a frame according to its name. The name you specify appears
1088in the mode line when the frame is selected.
1089
1090@node Text-Only Mouse
1091@section Using a Mouse in Terminal Emulators
1092@cindex mouse support
1093@cindex terminal emulators, mouse support
1094
1095Some terminal emulators support mouse clicks in the terminal window.
1096
1097@cindex xterm
1098In a terminal emulator which is compatible with @code{xterm},
1099you can use @kbd{M-x xterm-mouse-mode} to give Emacs control over
1100simple use of the mouse---basically, only non-modified single clicks
1101are supported. The normal @code{xterm} mouse functionality for such
1102clicks is still available by holding down the @kbd{SHIFT} key when you
1103press the mouse button. Xterm Mouse mode is a global minor mode
1104(@pxref{Minor Modes}). Repeating the command turns the mode off
1105again.
1106
1107In the console on GNU/Linux, you can use @kbd{M-x t-mouse-mode}. You
1108need to have the gpm package installed and running on your system in
1109order for this to work.
1110
1111@ignore
1112 arch-tag: 7dcf3a31-a43b-45d4-a900-445b10d77e49
1113@end ignore
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
new file mode 100644
index 00000000000..f289c2ca1cb
--- /dev/null
+++ b/doc/emacs/glossary.texi
@@ -0,0 +1,1323 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Glossary, Key Index, Intro, Top
6@unnumbered Glossary
7
8@table @asis
9@item Abbrev
10An abbrev is a text string which expands into a different text string
11when present in the buffer. For example, you might define a few letters
12as an abbrev for a long phrase that you want to insert frequently.
13@xref{Abbrevs}.
14
15@item Aborting
16Aborting means getting out of a recursive edit (q.v.@:). The
17commands @kbd{C-]} and @kbd{M-x top-level} are used for this.
18@xref{Quitting}.
19
20@item Alt
21Alt is the name of a modifier bit which a keyboard input character may
22have. To make a character Alt, type it while holding down the @key{ALT}
23key. Such characters are given names that start with @kbd{Alt-}
24(usually written @kbd{A-} for short). (Note that many terminals have a
25key labeled @key{ALT} which is really a @key{META} key.) @xref{User
26Input, Alt}.
27
28@item Argument
29See `numeric argument.'
30
31@item @acronym{ASCII} character
32An @acronym{ASCII} character is either an @acronym{ASCII} control character or an @acronym{ASCII}
33printing character. @xref{User Input}.
34
35@item @acronym{ASCII} control character
36An @acronym{ASCII} control character is the Control version of an upper-case
37letter, or the Control version of one of the characters @samp{@@[\]^_?}.
38
39@item @acronym{ASCII} printing character
40@acronym{ASCII} printing characters include letters, digits, space, and these
41punctuation characters: @samp{!@@#$%^& *()_-+=|\~` @{@}[]:;"' <>,.?/}.
42
43@item Auto Fill Mode
44Auto Fill mode is a minor mode in which text that you insert is
45automatically broken into lines of a given maximum width.
46@xref{Filling}.
47
48@item Auto Saving
49Auto saving is the practice of saving the contents of an Emacs buffer in
50a specially-named file, so that the information will not be lost if the
51buffer is lost due to a system error or user error. @xref{Auto Save}.
52
53@item Autoloading
54Emacs automatically loads Lisp libraries when a Lisp program requests a
55function or a variable from those libraries. This is called
56`autoloading'. @xref{Lisp Libraries}.
57
58@item Backtrace
59A backtrace is a trace of a series of function calls showing how a
60program arrived to a certain point. It is used mainly for finding and
61correcting bugs (q.v.@:). Emacs can display a backtrace when it signals
62an error or when you type @kbd{C-g} (see `quitting'). @xref{Checklist}.
63
64@item Backup File
65A backup file records the contents that a file had before the current
66editing session. Emacs makes backup files automatically to help you
67track down or cancel changes you later regret making. @xref{Backup}.
68
69@item Balancing Parentheses
70Emacs can balance parentheses (or other matching delimiters) either
71manually or automatically. You do manual balancing with the commands
72to move over parenthetical groupings (@pxref{Moving by Parens}).
73Automatic balancing works by blinking or highlighting the delimiter
74that matches the one you just inserted (@pxref{Matching,,Matching
75Parens}).
76
77@item Balanced Expressions
78A balanced expression is a syntactically recognizable expression, such
79as a symbol, number, string constant, block, or parenthesized expression
80in C. @xref{Expressions,Balanced Expressions}.
81
82@item Balloon Help
83See `tooltips.'
84
85@item Base Buffer
86A base buffer is a buffer whose text is shared by an indirect buffer
87(q.v.@:).
88
89@item Bind
90To bind a key sequence means to give it a binding (q.v.@:).
91@xref{Rebinding}.
92
93@item Binding
94A key sequence gets its meaning in Emacs by having a binding, which is a
95command (q.v.@:), a Lisp function that is run when the user types that
96sequence. @xref{Commands,Binding}. Customization often involves
97rebinding a character to a different command function. The bindings of
98all key sequences are recorded in the keymaps (q.v.@:). @xref{Keymaps}.
99
100@item Blank Lines
101Blank lines are lines that contain only whitespace. Emacs has several
102commands for operating on the blank lines in the buffer.
103
104@item Bookmark
105Bookmarks are akin to registers (q.v.@:) in that they record positions
106in buffers to which you can return later. Unlike registers, bookmarks
107persist between Emacs sessions.
108
109@item Border
110A border is a thin space along the edge of the frame, used just for
111spacing, not for displaying anything. An Emacs frame has an ordinary
112external border, outside of everything including the menu bar, plus an
113internal border that surrounds the text windows and their scroll bars
114and separates them from the menu bar and tool bar. You can customize
115both borders with options and resources (@pxref{Borders X}). Borders
116are not the same as fringes (q.v.@:).
117
118@item Buffer
119The buffer is the basic editing unit; one buffer corresponds to one text
120being edited. You can have several buffers, but at any time you are
121editing only one, the `current buffer,' though several can be visible
122when you are using multiple windows (q.v.@:). Most buffers are visiting
123(q.v.@:) some file. @xref{Buffers}.
124
125@item Buffer Selection History
126Emacs keeps a buffer selection history which records how recently each
127Emacs buffer has been selected. This is used for choosing a buffer to
128select. @xref{Buffers}.
129
130@item Bug
131A bug is an incorrect or unreasonable behavior of a program, or
132inaccurate or confusing documentation. Emacs developers treat bug
133reports, both in Emacs code and its documentation, very seriously and
134ask you to report any bugs you find. @xref{Bugs}.
135
136@item Button Down Event
137A button down event is the kind of input event generated right away when
138you press down on a mouse button. @xref{Mouse Buttons}.
139
140@item By Default
141See `default.'
142
143@item Byte Compilation
144See `compilation.'
145
146@item @kbd{C-}
147@kbd{C-} in the name of a character is an abbreviation for Control.
148@xref{User Input,C-}.
149
150@item @kbd{C-M-}
151@kbd{C-M-} in the name of a character is an abbreviation for
152Control-Meta. @xref{User Input,C-M-}.
153
154@item Case Conversion
155Case conversion means changing text from upper case to lower case or
156vice versa. @xref{Case}, for the commands for case conversion.
157
158@item Character
159Characters form the contents of an Emacs buffer; see @ref{Text
160Characters}. Also, key sequences (q.v.@:) are usually made up of
161characters (though they may include other input events as well).
162@xref{User Input}.
163
164@item Character Set
165Emacs supports a number of character sets, each of which represents a
166particular alphabet or script. @xref{International}.
167
168@item Character Terminal
169See `text-only terminal.'
170
171@item Click Event
172A click event is the kind of input event generated when you press a
173mouse button and release it without moving the mouse. @xref{Mouse Buttons}.
174
175@item Clipboard
176A clipboard is a buffer provided by the window system for transferring
177text between applications. On the X Window system, the clipboard is
178provided in addition to the primary selection (q.v.@:); on MS-Windows and Mac,
179the clipboard is used @emph{instead} of the primary selection.
180@xref{Clipboard}.
181
182@item Coding System
183A coding system is an encoding for representing text characters in a
184file or in a stream of information. Emacs has the ability to convert
185text to or from a variety of coding systems when reading or writing it.
186@xref{Coding Systems}.
187
188@item Command
189A command is a Lisp function specially defined to be able to serve as a
190key binding in Emacs. When you type a key sequence (q.v.@:), its
191binding (q.v.@:) is looked up in the relevant keymaps (q.v.@:) to find
192the command to run. @xref{Commands}.
193
194@item Command History
195See `minibuffer history.'
196
197@item Command Name
198A command name is the name of a Lisp symbol which is a command
199(@pxref{Commands}). You can invoke any command by its name using
200@kbd{M-x} (@pxref{M-x,M-x,Running Commands by Name}).
201
202@item Comment
203A comment is text in a program which is intended only for humans reading
204the program, and which is marked specially so that it will be ignored
205when the program is loaded or compiled. Emacs offers special commands
206for creating, aligning and killing comments. @xref{Comments}.
207
208@item Common Lisp
209Common Lisp is a dialect of Lisp (q.v.@:) much larger and more powerful
210than Emacs Lisp. Emacs provides a subset of Common Lisp in the CL
211package. @xref{Top, Common Lisp, Overview, cl, Common Lisp Extensions}.
212
213@item Compilation
214Compilation is the process of creating an executable program from source
215code. Emacs has commands for compiling files of Emacs Lisp code
216(@pxref{Byte Compilation,,, elisp, the Emacs Lisp
217Reference Manual}) and programs in C and other languages
218(@pxref{Compilation}).
219
220@item Complete Key
221A complete key is a key sequence which fully specifies one action to be
222performed by Emacs. For example, @kbd{X} and @kbd{C-f} and @kbd{C-x m}
223are complete keys. Complete keys derive their meanings from being bound
224(q.v.@:) to commands (q.v.@:). Thus, @kbd{X} is conventionally bound to
225a command to insert @samp{X} in the buffer; @kbd{C-x m} is
226conventionally bound to a command to begin composing a mail message.
227@xref{Keys}.
228
229@item Completion
230Completion is what Emacs does when it automatically fills out an
231abbreviation for a name into the entire name. Completion is done for
232minibuffer (q.v.@:) arguments when the set of possible valid inputs
233is known; for example, on command names, buffer names, and
234file names. Completion occurs when @key{TAB}, @key{SPC} or @key{RET}
235is typed. @xref{Completion}.@refill
236
237@item Continuation Line
238When a line of text is longer than the width of the window, it
239takes up more than one screen line when displayed. We say that the
240text line is continued, and all screen lines used for it after the
241first are called continuation lines. @xref{Continuation Lines}.
242A related Emacs feature is `filling' (q.v.@:).
243
244@item Control Character
245A control character is a character that you type by holding down the
246@key{CTRL} key. Some control characters also have their own keys, so
247that you can type them without using @key{CTRL}. For example,
248@key{RET}, @key{TAB}, @key{ESC} and @key{DEL} are all control
249characters. @xref{User Input}.
250
251@item Copyleft
252A copyleft is a notice giving the public legal permission to
253redistribute and modify a program or other work of art, but requiring
254modified versions to carry similar permission. Copyright is normally
255used to keep users divided and helpless; with copyleft we turn that
256around to empower users and encourage them to cooperate.
257
258The particular form of copyleft used by the GNU project is called the
259GNU General Public License. @xref{Copying}.
260
261@item @key{CTRL}
262The @key{CTRL} or ``control'' key is what you hold down
263in order to enter a control character (q.v.).
264
265@item Current Buffer
266The current buffer in Emacs is the Emacs buffer on which most editing
267commands operate. You can select any Emacs buffer as the current one.
268@xref{Buffers}.
269
270@item Current Line
271The current line is the line that point is on (@pxref{Point}).
272
273@item Current Paragraph
274The current paragraph is the paragraph that point is in. If point is
275between two paragraphs, the current paragraph is the one that follows
276point. @xref{Paragraphs}.
277
278@item Current Defun
279The current defun is the defun (q.v.@:) that point is in. If point is
280between defuns, the current defun is the one that follows point.
281@xref{Defuns}.
282
283@item Cursor
284The cursor is the rectangle on the screen which indicates the position
285called point (q.v.@:) at which insertion and deletion takes place.
286The cursor is on or under the character that follows point. Often
287people speak of `the cursor' when, strictly speaking, they mean
288`point.' @xref{Point,Cursor}.
289
290@item Customization
291Customization is making minor changes in the way Emacs works. It is
292often done by setting variables (@pxref{Variables}) or faces
293(@pxref{Face Customization}), or by rebinding key sequences
294(@pxref{Keymaps}).
295
296@cindex cut and paste
297@item Cut and Paste
298See `killing' and `yanking.'
299
300@item Default Argument
301The default for an argument is the value that will be assumed if you
302do not specify one. When the minibuffer is used to read an argument,
303the default argument is used if you just type @key{RET}.
304@xref{Minibuffer}.
305
306@item Default
307A default is the value that is used for a certain purpose if and when
308you do not specify a value to use.
309
310@item Default Directory
311When you specify a file name that does not start with @samp{/} or @samp{~},
312it is interpreted relative to the current buffer's default directory.
313(On MS-Windows and MS-DOS, file names which start with a drive letter
314@samp{@var{x}:} are treated as absolute, not relative.)
315@xref{Minibuffer File,Default Directory}.
316
317@item Defun
318A defun is a major definition at the top level in a program. The name
319`defun' comes from Lisp, where most such definitions use the construct
320@code{defun}. @xref{Defuns}.
321
322@item @key{DEL}
323@key{DEL} is a character that runs the command to delete one character
324of text before the cursor. It is typically either the @key{DELETE}
325key or the @key{BACKSPACE} key, whichever one is easy to type.
326@xref{Erasing,DEL}.
327
328@item Deletion
329Deletion means erasing text without copying it into the kill ring
330(q.v.@:). The alternative is killing (q.v.@:). @xref{Killing,Deletion}.
331
332@item Deletion of Files
333Deleting a file means erasing it from the file system.
334@xref{Misc File Ops,Misc File Ops,Miscellaneous File Operations}.
335
336@item Deletion of Messages
337Deleting a message means flagging it to be eliminated from your mail
338file. Until you expunge (q.v.@:) the Rmail file, you can still undelete
339the messages you have deleted. @xref{Rmail Deletion}.
340
341@item Deletion of Windows
342Deleting a window means eliminating it from the screen. Other windows
343expand to use up the space. The deleted window can never come back,
344but no actual text is thereby lost. @xref{Windows}.
345
346@item Directory
347File directories are named collections in the file system, within which
348you can place individual files or subdirectories. @xref{Directories}.
349
350@item Dired
351Dired is the Emacs facility that displays the contents of a file
352directory and allows you to ``edit the directory,'' performing
353operations on the files in the directory. @xref{Dired}.
354
355@item Disabled Command
356A disabled command is one that you may not run without special
357confirmation. The usual reason for disabling a command is that it is
358confusing for beginning users. @xref{Disabling}.
359
360@item Down Event
361Short for `button down event' (q.v.@:).
362
363@item Drag Event
364A drag event is the kind of input event generated when you press a mouse
365button, move the mouse, and then release the button. @xref{Mouse
366Buttons}.
367
368@item Dribble File
369A dribble file is a file into which Emacs writes all the characters that
370you type on the keyboard. Dribble files are used to make a record
371for debugging Emacs bugs. Emacs does not make a dribble file unless you
372tell it to. @xref{Bugs}.
373
374@item Echo Area
375The echo area is the bottom line of the screen, used for echoing the
376arguments to commands, for asking questions, and showing brief messages
377(including error messages). The messages are stored in the buffer
378@samp{*Messages*} so you can review them later. @xref{Echo Area}.
379
380@item Echoing
381Echoing is acknowledging the receipt of input events by displaying
382them (in the echo area). Emacs never echoes single-character key
383sequences; longer key sequences echo only if you pause while typing
384them.
385
386@item Electric
387We say that a character is electric if it is normally self-inserting
388(q.v.@:), but the current major mode (q.v.@:) redefines it to do something
389else as well. For example, some programming language major modes define
390particular delimiter characters to reindent the line or insert one or
391more newlines in addition to self-insertion.
392
393@item End Of Line
394End of line is a character or a sequence of characters that indicate
395the end of a text line. On GNU and Unix systems, this is a newline
396(q.v.@:), but other systems have other conventions. @xref{Coding
397Systems,end-of-line}. Emacs can recognize several end-of-line
398conventions in files and convert between them.
399
400@item Environment Variable
401An environment variable is one of a collection of variables stored by
402the operating system, each one having a name and a value. Emacs can
403access environment variables set by its parent shell, and it can set
404variables in the environment it passes to programs it invokes.
405@xref{Environment}.
406
407@item EOL
408See `end of line.'
409
410@item Error
411An error occurs when an Emacs command cannot execute in the current
412circumstances. When an error occurs, execution of the command stops
413(unless the command has been programmed to do otherwise) and Emacs
414reports the error by displaying an error message (q.v.@:). Type-ahead
415is discarded. Then Emacs is ready to read another editing command.
416
417@item Error Message
418An error message is a single line of output displayed by Emacs when the
419user asks for something impossible to do (such as, killing text
420forward when point is at the end of the buffer). They appear in the
421echo area, accompanied by a beep.
422
423@item @key{ESC}
424@key{ESC} is a character used as a prefix for typing Meta characters on
425keyboards lacking a @key{META} key. Unlike the @key{META} key (which,
426like the @key{SHIFT} key, is held down while another character is
427typed), you press the @key{ESC} key as you would press a letter key, and
428it applies to the next character you type.
429
430@item Expression
431See `balanced expression.'
432
433@item Expunging
434Expunging an Rmail file or Dired buffer or a Gnus newsgroup buffer is an
435operation that truly discards the messages or files you have previously
436flagged for deletion.
437
438@item Face
439A face is a style of displaying characters. It specifies attributes
440such as font family and size, foreground and background colors,
441underline and strike-through, background stipple, etc. Emacs provides
442features to associate specific faces with portions of buffer text, in
443order to display that text as specified by the face attributes.
444@xref{Faces}.
445
446@item File Locking
447Emacs uses file locking to notice when two different users
448start to edit one file at the same time. @xref{Interlocking}.
449
450@item File Name
451A file name is a name that refers to a file. File names may be relative
452or absolute; the meaning of a relative file name depends on the current
453directory, but an absolute file name refers to the same file regardless
454of which directory is current. On GNU and Unix systems, an absolute
455file name starts with a slash (the root directory) or with @samp{~/} or
456@samp{~@var{user}/} (a home directory). On MS-Windows/MS-DOS, an
457absolute file name can also start with a drive letter and a colon
458@samp{@var{d}:}.
459
460Some people use the term ``pathname'' for file names, but we do not;
461we use the word ``path'' only in the term ``search path'' (q.v.@:).
462
463@item File-Name Component
464A file-name component names a file directly within a particular
465directory. On GNU and Unix systems, a file name is a sequence of
466file-name components, separated by slashes. For example, @file{foo/bar}
467is a file name containing two components, @samp{foo} and @samp{bar}; it
468refers to the file named @samp{bar} in the directory named @samp{foo} in
469the current directory. MS-DOS/MS-Windows file names can also use
470backslashes to separate components, as in @file{foo\bar}.
471
472@item Fill Prefix
473The fill prefix is a string that should be expected at the beginning
474of each line when filling is done. It is not regarded as part of the
475text to be filled. @xref{Filling}.
476
477@item Filling
478Filling text means shifting text between consecutive lines so that all
479the lines are approximately the same length. @xref{Filling}. Some
480other editors call this feature `line wrapping.'
481
482@item Font Lock
483Font Lock is a mode that highlights parts of buffer text according to
484its syntax. @xref{Font Lock}.
485
486@item Fontset
487A fontset is a named collection of fonts. A fontset specification lists
488character sets and which font to use to display each of them. Fontsets
489make it easy to change several fonts at once by specifying the name of a
490fontset, rather than changing each font separately. @xref{Fontsets}.
491
492@item Formatted Text
493Formatted text is text that displays with formatting information while
494you edit. Formatting information includes fonts, colors, and specified
495margins. @xref{Formatted Text}.
496
497@item Formfeed Character
498See `page.'
499
500@item Frame
501A frame is a rectangular cluster of Emacs windows. Emacs starts out
502with one frame, but you can create more. You can subdivide each frame
503into Emacs windows (q.v.@:). When you are using a window system
504(q.v.@:), all the frames can be visible at the same time.
505@xref{Frames}. Some other editors use the term ``window'' for this,
506but in Emacs a window means something else.
507
508@item Fringe
509On a graphical display (q.v.@:), there's a narrow portion of the
510frame (q.v.@:) between the text area and the window's border. Emacs
511displays the fringe using a special face (q.v.@:) called
512@code{fringe}. @xref{Faces,fringe}.
513
514@item FTP
515FTP is an acronym for File Transfer Protocol. Emacs uses an FTP client
516program to provide access to remote files (q.v.@:).
517
518@item Function Key
519A function key is a key on the keyboard that sends input but does not
520correspond to any character. @xref{Function Keys}.
521
522@item Global
523Global means ``independent of the current environment; in effect
524throughout Emacs.'' It is the opposite of local (q.v.@:). Particular
525examples of the use of `global' appear below.
526
527@item Global Abbrev
528A global definition of an abbrev (q.v.@:) is effective in all major
529modes that do not have local (q.v.@:) definitions for the same abbrev.
530@xref{Abbrevs}.
531
532@item Global Keymap
533The global keymap (q.v.@:) contains key bindings that are in effect
534except when overridden by local key bindings in a major mode's local
535keymap (q.v.@:). @xref{Keymaps}.
536
537@item Global Mark Ring
538The global mark ring records the series of buffers you have recently
539set a mark (q.v.@:) in. In many cases you can use this to backtrack
540through buffers you have been editing in, or in which you have found
541tags (see `tags table'). @xref{Global Mark Ring}.
542
543@item Global Substitution
544Global substitution means replacing each occurrence of one string by
545another string throughout a large amount of text. @xref{Replace}.
546
547@item Global Variable
548The global value of a variable (q.v.@:) takes effect in all buffers
549that do not have their own local (q.v.@:) values for the variable.
550@xref{Variables}.
551
552@item Graphic Character
553Graphic characters are those assigned pictorial images rather than
554just names. All the non-Meta (q.v.@:) characters except for the
555Control (q.v.@:) characters are graphic characters. These include
556letters, digits, punctuation, and spaces; they do not include
557@key{RET} or @key{ESC}. In Emacs, typing a graphic character inserts
558that character (in ordinary editing modes). @xref{Inserting Text}.
559
560@item Graphical Display
561A graphical display is one that can display images and multiple fonts.
562Usually it also has a window system (q.v.@:).
563
564@item Highlighting
565Highlighting text means displaying it with a different foreground and/or
566background color to make it stand out from the rest of the text in the
567buffer.
568
569Emacs uses highlighting in several ways. When you mark a region with
570the mouse, the region is always highlighted. Optionally Emacs can
571also highlight the region whenever it is active (@pxref{Transient
572Mark}). Incremental search also highlights matches (@pxref{Incremental
573Search}). See also `font lock'.
574
575@item Hardcopy
576Hardcopy means printed output. Emacs has commands for making printed
577listings of text in Emacs buffers. @xref{Printing}.
578
579@item @key{HELP}
580@key{HELP} is the Emacs name for @kbd{C-h} or @key{F1}. You can type
581@key{HELP} at any time to ask what options you have, or to ask what any
582command does. @xref{Help}.
583
584@item Help Echo
585Help echo is a short message displayed in the echo area when the mouse
586pointer is located on portions of display that require some
587explanations. Emacs displays help echo for menu items, parts of the
588mode line, tool-bar buttons, etc. On graphics displays, the messages
589can be displayed as tooltips (q.v.@:). @xref{Tooltips}.
590
591@item Hook
592A hook is a list of functions to be called on specific occasions, such
593as saving a buffer in a file, major mode activation, etc. By
594customizing the various hooks, you can modify Emacs's behavior without
595changing any of its code. @xref{Hooks}.
596
597@item Hyper
598Hyper is the name of a modifier bit which a keyboard input character may
599have. To make a character Hyper, type it while holding down the
600@key{HYPER} key. Such characters are given names that start with
601@kbd{Hyper-} (usually written @kbd{H-} for short). @xref{User Input,
602Hyper}.
603
604@item Iff
605``Iff'' means ``if and only if.'' This terminology comes from
606mathematics. Try to avoid using this term in documentation, since
607many are unfamiliar with it and mistake it for a typo.
608
609@item Inbox
610An inbox is a file in which mail is delivered by the operating system.
611Rmail transfers mail from inboxes to Rmail files (q.v.@:) in which the
612mail is then stored permanently or until explicitly deleted.
613@xref{Rmail Inbox}.
614
615@item Incremental Search
616Emacs provides an incremental search facility, whereby Emacs searches
617for the string as you type it. @xref{Incremental Search}.
618
619@item Indentation
620Indentation means blank space at the beginning of a line. Most
621programming languages have conventions for using indentation to
622illuminate the structure of the program, and Emacs has special
623commands to adjust indentation.
624@xref{Indentation}.
625
626@item Indirect Buffer
627An indirect buffer is a buffer that shares the text of another buffer,
628called its base buffer (q.v.@:). @xref{Indirect Buffers}.
629
630@item Info
631Info is the hypertext format used by the GNU project for writing
632documentation.
633
634@item Input Event
635An input event represents, within Emacs, one action taken by the user on
636the terminal. Input events include typing characters, typing function
637keys, pressing or releasing mouse buttons, and switching between Emacs
638frames. @xref{User Input}.
639
640@item Input Method
641An input method is a system for entering non-@acronym{ASCII} text characters by
642typing sequences of @acronym{ASCII} characters (q.v.@:). @xref{Input Methods}.
643
644@item Insertion
645Insertion means copying text into the buffer, either from the keyboard
646or from some other place in Emacs.
647
648@item Interlocking
649Interlocking is a feature for warning when you start to alter a file
650that someone else is already editing.
651@xref{Interlocking,Interlocking,Simultaneous Editing}.
652
653@item Isearch
654See `incremental search.'
655
656@item Justification
657Justification means adding extra spaces within lines of text to make
658them extend exactly to a specified width.
659@xref{Format Justification}.
660
661@item Keybinding
662See `binding.'
663
664@item Keyboard Macro
665Keyboard macros are a way of defining new Emacs commands from
666sequences of existing ones, with no need to write a Lisp program.
667@xref{Keyboard Macros}.
668
669@cindex keyboard shortcuts
670@item Keyboard Shortcut
671A keyboard shortcut is a key sequence (q.v.@:) which invokes a
672command. What some programs call ``assigning a keyboard shortcut,''
673Emacs calls ``binding a key sequence.'' See `binding.'
674
675@item Key Sequence
676A key sequence (key, for short) is a sequence of input events (q.v.@:)
677that are meaningful as a single unit. If the key sequence is enough to
678specify one action, it is a complete key (q.v.@:); if it is not enough,
679it is a prefix key (q.v.@:). @xref{Keys}.
680
681@item Keymap
682The keymap is the data structure that records the bindings (q.v.@:) of
683key sequences to the commands that they run. For example, the global
684keymap binds the character @kbd{C-n} to the command function
685@code{next-line}. @xref{Keymaps}.
686
687@item Keyboard Translation Table
688The keyboard translation table is an array that translates the character
689codes that come from the terminal into the character codes that make up
690key sequences.
691
692@item Kill Ring
693The kill ring is where all text you have killed recently is saved.
694You can reinsert any of the killed text still in the ring; this is
695called yanking (q.v.@:). @xref{Yanking}.
696
697@item Killing
698Killing means erasing text and saving it on the kill ring so it can be
699yanked (q.v.@:) later. Some other systems call this ``cutting.''
700Most Emacs commands that erase text perform killing, as opposed to
701deletion (q.v.@:). @xref{Killing}.
702
703@item Killing a Job
704Killing a job (such as, an invocation of Emacs) means making it cease
705to exist. Any data within it, if not saved in a file, is lost.
706@xref{Exiting}.
707
708@item Language Environment
709Your choice of language environment specifies defaults for the input
710method (q.v.@:) and coding system (q.v.@:). @xref{Language
711Environments}. These defaults are relevant if you edit non-@acronym{ASCII} text
712(@pxref{International}).
713
714@item Line Wrapping
715See `filling.'
716
717@item Lisp
718Lisp is a programming language. Most of Emacs is written in a dialect
719of Lisp, called Emacs Lisp, that is extended with special features which
720make it especially suitable for text editing tasks.
721
722@item List
723A list is, approximately, a text string beginning with an open
724parenthesis and ending with the matching close parenthesis. In C mode
725and other non-Lisp modes, groupings surrounded by other kinds of matched
726delimiters appropriate to the language, such as braces, are also
727considered lists. Emacs has special commands for many operations on
728lists. @xref{Moving by Parens}.
729
730@item Local
731Local means ``in effect only in a particular context''; the relevant
732kind of context is a particular function execution, a particular
733buffer, or a particular major mode. It is the opposite of `global'
734(q.v.@:). Specific uses of `local' in Emacs terminology appear below.
735
736@item Local Abbrev
737A local abbrev definition is effective only if a particular major mode
738is selected. In that major mode, it overrides any global definition
739for the same abbrev. @xref{Abbrevs}.
740
741@item Local Keymap
742A local keymap is used in a particular major mode; the key bindings
743(q.v.@:) in the current local keymap override global bindings of the
744same key sequences. @xref{Keymaps}.
745
746@item Local Variable
747A local value of a variable (q.v.@:) applies to only one buffer.
748@xref{Locals}.
749
750@item @kbd{M-}
751@kbd{M-} in the name of a character is an abbreviation for @key{META},
752one of the modifier keys that can accompany any character.
753@xref{User Input,M-}.
754
755@item @kbd{M-C-}
756@kbd{M-C-} in the name of a character is an abbreviation for
757Control-Meta; it means the same thing as @kbd{C-M-}. If your
758terminal lacks a real @key{META} key, you type a Control-Meta character by
759typing @key{ESC} and then typing the corresponding Control character.
760@xref{User Input,C-M-}.
761
762@item @kbd{M-x}
763@kbd{M-x} is the key sequence which is used to call an Emacs command by
764name. This is how you run commands that are not bound to key sequences.
765@xref{M-x,M-x,Running Commands by Name}.
766
767@item Mail
768Mail means messages sent from one user to another through the computer
769system, to be read at the recipient's convenience. Emacs has commands for
770composing and sending mail, and for reading and editing the mail you have
771received. @xref{Sending Mail}. @xref{Rmail}, for how to read mail.
772
773@item Mail Composition Method
774A mail composition method is a program runnable within Emacs for editing
775and sending a mail message. Emacs lets you select from several
776alternative mail composition methods. @xref{Mail Methods}.
777
778@item Major Mode
779The Emacs major modes are a mutually exclusive set of options, each of
780which configures Emacs for editing a certain sort of text. Ideally,
781each programming language has its own major mode. @xref{Major Modes}.
782
783@item Margin
784The space between the usable part of a window (including the
785fringe) and the window edge.
786
787@item Mark
788The mark points to a position in the text. It specifies one end of the
789region (q.v.@:), point being the other end. Many commands operate on
790all the text from point to the mark. Each buffer has its own mark.
791@xref{Mark}.
792
793@item Mark Ring
794The mark ring is used to hold several recent previous locations of the
795mark, just in case you want to move back to them. Each buffer has its
796own mark ring; in addition, there is a single global mark ring (q.v.@:).
797@xref{Mark Ring}.
798
799@item Menu Bar
800The menu bar is the line at the top of an Emacs frame. It contains
801words you can click on with the mouse to bring up menus, or you can use
802a keyboard interface to navigate it. @xref{Menu Bars}.
803
804@item Message
805See `mail.'
806
807@item Meta
808Meta is the name of a modifier bit which you can use in a command
809character. To enter a meta character, you hold down the @key{META}
810key while typing the character. We refer to such characters with
811names that start with @kbd{Meta-} (usually written @kbd{M-} for
812short). For example, @kbd{M-<} is typed by holding down @key{META}
813and at the same time typing @kbd{<} (which itself is done, on most
814terminals, by holding down @key{SHIFT} and typing @kbd{,}).
815@xref{User Input,Meta}.
816
817On some terminals, the @key{META} key is actually labeled @key{ALT}
818or @key{EDIT}.
819
820@item Meta Character
821A Meta character is one whose character code includes the Meta bit.
822
823@item Minibuffer
824The minibuffer is the window that appears when necessary inside the
825echo area (q.v.@:), used for reading arguments to commands.
826@xref{Minibuffer}.
827
828@item Minibuffer History
829The minibuffer history records the text you have specified in the past
830for minibuffer arguments, so you can conveniently use the same text
831again. @xref{Minibuffer History}.
832
833@item Minor Mode
834A minor mode is an optional feature of Emacs which can be switched on
835or off independently of all other features. Each minor mode has a
836command to turn it on or off. @xref{Minor Modes}.
837
838@item Minor Mode Keymap
839A minor mode keymap is a keymap that belongs to a minor mode and is
840active when that mode is enabled. Minor mode keymaps take precedence
841over the buffer's local keymap, just as the local keymap takes
842precedence over the global keymap. @xref{Keymaps}.
843
844@item Mode Line
845The mode line is the line at the bottom of each window (q.v.@:), giving
846status information on the buffer displayed in that window. @xref{Mode
847Line}.
848
849@item Modified Buffer
850A buffer (q.v.@:) is modified if its text has been changed since the
851last time the buffer was saved (or since when it was created, if it
852has never been saved). @xref{Saving}.
853
854@item Moving Text
855Moving text means erasing it from one place and inserting it in
856another. The usual way to move text is by killing (q.v.@:) it and then
857yanking (q.v.@:) it. @xref{Killing}.
858
859@item MULE
860MULE refers to the Emacs features for editing multilingual non-@acronym{ASCII} text
861using multibyte characters (q.v.@:). @xref{International}.
862
863@item Multibyte Character
864A multibyte character is a character that takes up several bytes in a
865buffer. Emacs uses multibyte characters to represent non-@acronym{ASCII} text,
866since the number of non-@acronym{ASCII} characters is much more than 256.
867@xref{International Chars, International Characters}.
868
869@item Named Mark
870A named mark is a register (q.v.@:) in its role of recording a
871location in text so that you can move point to that location.
872@xref{Registers}.
873
874@item Narrowing
875Narrowing means creating a restriction (q.v.@:) that limits editing in
876the current buffer to only a part of the text in the buffer. Text
877outside that part is inaccessible for editing until the boundaries are
878widened again, but it is still there, and saving the file saves it
879all. @xref{Narrowing}.
880
881@item Newline
882Control-J characters in the buffer terminate lines of text and are
883therefore also called newlines. @xref{Text Characters,Newline}.
884
885@cindex nil
886@cindex t
887@item @code{nil}
888@code{nil} is a value usually interpreted as a logical ``false.'' Its
889opposite is @code{t}, interpreted as ``true.''
890
891@item Numeric Argument
892A numeric argument is a number, specified before a command, to change
893the effect of the command. Often the numeric argument serves as a
894repeat count. @xref{Arguments}.
895
896@item Overwrite Mode
897Overwrite mode is a minor mode. When it is enabled, ordinary text
898characters replace the existing text after point rather than pushing
899it to the right. @xref{Minor Modes}.
900
901@item Page
902A page is a unit of text, delimited by formfeed characters (@acronym{ASCII}
903control-L, code 014) coming at the beginning of a line. Some Emacs
904commands are provided for moving over and operating on pages.
905@xref{Pages}.
906
907@item Paragraph
908Paragraphs are the medium-size unit of human-language text. There are
909special Emacs commands for moving over and operating on paragraphs.
910@xref{Paragraphs}.
911
912@item Parsing
913We say that certain Emacs commands parse words or expressions in the
914text being edited. Really, all they know how to do is find the other
915end of a word or expression. @xref{Syntax}.
916
917@item Point
918Point is the place in the buffer at which insertion and deletion
919occur. Point is considered to be between two characters, not at one
920character. The terminal's cursor (q.v.@:) indicates the location of
921point. @xref{Point}.
922
923@item Prefix Argument
924See `numeric argument.'
925
926@item Prefix Key
927A prefix key is a key sequence (q.v.@:) whose sole function is to
928introduce a set of longer key sequences. @kbd{C-x} is an example of
929prefix key; any two-character sequence starting with @kbd{C-x} is
930therefore a legitimate key sequence. @xref{Keys}.
931
932@item Primary Rmail File
933Your primary Rmail file is the file named @samp{RMAIL} in your home
934directory. That's where Rmail stores your incoming mail, unless you
935specify a different file name. @xref{Rmail}.
936
937@item Primary Selection
938The primary selection is one particular X selection (q.v.@:); it is the
939selection that most X applications use for transferring text to and from
940other applications.
941
942The Emacs kill commands set the primary selection and the yank command
943uses the primary selection when appropriate. @xref{Killing}.
944
945@item Prompt
946A prompt is text used to ask the user for input. Displaying a prompt
947is called prompting. Emacs prompts always appear in the echo area
948(q.v.@:). One kind of prompting happens when the minibuffer is used to
949read an argument (@pxref{Minibuffer}); the echoing which happens when
950you pause in the middle of typing a multi-character key sequence is also
951a kind of prompting (@pxref{Echo Area}).
952
953@item Query-Replace
954Query-replace is an interactive string replacement feature provided by
955Emacs. @xref{Query Replace}.
956
957@item Quitting
958Quitting means canceling a partially typed command or a running
959command, using @kbd{C-g} (or @kbd{C-@key{BREAK}} on MS-DOS). @xref{Quitting}.
960
961@item Quoting
962Quoting means depriving a character of its usual special significance.
963The most common kind of quoting in Emacs is with @kbd{C-q}. What
964constitutes special significance depends on the context and on
965convention. For example, an ``ordinary'' character as an Emacs command
966inserts itself; so in this context, a special character is any character
967that does not normally insert itself (such as @key{DEL}, for example),
968and quoting it makes it insert itself as if it were not special. Not
969all contexts allow quoting. @xref{Inserting Text,Quoting}.
970
971@item Quoting File Names
972Quoting a file name turns off the special significance of constructs
973such as @samp{$}, @samp{~} and @samp{:}. @xref{Quoted File Names}.
974
975@item Read-Only Buffer
976A read-only buffer is one whose text you are not allowed to change.
977Normally Emacs makes buffers read-only when they contain text which
978has a special significance to Emacs; for example, Dired buffers.
979Visiting a file that is write-protected also makes a read-only buffer.
980@xref{Buffers}.
981
982@item Rectangle
983A rectangle consists of the text in a given range of columns on a given
984range of lines. Normally you specify a rectangle by putting point at
985one corner and putting the mark at the diagonally opposite corner.
986@xref{Rectangles}.
987
988@item Recursive Editing Level
989A recursive editing level is a state in which part of the execution of
990a command involves asking you to edit some text. This text may
991or may not be the same as the text to which the command was applied.
992The mode line indicates recursive editing levels with square brackets
993(@samp{[} and @samp{]}). @xref{Recursive Edit}.
994
995@item Redisplay
996Redisplay is the process of correcting the image on the screen to
997correspond to changes that have been made in the text being edited.
998@xref{Screen,Redisplay}.
999
1000@item Regexp
1001See `regular expression.'
1002
1003@item Region
1004The region is the text between point (q.v.@:) and the mark (q.v.@:).
1005Many commands operate on the text of the region. @xref{Mark,Region}.
1006
1007@item Register
1008Registers are named slots in which text or buffer positions or
1009rectangles can be saved for later use. @xref{Registers}. A related
1010Emacs feature is `bookmarks' (q.v.@:).
1011
1012@item Regular Expression
1013A regular expression is a pattern that can match various text strings;
1014for example, @samp{a[0-9]+} matches @samp{a} followed by one or more
1015digits. @xref{Regexps}.
1016
1017@item Remote File
1018A remote file is a file that is stored on a system other than your own.
1019Emacs can access files on other computers provided that they are
1020connected to the same network as your machine, and (obviously) that
1021you have a supported method to gain access to those files.
1022@xref{Remote Files}.
1023
1024@item Repeat Count
1025See `numeric argument.'
1026
1027@item Replacement
1028See `global substitution.'
1029
1030@item Restriction
1031A buffer's restriction is the amount of text, at the beginning or the
1032end of the buffer, that is temporarily inaccessible. Giving a buffer a
1033nonzero amount of restriction is called narrowing (q.v.@:); removing
1034a restriction is called widening (q.v.@:). @xref{Narrowing}.
1035
1036@item @key{RET}
1037@key{RET} is a character that in Emacs runs the command to insert a
1038newline into the text. It is also used to terminate most arguments
1039read in the minibuffer (q.v.@:). @xref{User Input,Return}.
1040
1041@item Reverting
1042Reverting means returning to the original state. Emacs lets you
1043revert a buffer by re-reading its file from disk. @xref{Reverting}.
1044
1045@item Rmail File
1046An Rmail file is a file containing text in a special format used by
1047Rmail for storing mail. @xref{Rmail}.
1048
1049@item Saving
1050Saving a buffer means copying its text into the file that was visited
1051(q.v.@:) in that buffer. This is the way text in files actually gets
1052changed by your Emacs editing. @xref{Saving}.
1053
1054@item Scroll Bar
1055A scroll bar is a tall thin hollow box that appears at the side of a
1056window. You can use mouse commands in the scroll bar to scroll the
1057window. The scroll bar feature is supported only under windowing
1058systems. @xref{Scroll Bars}.
1059
1060@item Scrolling
1061Scrolling means shifting the text in the Emacs window so as to see a
1062different part of the buffer. @xref{Scrolling}.
1063
1064@item Searching
1065Searching means moving point to the next occurrence of a specified
1066string or the next match for a specified regular expression.
1067@xref{Search}.
1068
1069@item Search Path
1070A search path is a list of directory names, to be used for searching for
1071files for certain purposes. For example, the variable @code{load-path}
1072holds a search path for finding Lisp library files. @xref{Lisp Libraries}.
1073
1074@item Secondary Selection
1075The secondary selection is one particular X selection; some X
1076applications can use it for transferring text to and from other
1077applications. Emacs has special mouse commands for transferring text
1078using the secondary selection. @xref{Secondary Selection}.
1079
1080@item Selected Frame
1081The selected frame is the one your input currently operates on.
1082@xref{Frames}.
1083
1084@item Selected Window
1085The selected frame is the one your input currently operates on.
1086@xref{Basic Window}.
1087
1088@item Selecting a Buffer
1089Selecting a buffer means making it the current (q.v.@:) buffer.
1090@xref{Select Buffer}.
1091
1092@item Selection
1093Windowing systems allow an application program to specify
1094selections whose values are text. A program can also read the
1095selections that other programs have set up. This is the principal way
1096of transferring text between window applications. Emacs has commands to
1097work with the primary (q.v.@:) selection and the secondary (q.v.@:)
1098selection, and also with the clipboard (q.v.@:).
1099
1100@item Self-Documentation
1101Self-documentation is the feature of Emacs which can tell you what any
1102command does, or give you a list of all commands related to a topic
1103you specify. You ask for self-documentation with the help character,
1104@kbd{C-h}. @xref{Help}.
1105
1106@item Self-Inserting Character
1107A character is self-inserting if typing that character inserts that
1108character in the buffer. Ordinary printing and whitespace characters
1109are self-inserting in Emacs, except in certain special major modes.
1110
1111@item Sentences
1112Emacs has commands for moving by or killing by sentences.
1113@xref{Sentences}.
1114
1115@item Sexp
1116A sexp (short for ``s-expression'') is the basic syntactic unit of
1117Lisp in its textual form: either a list, or Lisp atom. Sexps are also
1118the balanced expressions (q.v.@:) of the Lisp language; this is why
1119the commands for editing balanced expressions have `sexp' in their
1120name. @xref{Expressions,Sexps}.
1121
1122@item Simultaneous Editing
1123Simultaneous editing means two users modifying the same file at once.
1124Simultaneous editing, if not detected, can cause one user to lose his
1125or her work. Emacs detects all cases of simultaneous editing, and
1126warns one of the users to investigate.
1127@xref{Interlocking,Interlocking,Simultaneous Editing}.
1128
1129@item @key{SPC}
1130@key{SPC} is the space character, which you enter by pressing the
1131space bar.
1132
1133@item Speedbar
1134The speedbar is a special tall frame that provides fast access to Emacs
1135buffers, functions within those buffers, Info nodes, and other
1136interesting parts of text within Emacs. @xref{Speedbar}.
1137
1138@item Spell Checking
1139Spell checking means checking correctness of the written form of each
1140one of the words in a text. Emacs uses the Ispell spelling-checker
1141program to check the spelling of parts of a buffer via a convenient user
1142interface. @xref{Spelling}.
1143
1144@item String
1145A string is a kind of Lisp data object which contains a sequence of
1146characters. Many Emacs variables are intended to have strings as
1147values. The Lisp syntax for a string consists of the characters in the
1148string with a @samp{"} before and another @samp{"} after. A @samp{"}
1149that is part of the string must be written as @samp{\"} and a @samp{\}
1150that is part of the string must be written as @samp{\\}. All other
1151characters, including newline, can be included just by writing them
1152inside the string; however, backslash sequences as in C, such as
1153@samp{\n} for newline or @samp{\241} using an octal character code, are
1154allowed as well.
1155
1156@item String Substitution
1157See `global substitution'.
1158
1159@item Syntax Highlighting
1160See `font lock.'
1161
1162@item Syntax Table
1163The syntax table tells Emacs which characters are part of a word,
1164which characters balance each other like parentheses, etc.
1165@xref{Syntax}.
1166
1167@item Super
1168Super is the name of a modifier bit which a keyboard input character may
1169have. To make a character Super, type it while holding down the
1170@key{SUPER} key. Such characters are given names that start with
1171@kbd{Super-} (usually written @kbd{s-} for short). @xref{User Input,
1172Super}.
1173
1174@item Suspending
1175Suspending Emacs means stopping it temporarily and returning control
1176to its parent process, which is usually a shell. Unlike killing a job
1177(q.v.@:), you can later resume the suspended Emacs job without losing
1178your buffers, unsaved edits, undo history, etc. @xref{Exiting}.
1179
1180@item @key{TAB}
1181@key{TAB} is the tab character. In Emacs it is typically used for
1182indentation or completion.
1183
1184@item Tags Table
1185A tags table is a file that serves as an index to the function
1186definitions in one or more other files. @xref{Tags}.
1187
1188@item Termscript File
1189A termscript file contains a record of all characters sent by Emacs to
1190the terminal. It is used for tracking down bugs in Emacs redisplay.
1191Emacs does not make a termscript file unless you tell it to.
1192@xref{Bugs}.
1193
1194@item Text
1195`Text' has two meanings (@pxref{Text}):
1196
1197@itemize @bullet
1198@item
1199Data consisting of a sequence of characters, as opposed to binary
1200numbers, executable programs, and the like. The basic contents of an
1201Emacs buffer (aside from the text properties, q.v.@:) are always text
1202in this sense.
1203@item
1204Data consisting of written human language, as opposed to programs,
1205or following the stylistic conventions of human language.
1206@end itemize
1207
1208@item Text-only Terminal
1209A text-only terminal is a display that is limited to displaying text in
1210character units. Such a terminal cannot control individual pixels it
1211displays. Emacs supports a subset of display features on text-only
1212terminals.
1213
1214@item Text Properties
1215Text properties are annotations recorded for particular characters in
1216the buffer. Images in the buffer are recorded as text properties;
1217they also specify formatting information. @xref{Editing Format Info}.
1218
1219@item Tool Bar
1220The tool bar is a line (sometimes multiple lines) of icons at the top
1221of an Emacs frame. Clicking on one of these icons executes a command.
1222You can think of this as a graphical relative of the menu bar (q.v.@:).
1223@xref{Tool Bars}.
1224
1225@item Tooltips
1226Tooltips are small windows displaying a help echo (q.v.@:) text that
1227explains parts of the display, lists useful options available via mouse
1228clicks, etc. @xref{Tooltips}.
1229
1230@item Top Level
1231Top level is the normal state of Emacs, in which you are editing the
1232text of the file you have visited. You are at top level whenever you
1233are not in a recursive editing level (q.v.@:) or the minibuffer
1234(q.v.@:), and not in the middle of a command. You can get back to top
1235level by aborting (q.v.@:) and quitting (q.v.@:). @xref{Quitting}.
1236
1237@item Transposition
1238Transposing two units of text means putting each one into the place
1239formerly occupied by the other. There are Emacs commands to transpose
1240two adjacent characters, words, balanced expressions (q.v.@:) or lines
1241(@pxref{Transpose}).
1242
1243@item Truncation
1244Truncating text lines in the display means leaving out any text on a
1245line that does not fit within the right margin of the window
1246displaying it. See also `continuation line.'
1247@xref{Continuation Lines,Truncation}.
1248
1249@item TTY
1250See `text-only terminal.'
1251
1252@item Undoing
1253Undoing means making your previous editing go in reverse, bringing
1254back the text that existed earlier in the editing session.
1255@xref{Undo}.
1256
1257@item User Option
1258A user option is a face (q.v.@:) or a variable (q.v.@:) that exists so
1259that you can customize Emacs by setting it to a new value.
1260@xref{Easy Customization}.
1261
1262@item Variable
1263A variable is an object in Lisp that can store an arbitrary value.
1264Emacs uses some variables for internal purposes, and has others (known
1265as `user options' (q.v.@:)) just so that you can set their values to
1266control the behavior of Emacs. The variables used in Emacs that you
1267are likely to be interested in are listed in the Variables Index in
1268this manual (@pxref{Variable Index}). @xref{Variables}, for
1269information on variables.
1270
1271@item Version Control
1272Version control systems keep track of multiple versions of a source file.
1273They provide a more powerful alternative to keeping backup files (q.v.@:).
1274@xref{Version Control}.
1275
1276@item Visiting
1277Visiting a file means loading its contents into a buffer (q.v.@:)
1278where they can be edited. @xref{Visiting}.
1279
1280@item Whitespace
1281Whitespace is any run of consecutive formatting characters (space,
1282tab, newline, and backspace).
1283
1284@item Widening
1285Widening is removing any restriction (q.v.@:) on the current buffer;
1286it is the opposite of narrowing (q.v.@:). @xref{Narrowing}.
1287
1288@item Window
1289Emacs divides a frame (q.v.@:) into one or more windows, each of which
1290can display the contents of one buffer (q.v.@:) at any time.
1291@xref{Screen}, for basic information on how Emacs uses the screen.
1292@xref{Windows}, for commands to control the use of windows. Some
1293other editors use the term ``window'' for what we call a `frame'
1294(q.v.@:) in Emacs.
1295
1296@item Window System
1297A window system is software that operates on a graphical display
1298(q.v.@:), to subdivide the screen so that multiple applications can
1299have their] own windows at the same time. All modern operating systems
1300include a window system.
1301
1302@item Word Abbrev
1303See `abbrev.'
1304
1305@item Word Search
1306Word search is searching for a sequence of words, considering the
1307punctuation between them as insignificant. @xref{Word Search}.
1308
1309@item WYSIWYG
1310WYSIWYG stands for ``What you see is what you get.'' Emacs generally
1311provides WYSIWYG editing for files of characters; in Enriched mode
1312(@pxref{Formatted Text}), it provides WYSIWYG editing for files that
1313include text formatting information.
1314
1315@item Yanking
1316Yanking means reinserting text previously killed. It can be used to
1317undo a mistaken kill, or for copying or moving text. Some other
1318systems call this ``pasting.'' @xref{Yanking}.
1319@end table
1320
1321@ignore
1322 arch-tag: 0dd53ce1-5f09-4ac2-b13b-cf22b0f28d23
1323@end ignore
diff --git a/doc/emacs/gnu.texi b/doc/emacs/gnu.texi
new file mode 100644
index 00000000000..1cf85f41c3c
--- /dev/null
+++ b/doc/emacs/gnu.texi
@@ -0,0 +1,567 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2001, 2002, 2003, 2004,
3@c 2005, 2006, 2007 Free Software Foundation, Inc.
4@ifclear justgnu
5@node Manifesto,, Microsoft Windows, Top
6@unnumbered The GNU Manifesto
7@end ifclear
8@ifset justgnu
9Copyright @copyright{} 1985, 1993, 2001, 2002, 2003, 2004,
102005, 2006, 2007 Free Software Foundation, Inc.
11
12Permission is granted to copy, distribute and/or modify this document
13under the terms of the GNU Free Documentation License, Version 1.2 or
14any later version published by the Free Software Foundation; with no
15Invariant Sections, with the Front-Cover texts being ``A GNU
16Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
17license is included in the section entitled ``GNU Free Documentation
18License'' in the Emacs manual.
19
20(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
21this GNU Manual, like GNU software. Copies published by the Free
22Software Foundation raise funds for GNU development.''
23
24This document is part of a collection distributed under the GNU Free
25Documentation License. If you want to distribute this document
26separately from the collection, you can do so by adding a copy of the
27license to the document, as described in section 6 of the license.
28
29@node Top
30@top The GNU Manifesto
31@end ifset
32
33@quotation
34The GNU Manifesto which appears below was written by Richard Stallman at
35the beginning of the GNU project, to ask for participation and support.
36For the first few years, it was updated in minor ways to account for
37developments, but now it seems best to leave it unchanged as most people
38have seen it.
39
40Since that time, we have learned about certain common misunderstandings
41that different wording could help avoid. Footnotes added in 1993 help
42clarify these points.
43
44For up-to-date information about available GNU software, please see
45our web site, @uref{http://www.gnu.org}. For software tasks and other
46ways to contribute, see @uref{http://www.gnu.org/help}.
47@end quotation
48
49@unnumberedsec What's GNU? Gnu's Not Unix!
50
51GNU, which stands for Gnu's Not Unix, is the name for the complete
52Unix-compatible software system which I am writing so that I can give it
53away free to everyone who can use it.@footnote{The wording here was
54careless. The intention was that nobody would have to pay for
55@emph{permission} to use the GNU system. But the words don't make this
56clear, and people often interpret them as saying that copies of GNU
57should always be distributed at little or no charge. That was never the
58intent; later on, the manifesto mentions the possibility of companies
59providing the service of distribution for a profit. Subsequently I have
60learned to distinguish carefully between ``free'' in the sense of
61freedom and ``free'' in the sense of price. Free software is software
62that users have the freedom to distribute and change. Some users may
63obtain copies at no charge, while others pay to obtain copies---and if
64the funds help support improving the software, so much the better. The
65important thing is that everyone who has a copy has the freedom to
66cooperate with others in using it.} Several other volunteers are helping
67me. Contributions of time, money, programs and equipment are greatly
68needed.
69
70So far we have an Emacs text editor with Lisp for writing editor commands,
71a source level debugger, a yacc-compatible parser generator, a linker, and
72around 35 utilities. A shell (command interpreter) is nearly completed. A
73new portable optimizing C compiler has compiled itself and may be released
74this year. An initial kernel exists but many more features are needed to
75emulate Unix. When the kernel and compiler are finished, it will be
76possible to distribute a GNU system suitable for program development. We
77will use @TeX{} as our text formatter, but an nroff is being worked on. We
78will use the free, portable X window system as well. After this we will
79add a portable Common Lisp, an Empire game, a spreadsheet, and hundreds of
80other things, plus on-line documentation. We hope to supply, eventually,
81everything useful that normally comes with a Unix system, and more.
82
83GNU will be able to run Unix programs, but will not be identical to Unix.
84We will make all improvements that are convenient, based on our experience
85with other operating systems. In particular, we plan to have longer
86file names, file version numbers, a crashproof file system, file name
87completion perhaps, terminal-independent display support, and perhaps
88eventually a Lisp-based window system through which several Lisp programs
89and ordinary Unix programs can share a screen. Both C and Lisp will be
90available as system programming languages. We will try to support UUCP,
91MIT Chaosnet, and Internet protocols for communication.
92
93GNU is aimed initially at machines in the 68000/16000 class with virtual
94memory, because they are the easiest machines to make it run on. The extra
95effort to make it run on smaller machines will be left to someone who wants
96to use it on them.
97
98To avoid horrible confusion, please pronounce the `G' in the word `GNU'
99when it is the name of this project.
100
101@unnumberedsec Why I Must Write GNU
102
103I consider that the golden rule requires that if I like a program I must
104share it with other people who like it. Software sellers want to divide
105the users and conquer them, making each user agree not to share with
106others. I refuse to break solidarity with other users in this way. I
107cannot in good conscience sign a nondisclosure agreement or a software
108license agreement. For years I worked within the Artificial Intelligence
109Lab to resist such tendencies and other inhospitalities, but eventually
110they had gone too far: I could not remain in an institution where such
111things are done for me against my will.
112
113So that I can continue to use computers without dishonor, I have decided to
114put together a sufficient body of free software so that I will be able to
115get along without any software that is not free. I have resigned from the
116AI lab to deny MIT any legal excuse to prevent me from giving GNU away.
117
118@unnumberedsec Why GNU Will Be Compatible with Unix
119
120Unix is not my ideal system, but it is not too bad. The essential features
121of Unix seem to be good ones, and I think I can fill in what Unix lacks
122without spoiling them. And a system compatible with Unix would be
123convenient for many other people to adopt.
124
125@unnumberedsec How GNU Will Be Available
126
127GNU is not in the public domain. Everyone will be permitted to modify and
128redistribute GNU, but no distributor will be allowed to restrict its
129further redistribution. That is to say, proprietary modifications will not
130be allowed. I want to make sure that all versions of GNU remain free.
131
132@unnumberedsec Why Many Other Programmers Want to Help
133
134I have found many other programmers who are excited about GNU and want to
135help.
136
137Many programmers are unhappy about the commercialization of system
138software. It may enable them to make more money, but it requires them to
139feel in conflict with other programmers in general rather than feel as
140comrades. The fundamental act of friendship among programmers is the
141sharing of programs; marketing arrangements now typically used essentially
142forbid programmers to treat others as friends. The purchaser of software
143must choose between friendship and obeying the law. Naturally, many decide
144that friendship is more important. But those who believe in law often do
145not feel at ease with either choice. They become cynical and think that
146programming is just a way of making money.
147
148By working on and using GNU rather than proprietary programs, we can be
149hospitable to everyone and obey the law. In addition, GNU serves as an
150example to inspire and a banner to rally others to join us in sharing.
151This can give us a feeling of harmony which is impossible if we use
152software that is not free. For about half the programmers I talk to, this
153is an important happiness that money cannot replace.
154
155@unnumberedsec How You Can Contribute
156
157I am asking computer manufacturers for donations of machines and money.
158I'm asking individuals for donations of programs and work.
159
160One consequence you can expect if you donate machines is that GNU will run
161on them at an early date. The machines should be complete, ready to use
162systems, approved for use in a residential area, and not in need of
163sophisticated cooling or power.
164
165I have found very many programmers eager to contribute part-time work for
166GNU. For most projects, such part-time distributed work would be very hard
167to coordinate; the independently-written parts would not work together.
168But for the particular task of replacing Unix, this problem is absent. A
169complete Unix system contains hundreds of utility programs, each of which
170is documented separately. Most interface specifications are fixed by Unix
171compatibility. If each contributor can write a compatible replacement for
172a single Unix utility, and make it work properly in place of the original
173on a Unix system, then these utilities will work right when put together.
174Even allowing for Murphy to create a few unexpected problems, assembling
175these components will be a feasible task. (The kernel will require closer
176communication and will be worked on by a small, tight group.)
177
178If I get donations of money, I may be able to hire a few people full or
179part time. The salary won't be high by programmers' standards, but I'm
180looking for people for whom building community spirit is as important as
181making money. I view this as a way of enabling dedicated people to devote
182their full energies to working on GNU by sparing them the need to make a
183living in another way.
184
185@unnumberedsec Why All Computer Users Will Benefit
186
187Once GNU is written, everyone will be able to obtain good system
188software free, just like air.@footnote{This is another place I failed to
189distinguish carefully between the two different meanings of ``free.''
190The statement as it stands is not false---you can get copies of GNU
191software at no charge, from your friends or over the net. But it does
192suggest the wrong idea.}
193
194This means much more than just saving everyone the price of a Unix license.
195It means that much wasteful duplication of system programming effort will
196be avoided. This effort can go instead into advancing the state of the
197art.
198
199Complete system sources will be available to everyone. As a result, a user
200who needs changes in the system will always be free to make them himself,
201or hire any available programmer or company to make them for him. Users
202will no longer be at the mercy of one programmer or company which owns the
203sources and is in sole position to make changes.
204
205Schools will be able to provide a much more educational environment by
206encouraging all students to study and improve the system code. Harvard's
207computer lab used to have the policy that no program could be installed on
208the system if its sources were not on public display, and upheld it by
209actually refusing to install certain programs. I was very much inspired by
210this.
211
212Finally, the overhead of considering who owns the system software and what
213one is or is not entitled to do with it will be lifted.
214
215Arrangements to make people pay for using a program, including licensing of
216copies, always incur a tremendous cost to society through the cumbersome
217mechanisms necessary to figure out how much (that is, which programs) a
218person must pay for. And only a police state can force everyone to obey
219them. Consider a space station where air must be manufactured at great
220cost: charging each breather per liter of air may be fair, but wearing the
221metered gas mask all day and all night is intolerable even if everyone can
222afford to pay the air bill. And the TV cameras everywhere to see if you
223ever take the mask off are outrageous. It's better to support the air
224plant with a head tax and chuck the masks.
225
226Copying all or parts of a program is as natural to a programmer as
227breathing, and as productive. It ought to be as free.
228
229@unnumberedsec Some Easily Rebutted Objections to GNU's Goals
230
231@quotation
232``Nobody will use it if it is free, because that means they can't rely
233on any support.''
234
235``You have to charge for the program to pay for providing the
236support.''
237@end quotation
238
239If people would rather pay for GNU plus service than get GNU free without
240service, a company to provide just service to people who have obtained GNU
241free ought to be profitable.@footnote{Several such companies now exist.}
242
243We must distinguish between support in the form of real programming work
244and mere handholding. The former is something one cannot rely on from a
245software vendor. If your problem is not shared by enough people, the
246vendor will tell you to get lost.
247
248If your business needs to be able to rely on support, the only way is to
249have all the necessary sources and tools. Then you can hire any available
250person to fix your problem; you are not at the mercy of any individual.
251With Unix, the price of sources puts this out of consideration for most
252businesses. With GNU this will be easy. It is still possible for there to
253be no available competent person, but this problem cannot be blamed on
254distribution arrangements. GNU does not eliminate all the world's problems,
255only some of them.
256
257Meanwhile, the users who know nothing about computers need handholding:
258doing things for them which they could easily do themselves but don't know
259how.
260
261Such services could be provided by companies that sell just hand-holding
262and repair service. If it is true that users would rather spend money and
263get a product with service, they will also be willing to buy the service
264having got the product free. The service companies will compete in quality
265and price; users will not be tied to any particular one. Meanwhile, those
266of us who don't need the service should be able to use the program without
267paying for the service.
268
269@quotation
270``You cannot reach many people without advertising,
271and you must charge for the program to support that.''
272
273``It's no use advertising a program people can get free.''
274@end quotation
275
276There are various forms of free or very cheap publicity that can be used to
277inform numbers of computer users about something like GNU. But it may be
278true that one can reach more microcomputer users with advertising. If this
279is really so, a business which advertises the service of copying and
280mailing GNU for a fee ought to be successful enough to pay for its
281advertising and more. This way, only the users who benefit from the
282advertising pay for it.
283
284On the other hand, if many people get GNU from their friends, and such
285companies don't succeed, this will show that advertising was not really
286necessary to spread GNU. Why is it that free market advocates don't
287want to let the free market decide this?@footnote{The Free Software
288Foundation raises most of its funds from a distribution service,
289although it is a charity rather than a company. If @emph{no one}
290chooses to obtain copies by ordering from the FSF, it will be unable
291to do its work. But this does not mean that proprietary restrictions
292are justified to force every user to pay. If a small fraction of all
293the users order copies from the FSF, that is sufficient to keep the FSF
294afloat. So we ask users to choose to support us in this way. Have you
295done your part?}
296
297@quotation
298``My company needs a proprietary operating system
299to get a competitive edge.''
300@end quotation
301
302GNU will remove operating system software from the realm of competition.
303You will not be able to get an edge in this area, but neither will your
304competitors be able to get an edge over you. You and they will compete in
305other areas, while benefiting mutually in this one. If your business is
306selling an operating system, you will not like GNU, but that's tough on
307you. If your business is something else, GNU can save you from being
308pushed into the expensive business of selling operating systems.
309
310I would like to see GNU development supported by gifts from many
311manufacturers and users, reducing the cost to each.@footnote{A group of
312computer companies recently pooled funds to support maintenance of the
313GNU C Compiler.}
314
315@quotation
316``Don't programmers deserve a reward for their creativity?''
317@end quotation
318
319If anything deserves a reward, it is social contribution. Creativity can
320be a social contribution, but only in so far as society is free to use the
321results. If programmers deserve to be rewarded for creating innovative
322programs, by the same token they deserve to be punished if they restrict
323the use of these programs.
324
325@quotation
326``Shouldn't a programmer be able to ask for a reward for his creativity?''
327@end quotation
328
329There is nothing wrong with wanting pay for work, or seeking to maximize
330one's income, as long as one does not use means that are destructive. But
331the means customary in the field of software today are based on
332destruction.
333
334Extracting money from users of a program by restricting their use of it is
335destructive because the restrictions reduce the amount and the ways that
336the program can be used. This reduces the amount of wealth that humanity
337derives from the program. When there is a deliberate choice to restrict,
338the harmful consequences are deliberate destruction.
339
340The reason a good citizen does not use such destructive means to become
341wealthier is that, if everyone did so, we would all become poorer from the
342mutual destructiveness. This is Kantian ethics; or, the Golden Rule.
343Since I do not like the consequences that result if everyone hoards
344information, I am required to consider it wrong for one to do so.
345Specifically, the desire to be rewarded for one's creativity does not
346justify depriving the world in general of all or part of that creativity.
347
348@quotation
349``Won't programmers starve?''
350@end quotation
351
352I could answer that nobody is forced to be a programmer. Most of us cannot
353manage to get any money for standing on the street and making faces. But
354we are not, as a result, condemned to spend our lives standing on the
355street making faces, and starving. We do something else.
356
357But that is the wrong answer because it accepts the questioner's implicit
358assumption: that without ownership of software, programmers cannot possibly
359be paid a cent. Supposedly it is all or nothing.
360
361The real reason programmers will not starve is that it will still be
362possible for them to get paid for programming; just not paid as much as
363now.
364
365Restricting copying is not the only basis for business in software. It is
366the most common basis because it brings in the most money. If it were
367prohibited, or rejected by the customer, software business would move to
368other bases of organization which are now used less often. There are
369always numerous ways to organize any kind of business.
370
371Probably programming will not be as lucrative on the new basis as it is
372now. But that is not an argument against the change. It is not considered
373an injustice that sales clerks make the salaries that they now do. If
374programmers made the same, that would not be an injustice either. (In
375practice they would still make considerably more than that.)
376
377@quotation
378``Don't people have a right to control how their creativity is used?''
379@end quotation
380
381``Control over the use of one's ideas'' really constitutes control over
382other people's lives; and it is usually used to make their lives more
383difficult.
384
385People who have studied the issue of intellectual property
386rights@footnote{In the 80s I had not yet realized how confusing it was
387to speak of ``the issue'' of ``intellectual property.'' That term is
388obviously biased; more subtle is the fact that it lumps together
389various disparate laws which raise very different issues. Nowadays I
390urge people to reject the term ``intellectual property'' entirely,
391lest it lead others to suppose that those laws form one coherent
392issue. The way to be clear is to discuss patents, copyrights, and
393trademarks separately. See
394@uref{http://www.gnu.org/philosophy/not-ipr.xhtml} for more
395explanation of how this term spreads confusion and bias.} carefully
396(such as lawyers) say that there is no intrinsic right to intellectual
397property. The kinds of supposed intellectual property rights that the
398government recognizes were created by specific acts of legislation for
399specific purposes.
400
401For example, the patent system was established to encourage inventors to
402disclose the details of their inventions. Its purpose was to help society
403rather than to help inventors. At the time, the life span of 17 years for
404a patent was short compared with the rate of advance of the state of the
405art. Since patents are an issue only among manufacturers, for whom the
406cost and effort of a license agreement are small compared with setting up
407production, the patents often do not do much harm. They do not obstruct
408most individuals who use patented products.
409
410The idea of copyright did not exist in ancient times, when authors
411frequently copied other authors at length in works of non-fiction. This
412practice was useful, and is the only way many authors' works have survived
413even in part. The copyright system was created expressly for the purpose
414of encouraging authorship. In the domain for which it was
415invented---books, which could be copied economically only on a printing
416press---it did little harm, and did not obstruct most of the individuals
417who read the books.
418
419All intellectual property rights are just licenses granted by society
420because it was thought, rightly or wrongly, that society as a whole would
421benefit by granting them. But in any particular situation, we have to ask:
422are we really better off granting such license? What kind of act are we
423licensing a person to do?
424
425The case of programs today is very different from that of books a hundred
426years ago. The fact that the easiest way to copy a program is from one
427neighbor to another, the fact that a program has both source code and
428object code which are distinct, and the fact that a program is used rather
429than read and enjoyed, combine to create a situation in which a person who
430enforces a copyright is harming society as a whole both materially and
431spiritually; in which a person should not do so regardless of whether the
432law enables him to.
433
434@quotation
435``Competition makes things get done better.''
436@end quotation
437
438The paradigm of competition is a race: by rewarding the winner, we
439encourage everyone to run faster. When capitalism really works this way,
440it does a good job; but its defenders are wrong in assuming it always works
441this way. If the runners forget why the reward is offered and become
442intent on winning, no matter how, they may find other strategies---such as,
443attacking other runners. If the runners get into a fist fight, they will
444all finish late.
445
446Proprietary and secret software is the moral equivalent of runners in a
447fist fight. Sad to say, the only referee we've got does not seem to
448object to fights; he just regulates them (``For every ten yards you run,
449you can fire one shot''). He really ought to break them up, and penalize
450runners for even trying to fight.
451
452@quotation
453``Won't everyone stop programming without a monetary incentive?''
454@end quotation
455
456Actually, many people will program with absolutely no monetary incentive.
457Programming has an irresistible fascination for some people, usually the
458people who are best at it. There is no shortage of professional musicians
459who keep at it even though they have no hope of making a living that way.
460
461But really this question, though commonly asked, is not appropriate to the
462situation. Pay for programmers will not disappear, only become less. So
463the right question is, will anyone program with a reduced monetary
464incentive? My experience shows that they will.
465
466For more than ten years, many of the world's best programmers worked at the
467Artificial Intelligence Lab for far less money than they could have had
468anywhere else. They got many kinds of non-monetary rewards: fame and
469appreciation, for example. And creativity is also fun, a reward in itself.
470
471Then most of them left when offered a chance to do the same interesting
472work for a lot of money.
473
474What the facts show is that people will program for reasons other than
475riches; but if given a chance to make a lot of money as well, they will
476come to expect and demand it. Low-paying organizations do poorly in
477competition with high-paying ones, but they do not have to do badly if the
478high-paying ones are banned.
479
480@quotation
481``We need the programmers desperately. If they demand that we
482stop helping our neighbors, we have to obey.''
483@end quotation
484
485You're never so desperate that you have to obey this sort of demand.
486Remember: millions for defense, but not a cent for tribute!
487
488@quotation
489``Programmers need to make a living somehow.''
490@end quotation
491
492In the short run, this is true. However, there are plenty of ways that
493programmers could make a living without selling the right to use a program.
494This way is customary now because it brings programmers and businessmen the
495most money, not because it is the only way to make a living. It is easy to
496find other ways if you want to find them. Here are a number of examples.
497
498A manufacturer introducing a new computer will pay for the porting of
499operating systems onto the new hardware.
500
501The sale of teaching, hand-holding and maintenance services could also
502employ programmers.
503
504People with new ideas could distribute programs as
505freeware@footnote{Subsequently we have discovered the need to
506distinguish between ``free software'' and ``freeware''. The term
507``freeware'' means software you are free to redistribute, but usually
508you are not free to study and change the source code, so most of it is
509not free software. See
510@uref{http://www.gnu.org/philosophy/words-to-avoid.html} for more
511explanation.}, asking for donations from satisfied users, or selling
512hand-holding services. I have met people who are already working this
513way successfully.
514
515Users with related needs can form users' groups, and pay dues. A group
516would contract with programming companies to write programs that the
517group's members would like to use.
518
519All sorts of development can be funded with a Software Tax:
520
521@quotation
522Suppose everyone who buys a computer has to pay x percent of
523the price as a software tax. The government gives this to
524an agency like the NSF to spend on software development.
525
526But if the computer buyer makes a donation to software development
527himself, he can take a credit against the tax. He can donate to
528the project of his own choosing---often, chosen because he hopes to
529use the results when it is done. He can take a credit for any amount
530of donation up to the total tax he had to pay.
531
532The total tax rate could be decided by a vote of the payers of
533the tax, weighted according to the amount they will be taxed on.
534
535The consequences:
536
537@itemize @bullet
538@item
539The computer-using community supports software development.
540@item
541This community decides what level of support is needed.
542@item
543Users who care which projects their share is spent on
544can choose this for themselves.
545@end itemize
546@end quotation
547
548In the long run, making programs free is a step toward the post-scarcity
549world, where nobody will have to work very hard just to make a living.
550People will be free to devote themselves to activities that are fun, such
551as programming, after spending the necessary ten hours a week on required
552tasks such as legislation, family counseling, robot repair and asteroid
553prospecting. There will be no need to be able to make a living from
554programming.
555
556We have already greatly reduced the amount of work that the whole society
557must do for its actual productivity, but only a little of this has
558translated itself into leisure for workers because much nonproductive
559activity is required to accompany productive activity. The main causes of
560this are bureaucracy and isometric struggles against competition. Free
561software will greatly reduce these drains in the area of software
562production. We must do this, in order for technical gains in productivity
563to translate into less work for us.
564
565@ignore
566 arch-tag: 21eb38f8-6fa0-480a-91cd-f3dab7148542
567@end ignore
diff --git a/doc/emacs/gpl.texi b/doc/emacs/gpl.texi
new file mode 100644
index 00000000000..5b416d3cb41
--- /dev/null
+++ b/doc/emacs/gpl.texi
@@ -0,0 +1,721 @@
1@c The GNU General Public License.
2@center Version 3, 29 June 2007
3
4@c This file is intended to be included within another document,
5@c hence no sectioning command or @node.
6
7@display
8Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
9
10Everyone is permitted to copy and distribute verbatim copies of this
11license document, but changing it is not allowed.
12@end display
13
14@heading Preamble
15
16The GNU General Public License is a free, copyleft license for
17software and other kinds of works.
18
19The licenses for most software and other practical works are designed
20to take away your freedom to share and change the works. By contrast,
21the GNU General Public License is intended to guarantee your freedom
22to share and change all versions of a program---to make sure it remains
23free software for all its users. We, the Free Software Foundation,
24use the GNU General Public License for most of our software; it
25applies also to any other work released this way by its authors. You
26can apply it to your programs, too.
27
28When we speak of free software, we are referring to freedom, not
29price. Our General Public Licenses are designed to make sure that you
30have the freedom to distribute copies of free software (and charge for
31them if you wish), that you receive source code or can get it if you
32want it, that you can change the software or use pieces of it in new
33free programs, and that you know you can do these things.
34
35To protect your rights, we need to prevent others from denying you
36these rights or asking you to surrender the rights. Therefore, you
37have certain responsibilities if you distribute copies of the
38software, or if you modify it: responsibilities to respect the freedom
39of others.
40
41For example, if you distribute copies of such a program, whether
42gratis or for a fee, you must pass on to the recipients the same
43freedoms that you received. You must make sure that they, too,
44receive or can get the source code. And you must show them these
45terms so they know their rights.
46
47Developers that use the GNU GPL protect your rights with two steps:
48(1) assert copyright on the software, and (2) offer you this License
49giving you legal permission to copy, distribute and/or modify it.
50
51For the developers' and authors' protection, the GPL clearly explains
52that there is no warranty for this free software. For both users' and
53authors' sake, the GPL requires that modified versions be marked as
54changed, so that their problems will not be attributed erroneously to
55authors of previous versions.
56
57Some devices are designed to deny users access to install or run
58modified versions of the software inside them, although the
59manufacturer can do so. This is fundamentally incompatible with the
60aim of protecting users' freedom to change the software. The
61systematic pattern of such abuse occurs in the area of products for
62individuals to use, which is precisely where it is most unacceptable.
63Therefore, we have designed this version of the GPL to prohibit the
64practice for those products. If such problems arise substantially in
65other domains, we stand ready to extend this provision to those
66domains in future versions of the GPL, as needed to protect the
67freedom of users.
68
69Finally, every program is threatened constantly by software patents.
70States should not allow patents to restrict development and use of
71software on general-purpose computers, but in those that do, we wish
72to avoid the special danger that patents applied to a free program
73could make it effectively proprietary. To prevent this, the GPL
74assures that patents cannot be used to render the program non-free.
75
76The precise terms and conditions for copying, distribution and
77modification follow.
78
79@heading TERMS AND CONDITIONS
80
81@enumerate 0
82@item Definitions.
83
84``This License'' refers to version 3 of the GNU General Public License.
85
86``Copyright'' also means copyright-like laws that apply to other kinds
87of works, such as semiconductor masks.
88
89``The Program'' refers to any copyrightable work licensed under this
90License. Each licensee is addressed as ``you''. ``Licensees'' and
91``recipients'' may be individuals or organizations.
92
93To ``modify'' a work means to copy from or adapt all or part of the work
94in a fashion requiring copyright permission, other than the making of
95an exact copy. The resulting work is called a ``modified version'' of
96the earlier work or a work ``based on'' the earlier work.
97
98A ``covered work'' means either the unmodified Program or a work based
99on the Program.
100
101To ``propagate'' a work means to do anything with it that, without
102permission, would make you directly or secondarily liable for
103infringement under applicable copyright law, except executing it on a
104computer or modifying a private copy. Propagation includes copying,
105distribution (with or without modification), making available to the
106public, and in some countries other activities as well.
107
108To ``convey'' a work means any kind of propagation that enables other
109parties to make or receive copies. Mere interaction with a user
110through a computer network, with no transfer of a copy, is not
111conveying.
112
113An interactive user interface displays ``Appropriate Legal Notices'' to
114the extent that it includes a convenient and prominently visible
115feature that (1) displays an appropriate copyright notice, and (2)
116tells the user that there is no warranty for the work (except to the
117extent that warranties are provided), that licensees may convey the
118work under this License, and how to view a copy of this License. If
119the interface presents a list of user commands or options, such as a
120menu, a prominent item in the list meets this criterion.
121
122@item Source Code.
123
124The ``source code'' for a work means the preferred form of the work for
125making modifications to it. ``Object code'' means any non-source form
126of a work.
127
128A ``Standard Interface'' means an interface that either is an official
129standard defined by a recognized standards body, or, in the case of
130interfaces specified for a particular programming language, one that
131is widely used among developers working in that language.
132
133The ``System Libraries'' of an executable work include anything, other
134than the work as a whole, that (a) is included in the normal form of
135packaging a Major Component, but which is not part of that Major
136Component, and (b) serves only to enable use of the work with that
137Major Component, or to implement a Standard Interface for which an
138implementation is available to the public in source code form. A
139``Major Component'', in this context, means a major essential component
140(kernel, window system, and so on) of the specific operating system
141(if any) on which the executable work runs, or a compiler used to
142produce the work, or an object code interpreter used to run it.
143
144The ``Corresponding Source'' for a work in object code form means all
145the source code needed to generate, install, and (for an executable
146work) run the object code and to modify the work, including scripts to
147control those activities. However, it does not include the work's
148System Libraries, or general-purpose tools or generally available free
149programs which are used unmodified in performing those activities but
150which are not part of the work. For example, Corresponding Source
151includes interface definition files associated with source files for
152the work, and the source code for shared libraries and dynamically
153linked subprograms that the work is specifically designed to require,
154such as by intimate data communication or control flow between those
155subprograms and other parts of the work.
156
157The Corresponding Source need not include anything that users can
158regenerate automatically from other parts of the Corresponding Source.
159
160The Corresponding Source for a work in source code form is that same
161work.
162
163@item Basic Permissions.
164
165All rights granted under this License are granted for the term of
166copyright on the Program, and are irrevocable provided the stated
167conditions are met. This License explicitly affirms your unlimited
168permission to run the unmodified Program. The output from running a
169covered work is covered by this License only if the output, given its
170content, constitutes a covered work. This License acknowledges your
171rights of fair use or other equivalent, as provided by copyright law.
172
173You may make, run and propagate covered works that you do not convey,
174without conditions so long as your license otherwise remains in force.
175You may convey covered works to others for the sole purpose of having
176them make modifications exclusively for you, or provide you with
177facilities for running those works, provided that you comply with the
178terms of this License in conveying all material for which you do not
179control copyright. Those thus making or running the covered works for
180you must do so exclusively on your behalf, under your direction and
181control, on terms that prohibit them from making any copies of your
182copyrighted material outside their relationship with you.
183
184Conveying under any other circumstances is permitted solely under the
185conditions stated below. Sublicensing is not allowed; section 10
186makes it unnecessary.
187
188@item Protecting Users' Legal Rights From Anti-Circumvention Law.
189
190No covered work shall be deemed part of an effective technological
191measure under any applicable law fulfilling obligations under article
19211 of the WIPO copyright treaty adopted on 20 December 1996, or
193similar laws prohibiting or restricting circumvention of such
194measures.
195
196When you convey a covered work, you waive any legal power to forbid
197circumvention of technological measures to the extent such
198circumvention is effected by exercising rights under this License with
199respect to the covered work, and you disclaim any intention to limit
200operation or modification of the work as a means of enforcing, against
201the work's users, your or third parties' legal rights to forbid
202circumvention of technological measures.
203
204@item Conveying Verbatim Copies.
205
206You may convey verbatim copies of the Program's source code as you
207receive it, in any medium, provided that you conspicuously and
208appropriately publish on each copy an appropriate copyright notice;
209keep intact all notices stating that this License and any
210non-permissive terms added in accord with section 7 apply to the code;
211keep intact all notices of the absence of any warranty; and give all
212recipients a copy of this License along with the Program.
213
214You may charge any price or no price for each copy that you convey,
215and you may offer support or warranty protection for a fee.
216
217@item Conveying Modified Source Versions.
218
219You may convey a work based on the Program, or the modifications to
220produce it from the Program, in the form of source code under the
221terms of section 4, provided that you also meet all of these
222conditions:
223
224@enumerate a
225@item
226The work must carry prominent notices stating that you modified it,
227and giving a relevant date.
228
229@item
230The work must carry prominent notices stating that it is released
231under this License and any conditions added under section 7. This
232requirement modifies the requirement in section 4 to ``keep intact all
233notices''.
234
235@item
236You must license the entire work, as a whole, under this License to
237anyone who comes into possession of a copy. This License will
238therefore apply, along with any applicable section 7 additional terms,
239to the whole of the work, and all its parts, regardless of how they
240are packaged. This License gives no permission to license the work in
241any other way, but it does not invalidate such permission if you have
242separately received it.
243
244@item
245If the work has interactive user interfaces, each must display
246Appropriate Legal Notices; however, if the Program has interactive
247interfaces that do not display Appropriate Legal Notices, your work
248need not make them do so.
249@end enumerate
250
251A compilation of a covered work with other separate and independent
252works, which are not by their nature extensions of the covered work,
253and which are not combined with it such as to form a larger program,
254in or on a volume of a storage or distribution medium, is called an
255``aggregate'' if the compilation and its resulting copyright are not
256used to limit the access or legal rights of the compilation's users
257beyond what the individual works permit. Inclusion of a covered work
258in an aggregate does not cause this License to apply to the other
259parts of the aggregate.
260
261@item Conveying Non-Source Forms.
262
263You may convey a covered work in object code form under the terms of
264sections 4 and 5, provided that you also convey the machine-readable
265Corresponding Source under the terms of this License, in one of these
266ways:
267
268@enumerate a
269@item
270Convey the object code in, or embodied in, a physical product
271(including a physical distribution medium), accompanied by the
272Corresponding Source fixed on a durable physical medium customarily
273used for software interchange.
274
275@item
276Convey the object code in, or embodied in, a physical product
277(including a physical distribution medium), accompanied by a written
278offer, valid for at least three years and valid for as long as you
279offer spare parts or customer support for that product model, to give
280anyone who possesses the object code either (1) a copy of the
281Corresponding Source for all the software in the product that is
282covered by this License, on a durable physical medium customarily used
283for software interchange, for a price no more than your reasonable
284cost of physically performing this conveying of source, or (2) access
285to copy the Corresponding Source from a network server at no charge.
286
287@item
288Convey individual copies of the object code with a copy of the written
289offer to provide the Corresponding Source. This alternative is
290allowed only occasionally and noncommercially, and only if you
291received the object code with such an offer, in accord with subsection
2926b.
293
294@item
295Convey the object code by offering access from a designated place
296(gratis or for a charge), and offer equivalent access to the
297Corresponding Source in the same way through the same place at no
298further charge. You need not require recipients to copy the
299Corresponding Source along with the object code. If the place to copy
300the object code is a network server, the Corresponding Source may be
301on a different server (operated by you or a third party) that supports
302equivalent copying facilities, provided you maintain clear directions
303next to the object code saying where to find the Corresponding Source.
304Regardless of what server hosts the Corresponding Source, you remain
305obligated to ensure that it is available for as long as needed to
306satisfy these requirements.
307
308@item
309Convey the object code using peer-to-peer transmission, provided you
310inform other peers where the object code and Corresponding Source of
311the work are being offered to the general public at no charge under
312subsection 6d.
313
314@end enumerate
315
316A separable portion of the object code, whose source code is excluded
317from the Corresponding Source as a System Library, need not be
318included in conveying the object code work.
319
320A ``User Product'' is either (1) a ``consumer product'', which means any
321tangible personal property which is normally used for personal,
322family, or household purposes, or (2) anything designed or sold for
323incorporation into a dwelling. In determining whether a product is a
324consumer product, doubtful cases shall be resolved in favor of
325coverage. For a particular product received by a particular user,
326``normally used'' refers to a typical or common use of that class of
327product, regardless of the status of the particular user or of the way
328in which the particular user actually uses, or expects or is expected
329to use, the product. A product is a consumer product regardless of
330whether the product has substantial commercial, industrial or
331non-consumer uses, unless such uses represent the only significant
332mode of use of the product.
333
334``Installation Information'' for a User Product means any methods,
335procedures, authorization keys, or other information required to
336install and execute modified versions of a covered work in that User
337Product from a modified version of its Corresponding Source. The
338information must suffice to ensure that the continued functioning of
339the modified object code is in no case prevented or interfered with
340solely because modification has been made.
341
342If you convey an object code work under this section in, or with, or
343specifically for use in, a User Product, and the conveying occurs as
344part of a transaction in which the right of possession and use of the
345User Product is transferred to the recipient in perpetuity or for a
346fixed term (regardless of how the transaction is characterized), the
347Corresponding Source conveyed under this section must be accompanied
348by the Installation Information. But this requirement does not apply
349if neither you nor any third party retains the ability to install
350modified object code on the User Product (for example, the work has
351been installed in ROM).
352
353The requirement to provide Installation Information does not include a
354requirement to continue to provide support service, warranty, or
355updates for a work that has been modified or installed by the
356recipient, or for the User Product in which it has been modified or
357installed. Access to a network may be denied when the modification
358itself materially and adversely affects the operation of the network
359or violates the rules and protocols for communication across the
360network.
361
362Corresponding Source conveyed, and Installation Information provided,
363in accord with this section must be in a format that is publicly
364documented (and with an implementation available to the public in
365source code form), and must require no special password or key for
366unpacking, reading or copying.
367
368@item Additional Terms.
369
370``Additional permissions'' are terms that supplement the terms of this
371License by making exceptions from one or more of its conditions.
372Additional permissions that are applicable to the entire Program shall
373be treated as though they were included in this License, to the extent
374that they are valid under applicable law. If additional permissions
375apply only to part of the Program, that part may be used separately
376under those permissions, but the entire Program remains governed by
377this License without regard to the additional permissions.
378
379When you convey a copy of a covered work, you may at your option
380remove any additional permissions from that copy, or from any part of
381it. (Additional permissions may be written to require their own
382removal in certain cases when you modify the work.) You may place
383additional permissions on material, added by you to a covered work,
384for which you have or can give appropriate copyright permission.
385
386Notwithstanding any other provision of this License, for material you
387add to a covered work, you may (if authorized by the copyright holders
388of that material) supplement the terms of this License with terms:
389
390@enumerate a
391@item
392Disclaiming warranty or limiting liability differently from the terms
393of sections 15 and 16 of this License; or
394
395@item
396Requiring preservation of specified reasonable legal notices or author
397attributions in that material or in the Appropriate Legal Notices
398displayed by works containing it; or
399
400@item
401Prohibiting misrepresentation of the origin of that material, or
402requiring that modified versions of such material be marked in
403reasonable ways as different from the original version; or
404
405@item
406Limiting the use for publicity purposes of names of licensors or
407authors of the material; or
408
409@item
410Declining to grant rights under trademark law for use of some trade
411names, trademarks, or service marks; or
412
413@item
414Requiring indemnification of licensors and authors of that material by
415anyone who conveys the material (or modified versions of it) with
416contractual assumptions of liability to the recipient, for any
417liability that these contractual assumptions directly impose on those
418licensors and authors.
419@end enumerate
420
421All other non-permissive additional terms are considered ``further
422restrictions'' within the meaning of section 10. If the Program as you
423received it, or any part of it, contains a notice stating that it is
424governed by this License along with a term that is a further
425restriction, you may remove that term. If a license document contains
426a further restriction but permits relicensing or conveying under this
427License, you may add to a covered work material governed by the terms
428of that license document, provided that the further restriction does
429not survive such relicensing or conveying.
430
431If you add terms to a covered work in accord with this section, you
432must place, in the relevant source files, a statement of the
433additional terms that apply to those files, or a notice indicating
434where to find the applicable terms.
435
436Additional terms, permissive or non-permissive, may be stated in the
437form of a separately written license, or stated as exceptions; the
438above requirements apply either way.
439
440@item Termination.
441
442You may not propagate or modify a covered work except as expressly
443provided under this License. Any attempt otherwise to propagate or
444modify it is void, and will automatically terminate your rights under
445this License (including any patent licenses granted under the third
446paragraph of section 11).
447
448However, if you cease all violation of this License, then your license
449from a particular copyright holder is reinstated (a) provisionally,
450unless and until the copyright holder explicitly and finally
451terminates your license, and (b) permanently, if the copyright holder
452fails to notify you of the violation by some reasonable means prior to
45360 days after the cessation.
454
455Moreover, your license from a particular copyright holder is
456reinstated permanently if the copyright holder notifies you of the
457violation by some reasonable means, this is the first time you have
458received notice of violation of this License (for any work) from that
459copyright holder, and you cure the violation prior to 30 days after
460your receipt of the notice.
461
462Termination of your rights under this section does not terminate the
463licenses of parties who have received copies or rights from you under
464this License. If your rights have been terminated and not permanently
465reinstated, you do not qualify to receive new licenses for the same
466material under section 10.
467
468@item Acceptance Not Required for Having Copies.
469
470You are not required to accept this License in order to receive or run
471a copy of the Program. Ancillary propagation of a covered work
472occurring solely as a consequence of using peer-to-peer transmission
473to receive a copy likewise does not require acceptance. However,
474nothing other than this License grants you permission to propagate or
475modify any covered work. These actions infringe copyright if you do
476not accept this License. Therefore, by modifying or propagating a
477covered work, you indicate your acceptance of this License to do so.
478
479@item Automatic Licensing of Downstream Recipients.
480
481Each time you convey a covered work, the recipient automatically
482receives a license from the original licensors, to run, modify and
483propagate that work, subject to this License. You are not responsible
484for enforcing compliance by third parties with this License.
485
486An ``entity transaction'' is a transaction transferring control of an
487organization, or substantially all assets of one, or subdividing an
488organization, or merging organizations. If propagation of a covered
489work results from an entity transaction, each party to that
490transaction who receives a copy of the work also receives whatever
491licenses to the work the party's predecessor in interest had or could
492give under the previous paragraph, plus a right to possession of the
493Corresponding Source of the work from the predecessor in interest, if
494the predecessor has it or can get it with reasonable efforts.
495
496You may not impose any further restrictions on the exercise of the
497rights granted or affirmed under this License. For example, you may
498not impose a license fee, royalty, or other charge for exercise of
499rights granted under this License, and you may not initiate litigation
500(including a cross-claim or counterclaim in a lawsuit) alleging that
501any patent claim is infringed by making, using, selling, offering for
502sale, or importing the Program or any portion of it.
503
504@item Patents.
505
506A ``contributor'' is a copyright holder who authorizes use under this
507License of the Program or a work on which the Program is based. The
508work thus licensed is called the contributor's ``contributor version''.
509
510A contributor's ``essential patent claims'' are all patent claims owned
511or controlled by the contributor, whether already acquired or
512hereafter acquired, that would be infringed by some manner, permitted
513by this License, of making, using, or selling its contributor version,
514but do not include claims that would be infringed only as a
515consequence of further modification of the contributor version. For
516purposes of this definition, ``control'' includes the right to grant
517patent sublicenses in a manner consistent with the requirements of
518this License.
519
520Each contributor grants you a non-exclusive, worldwide, royalty-free
521patent license under the contributor's essential patent claims, to
522make, use, sell, offer for sale, import and otherwise run, modify and
523propagate the contents of its contributor version.
524
525In the following three paragraphs, a ``patent license'' is any express
526agreement or commitment, however denominated, not to enforce a patent
527(such as an express permission to practice a patent or covenant not to
528sue for patent infringement). To ``grant'' such a patent license to a
529party means to make such an agreement or commitment not to enforce a
530patent against the party.
531
532If you convey a covered work, knowingly relying on a patent license,
533and the Corresponding Source of the work is not available for anyone
534to copy, free of charge and under the terms of this License, through a
535publicly available network server or other readily accessible means,
536then you must either (1) cause the Corresponding Source to be so
537available, or (2) arrange to deprive yourself of the benefit of the
538patent license for this particular work, or (3) arrange, in a manner
539consistent with the requirements of this License, to extend the patent
540license to downstream recipients. ``Knowingly relying'' means you have
541actual knowledge that, but for the patent license, your conveying the
542covered work in a country, or your recipient's use of the covered work
543in a country, would infringe one or more identifiable patents in that
544country that you have reason to believe are valid.
545
546If, pursuant to or in connection with a single transaction or
547arrangement, you convey, or propagate by procuring conveyance of, a
548covered work, and grant a patent license to some of the parties
549receiving the covered work authorizing them to use, propagate, modify
550or convey a specific copy of the covered work, then the patent license
551you grant is automatically extended to all recipients of the covered
552work and works based on it.
553
554A patent license is ``discriminatory'' if it does not include within the
555scope of its coverage, prohibits the exercise of, or is conditioned on
556the non-exercise of one or more of the rights that are specifically
557granted under this License. You may not convey a covered work if you
558are a party to an arrangement with a third party that is in the
559business of distributing software, under which you make payment to the
560third party based on the extent of your activity of conveying the
561work, and under which the third party grants, to any of the parties
562who would receive the covered work from you, a discriminatory patent
563license (a) in connection with copies of the covered work conveyed by
564you (or copies made from those copies), or (b) primarily for and in
565connection with specific products or compilations that contain the
566covered work, unless you entered into that arrangement, or that patent
567license was granted, prior to 28 March 2007.
568
569Nothing in this License shall be construed as excluding or limiting
570any implied license or other defenses to infringement that may
571otherwise be available to you under applicable patent law.
572
573@item No Surrender of Others' Freedom.
574
575If conditions are imposed on you (whether by court order, agreement or
576otherwise) that contradict the conditions of this License, they do not
577excuse you from the conditions of this License. If you cannot convey
578a covered work so as to satisfy simultaneously your obligations under
579this License and any other pertinent obligations, then as a
580consequence you may not convey it at all. For example, if you agree
581to terms that obligate you to collect a royalty for further conveying
582from those to whom you convey the Program, the only way you could
583satisfy both those terms and this License would be to refrain entirely
584from conveying the Program.
585
586@item Use with the GNU Affero General Public License.
587
588Notwithstanding any other provision of this License, you have
589permission to link or combine any covered work with a work licensed
590under version 3 of the GNU Affero General Public License into a single
591combined work, and to convey the resulting work. The terms of this
592License will continue to apply to the part which is the covered work,
593but the special requirements of the GNU Affero General Public License,
594section 13, concerning interaction through a network will apply to the
595combination as such.
596
597@item Revised Versions of this License.
598
599The Free Software Foundation may publish revised and/or new versions
600of the GNU General Public License from time to time. Such new
601versions will be similar in spirit to the present version, but may
602differ in detail to address new problems or concerns.
603
604Each version is given a distinguishing version number. If the Program
605specifies that a certain numbered version of the GNU General Public
606License ``or any later version'' applies to it, you have the option of
607following the terms and conditions either of that numbered version or
608of any later version published by the Free Software Foundation. If
609the Program does not specify a version number of the GNU General
610Public License, you may choose any version ever published by the Free
611Software Foundation.
612
613If the Program specifies that a proxy can decide which future versions
614of the GNU General Public License can be used, that proxy's public
615statement of acceptance of a version permanently authorizes you to
616choose that version for the Program.
617
618Later license versions may give you additional or different
619permissions. However, no additional obligations are imposed on any
620author or copyright holder as a result of your choosing to follow a
621later version.
622
623@item Disclaimer of Warranty.
624
625THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
626APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
627HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
628WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
629LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
630A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
631PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
632DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
633CORRECTION.
634
635@item Limitation of Liability.
636
637IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
638WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
639CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
640INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
641ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
642NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
643LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
644TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
645PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
646
647@item Interpretation of Sections 15 and 16.
648
649If the disclaimer of warranty and limitation of liability provided
650above cannot be given local legal effect according to their terms,
651reviewing courts shall apply local law that most closely approximates
652an absolute waiver of all civil liability in connection with the
653Program, unless a warranty or assumption of liability accompanies a
654copy of the Program in return for a fee.
655
656@end enumerate
657
658@heading END OF TERMS AND CONDITIONS
659
660@heading How to Apply These Terms to Your New Programs
661
662If you develop a new program, and you want it to be of the greatest
663possible use to the public, the best way to achieve this is to make it
664free software which everyone can redistribute and change under these
665terms.
666
667To do so, attach the following notices to the program. It is safest
668to attach them to the start of each source file to most effectively
669state the exclusion of warranty; and each file should have at least
670the ``copyright'' line and a pointer to where the full notice is found.
671
672@smallexample
673@var{one line to give the program's name and a brief idea of what it does.}
674Copyright (C) @var{year} @var{name of author}
675
676This program is free software: you can redistribute it and/or modify
677it under the terms of the GNU General Public License as published by
678the Free Software Foundation, either version 3 of the License, or (at
679your option) any later version.
680
681This program is distributed in the hope that it will be useful, but
682WITHOUT ANY WARRANTY; without even the implied warranty of
683MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
684General Public License for more details.
685
686You should have received a copy of the GNU General Public License
687along with this program. If not, see @url{http://www.gnu.org/licenses/}.
688@end smallexample
689
690Also add information on how to contact you by electronic and paper mail.
691
692If the program does terminal interaction, make it output a short
693notice like this when it starts in an interactive mode:
694
695@smallexample
696@var{program} Copyright (C) @var{year} @var{name of author}
697This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
698This is free software, and you are welcome to redistribute it
699under certain conditions; type @samp{show c} for details.
700@end smallexample
701
702The hypothetical commands @samp{show w} and @samp{show c} should show
703the appropriate parts of the General Public License. Of course, your
704program's commands might be different; for a GUI interface, you would
705use an ``about box''.
706
707You should also get your employer (if you work as a programmer) or school,
708if any, to sign a ``copyright disclaimer'' for the program, if necessary.
709For more information on this, and how to apply and follow the GNU GPL, see
710@url{http://www.gnu.org/licenses/}.
711
712The GNU General Public License does not permit incorporating your
713program into proprietary programs. If your program is a subroutine
714library, you may consider it more useful to permit linking proprietary
715applications with the library. If this is what you want to do, use
716the GNU Lesser General Public License instead of this License. But
717first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
718
719@ignore
720 arch-tag: 0c4a2556-f87e-464f-9b1d-efd920fcaf67
721@end ignore
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
new file mode 100644
index 00000000000..fe7c2a85ffa
--- /dev/null
+++ b/doc/emacs/help.texi
@@ -0,0 +1,666 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Help, Mark, M-x, Top
6@chapter Help
7@kindex Help
8@cindex help
9@cindex self-documentation
10@findex help-command
11@kindex C-h
12@kindex F1
13
14 Emacs provides extensive help features, all accessible through the
15@dfn{help character}, @kbd{C-h}. This is a prefix key that is used
16for commands that display documentation; the next character you type
17should be a @dfn{help options}, to ask for a particular kind of help.
18You can cancel the @kbd{C-h} command with @kbd{C-g}. The function key
19@key{F1} is equivalent to @kbd{C-h}.
20
21@kindex C-h C-h
22@findex help-for-help
23 @kbd{C-h} itself is one of the help options; @kbd{C-h C-h} displays
24a list of help options, with a brief description of each one
25(@code{help-for-help}). You can scroll the list with @key{SPC} and
26@key{DEL}, then type the help option you want. To cancel, type
27@kbd{C-g}.
28
29 @kbd{C-h} or @key{F1} means ``help'' in various other contexts as
30well. For instance, you can type them after a prefix key to display
31list of the keys that can follow the prefix key. (A few prefix keys
32don't support @kbd{C-h} in this way, because they define other
33meanings for it, but they all support @key{F1} for help.)
34
35 Most help buffers use a special major mode, Help mode, which lets
36you scroll conveniently with @key{SPC} and @key{DEL}. You can also
37follow hyperlinks to URLs, and to other facilities including Info
38nodes and customization buffers. @xref{Help Mode}.
39
40@cindex searching documentation efficiently
41@cindex looking for a subject in documentation
42 If you are looking for a certain feature, but don't know what it is
43called or where to look, we recommend three methods. First, try an
44apropos command, then try searching the manual index, then look in the
45FAQ and the package keywords.
46
47@table @kbd
48@item C-h a @var{topics} @key{RET}
49This searches for commands whose names match the argument
50@var{topics}. The argument can be a keyword, a list of keywords, or a
51regular expression (@pxref{Regexps}). This command displays all the
52matches in a new buffer. @xref{Apropos}.
53
54@item C-h i d m emacs @key{RET} i @var{topic} @key{RET}
55This searches for @var{topic} in the indices of the on-line Emacs
56manual, and displays the first match found. Press @kbd{,} to see
57subsequent matches. You can use a regular expression as @var{topic}.
58
59@item C-h i d m emacs @key{RET} s @var{topic} @key{RET}
60Similar, but searches the @emph{text} of the manual rather than the
61indices.
62
63@item C-h C-f
64This displays the Emacs FAQ. You can use the Info commands
65to browse it.
66
67@item C-h p
68This displays the available Emacs packages based on keywords.
69@xref{Library Keywords}.
70@end table
71
72@menu
73* Help Summary:: Brief list of all Help commands.
74* Key Help:: Asking what a key does in Emacs.
75* Name Help:: Asking about a command, variable or function name.
76* Apropos:: Asking what pertains to a given topic.
77* Help Mode:: Special features of Help mode and Help buffers.
78* Library Keywords:: Finding Lisp libraries by keywords (topics).
79* Language Help:: Help relating to international language support.
80* Misc Help:: Other help commands.
81* Help Files:: Commands to display pre-written help files.
82* Help Echo:: Help on active text and tooltips (`balloon help')
83@end menu
84
85@iftex
86@node Help Summary
87@end iftex
88@ifnottex
89@node Help Summary
90@section Help Summary
91@end ifnottex
92
93 Here is a summary of the Emacs interactive help commands. (The
94character that follows @kbd{C-h} is the ``help option.'') @xref{Help
95Files}, for other help commands that display fixed files of
96information.
97
98@table @kbd
99@item C-h a @var{topics} @key{RET}
100Display a list of commands whose names match @var{topics}
101(@code{apropos-command}; @pxref{Apropos}).
102@item C-h b
103Display all active key bindings; minor mode bindings first, then those
104of the major mode, then global bindings (@code{describe-bindings}).
105@item C-h c @var{key}
106Given a key sequence @var{key}, show the name of the command that it
107runs (@code{describe-key-briefly}). Here @kbd{c} stands for
108``character.'' For more extensive information on @var{key}, use
109@kbd{C-h k}.
110@item C-h d @var{topics} @key{RET}
111Display the commands and variables whose documentation matches
112@var{topics} (@code{apropos-documentation}).
113@item C-h e
114Display the @code{*Messages*} buffer
115(@code{view-echo-area-messages}).
116@item C-h f @var{function} @key{RET}
117Display documentation on the Lisp function named @var{function}
118(@code{describe-function}). Since commands are Lisp functions,
119this works for commands too.
120@item C-h h
121Display the @file{HELLO} file, which shows examples of various character
122sets.
123@item C-h i
124Run Info, the GNU documentation browser (@code{info}).
125The complete Emacs manual is available on-line in Info.
126@item C-h k @var{key}
127Display the name and documentation of the command that @var{key} runs
128(@code{describe-key}).
129@item C-h l
130Display a description of the last 100 characters you typed
131(@code{view-lossage}).
132@item C-h m
133Display documentation of the current major mode (@code{describe-mode}).
134@item C-h p
135Find packages by topic keyword (@code{finder-by-keyword}).
136@item C-h s
137Display the current contents of the syntax table, with an explanation of
138what they mean (@code{describe-syntax}). @xref{Syntax}.
139@item C-h t
140Enter the Emacs interactive tutorial (@code{help-with-tutorial}).
141@item C-h v @var{var} @key{RET}
142Display the documentation of the Lisp variable @var{var}
143(@code{describe-variable}).
144@item C-h w @var{command} @key{RET}
145Show which keys run the command named @var{command} (@code{where-is}).
146@item C-h C @var{coding} @key{RET}
147Describe the coding system @var{coding}
148(@code{describe-coding-system}).
149@item C-h C @key{RET}
150Describe the coding systems currently in use.
151@item C-h I @var{method} @key{RET}
152Describe the input method @var{method} (@code{describe-input-method}).
153@item C-h L @var{language-env} @key{RET}
154Display information on the character sets, coding systems, and input
155methods used in language environment @var{language-env}
156(@code{describe-language-environment}).
157@item C-h F @var{function} @key{RET}
158Enter Info and goes to the node that documents the Emacs function
159@var{function} (@code{Info-goto-emacs-command-node}).
160@item C-h K @var{key}
161Enter Info and goes to the node that documents the key sequence
162@var{key} (@code{Info-goto-emacs-key-command-node}).
163@item C-h S @var{symbol} @key{RET}
164Display the Info documentation on symbol @var{symbol} according to the
165programming language you are editing (@code{info-lookup-symbol}).
166@item C-h .
167Display the help message for a special text area, if point is in one
168(@code{display-local-help}). (These include, for example, links in
169@samp{*Help*} buffers.)
170@end table
171
172@node Key Help
173@section Documentation for a Key
174
175@kindex C-h c
176@findex describe-key-briefly
177 The help commands to get information about a key sequence are
178@kbd{C-h c} and @w{@kbd{C-h k}}. @kbd{C-h c @var{key}} displays in
179the echo area the name of the command that @var{key} is bound to. For
180example, @kbd{C-h c C-f} displays @samp{forward-char}. Since command
181names are chosen to describe what the commands do, this gives you a
182very brief description of what @var{key} does.
183
184@kindex C-h k
185@findex describe-key
186 @kbd{C-h k @var{key}} is similar but gives more information: it
187displays the documentation string of the command as well as its name.
188It displays this information in a window, since it may not fit in the
189echo area.
190
191@kindex C-h K
192@findex Info-goto-emacs-key-command-node
193 To find the documentation of a key sequence @var{key}, type @kbd{C-h
194K @var{key}}. This displays the appropriate manual section which
195contains the documentation of @var{key}.
196
197 @kbd{C-h c}, @kbd{C-h k} and @kbd{C-h K} work for any sort of key
198sequences, including function keys, menus, and mouse events. For
199instance, after @kbd{C-h k} you can select a menu item from the menu
200bar, to view the documentation string of the command it runs.
201
202@kindex C-h w
203@findex where-is
204 @kbd{C-h w @var{command} @key{RET}} lists the keys that are bound to
205@var{command}. It displays the list in the echo area. If it says the
206command is not on any key, that means you must use @kbd{M-x} to run
207it. @kbd{C-h w} runs the command @code{where-is}.
208
209@node Name Help
210@section Help by Command or Variable Name
211
212@kindex C-h f
213@findex describe-function
214 @kbd{C-h f @var{function} @key{RET}} (@code{describe-function})
215displays the documentation of Lisp function @var{function}, in a
216window. Since commands are Lisp functions, you can use this method to
217view the documentation of any command whose name you know. For
218example,
219
220@example
221C-h f auto-fill-mode @key{RET}
222@end example
223
224@noindent
225displays the documentation of @code{auto-fill-mode}. This is the only
226way to get the documentation of a command that is not bound to any key
227(one which you would normally run using @kbd{M-x}).
228
229 @kbd{C-h f} is also useful for Lisp functions that you use in a Lisp
230program. For example, if you have just written the expression
231@code{(make-vector len)} and want to check that you are using
232@code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}.
233Because @kbd{C-h f} allows all function names, not just command names,
234you may find that some of your favorite completion abbreviations that
235work in @kbd{M-x} don't work in @kbd{C-h f}. An abbreviation that is
236unique among command names may not be unique among all function names.
237
238 If you type @kbd{C-h f @key{RET}}, it describes the function called
239by the innermost Lisp expression in the buffer around point,
240@emph{provided} that function name is a valid, defined Lisp function.
241(That name appears as the default while you enter the argument.) For
242example, if point is located following the text @samp{(make-vector
243(car x)}, the innermost list containing point is the one that starts
244with @samp{(make-vector}, so @kbd{C-h f @key{RET}} will describe the
245function @code{make-vector}.
246
247 @kbd{C-h f} is also useful just to verify that you spelled a
248function name correctly. If the minibuffer prompt for @kbd{C-h f}
249shows the function name from the buffer as the default, it means that
250name is defined as a Lisp function. Type @kbd{C-g} to cancel the
251@kbd{C-h f} command if you don't really want to view the
252documentation.
253
254@kindex C-h v
255@findex describe-variable
256 @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but
257describes Lisp variables instead of Lisp functions. Its default is
258the Lisp symbol around or before point, if that is the name of a
259defined Lisp variable. @xref{Variables}.
260
261 Help buffers that describe Emacs variables and functions normally
262have hyperlinks to the corresponding source definition, if you have
263the source files installed. (@xref{Hyperlinking}.) If you know Lisp
264(or C), this provides the ultimate documentation. If you don't know
265Lisp, you should learn it. (The Introduction to Emacs Lisp
266Programming, available from the FSF through fsf.org, is a good way to
267get started.) If Emacs feels you are just @emph{using} it, treating
268it as an object program, its feelings may be hurt. For real intimacy,
269read the Emacs source code.
270
271@kindex C-h F
272@findex Info-goto-emacs-command-node
273 To find a function's documentation in a manual, use @kbd{C-h F}
274(@code{Info-goto-emacs-command-node}). This knows about various
275manuals, not just the Emacs manual, and finds the right one.
276
277@node Apropos
278@section Apropos
279
280 The @dfn{apropos} commands answer questions like, ``What are the
281commands for working with files?'' More precisely, you specify an
282@dfn{apropos pattern}, which means either a word, a list of words, or
283a regular expression. Each apropos command displays a list of items
284that match the pattern, in a separate buffer.
285
286@table @kbd
287@item C-h a @var{pattern} @key{RET}
288Search for commands whose names match @var{pattern}.
289
290@item M-x apropos @key{RET} @var{pattern} @key{RET}
291Search for functions and variables whose names match @var{pattern}.
292Both interactive functions (commands) and noninteractive functions can
293be found by this command.
294
295@item M-x apropos-variable @key{RET} @var{pattern} @key{RET}
296Search for user-option variables whose names match @var{pattern}.
297
298@item M-x apropos-value @key{RET} @var{pattern} @key{RET}
299Search for functions whose definitions @var{pattern}, and variables
300whose values match @var{pattern}.
301
302@item C-h d @var{pattern} @key{RET}
303Search for functions and variables whose @strong{documentation
304strings} match @var{pattern}.
305@end table
306
307@kindex C-h a
308@findex apropos-command
309@cindex apropos
310 The simplest kind of apropos pattern is one word. Anything which
311contains that word matches the pattern. Thus, to find the commands
312that work on files, type @kbd{C-h a file @key{RET}}. This displays a
313list of all command names that contain @samp{file}, including
314@code{copy-file}, @code{find-file}, and so on. Each command name
315comes with a brief description and a list of keys you can currently
316invoke it with. In our example, it would say that you can invoke
317@code{find-file} by typing @kbd{C-x C-f}.
318
319 The @kbd{a} in @kbd{C-h a} stands for ``Apropos''; @kbd{C-h a}
320runs the command @code{apropos-command}. This command normally checks
321only commands (interactive functions); if you specify a prefix
322argument, it checks noninteractive functions as well.
323
324 For more information about a function definition, variable or symbol
325property listed in the apropos buffer, you can click on it with
326@kbd{Mouse-1} or @kbd{Mouse-2}, or move there and type @key{RET}.
327
328 When you specify more than one word in the apropos pattern, a name
329must contain at least two of the words in order to match. Thus, if
330you are looking for commands to kill a chunk of text before point, you
331could try @kbd{C-h a kill back backward behind before @key{RET}}. The
332real command name @code{kill-backward} will match that; if there were
333a command @code{kill-text-before}, it would also match, since it
334contains two of the specified words.
335
336 For even greater flexibility, you can specify a regular expression
337(@pxref{Regexps}). An apropos pattern is interpreted as a regular
338expression if it contains any of the regular expression special
339characters, @samp{^$*+?.\[}.
340
341 Following the conventions for naming Emacs commands, here are some
342words that you'll find useful in apropos patterns. By using them in
343@kbd{C-h a}, you will also get a feel for the naming conventions.
344
345@quotation
346char, line, word, sentence, paragraph, region, page, sexp, list, defun,
347rect, buffer, frame, window, face, file, dir, register, mode, beginning, end,
348forward, backward, next, previous, up, down, search, goto, kill, delete,
349mark, insert, yank, fill, indent, case, change, set, what, list, find,
350view, describe, default.
351@end quotation
352
353@findex apropos
354 Use @kbd{M-x apropos} instead of @kbd{C-h a} to list all the Lisp
355symbols that match an apropos pattern, not just the symbols that are
356commands. This command does not list key bindings by default; specify
357a numeric argument if you want it to list them.
358
359@findex apropos-variable
360 Use @kbd{M-x apropos-variable} to list user-customizable variables
361that match an apropos pattern. If you specify a prefix argument, it
362lists all matching variables.
363
364@kindex C-h d
365@findex apropos-documentation
366 The @code{apropos-documentation} command is like @code{apropos}
367except that it searches documentation strings instead of symbol names
368for matches.
369
370@findex apropos-value
371 The @code{apropos-value} command is like @code{apropos} except that
372it searches variables' values for matches for the apropos pattern.
373With a prefix argument, it also checks symbols' function definitions
374and property lists.
375
376@vindex apropos-do-all
377 If the variable @code{apropos-do-all} is non-@code{nil}, the apropos
378commands always behave as if they had been given a prefix argument.
379
380@vindex apropos-sort-by-scores
381@cindex apropos search results, order by score
382 By default, apropos lists the search results in alphabetical order.
383If the variable @code{apropos-sort-by-scores} is non-@code{nil}, the
384apropos commands try to guess the relevance of each result, and
385display the most relevant ones first.
386
387@vindex apropos-documentation-sort-by-scores
388 By default, apropos lists the search results for
389@code{apropos-documentation} in order of relevance of the match. If
390the variable @code{apropos-documentation-sort-by-scores} is
391@code{nil}, apropos lists the symbols found in alphabetical order.
392
393@node Help Mode
394@section Help Mode Commands
395
396 Help buffers provide the same commands as View mode (@pxref{Misc File
397Ops}), plus a few special commands of their own.
398
399@table @kbd
400@item @key{SPC}
401Scroll forward.
402@item @key{DEL}
403Scroll backward.
404@item @key{RET}
405Follow a cross reference at point.
406@item @key{TAB}
407Move point forward to the next cross reference.
408@item S-@key{TAB}
409Move point back to the previous cross reference.
410@item Mouse-1
411@itemx Mouse-2
412Follow a cross reference that you click on.
413@item C-c C-c
414Show all documentation about the symbol at point.
415@end table
416
417 When a function name (@pxref{M-x,, Running Commands by Name}),
418variable name (@pxref{Variables}), or face name (@pxref{Faces})
419appears in the documentation, it normally appears inside paired
420single-quotes. To view the documentation of that command, variable or
421face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2},
422or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace
423your steps.
424
425@cindex URL, viewing in help
426@cindex help, viewing web pages
427@cindex viewing web pages in help
428@cindex web pages, viewing in help
429@findex browse-url
430 You can follow cross references to URLs (web pages) also. This uses
431the @code{browse-url} command to view the page in the browser you
432choose. @xref{Browse-URL}.
433
434@kindex @key{TAB} @r{(Help mode)}
435@findex help-next-ref
436@kindex S-@key{TAB} @r{(Help mode)}
437@findex help-previous-ref
438 There are convenient commands to move point to cross references in
439the help text. @key{TAB} (@code{help-next-ref}) moves point down to
440the next cross reference. @kbd{S-@key{TAB}} moves up to the previous
441cross reference (@code{help-previous-ref}).
442
443 To view all documentation about any symbol name that appears in the
444text, move point to the symbol name and type @kbd{C-c C-c}
445(@code{help-follow-symbol}). This shows all available documentation
446about the symbol as a variable, function and/or face. As above, use
447@kbd{C-c C-b} to retrace your steps.
448
449@node Library Keywords
450@section Keyword Search for Lisp Libraries
451
452@kindex C-h p
453@findex finder-by-keyword
454The @kbd{C-h p} command lets you search the standard Emacs Lisp
455libraries by topic keywords. Here is a partial list of keywords you can
456use:
457
458@multitable {convenience} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
459@item abbrev@tab abbreviation handling, typing shortcuts, macros.
460@item bib@tab code related to the @code{bib} bibliography processor.
461@item c@tab support for the C language and related languages.
462@item calendar@tab calendar and time management support.
463@item comm@tab communications, networking, remote access to files.
464@item convenience@tab convenience features for faster editing.
465@item data@tab support for editing files of data.
466@item docs@tab support for Emacs documentation.
467@item emulations@tab emulations of other editors.
468@item extensions@tab Emacs Lisp language extensions.
469@item faces@tab support for multiple fonts.
470@item files@tab support for editing and manipulating files.
471@item frames@tab support for Emacs frames and window systems.
472@item games@tab games, jokes and amusements.
473@item hardware@tab support for interfacing with exotic hardware.
474@item help@tab support for on-line help systems.
475@item hypermedia@tab support for links between text or other media types.
476@item i18n@tab internationalization and alternate character-set support.
477@item internal@tab code for Emacs internals, build process, defaults.
478@item languages@tab specialized modes for editing programming languages.
479@item lisp@tab Lisp support, including Emacs Lisp.
480@item local@tab code local to your site.
481@item maint@tab maintenance aids for the Emacs development group.
482@item mail@tab modes for electronic-mail handling.
483@item matching@tab various sorts of searching and matching.
484@item mouse@tab mouse support.
485@item multimedia@tab images and sound support.
486@item news@tab support for netnews reading and posting.
487@item oop@tab support for object-oriented programming.
488@item outlines@tab support for hierarchical outlining.
489@item processes@tab process, subshell, compilation, and job control support.
490@item terminals@tab support for terminal types.
491@item tex@tab supporting code for the @TeX{} formatter.
492@item tools@tab programming tools.
493@item unix@tab front-ends/assistants for, or emulators of, UNIX-like features.
494@item wp@tab word processing.
495@end multitable
496
497@node Language Help
498@section Help for International Language Support
499
500 You can use the command @kbd{C-h L}
501(@code{describe-language-environment}) to get information about a
502specific language environment. @xref{Language Environments}. This
503tells you which languages this language environment supports. It also
504lists the character sets, coding systems, and input methods that work
505with this language environment, and finally shows some sample text to
506illustrate scripts.
507
508 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
509@file{etc/HELLO}, which shows how to say ``hello'' in many languages.
510
511 The command @kbd{C-h I} (@code{describe-input-method}) describes an
512input method---either a specified input method, or by default the
513input method currently in use. @xref{Input Methods}.
514
515 The command @kbd{C-h C} (@code{describe-coding-system}) describes
516coding systems---either a specified coding system, or the ones
517currently in use. @xref{Coding Systems}.
518
519@node Misc Help
520@section Other Help Commands
521
522@kindex C-h i
523@findex info
524@cindex Info
525@cindex manuals, on-line
526@cindex on-line manuals
527 @kbd{C-h i} (@code{info}) runs the Info program, which browses
528structured documentation files. The entire Emacs manual is available
529within Info, along with many other manuals for the GNU system. Type
530@kbd{h} after entering Info to run a tutorial on using Info.
531
532@cindex find Info manual by its file name
533 With a numeric argument @var{n}, @kbd{C-h i} selects the Info buffer
534@samp{*info*<@var{n}>}. This is useful if you want to browse multiple
535Info manuals simultaneously. If you specify just @kbd{C-u} as the
536prefix argument, @kbd{C-h i} prompts for the name of a documentation
537file, so you can browse a file which doesn't have an entry in the
538top-level Info menu.
539
540 The help commands @kbd{C-h F @var{function} @key{RET}} and @kbd{C-h
541K @var{key}}, described above, enter Info and go straight to the
542documentation of @var{function} or @var{key}.
543
544@kindex C-h S
545@findex info-lookup-symbol
546 When editing a program, if you have an Info version of the manual
547for the programming language, you can use @kbd{C-h S}
548(@code{info-lookup-symbol}) to find symbol (keyword, function or
549variable) in the proper manual. The details of how this command works
550depend on the major mode.
551
552@kindex C-h l
553@findex view-lossage
554 If something surprising happens, and you are not sure what you
555typed, use @kbd{C-h l} (@code{view-lossage}). @kbd{C-h l} displays
556the last 100 characters you typed in Emacs. If you see commands that
557you don't know, you can use @kbd{C-h c} to find out what they do.
558
559@kindex C-h e
560@findex view-echo-area-messages
561 To review recent echo area messages, use @kbd{C-h e}
562(@code{view-echo-area-messages}). This displays the buffer
563@code{*Messages*}, where those messages are kept.
564
565@kindex C-h m
566@findex describe-mode
567 Each Emacs major mode typically redefines a few keys and makes other
568changes in how editing works. @kbd{C-h m} (@code{describe-mode})
569displays documentation on the current major mode, which normally
570describes the commands and features that are changed in this mode.
571
572@kindex C-h b
573@findex describe-bindings
574 @kbd{C-h b} (@code{describe-bindings}) and @kbd{C-h s}
575(@code{describe-syntax}) show other information about the current
576environment within Emacs. @kbd{C-h b} displays a list of all the key
577bindings now in effect: first the local bindings of the current minor
578modes, then the local bindings defined by the current major mode, and
579finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s}
580displays the contents of the syntax table, with explanations of each
581character's syntax (@pxref{Syntax}).
582
583 You can get a list of subcommands for a particular prefix key by
584typing @kbd{C-h} after the prefix key. (There are a few prefix keys
585for which this does not work---those that provide their own bindings
586for @kbd{C-h}. One of these is @key{ESC}, because @kbd{@key{ESC} C-h}
587is actually @kbd{C-M-h}, which marks a defun.)
588
589@node Help Files
590@section Help Files
591
592 The Emacs help commands described above display dynamic help based
593on the current state within Emacs, or refer to manuals. Other help
594commands display pre-written, static help files. These commands all
595have the form @kbd{C-h C-@var{char}}; that is, @kbd{C-h} followed by a
596control character.
597
598@kindex C-h C-c
599@findex describe-copying
600@kindex C-h C-d
601@findex describe-distribution
602@kindex C-h C-e
603@findex view-emacs-problems
604@kindex C-h C-f
605@findex view-emacs-FAQ
606@kindex C-h C-n
607@findex view-emacs-news
608@kindex C-h C-p
609@findex describe-project
610@kindex C-h C-t
611@findex view-emacs-todo
612@kindex C-h C-w
613@findex describe-no-warranty
614
615@table @kbd
616@item C-h C-c
617Display the Emacs copying conditions (@code{describe-copying}).
618These are the rules under which you can copy and redistribute Emacs.
619@item C-h C-d
620Display how to download or order the latest version of
621Emacs and other GNU software (@code{describe-distribution}).
622@item C-h C-e
623Display the list of known Emacs problems, sometimes with suggested
624workarounds (@code{view-emacs-problems}).
625@item C-h C-f
626Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}).
627@item C-h C-n
628Display the Emacs ``news'' file, which lists new features in the most
629recent version of Emacs (@code{view-emacs-news}).
630@item C-h C-p
631Display general information about the GNU Project
632(@code{describe-project}).
633@item C-h C-t
634Display the Emacs to-do list (@code{view-todo}).
635@item C-h C-w
636Display the full details on the complete absence of warranty for GNU
637Emacs (@code{describe-no-warranty}).
638@end table
639
640@node Help Echo
641@section Help on Active Text and Tooltips
642
643@cindex tooltips
644@cindex balloon help
645 When a region of text is ``active,'' so that you can select it with
646the mouse or a key like @kbd{RET}, it often has associated help text.
647For instance, most parts of the mode line have help text. On
648graphical displays, the help text is displayed as a ``tooltip''
649(sometimes known as ``balloon help''), when you move the mouse over
650the active text. @xref{Tooltips}. On some systems, it is shown in
651the echo area. On text-only terminals, if Emacs cannot follow the
652mouse, it cannot show the help text on mouse-over.
653
654@kindex C-h .
655@findex display-local-help
656@vindex help-at-pt-display-when-idle
657 You can also access text region help info using the keyboard. The
658command @kbd{C-h .} (@code{display-local-help}) displays any help text
659associated with the text at point, using the echo area. If you want
660help text to be displayed automatically whenever it is available at
661point, set the variable @code{help-at-pt-display-when-idle} to
662@code{t}.
663
664@ignore
665 arch-tag: 6f33ab62-bc75-4367-8057-fd67cc15c3a1
666@end ignore
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi
new file mode 100644
index 00000000000..568b54897fa
--- /dev/null
+++ b/doc/emacs/indent.texi
@@ -0,0 +1,244 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Indentation, Text, Major Modes, Top
6@chapter Indentation
7@cindex indentation
8@cindex columns (indentation)
9
10 This chapter describes the Emacs commands that add, remove, or
11adjust indentation.
12
13@table @kbd
14@item @key{TAB}
15Indent the current line ``appropriately'' in a mode-dependent fashion.
16@item @kbd{C-j}
17Perform @key{RET} followed by @key{TAB} (@code{newline-and-indent}).
18@item M-^
19Merge the previous and the current line (@code{delete-indentation}).
20This would cancel the effect of a preceding @kbd{C-j}.
21@item C-M-o
22Split the current line at point; text on the line after point becomes a
23new line indented to the same column where point is located
24(@code{split-line}).
25@item M-m
26Move (forward or back) to the first nonblank character on the current
27line (@code{back-to-indentation}).
28@item C-M-\
29Indent lines in the region to the same column (@code{indent-region}).
30@item C-x @key{TAB}
31Shift lines in the region rigidly right or left (@code{indent-rigidly}).
32@item M-i
33Indent from point to the next prespecified tab stop column
34(@code{tab-to-tab-stop}).
35@item M-x indent-relative
36Indent from point to under an indentation point in the previous line.
37@end table
38
39 Emacs supports four general categories of operations that could all
40be called `indentation':
41
42@enumerate
43@item
44Insert a tab character. You can type @kbd{C-q @key{TAB}} to do this.
45
46A tab character is displayed as a stretch of whitespace which extends
47to the next display tab stop position, and the default width of a tab
48stop is eight. @xref{Text Display}, for more details.
49
50@item
51Insert whitespace up to the next tab stop. You can set tab stops at
52your choice of column positions, then type @kbd{M-i} to advance to the
53next tab stop. The default tab stop settings have a tab stop every
54eight columns, which means by default @kbd{M-i} inserts a tab
55character. To set the tab stops, use @kbd{M-x edit-tab-stops}.
56
57@item
58Align a line with the previous line. More precisely, the command
59@kbd{M-x indent-relative} indents the current line under the beginning
60of some word in the previous line. In Fundamental mode and in Text
61mode, @key{TAB} runs the command @code{indent-relative}.
62
63@item
64The most sophisticated method is @dfn{syntax-driven indentation}.
65Most programming languages have an indentation convention. For Lisp
66code, lines are indented according to their nesting in parentheses. C
67code uses the same general idea, but many details are different.
68
69@kindex TAB
70Type @key{TAB} to do syntax-driven indentation, in a mode that
71supports it. It realigns the current line according with the syntax
72of the preceding lines. No matter where in the line you are when you
73type @key{TAB}, it aligns the line as a whole.
74@end enumerate
75
76 Normally, most of the above methods insert an optimal mix of tabs and
77spaces to align to the desired column. @xref{Just Spaces}, for how to
78disable use of tabs. However, @kbd{C-q @key{TAB}} always inserts a
79tab, even when tabs are disabled for the indentation commands.
80
81@menu
82* Indentation Commands:: Various commands and techniques for indentation.
83* Tab Stops:: You can set arbitrary "tab stops" and then
84 indent to the next tab stop when you want to.
85* Just Spaces:: You can request indentation using just spaces.
86@end menu
87
88@node Indentation Commands, Tab Stops, Indentation, Indentation
89@section Indentation Commands and Techniques
90
91@kindex M-m
92@findex back-to-indentation
93 To move over the indentation on a line, do @kbd{M-m}
94(@code{back-to-indentation}). This command, given anywhere on a line,
95positions point at the first nonblank character on the line, if any,
96or else at the end of the line.
97
98 To insert an indented line before the current line, do @kbd{C-a C-o
99@key{TAB}}. To make an indented line after the current line, use
100@kbd{C-e C-j}.
101
102 If you just want to insert a tab character in the buffer, you can type
103@kbd{C-q @key{TAB}}.
104
105@kindex C-M-o
106@findex split-line
107 @kbd{C-M-o} (@code{split-line}) moves the text from point to the end of
108the line vertically down, so that the current line becomes two lines.
109@kbd{C-M-o} first moves point forward over any spaces and tabs. Then it
110inserts after point a newline and enough indentation to reach the same
111column point is on. Point remains before the inserted newline; in this
112regard, @kbd{C-M-o} resembles @kbd{C-o}.
113
114@kindex M-^
115@findex delete-indentation
116 To join two lines cleanly, use the @kbd{M-^}
117(@code{delete-indentation}) command. It deletes the indentation at
118the front of the current line, and the line boundary as well,
119replacing them with a single space. As a special case (useful for
120Lisp code) the single space is omitted if the characters to be joined
121are consecutive open parentheses or closing parentheses, or if the
122junction follows another newline. To delete just the indentation of a
123line, go to the beginning of the line and use @kbd{M-\}
124(@code{delete-horizontal-space}), which deletes all spaces and tabs
125around the cursor.
126
127 If you have a fill prefix, @kbd{M-^} deletes the fill prefix if it
128appears after the newline that is deleted. @xref{Fill Prefix}.
129
130@kindex C-M-\
131@kindex C-x TAB
132@findex indent-region
133@findex indent-rigidly
134 There are also commands for changing the indentation of several lines
135at once. They apply to all the lines that begin in the region.
136@kbd{C-M-\} (@code{indent-region}) indents each line in the ``usual''
137way, as if you had typed @key{TAB} at the beginning of the line. A
138numeric argument specifies the column to indent to, and each line is
139shifted left or right so that its first nonblank character appears in
140that column. @kbd{C-x @key{TAB}} (@code{indent-rigidly}) moves all of
141the lines in the region right by its argument (left, for negative
142arguments). The whole group of lines moves rigidly sideways, which is
143how the command gets its name.
144
145@cindex remove indentation
146 To remove all indentation from all of the lines in the region,
147invoke @kbd{C-x @key{TAB}} with a large negative argument, such as
148-1000.
149
150@findex indent-relative
151 @kbd{M-x indent-relative} indents at point based on the previous line
152(actually, the last nonempty line). It inserts whitespace at point, moving
153point, until it is underneath the next indentation point in the previous line.
154An indentation point is the end of a sequence of whitespace or the end of
155the line. If point is farther right than any indentation point in the
156previous line, @code{indent-relative} runs @code{tab-to-tab-stop}
157@ifnottex
158(@pxref{Tab Stops}),
159@end ifnottex
160@iftex
161(see next section),
162@end iftex
163unless it is called with a numeric argument, in which case it does
164nothing.
165
166 @xref{Format Indentation}, for another way of specifying the
167indentation for part of your text.
168
169@node Tab Stops, Just Spaces, Indentation Commands, Indentation
170@section Tab Stops
171
172@cindex tab stops
173@cindex using tab stops in making tables
174@cindex tables, indentation for
175@kindex M-i
176@findex tab-to-tab-stop
177 For typing in tables, you can use @kbd{M-i} (@code{tab-to-tab-stop}).
178This command inserts indentation before point, enough to reach the
179next tab stop column.
180
181@findex edit-tab-stops
182@findex edit-tab-stops-note-changes
183@kindex C-c C-c @r{(Edit Tab Stops)}
184@vindex tab-stop-list
185 You can specify the tab stops used by @kbd{M-i}. They are stored in a
186variable called @code{tab-stop-list}, as a list of column-numbers in
187increasing order.
188
189 The convenient way to set the tab stops is with @kbd{M-x
190edit-tab-stops}, which creates and selects a buffer containing a
191description of the tab stop settings. You can edit this buffer to
192specify different tab stops, and then type @kbd{C-c C-c} to make those
193new tab stops take effect. The buffer uses Overwrite mode
194(@pxref{Minor Modes}). @code{edit-tab-stops} records which buffer was
195current when you invoked it, and stores the tab stops back in that
196buffer; normally all buffers share the same tab stops and changing
197them in one buffer affects all, but if you happen to make
198@code{tab-stop-list} local in one buffer then @code{edit-tab-stops} in
199that buffer will edit the local settings.
200
201 Here is what the text representing the tab stops looks like for ordinary
202tab stops every eight columns.
203
204@example
205 : : : : : :
2060 1 2 3 4
2070123456789012345678901234567890123456789012345678
208To install changes, type C-c C-c
209@end example
210
211 The first line contains a colon at each tab stop. The remaining lines
212are present just to help you see where the colons are and know what to do.
213
214 Note that the tab stops that control @code{tab-to-tab-stop} have nothing
215to do with displaying tab characters in the buffer. @xref{Text Display},
216for more information on that.
217
218@node Just Spaces,, Tab Stops, Indentation
219@section Tabs vs. Spaces
220
221@vindex indent-tabs-mode
222 Emacs normally uses both tabs and spaces to indent lines. If you
223prefer, all indentation can be made from spaces only. To request
224this, set @code{indent-tabs-mode} to @code{nil}. This is a per-buffer
225variable, so altering the variable affects only the current buffer,
226but there is a default value which you can change as well.
227@xref{Locals}.
228
229 A tab is not always displayed in the same way. By default, tabs are
230eight columns wide, but some people like to customize their tools to
231use a different tab width. So by using spaces only, you can make sure
232that your file looks the same regardless of the tab width setting.
233
234@findex tabify
235@findex untabify
236 There are also commands to convert tabs to spaces or vice versa, always
237preserving the columns of all nonblank text. @kbd{M-x tabify} scans the
238region for sequences of spaces, and converts sequences of at least two
239spaces to tabs if that can be done without changing indentation. @kbd{M-x
240untabify} changes all tabs in the region to appropriate numbers of spaces.
241
242@ignore
243 arch-tag: acc07de7-ae11-4ee8-a159-cb59c473f0fb
244@end ignore
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
new file mode 100644
index 00000000000..b626bfab385
--- /dev/null
+++ b/doc/emacs/killing.texi
@@ -0,0 +1,699 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5
6@node Killing, Yanking, Mark, Top
7@chapter Killing and Moving Text
8
9@ifnottex
10@raisesections
11@end ifnottex
12
13 @dfn{Killing} means erasing text and copying it into the @dfn{kill
14ring}, from which you can bring it back into the buffer by
15@dfn{yanking} it. (Some systems use the terms ``cutting'' and
16``pasting'' for these operations.) This is the most common way of
17moving or copying text within Emacs. Killing and yanking is very safe
18because Emacs remembers several recent kills, not just the last one.
19It is versatile, because the many commands for killing syntactic units
20can also be used for moving those units. But there are other ways of
21copying text for special purposes.
22
23@iftex
24@section Deletion and Killing
25@end iftex
26
27@cindex killing text
28@cindex cutting text
29@cindex deletion
30 Most commands which erase text from the buffer save it in the kill
31ring. These commands are known as @dfn{kill} commands. The commands
32that erase text but do not save it in the kill ring are known as
33@dfn{delete} commands. The @kbd{C-x u} (@code{undo}) command
34(@pxref{Undo}) can undo both kill and delete commands; the importance
35of the kill ring is that you can also yank the text in a different
36place or places. Emacs has only one kill ring for all buffers, so you
37can kill text in one buffer and yank it in another buffer.
38
39 The delete commands include @kbd{C-d} (@code{delete-char}) and
40@key{DEL} (@code{delete-backward-char}), which delete only one
41character at a time, and those commands that delete only spaces or
42newlines. Commands that can erase significant amounts of nontrivial
43data generally do a kill operation instead. The commands' names and
44individual descriptions use the words @samp{kill} and @samp{delete} to
45say which kind of operation they perform.
46
47@vindex kill-read-only-ok
48@cindex read-only text, killing
49 You cannot kill read-only text, since such text does not allow any
50kind of modification. But some users like to use the kill commands to
51copy read-only text into the kill ring, without actually changing it.
52Therefore, the kill commands work specially in a read-only buffer:
53they move over text, and copy it to the kill ring, without actually
54deleting it from the buffer. Normally, kill commands beep and display
55an error message when this happens. But if you set the variable
56@code{kill-read-only-ok} to a non-@code{nil} value, they just print a
57message in the echo area to explain why the text has not been erased.
58
59 You can also use the mouse to kill and yank. @xref{Cut and Paste}.
60
61@menu
62* Deletion:: Commands for deleting small amounts of text and
63 blank areas.
64* Killing by Lines:: How to kill entire lines of text at one time.
65* Other Kill Commands:: Commands to kill large regions of text and
66 syntactic units such as words and sentences.
67@end menu
68
69@need 1500
70@node Deletion
71@subsection Deletion
72@findex delete-backward-char
73@findex delete-char
74
75 Deletion means erasing text and not saving it in the kill ring. For
76the most part, the Emacs commands that delete text are those that
77erase just one character or only whitespace.
78
79@table @kbd
80@item C-d
81@itemx @key{DELETE}
82Delete next character (@code{delete-char}). If your keyboard has a
83@key{DELETE} function key (usually located in the edit keypad), Emacs
84binds it to @code{delete-char} as well.
85@item @key{DEL}
86@itemx @key{BS}
87Delete previous character (@code{delete-backward-char}).
88@item M-\
89Delete spaces and tabs around point (@code{delete-horizontal-space}).
90@item M-@key{SPC}
91Delete spaces and tabs around point, leaving one space
92(@code{just-one-space}).
93@item C-x C-o
94Delete blank lines around the current line (@code{delete-blank-lines}).
95@item M-^
96Join two lines by deleting the intervening newline, along with any
97indentation following it (@code{delete-indentation}).
98@end table
99
100@kindex DEL
101@kindex C-d
102 The most basic delete commands are @kbd{C-d} (@code{delete-char}) and
103@key{DEL} (@code{delete-backward-char}). @kbd{C-d} deletes the
104character after point, the one the cursor is ``on top of.'' This
105doesn't move point. @key{DEL} deletes the character before the cursor,
106and moves point back. You can delete newlines like any other characters
107in the buffer; deleting a newline joins two lines. Actually, @kbd{C-d}
108and @key{DEL} aren't always delete commands; when given arguments, they
109kill instead, since they can erase more than one character this way.
110
111@kindex BACKSPACE
112@kindex BS
113@kindex DELETE
114 Every keyboard has a large key which is a short distance above the
115@key{RET} or @key{ENTER} key and is normally used for erasing what you
116have typed. It may be labeled @key{DEL}, @key{BACKSPACE}, @key{BS},
117@key{DELETE}, or even with a left arrow. Regardless of the label on
118the key, in Emacs it called @key{DEL}, and it should delete one
119character backwards.
120
121 Many keyboards (including standard PC keyboards) have a
122@key{BACKSPACE} key a short ways above @key{RET} or @key{ENTER}, and a
123@key{DELETE} key elsewhere. In that case, the @key{BACKSPACE} key is
124@key{DEL}, and the @key{DELETE} key is equivalent to @kbd{C-d}---or it
125should be.
126
127 Why do we say ``or it should be''? When Emacs starts up using a
128graphical display, it determines automatically which key or keys should be
129equivalent to @key{DEL}. As a result, @key{BACKSPACE} and/or @key{DELETE}
130keys normally do the right things. But in some unusual cases Emacs
131gets the wrong information from the system. If these keys don't do
132what they ought to do, you need to tell Emacs which key to use for
133@key{DEL}. @xref{DEL Does Not Delete}, for how to do this.
134
135@findex normal-erase-is-backspace-mode
136 On most text-only terminals, Emacs cannot tell which keys the
137keyboard really has, so it follows a uniform plan which may or may not
138fit your keyboard. The uniform plan is that the @acronym{ASCII} @key{DEL}
139character deletes, and the @acronym{ASCII} @key{BS} (backspace) character asks
140for help (it is the same as @kbd{C-h}). If this is not right for your
141keyboard, such as if you find that the key which ought to delete backwards
142enters Help instead, see @ref{DEL Does Not Delete}.
143
144@kindex M-\
145@findex delete-horizontal-space
146@kindex M-SPC
147@findex just-one-space
148 The other delete commands are those which delete only whitespace
149characters: spaces, tabs and newlines. @kbd{M-\}
150(@code{delete-horizontal-space}) deletes all the spaces and tab
151characters before and after point. With a prefix argument, this only
152deletes spaces and tab characters before point. @kbd{M-@key{SPC}}
153(@code{just-one-space}) does likewise but leaves a single space after
154point, regardless of the number of spaces that existed previously
155(even if there were none before). With a numeric argument @var{n}, it
156leaves @var{n} spaces after point.
157
158 @kbd{C-x C-o} (@code{delete-blank-lines}) deletes all blank lines
159after the current line. If the current line is blank, it deletes all
160blank lines preceding the current line as well (leaving one blank line,
161the current line). On a solitary blank line, it deletes that line.
162
163 @kbd{M-^} (@code{delete-indentation}) joins the current line and the
164previous line, by deleting a newline and all surrounding spaces, usually
165leaving a single space. @xref{Indentation,M-^}.
166
167@node Killing by Lines
168@subsection Killing by Lines
169
170@table @kbd
171@item C-k
172Kill rest of line or one or more lines (@code{kill-line}).
173@item C-S-backspace
174Kill an entire line at once (@code{kill-whole-line})
175@end table
176
177@kindex C-k
178@findex kill-line
179 The simplest kill command is @kbd{C-k}. If given at the beginning of
180a line, it kills all the text on the line, leaving it blank. When used
181on a blank line, it kills the whole line including its newline. To kill
182an entire non-blank line, go to the beginning and type @kbd{C-k} twice.
183
184 More generally, @kbd{C-k} kills from point up to the end of the line,
185unless it is at the end of a line. In that case it kills the newline
186following point, thus merging the next line into the current one.
187Spaces and tabs that you can't see at the end of the line are ignored
188when deciding which case applies, so if point appears to be at the end
189of the line, you can be sure @kbd{C-k} will kill the newline.
190
191 When @kbd{C-k} is given a positive argument, it kills that many lines
192and the newlines that follow them (however, text on the current line
193before point is not killed). With a negative argument @minus{}@var{n}, it
194kills @var{n} lines preceding the current line (together with the text
195on the current line before point). Thus, @kbd{C-u - 2 C-k} at the front
196of a line kills the two previous lines.
197
198 @kbd{C-k} with an argument of zero kills the text before point on the
199current line.
200
201@vindex kill-whole-line
202 If the variable @code{kill-whole-line} is non-@code{nil}, @kbd{C-k} at
203the very beginning of a line kills the entire line including the
204following newline. This variable is normally @code{nil}.
205
206@kindex C-S-backspace
207@findex kill-whole-line
208 @kbd{C-S-backspace} (@code{kill-whole-line}) will kill a whole line
209including its newline regardless of the position of point within the
210line. Note that many character terminals will prevent you from typing
211the key sequence @kbd{C-S-backspace}.
212
213@node Other Kill Commands
214@subsection Other Kill Commands
215@findex kill-region
216@kindex C-w
217
218@table @kbd
219@item C-w
220Kill region (from point to the mark) (@code{kill-region}).
221@item M-d
222Kill word (@code{kill-word}). @xref{Words}.
223@item M-@key{DEL}
224Kill word backwards (@code{backward-kill-word}).
225@item C-x @key{DEL}
226Kill back to beginning of sentence (@code{backward-kill-sentence}).
227@xref{Sentences}.
228@item M-k
229Kill to end of sentence (@code{kill-sentence}).
230@item C-M-k
231Kill the following balanced expression (@code{kill-sexp}). @xref{Expressions}.
232@item M-z @var{char}
233Kill through the next occurrence of @var{char} (@code{zap-to-char}).
234@end table
235
236 The most general kill command is @kbd{C-w} (@code{kill-region}),
237which kills everything between point and the mark. With this command,
238you can kill any contiguous sequence of characters, if you first set
239the region around them.
240
241@kindex M-z
242@findex zap-to-char
243 A convenient way of killing is combined with searching: @kbd{M-z}
244(@code{zap-to-char}) reads a character and kills from point up to (and
245including) the next occurrence of that character in the buffer. A
246numeric argument acts as a repeat count. A negative argument means to
247search backward and kill text before point.
248
249 Other syntactic units can be killed: words, with @kbd{M-@key{DEL}}
250and @kbd{M-d} (@pxref{Words}); balanced expressions, with @kbd{C-M-k}
251(@pxref{Expressions}); and sentences, with @kbd{C-x @key{DEL}} and
252@kbd{M-k} (@pxref{Sentences}).@refill
253
254@node Yanking, Accumulating Text, Killing, Top
255@section Yanking
256@cindex moving text
257@cindex copying text
258@cindex kill ring
259@cindex yanking
260@cindex pasting
261
262 @dfn{Yanking} means reinserting text previously killed. This is what
263some systems call ``pasting.'' The usual way to move or copy text is to
264kill it and then yank it elsewhere one or more times. This is very safe
265because Emacs remembers many recent kills, not just the last one.
266
267@table @kbd
268@item C-y
269Yank last killed text (@code{yank}).
270@item M-y
271Replace text just yanked with an earlier batch of killed text
272(@code{yank-pop}).
273@item M-w
274Save region as last killed text without actually killing it
275(@code{kill-ring-save}). Some systems call this ``copying.''
276@item C-M-w
277Append next kill to last batch of killed text (@code{append-next-kill}).
278@end table
279
280 On graphical displays with window systems, if there is a current
281selection in some other application, and you selected it more recently
282than you killed any text in Emacs, @kbd{C-y} copies the selection
283instead of text killed within Emacs.
284
285@menu
286* Kill Ring:: Where killed text is stored. Basic yanking.
287* Appending Kills:: Several kills in a row all yank together.
288* Earlier Kills:: Yanking something killed some time ago.
289@end menu
290
291@node Kill Ring
292@subsection The Kill Ring
293
294 All killed text is recorded in the @dfn{kill ring}, a list of blocks of
295text that have been killed. There is only one kill ring, shared by all
296buffers, so you can kill text in one buffer and yank it in another buffer.
297This is the usual way to move text from one file to another.
298(@xref{Accumulating Text}, for some other ways.)
299
300@kindex C-y
301@findex yank
302 The command @kbd{C-y} (@code{yank}) reinserts the text of the most recent
303kill. It leaves the cursor at the end of the text. It sets the mark at
304the beginning of the text. @xref{Mark}.
305
306 @kbd{C-u C-y} leaves the cursor in front of the text, and sets the
307mark after it. This happens only if the argument is specified with just
308a @kbd{C-u}, precisely. Any other sort of argument, including @kbd{C-u}
309and digits, specifies an earlier kill to yank (@pxref{Earlier Kills}).
310
311@cindex yanking and text properties
312@vindex yank-excluded-properties
313 The yank commands discard certain text properties from the text that
314is yanked, those that might lead to annoying results. For instance,
315they discard text properties that respond to the mouse or specify key
316bindings. The variable @code{yank-excluded-properties} specifies the
317properties to discard. Yanking of register contents and rectangles
318also discard these properties.
319
320@kindex M-w
321@findex kill-ring-save
322 To copy a block of text, you can use @kbd{M-w}
323(@code{kill-ring-save}), which copies the region into the kill ring
324without removing it from the buffer. This is approximately equivalent
325to @kbd{C-w} followed by @kbd{C-x u}, except that @kbd{M-w} does not
326alter the undo history and does not temporarily change the screen.
327
328@node Appending Kills
329@subsection Appending Kills
330
331@cindex appending kills in the ring
332@cindex television
333 Normally, each kill command pushes a new entry onto the kill ring.
334However, two or more kill commands in a row combine their text into a
335single entry, so that a single @kbd{C-y} yanks all the text as a unit,
336just as it was before it was killed.
337
338 Thus, if you want to yank text as a unit, you need not kill all of it
339with one command; you can keep killing line after line, or word after
340word, until you have killed it all, and you can still get it all back at
341once.
342
343 Commands that kill forward from point add onto the end of the previous
344killed text. Commands that kill backward from point add text onto the
345beginning. This way, any sequence of mixed forward and backward kill
346commands puts all the killed text into one entry without rearrangement.
347Numeric arguments do not break the sequence of appending kills. For
348example, suppose the buffer contains this text:
349
350@example
351This is a line @point{}of sample text.
352@end example
353
354@noindent
355with point shown by @point{}. If you type @kbd{M-d M-@key{DEL} M-d
356M-@key{DEL}}, killing alternately forward and backward, you end up with
357@samp{a line of sample} as one entry in the kill ring, and @samp{This
358is@ @ text.} in the buffer. (Note the double space between @samp{is}
359and @samp{text}, which you can clean up with @kbd{M-@key{SPC}} or
360@kbd{M-q}.)
361
362 Another way to kill the same text is to move back two words with
363@kbd{M-b M-b}, then kill all four words forward with @kbd{C-u M-d}.
364This produces exactly the same results in the buffer and in the kill
365ring. @kbd{M-f M-f C-u M-@key{DEL}} kills the same text, all going
366backward; once again, the result is the same. The text in the kill ring
367entry always has the same order that it had in the buffer before you
368killed it.
369
370@kindex C-M-w
371@findex append-next-kill
372 If a kill command is separated from the last kill command by other
373commands (not just numeric arguments), it starts a new entry on the kill
374ring. But you can force it to append by first typing the command
375@kbd{C-M-w} (@code{append-next-kill}) right before it. The @kbd{C-M-w}
376tells the following command, if it is a kill command, to append the text
377it kills to the last killed text, instead of starting a new entry. With
378@kbd{C-M-w}, you can kill several separated pieces of text and
379accumulate them to be yanked back in one place.@refill
380
381 A kill command following @kbd{M-w} does not append to the text that
382@kbd{M-w} copied into the kill ring.
383
384@node Earlier Kills
385@subsection Yanking Earlier Kills
386
387@cindex yanking previous kills
388@kindex M-y
389@findex yank-pop
390 To recover killed text that is no longer the most recent kill, use the
391@kbd{M-y} command (@code{yank-pop}). It takes the text previously
392yanked and replaces it with the text from an earlier kill. So, to
393recover the text of the next-to-the-last kill, first use @kbd{C-y} to
394yank the last kill, and then use @kbd{M-y} to replace it with the
395previous kill. @kbd{M-y} is allowed only after a @kbd{C-y} or another
396@kbd{M-y}.
397
398 You can understand @kbd{M-y} in terms of a ``last yank'' pointer which
399points at an entry in the kill ring. Each time you kill, the ``last
400yank'' pointer moves to the newly made entry at the front of the ring.
401@kbd{C-y} yanks the entry which the ``last yank'' pointer points to.
402@kbd{M-y} moves the ``last yank'' pointer to a different entry, and the
403text in the buffer changes to match. Enough @kbd{M-y} commands can move
404the pointer to any entry in the ring, so you can get any entry into the
405buffer. Eventually the pointer reaches the end of the ring; the next
406@kbd{M-y} loops back around to the first entry again.
407
408 @kbd{M-y} moves the ``last yank'' pointer around the ring, but it does
409not change the order of the entries in the ring, which always runs from
410the most recent kill at the front to the oldest one still remembered.
411
412 @kbd{M-y} can take a numeric argument, which tells it how many entries
413to advance the ``last yank'' pointer by. A negative argument moves the
414pointer toward the front of the ring; from the front of the ring, it
415moves ``around'' to the last entry and continues forward from there.
416
417 Once the text you are looking for is brought into the buffer, you can
418stop doing @kbd{M-y} commands and it will stay there. It's just a copy
419of the kill ring entry, so editing it in the buffer does not change
420what's in the ring. As long as no new killing is done, the ``last
421yank'' pointer remains at the same place in the kill ring, so repeating
422@kbd{C-y} will yank another copy of the same previous kill.
423
424 If you know how many @kbd{M-y} commands it would take to find the
425text you want, you can yank that text in one step using @kbd{C-y} with
426a numeric argument. @kbd{C-y} with an argument restores the text from
427the specified kill ring entry, counting back from the most recent as
4281. Thus, @kbd{C-u 2 C-y} gets the next-to-the-last block of killed
429text---it is equivalent to @kbd{C-y M-y}. @kbd{C-y} with a numeric
430argument starts counting from the ``last yank'' pointer, and sets the
431``last yank'' pointer to the entry that it yanks.
432
433@vindex kill-ring-max
434 The length of the kill ring is controlled by the variable
435@code{kill-ring-max}; no more than that many blocks of killed text are
436saved.
437
438@vindex kill-ring
439 The actual contents of the kill ring are stored in a variable named
440@code{kill-ring}; you can view the entire contents of the kill ring with
441the command @kbd{C-h v kill-ring}.
442
443@node Accumulating Text, Rectangles, Yanking, Top
444@section Accumulating Text
445@findex append-to-buffer
446@findex prepend-to-buffer
447@findex copy-to-buffer
448@findex append-to-file
449
450@cindex accumulating scattered text
451 Usually we copy or move text by killing it and yanking it, but there
452are other convenient methods for copying one block of text in many
453places, or for copying many scattered blocks of text into one place. To
454copy one block to many places, store it in a register
455(@pxref{Registers}). Here we describe the commands to accumulate
456scattered pieces of text into a buffer or into a file.
457
458@table @kbd
459@item M-x append-to-buffer
460Append region to the contents of a specified buffer.
461@item M-x prepend-to-buffer
462Prepend region to the contents of a specified buffer.
463@item M-x copy-to-buffer
464Copy region into a specified buffer, deleting that buffer's old contents.
465@item M-x insert-buffer
466Insert the contents of a specified buffer into current buffer at point.
467@item M-x append-to-file
468Append region to the contents of a specified file, at the end.
469@end table
470
471 To accumulate text into a buffer, use @kbd{M-x append-to-buffer}.
472This reads a buffer name, then inserts a copy of the region into the
473buffer specified. If you specify a nonexistent buffer,
474@code{append-to-buffer} creates the buffer. The text is inserted
475wherever point is in that buffer. If you have been using the buffer for
476editing, the copied text goes into the middle of the text of the buffer,
477starting from wherever point happens to be at that moment.
478
479 Point in that buffer is left at the end of the copied text, so
480successive uses of @code{append-to-buffer} accumulate the text in the
481specified buffer in the same order as they were copied. Strictly
482speaking, @code{append-to-buffer} does not always append to the text
483already in the buffer---it appends only if point in that buffer is at the end.
484However, if @code{append-to-buffer} is the only command you use to alter
485a buffer, then point is always at the end.
486
487 @kbd{M-x prepend-to-buffer} is just like @code{append-to-buffer}
488except that point in the other buffer is left before the copied text, so
489successive prependings add text in reverse order. @kbd{M-x
490copy-to-buffer} is similar, except that any existing text in the other
491buffer is deleted, so the buffer is left containing just the text newly
492copied into it.
493
494 To retrieve the accumulated text from another buffer, use the
495command @kbd{M-x insert-buffer}; this too takes @var{buffername} as an
496argument. It inserts a copy of the whole text in buffer
497@var{buffername} into the current buffer at point, and sets the mark
498after the inserted text. Alternatively, you can select the other
499buffer for editing, then copy text from it by killing.
500@xref{Buffers}, for background information on buffers.
501
502 Instead of accumulating text within Emacs, in a buffer, you can append
503text directly into a file with @kbd{M-x append-to-file}, which takes
504@var{filename} as an argument. It adds the text of the region to the end
505of the specified file. The file is changed immediately on disk.
506
507 You should use @code{append-to-file} only with files that are
508@emph{not} being visited in Emacs. Using it on a file that you are
509editing in Emacs would change the file behind Emacs's back, which
510can lead to losing some of your editing.
511
512@node Rectangles, CUA Bindings, Accumulating Text, Top
513@section Rectangles
514@cindex rectangle
515@cindex columns (and rectangles)
516@cindex killing rectangular areas of text
517
518 The rectangle commands operate on rectangular areas of the text: all
519the characters between a certain pair of columns, in a certain range of
520lines. Commands are provided to kill rectangles, yank killed rectangles,
521clear them out, fill them with blanks or text, or delete them. Rectangle
522commands are useful with text in multicolumn formats, and for changing
523text into or out of such formats.
524
525@cindex mark rectangle
526 When you must specify a rectangle for a command to work on, you do it
527by putting the mark at one corner and point at the opposite corner. The
528rectangle thus specified is called the @dfn{region-rectangle} because
529you control it in much the same way as the region is controlled. But
530remember that a given combination of point and mark values can be
531interpreted either as a region or as a rectangle, depending on the
532command that uses them.
533
534 If point and the mark are in the same column, the rectangle they
535delimit is empty. If they are in the same line, the rectangle is one
536line high. This asymmetry between lines and columns comes about
537because point (and likewise the mark) is between two columns, but within
538a line.
539
540@table @kbd
541@item C-x r k
542Kill the text of the region-rectangle, saving its contents as the
543``last killed rectangle'' (@code{kill-rectangle}).
544@item C-x r d
545Delete the text of the region-rectangle (@code{delete-rectangle}).
546@item C-x r y
547Yank the last killed rectangle with its upper left corner at point
548(@code{yank-rectangle}).
549@item C-x r o
550Insert blank space to fill the space of the region-rectangle
551(@code{open-rectangle}). This pushes the previous contents of the
552region-rectangle rightward.
553@item C-x r c
554Clear the region-rectangle by replacing all of its contents with spaces
555(@code{clear-rectangle}).
556@item M-x delete-whitespace-rectangle
557Delete whitespace in each of the lines on the specified rectangle,
558starting from the left edge column of the rectangle.
559@item C-x r t @var{string} @key{RET}
560Replace rectangle contents with @var{string} on each line
561(@code{string-rectangle}).
562@item M-x string-insert-rectangle @key{RET} @var{string} @key{RET}
563Insert @var{string} on each line of the rectangle.
564@end table
565
566 The rectangle operations fall into two classes: commands for
567deleting and inserting rectangles, and commands for blank rectangles.
568
569@kindex C-x r k
570@kindex C-x r d
571@findex kill-rectangle
572@findex delete-rectangle
573 There are two ways to get rid of the text in a rectangle: you can
574discard the text (delete it) or save it as the ``last killed''
575rectangle. The commands for these two ways are @kbd{C-x r d}
576(@code{delete-rectangle}) and @kbd{C-x r k} (@code{kill-rectangle}). In
577either case, the portion of each line that falls inside the rectangle's
578boundaries is deleted, causing any following text on the line to
579move left into the gap.
580
581 Note that ``killing'' a rectangle is not killing in the usual sense; the
582rectangle is not stored in the kill ring, but in a special place that
583can only record the most recent rectangle killed. This is because yanking
584a rectangle is so different from yanking linear text that different yank
585commands have to be used. It is hard to define yank-popping for rectangles,
586so we do not try.
587
588@kindex C-x r y
589@findex yank-rectangle
590 To yank the last killed rectangle, type @kbd{C-x r y}
591(@code{yank-rectangle}). Yanking a rectangle is the opposite of killing
592one. Point specifies where to put the rectangle's upper left corner.
593The rectangle's first line is inserted there, the rectangle's second
594line is inserted at the same horizontal position, but one line
595vertically down, and so on. The number of lines affected is determined
596by the height of the saved rectangle.
597
598 You can convert single-column lists into double-column lists using
599rectangle killing and yanking; kill the second half of the list as a
600rectangle and then yank it beside the first line of the list.
601@xref{Two-Column}, for another way to edit multi-column text.
602
603 You can also copy rectangles into and out of registers with @kbd{C-x r
604r @var{r}} and @kbd{C-x r i @var{r}}. @xref{RegRect,,Rectangle
605Registers}.
606
607@kindex C-x r o
608@findex open-rectangle
609@kindex C-x r c
610@findex clear-rectangle
611 There are two commands you can use for making blank rectangles:
612@kbd{C-x r c} (@code{clear-rectangle}) which blanks out existing text,
613and @kbd{C-x r o} (@code{open-rectangle}) which inserts a blank
614rectangle. Clearing a rectangle is equivalent to deleting it and then
615inserting a blank rectangle of the same size.
616
617@findex delete-whitespace-rectangle
618 The command @kbd{M-x delete-whitespace-rectangle} deletes horizontal
619whitespace starting from a particular column. This applies to each of
620the lines in the rectangle, and the column is specified by the left
621edge of the rectangle. The right edge of the rectangle does not make
622any difference to this command.
623
624@kindex C-x r t
625@findex string-rectangle
626 The command @kbd{C-x r t} (@code{string-rectangle}) replaces the
627contents of a region-rectangle with a string on each line. The
628string's width need not be the same as the width of the rectangle. If
629the string's width is less, the text after the rectangle shifts left;
630if the string is wider than the rectangle, the text after the
631rectangle shifts right.
632
633@findex string-insert-rectangle
634 The command @kbd{M-x string-insert-rectangle} is similar to
635@code{string-rectangle}, but inserts the string on each line,
636shifting the original text to the right.
637
638@node CUA Bindings, Registers, Rectangles, Top
639@section CUA Bindings
640@findex cua-mode
641@vindex cua-mode
642@cindex CUA key bindings
643@vindex cua-enable-cua-keys
644 The command @kbd{M-x cua-mode} sets up key bindings that are
645compatible with the Common User Access (CUA) system used in many other
646applications. @kbd{C-x} means cut (kill), @kbd{C-c} copy, @kbd{C-v}
647paste (yank), and @kbd{C-z} undo. Standard Emacs commands like
648@kbd{C-x C-c} still work, because @kbd{C-x} and @kbd{C-c} only take
649effect when the mark is active (and the region is highlighted).
650However, if you don't want to override these bindings in Emacs at all,
651set @code{cua-enable-cua-keys} to @code{nil}.
652
653 In CUA mode, using @kbd{Shift} together with the movement keys
654activates and highlights the region over which they move. The
655standard (unshifted) movement keys deactivate the mark, and typed text
656replaces the active region as in Delete-Selection mode
657(@pxref{Mouse Commands}).
658
659 To enter an Emacs command like @kbd{C-x C-f} while the mark is
660active, use one of the following methods: either hold @kbd{Shift}
661together with the prefix key, e.g. @kbd{S-C-x C-f}, or quickly type
662the prefix key twice, e.g. @kbd{C-x C-x C-f}.
663
664@cindex rectangle highlighting
665 CUA mode provides enhanced rectangle support with visible
666rectangle highlighting. Use @kbd{C-RET} to start a rectangle,
667extend it using the movement commands, and cut or copy it using
668@kbd{C-x} or @kbd{C-c}. @kbd{RET} moves the cursor to the next
669(clockwise) corner of the rectangle, so you can easily expand it in
670any direction. Normal text you type is inserted to the left or right
671of each line in the rectangle (on the same side as the cursor).
672
673 With CUA you can easily copy text and rectangles into and out of
674registers by providing a one-digit numeric prefix to the kill, copy,
675and yank commands, e.g. @kbd{C-1 C-c} copies the region into register
676@code{1}, and @kbd{C-2 C-v} yanks the contents of register @code{2}.
677
678@cindex global mark
679 CUA mode also has a global mark feature which allows easy moving and
680copying of text between buffers. Use @kbd{C-S-SPC} to toggle the
681global mark on and off. When the global mark is on, all text that you
682kill or copy is automatically inserted at the global mark, and text
683you type is inserted at the global mark rather than at the current
684position.
685
686 For example, to copy words from various buffers into a word list in
687a given buffer, set the global mark in the target buffer, then
688navigate to each of the words you want in the list, mark it (e.g. with
689@kbd{S-M-f}), copy it to the list with @kbd{C-c} or @kbd{M-w}, and
690insert a newline after the word in the target list by pressing
691@key{RET}.
692
693@ifnottex
694@lowersections
695@end ifnottex
696
697@ignore
698 arch-tag: d8da8f96-0928-449a-816e-ff2d3497866c
699@end ignore
diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi
new file mode 100644
index 00000000000..16526e1a2b8
--- /dev/null
+++ b/doc/emacs/kmacro.texi
@@ -0,0 +1,616 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Keyboard Macros, Files, Fixit, Top
6@chapter Keyboard Macros
7@cindex defining keyboard macros
8@cindex keyboard macro
9
10 In this chapter we describe how to record a sequence of editing
11commands so you can repeat it conveniently later.
12
13 A @dfn{keyboard macro} is a command defined by an Emacs user to stand for
14another sequence of keys. For example, if you discover that you are
15about to type @kbd{C-n M-d C-d} forty times, you can speed your work by
16defining a keyboard macro to do @kbd{C-n M-d C-d}, and then executing
17it 39 more times.
18
19 You define a keyboard macro by executing and recording the commands
20which are its definition. Put differently, as you define a keyboard
21macro, the definition is being executed for the first time. This way,
22you can see the effects of your commands, so that you don't have to
23figure them out in your head. When you close the definition, the
24keyboard macro is defined and also has been, in effect, executed once.
25You can then do the whole thing over again by invoking the macro.
26
27 Keyboard macros differ from ordinary Emacs commands in that they are
28written in the Emacs command language rather than in Lisp. This makes it
29easier for the novice to write them, and makes them more convenient as
30temporary hacks. However, the Emacs command language is not powerful
31enough as a programming language to be useful for writing anything
32intelligent or general. For such things, Lisp must be used.
33
34@menu
35* Basic Keyboard Macro:: Defining and running keyboard macros.
36* Keyboard Macro Ring:: Where previous keyboard macros are saved.
37* Keyboard Macro Counter:: Inserting incrementing numbers in macros.
38* Keyboard Macro Query:: Making keyboard macros do different things each time.
39* Save Keyboard Macro:: Giving keyboard macros names; saving them in files.
40* Edit Keyboard Macro:: Editing keyboard macros.
41* Keyboard Macro Step-Edit:: Interactively executing and editing a keyboard
42 macro.
43@end menu
44
45@node Basic Keyboard Macro
46@section Basic Use
47
48@table @kbd
49@item @key{F3}
50@itemx C-x (
51Start defining a keyboard macro (@code{kmacro-start-macro}).
52@item @key{F4}
53If a keyboard macro is being defined, end the definition; otherwise,
54execute the most recent keyboard macro
55(@code{kmacro-end-or-call-macro}).
56@item C-x )
57End the definition of a keyboard macro (@code{kmacro-end-macro}).
58@item C-x e
59Execute the most recent keyboard macro (@code{kmacro-end-and-call-macro}).
60First end the definition of the keyboard macro, if currently defining it.
61To immediately execute the keyboard macro again, just repeat the @kbd{e}.
62@item C-u C-x (
63Re-execute last keyboard macro, then add more keys to its definition.
64@item C-u C-u C-x (
65Add more keys to the last keyboard macro without re-executing it.
66@item C-x C-k r
67Run the last keyboard macro on each line that begins in the region
68(@code{apply-macro-to-region-lines}).
69@end table
70
71@kindex F3
72@kindex F4
73@kindex C-x (
74@kindex C-x )
75@kindex C-x e
76@findex kmacro-start-macro
77@findex kmacro-end-macro
78@findex kmacro-end-and-call-macro
79 To start defining a keyboard macro, type the @kbd{F3} or @kbd{C-x (} command
80(@code{kmacro-start-macro}). From then on, your keys continue to be
81executed, but also become part of the definition of the macro. @samp{Def}
82appears in the mode line to remind you of what is going on. When you are
83finished, the @kbd{F4} or @kbd{C-x )} command (@code{kmacro-end-macro}) terminates the
84definition (without becoming part of it!). For example,
85
86@example
87C-x ( M-f foo C-x )
88@end example
89
90@noindent
91defines a macro to move forward a word and then insert @samp{foo}.
92
93 The macro thus defined can be invoked again with the @kbd{C-x e}
94command (@code{kmacro-end-and-call-macro}), which may be given a
95repeat count as a numeric argument to execute the macro many times.
96If you enter @kbd{C-x e} while defining a macro, the macro is
97terminated and executed immediately.
98
99 After executing the macro with @kbd{C-x e}, you can use @kbd{e}
100repeatedly to immediately repeat the macro one or more times. For example,
101
102@example
103C-x ( xyz C-x e e e
104@end example
105
106@noindent
107inserts @samp{xyzxyzxyzxyz} in the current buffer.
108
109 @kbd{C-x )} can also be given a repeat count as an argument, in
110which case it repeats the macro that many times right after defining
111it, but defining the macro counts as the first repetition (since it is
112executed as you define it). Therefore, giving @kbd{C-x )} an argument
113of 4 executes the macro immediately 3 additional times. An argument
114of zero to @kbd{C-x e} or @kbd{C-x )} means repeat the macro
115indefinitely (until it gets an error or you type @kbd{C-g} or, on
116MS-DOS, @kbd{C-@key{BREAK}}).
117
118 The key @key{F4} is like a combination of @kbd{C-x )} and @kbd{C-x
119e}. If you're defining a macro, @key{F4} ends the definition.
120Otherwise it executes the last macro. For example,
121
122@example
123F3 xyz F4 F4 F4
124@end example
125
126@noindent
127inserts @samp{xyzxyzxyz} in the current buffer.
128
129 If you wish to repeat an operation at regularly spaced places in the
130text, define a macro and include as part of the macro the commands to move
131to the next place you want to use it. For example, if you want to change
132each line, you should position point at the start of a line, and define a
133macro to change that line and leave point at the start of the next line.
134Then repeating the macro will operate on successive lines.
135
136 When a command reads an argument with the minibuffer, your
137minibuffer input becomes part of the macro along with the command. So
138when you replay the macro, the command gets the same argument as
139when you entered the macro. For example,
140
141@example
142C-x ( C-a C-@key{SPC} C-n M-w C-x b f o o @key{RET} C-y C-x b @key{RET} C-x )
143@end example
144
145@noindent
146defines a macro that copies the current line into the buffer
147@samp{foo}, then returns to the original buffer.
148
149 You can use function keys in a keyboard macro, just like keyboard
150keys. You can even use mouse events, but be careful about that: when
151the macro replays the mouse event, it uses the original mouse position
152of that event, the position that the mouse had while you were defining
153the macro. The effect of this may be hard to predict. (Using the
154current mouse position would be even less predictable.)
155
156 One thing that sometimes works badly in a keyboard macro is the
157command @kbd{C-M-c} (@code{exit-recursive-edit}). When this command
158exits a recursive edit that started within the macro, it works as
159you'd expect. But if it exits a recursive edit that started before
160you invoked the keyboard macro, it also necessarily exits the keyboard
161macro as part of the process.
162
163 After you have terminated the definition of a keyboard macro, you can add
164to the end of its definition by typing @kbd{C-u F3} or @kbd{C-u C-x (}.
165This is equivalent
166to plain @kbd{C-x (} followed by retyping the whole definition so far. As
167a consequence it re-executes the macro as previously defined.
168
169 You can also add to the end of the definition of the last keyboard
170macro without re-executing it by typing @kbd{C-u C-u C-x (}.
171
172 The variable @code{kmacro-execute-before-append} specifies whether
173a single @kbd{C-u} prefix causes the existing macro to be re-executed
174before appending to it.
175
176@findex apply-macro-to-region-lines
177@kindex C-x C-k r
178 The command @kbd{C-x C-k r} (@code{apply-macro-to-region-lines})
179repeats the last defined keyboard macro on each line that begins in
180the region. It does this line by line, by moving point to the
181beginning of the line and then executing the macro.
182
183@node Keyboard Macro Ring
184@section The Keyboard Macro Ring
185
186 All defined keyboard macros are recorded in the ``keyboard macro ring,''
187a list of sequences of keys. There is only one keyboard macro ring,
188shared by all buffers.
189
190@table @kbd
191@item C-x C-k C-k
192Execute the keyboard macro at the head of the ring (@code{kmacro-end-or-call-macro-repeat}).
193@item C-x C-k C-n
194Rotate the keyboard macro ring to the next macro (defined earlier)
195(@code{kmacro-cycle-ring-next}).
196@item C-x C-k C-p
197Rotate the keyboard macro ring to the previous macro (defined later)
198(@code{kmacro-cycle-ring-previous}).
199@end table
200
201 All commands which operate on the keyboard macro ring use the
202same @kbd{C-x C-k} prefix. Most of these commands can be executed and
203repeated immediately after each other without repeating the @kbd{C-x
204C-k} prefix. For example,
205
206@example
207C-x C-k C-p C-p C-k C-k C-k C-n C-n C-k C-p C-k C-d
208@end example
209
210@noindent
211will rotate the keyboard macro ring to the ``second previous'' macro,
212execute the resulting head macro three times, rotate back to the
213original head macro, execute that once, rotate to the ``previous''
214macro, execute that, and finally delete it from the macro ring.
215
216@findex kmacro-end-or-call-macro-repeat
217@kindex C-x C-k C-k
218 The command @kbd{C-x C-k C-k} (@code{kmacro-end-or-call-macro-repeat})
219executes the keyboard macro at the head of the macro ring. You can
220repeat the macro immediately by typing another @kbd{C-k}, or you can
221rotate the macro ring immediately by typing @kbd{C-n} or @kbd{C-p}.
222
223 When a keyboard macro is being defined, @kbd{C-x C-k C-k} behaves like
224@kbd{C-x )} except that, immediately afterward, you can use most key
225bindings of this section without the @kbd{C-x C-k} prefix. For
226instance, another @kbd{C-k} will re-execute the macro.
227
228@findex kmacro-cycle-ring-next
229@kindex C-x C-k C-n
230@findex kmacro-cycle-ring-previous
231@kindex C-x C-k C-p
232 The commands @kbd{C-x C-k C-n} (@code{kmacro-cycle-ring-next}) and
233@kbd{C-x C-k C-p} (@code{kmacro-cycle-ring-previous}) rotate the
234macro ring, bringing the next or previous keyboard macro to the head
235of the macro ring. The definition of the new head macro is displayed
236in the echo area. You can continue to rotate the macro ring
237immediately by repeating just @kbd{C-n} and @kbd{C-p} until the
238desired macro is at the head of the ring. To execute the new macro
239ring head immediately, just type @kbd{C-k}.
240
241 Note that Emacs treats the head of the macro ring as the ``last
242defined keyboard macro.'' For instance, @kbd{C-x e} will execute that
243macro, and @kbd{C-x C-k n} will give it a name.
244
245@ignore @c This interface is too kludgy
246 @c and the functionality duplicates the functionality above -- rms.
247@findex kmacro-view-macro-repeat
248@kindex C-x C-k C-v
249 The command @kbd{C-x C-k C-v} (@code{kmacro-view-macro-repeat})
250displays the last keyboard macro, or when repeated (with @kbd{C-v}),
251it displays the previous macro on the macro ring, just like @kbd{C-x
252C-k C-p}, but without actually rotating the macro ring. If you enter
253@kbd{C-k} immediately after displaying a macro from the ring, that
254macro is executed, but still without altering the macro ring.
255
256 So while e.g. @kbd{C-x C-k C-p C-p C-p C-k C-k} makes the 3rd previous
257macro the current macro and executes it twice, @kbd{C-x C-k C-v C-v
258C-v C-k C-k} will display and execute the 3rd previous macro once and
259then the current macro once.
260@end ignore
261
262@ignore @c This is just too much feeping creaturism.
263 @c If you are reusing certain macros enough to want these,
264 @c you should give then names. -- rms
265@findex kmacro-delete-ring-head
266@kindex C-x C-k C-d
267
268 The command @kbd{C-x C-k C-d} (@code{kmacro-delete-ring-head})
269removes and deletes the macro currently at the head of the macro
270ring. You can use this to delete a macro that didn't work as
271expected, or which you don't need anymore.
272
273@findex kmacro-swap-ring
274@kindex C-x C-k C-t
275
276 The command @kbd{C-x C-k C-t} (@code{kmacro-swap-ring})
277interchanges the head of the macro ring with the previous element on
278the macro ring.
279
280@findex kmacro-call-ring-2nd-repeat
281@kindex C-x C-k C-l
282
283 The command @kbd{C-x C-k C-l} (@code{kmacro-call-ring-2nd-repeat})
284executes the previous (rather than the head) element on the macro ring.
285@end ignore
286
287@vindex kmacro-ring-max
288 The maximum number of macros stored in the keyboard macro ring is
289determined by the customizable variable @code{kmacro-ring-max}.
290
291@node Keyboard Macro Counter
292@section The Keyboard Macro Counter
293
294@table @kbd
295@item C-x C-k C-i
296Insert the keyboard macro counter value in the buffer
297(@code{kmacro-insert-counter}).
298@item C-x C-k C-c
299Set the keyboard macro counter (@code{kmacro-set-counter}).
300@item C-x C-k C-a
301Add the prefix arg to the keyboard macro counter (@code{kmacro-add-counter}).
302@item C-x C-k C-f
303Specify the format for inserting the keyboard macro counter
304(@code{kmacro-set-format}).
305@end table
306
307 Each keyboard macro has an associated counter. Normally, the
308macro counter is initialized to 0 when you start defining the macro,
309and incremented by 1 after each insertion of the counter value;
310that is, if you insert the macro counter twice while defining the
311macro, the counter will increase by 2 on each repetition of the macro.
312
313@findex kmacro-insert-counter
314@kindex C-x C-k C-i
315 The command @kbd{C-x C-k C-i} (@code{kmacro-insert-counter}) inserts
316the current value of the current keyboard macro's counter, and
317increments the counter by 1. You can use a numeric prefix argument to
318specify a different increment. If you just specify a @kbd{C-u}
319prefix, then the increment is zero, so it repeats the last inserted
320counter value. For example, if you enter the following sequence while
321defining a macro
322
323@example
324C-x C-k C-i C-x C-k C-i C-u C-x C-k C-i C-x C-k C-i
325@end example
326
327@noindent
328it inserts @samp{0112} in the buffer. The next two iterations
329of the macro will insert @samp{3445} and @samp{6778}.
330
331 This command usually only makes sense while defining a keyboard
332macro. But its behavior when no keyboard macro is being defined or
333executed is predictable: it inserts and increments the counter of the
334macro at the head of the keyboard macro ring.
335
336@findex kmacro-set-counter
337@kindex C-x C-k C-c
338 The command @kbd{C-x C-k C-c} (@code{kmacro-set-counter}) sets the
339current macro counter to the value of the numeric argument. If you use
340it inside the macro, it operates on each repetition of the macro. If
341you specify just @kbd{C-u} as the prefix, while executing the macro,
342that resets the counter to the value it had at the beginning of the
343current repetition of the macro (undoing any increments so far in this
344repetition).
345
346@findex kmacro-add-counter
347@kindex C-x C-k C-a
348 The command @kbd{C-x C-k C-a} (@code{kmacro-add-counter}) adds the
349prefix argument to the current macro counter. With just @kbd{C-u} as
350argument, it resets the counter to the last value inserted by any
351keyboard macro. (Normally, when you use this, the last insertion
352will be in the same macro and it will be the same counter.)
353
354@findex kmacro-set-format
355@kindex C-x C-k C-f
356 The command @kbd{C-x C-k C-f} (@code{kmacro-set-format}) prompts for
357the format to use when inserting the macro counter. The default
358format is @samp{%d}, which means to insert the number in decimal
359without any padding. You can exit with empty minibuffer to reset the
360format to this default. You can specify any format string that the
361@code{format} function accepts and that makes sense with a single
362integer extra argument (@pxref{Formatting Strings,,, elisp, The Emacs
363Lisp Reference Manual}). Do not put the format string inside double
364quotes when you insert it in the minibuffer.
365
366 If you use this command while no keyboard macro is being defined or
367executed, the new format affects all subsequent macro definitions.
368Existing macros continue to use the format in effect when they were
369defined. If you set the format while defining a keyboard macro, this
370affects the macro being defined from that point on, but it does not
371affect subsequent macros. Execution of the macro will, at each step,
372use the format in effect at that step during its definition. Changes
373to the macro format during execution of a macro, like the
374corresponding changes during its definition, have no effect on
375subsequent macros.
376
377 The format set by @kbd{C-x C-k C-f} does not affect insertion of
378numbers stored in registers.
379
380@node Keyboard Macro Query
381@section Executing Macros with Variations
382
383@table @kbd
384@item C-x q
385When this point is reached during macro execution, ask for confirmation
386(@code{kbd-macro-query}).
387@end table
388
389@kindex C-x q
390@findex kbd-macro-query
391 Using @kbd{C-x q} (@code{kbd-macro-query}), you can get an effect
392similar to that of @code{query-replace}, where the macro asks you each
393time around whether to make a change. While defining the macro,
394type @kbd{C-x q} at the point where you want the query to occur. During
395macro definition, the @kbd{C-x q} does nothing, but when you run the
396macro later, @kbd{C-x q} asks you interactively whether to continue.
397
398 The valid responses when @kbd{C-x q} asks are @key{SPC} (or @kbd{y}),
399@key{DEL} (or @kbd{n}), @key{RET} (or @kbd{q}), @kbd{C-l} and @kbd{C-r}.
400The answers are the same as in @code{query-replace}, though not all of
401the @code{query-replace} options are meaningful.
402
403 These responses include @key{SPC} to continue, and @key{DEL} to skip
404the remainder of this repetition of the macro and start right away with
405the next repetition. @key{RET} means to skip the remainder of this
406repetition and cancel further repetitions. @kbd{C-l} redraws the screen
407and asks you again for a character to say what to do.
408
409 @kbd{C-r} enters a recursive editing level, in which you can perform
410editing which is not part of the macro. When you exit the recursive
411edit using @kbd{C-M-c}, you are asked again how to continue with the
412keyboard macro. If you type a @key{SPC} at this time, the rest of the
413macro definition is executed. It is up to you to leave point and the
414text in a state such that the rest of the macro will do what you
415want.@refill
416
417 @kbd{C-u C-x q}, which is @kbd{C-x q} with a numeric argument,
418performs a completely different function. It enters a recursive edit
419reading input from the keyboard, both when you type it during the
420definition of the macro, and when it is executed from the macro. During
421definition, the editing you do inside the recursive edit does not become
422part of the macro. During macro execution, the recursive edit gives you
423a chance to do some particularized editing on each repetition.
424@xref{Recursive Edit}.
425
426 Another way to vary the behavior of a keyboard macro is to use a
427register as a counter, incrementing it on each repetition of the macro.
428@xref{RegNumbers}.
429
430@node Save Keyboard Macro
431@section Naming and Saving Keyboard Macros
432
433@table @kbd
434@item C-x C-k n
435Give a command name (for the duration of the Emacs session) to the most
436recently defined keyboard macro (@code{kmacro-name-last-macro}).
437@item C-x C-k b
438Bind the most recently defined keyboard macro to a key sequence (for
439the duration of the session) (@code{kmacro-bind-to-key}).
440@item M-x insert-kbd-macro
441Insert in the buffer a keyboard macro's definition, as Lisp code.
442@end table
443
444@cindex saving keyboard macros
445@findex kmacro-name-last-macro
446@kindex C-x C-k n
447 If you wish to save a keyboard macro for later use, you can give it
448a name using @kbd{C-x C-k n} (@code{kmacro-name-last-macro}).
449This reads a name as an argument using the minibuffer and defines that
450name to execute the last keyboard macro, in its current form. (If you
451later add to the definition of this macro, that does not alter the
452name's definition as a macro.) The macro name is a Lisp symbol, and
453defining it in this way makes it a valid command name for calling with
454@kbd{M-x} or for binding a key to with @code{global-set-key}
455(@pxref{Keymaps}). If you specify a name that has a prior definition
456other than a keyboard macro, an error message is shown and nothing is
457changed.
458
459@cindex binding keyboard macros
460@findex kmacro-bind-to-key
461@kindex C-x C-k b
462 You can also bind the last keyboard macro (in its current form) to a
463key, using @kbd{C-x C-k b} (@code{kmacro-bind-to-key}) followed by the
464key sequence you want to bind. You can bind to any key sequence in
465the global keymap, but since most key sequences already have other
466bindings, you should select the key sequence carefully. If you try to
467bind to a key sequence with an existing binding (in any keymap), this
468command asks you for confirmation before replacing the existing binding.
469
470 To avoid problems caused by overriding existing bindings, the key
471sequences @kbd{C-x C-k 0} through @kbd{C-x C-k 9} and @kbd{C-x C-k A}
472through @kbd{C-x C-k Z} are reserved for your own keyboard macro
473bindings. In fact, to bind to one of these key sequences, you only
474need to type the digit or letter rather than the whole key sequences.
475For example,
476
477@example
478C-x C-k b 4
479@end example
480
481@noindent
482will bind the last keyboard macro to the key sequence @kbd{C-x C-k 4}.
483
484@findex insert-kbd-macro
485 Once a macro has a command name, you can save its definition in a file.
486Then it can be used in another editing session. First, visit the file
487you want to save the definition in. Then use this command:
488
489@example
490M-x insert-kbd-macro @key{RET} @var{macroname} @key{RET}
491@end example
492
493@noindent
494This inserts some Lisp code that, when executed later, will define the
495same macro with the same definition it has now. (You need not
496understand Lisp code to do this, because @code{insert-kbd-macro} writes
497the Lisp code for you.) Then save the file. You can load the file
498later with @code{load-file} (@pxref{Lisp Libraries}). If the file you
499save in is your init file @file{~/.emacs} (@pxref{Init File}) then the
500macro will be defined each time you run Emacs.
501
502 If you give @code{insert-kbd-macro} a numeric argument, it makes
503additional Lisp code to record the keys (if any) that you have bound
504to @var{macroname}, so that the macro will be reassigned the same keys
505when you load the file.
506
507@node Edit Keyboard Macro
508@section Editing a Keyboard Macro
509
510@table @kbd
511@item C-x C-k C-e
512Edit the last defined keyboard macro (@code{kmacro-edit-macro}).
513@item C-x C-k e @var{name} @key{RET}
514Edit a previously defined keyboard macro @var{name} (@code{edit-kbd-macro}).
515@item C-x C-k l
516Edit the last 100 keystrokes as a keyboard macro
517(@code{kmacro-edit-lossage}).
518@end table
519
520@findex kmacro-edit-macro
521@kindex C-x C-k C-e
522@kindex C-x C-k RET
523 You can edit the last keyboard macro by typing @kbd{C-x C-k C-e} or
524@kbd{C-x C-k RET} (@code{kmacro-edit-macro}). This formats the macro
525definition in a buffer and enters a specialized major mode for editing
526it. Type @kbd{C-h m} once in that buffer to display details of how to
527edit the macro. When you are finished editing, type @kbd{C-c C-c}.
528
529@findex edit-kbd-macro
530@kindex C-x C-k e
531 You can edit a named keyboard macro or a macro bound to a key by typing
532@kbd{C-x C-k e} (@code{edit-kbd-macro}). Follow that with the
533keyboard input that you would use to invoke the macro---@kbd{C-x e} or
534@kbd{M-x @var{name}} or some other key sequence.
535
536@findex kmacro-edit-lossage
537@kindex C-x C-k l
538 You can edit the last 100 keystrokes as a macro by typing
539@kbd{C-x C-k l} (@code{kmacro-edit-lossage}).
540
541@node Keyboard Macro Step-Edit
542@section Stepwise Editing a Keyboard Macro
543
544@findex kmacro-step-edit-macro
545@kindex C-x C-k SPC
546 You can interactively replay and edit the last keyboard
547macro, one command at a time, by typing @kbd{C-x C-k SPC}
548(@code{kmacro-step-edit-macro}). Unless you quit the macro using
549@kbd{q} or @kbd{C-g}, the edited macro replaces the last macro on the
550macro ring.
551
552 This macro editing feature shows the last macro in the minibuffer
553together with the first (or next) command to be executed, and prompts
554you for an action. You can enter @kbd{?} to get a summary of your
555options. These actions are available:
556
557@itemize @bullet{}
558@item
559@kbd{SPC} and @kbd{y} execute the current command, and advance to the
560next command in the keyboard macro.
561@item
562@kbd{n}, @kbd{d}, and @kbd{DEL} skip and delete the current command.
563@item
564@kbd{f} skips the current command in this execution of the keyboard
565macro, but doesn't delete it from the macro.
566@item
567@kbd{@key{TAB}} executes the current command, as well as all similar
568commands immediately following the current command; for example, @key{TAB}
569may be used to insert a sequence of characters (corresponding to a
570sequence of @code{self-insert-command} commands).
571@item
572@kbd{c} continues execution (without further editing) until the end of
573the keyboard macro. If execution terminates normally, the edited
574macro replaces the original keyboard macro.
575@item
576@kbd{C-k} skips and deletes the rest of the keyboard macro,
577terminates step-editing, and replaces the original keyboard macro
578with the edited macro.
579@item
580@kbd{q} and @kbd{C-g} cancels the step-editing of the keyboard macro;
581discarding any changes made to the keyboard macro.
582@item
583@kbd{i KEY... C-j} reads and executes a series of key sequences (not
584including the final @kbd{C-j}), and inserts them before the current
585command in the keyboard macro, without advancing over the current
586command.
587@item
588@kbd{I KEY...} reads one key sequence, executes it, and inserts it
589before the current command in the keyboard macro, without advancing
590over the current command.
591@item
592@kbd{r KEY... C-j} reads and executes a series of key sequences (not
593including the final @kbd{C-j}), and replaces the current command in
594the keyboard macro with them, advancing over the inserted key
595sequences.
596@item
597@kbd{R KEY...} reads one key sequence, executes it, and replaces the
598current command in the keyboard macro with that key sequence,
599advancing over the inserted key sequence.
600@item
601@kbd{a KEY... C-j} executes the current command, then reads and
602executes a series of key sequences (not including the final
603@kbd{C-j}), and inserts them after the current command in the keyboard
604macro; it then advances over the current command and the inserted key
605sequences.
606@item
607@kbd{A KEY... C-j} executes the rest of the commands in the keyboard
608macro, then reads and executes a series of key sequences (not
609including the final @kbd{C-j}), and appends them at the end of the
610keyboard macro; it then terminates the step-editing and replaces the
611original keyboard macro with the edited macro.
612@end itemize
613
614@ignore
615 arch-tag: c1b0dd3b-3159-4c08-928f-52e763953e9c
616@end ignore
diff --git a/doc/emacs/m-x.texi b/doc/emacs/m-x.texi
new file mode 100644
index 00000000000..7a5b80fd348
--- /dev/null
+++ b/doc/emacs/m-x.texi
@@ -0,0 +1,75 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node M-x, Help, Minibuffer, Top
6@chapter Running Commands by Name
7
8 Every Emacs command has a name that you can use to run it. For
9convenience, many commands also have key bindings. You can run those
10commands by typing the keys, or run them by name. Most Emacs commands
11have no key bindings, so the only way to run them is by name.
12(@xref{Key Bindings}, for how to set up key bindings.)
13
14 By convention, a command name consists of one or more words,
15separated by hyphens; for example, @code{auto-fill-mode} or
16@code{manual-entry}. Command names mostly use complete English words
17to make them easier to remember.
18
19@kindex M-x
20 To run a command by name, start with @kbd{M-x}, type the command
21name, then terminate it with @key{RET}. @kbd{M-x} uses the minibuffer
22to read the command name. The string @samp{M-x} appears at the
23beginning of the minibuffer as a @dfn{prompt} to remind you to enter a
24command name to be run. @key{RET} exits the minibuffer and runs the
25command. @xref{Minibuffer}, for more information on the minibuffer.
26
27 You can use completion to enter the command name. For example,
28to invoke the command @code{forward-char}, you can type
29
30@example
31M-x forward-char @key{RET}
32@end example
33
34@noindent
35or
36
37@example
38M-x forw @key{TAB} c @key{RET}
39@end example
40
41@noindent
42Note that @code{forward-char} is the same command that you invoke with
43the key @kbd{C-f}. The existence of a key binding does not stop you
44from running the command by name.
45
46 To cancel the @kbd{M-x} and not run a command, type @kbd{C-g} instead
47of entering the command name. This takes you back to command level.
48
49 To pass a numeric argument to the command you are invoking with
50@kbd{M-x}, specify the numeric argument before @kbd{M-x}. The
51argument value appears in the prompt while the command name is being
52read, and finally @kbd{M-x} passes the argument to that command.
53
54@vindex suggest-key-bindings
55 When the command you run with @kbd{M-x} has a key binding, Emacs
56mentions this in the echo area after running the command. For
57example, if you type @kbd{M-x forward-word}, the message says that you
58can run the same command by typing @kbd{M-f}. You can turn off these
59messages by setting the variable @code{suggest-key-bindings} to
60@code{nil}.
61
62 In this manual, when we speak of running a command by name, we often
63omit the @key{RET} that terminates the name. Thus we might say
64@kbd{M-x auto-fill-mode} rather than @kbd{M-x auto-fill-mode
65@key{RET}}. We mention the @key{RET} only for emphasis, such as when
66the command is followed by arguments.
67
68@findex execute-extended-command
69 @kbd{M-x} works by running the command
70@code{execute-extended-command}, which is responsible for reading the
71name of another command and invoking it.
72
73@ignore
74 arch-tag: b67bff53-9628-4666-b94e-eda972a7ba56
75@end ignore
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
new file mode 100644
index 00000000000..28d7f43df8e
--- /dev/null
+++ b/doc/emacs/macos.texi
@@ -0,0 +1,429 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2000, 2001, 2002, 2003, 2004,
3@c 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Mac OS, Microsoft Windows, Antinews, Top
6@appendix Emacs and Mac OS
7@cindex Mac OS
8@cindex Macintosh
9
10 This section briefly describes the peculiarities of using Emacs
11under Mac OS with native window system support. For Mac OS X, Emacs
12can be built either without window system support, with X11, or with
13Carbon API. This section only applies to the Carbon build. For Mac
14OS Classic, Emacs can be built with or without Carbon API, and this
15section applies to either of them because they run on the native
16window system.
17
18 Emacs built on Mac OS X supports most of its major features except
19display support of PostScript images. The following features of Emacs
20are not supported on Mac OS Classic: unexec (@code{dump-emacs}),
21asynchronous subprocesses (@code{start-process}), and networking
22(@code{open-network-stream}). As a result, packages such as Gnus,
23GUD, and Comint do not work. Synchronous subprocesses
24(@code{call-process}) are supported on non-Carbon build, but
25specially-crafted external programs are needed. Since external
26programs to handle commands such as @code{print-buffer} and
27@code{diff} are not available on Mac OS Classic, they are not
28supported. Non-Carbon build on Mac OS Classic does not support some
29features such as file dialogs, drag-and-drop, and Unicode menus.
30
31@menu
32* Input: Mac Input. Keyboard and mouse input on Mac.
33* Intl: Mac International. International character sets on Mac.
34* Env: Mac Environment Variables. Setting environment variables for Emacs.
35* Directories: Mac Directories. Volumes and directories on Mac.
36* Font: Mac Font Specs. Specifying fonts on Mac.
37* Functions: Mac Functions. Mac-specific Lisp functions.
38@end menu
39
40@node Mac Input
41@section Keyboard and Mouse Input on Mac
42@cindex Meta (Mac OS)
43@cindex keyboard coding (Mac OS)
44
45@vindex mac-control-modifier
46@vindex mac-command-modifier
47@vindex mac-option-modifier
48@vindex mac-function-modifier
49 On Mac, Emacs can use @key{control}, @key{command}, @key{option}, and
50laptop @key{function} keys as any of Emacs modifier keys except
51@key{SHIFT} (i.e., @key{ALT}, @key{CTRL}, @key{HYPER}, @key{META}, and
52@key{SUPER}). The assignment is controlled by the variables
53@code{mac-control-modifier}, @code{mac-command-modifier},
54@code{mac-option-modifier}, and @code{mac-function-modifier}. The value
55for each of these variables can be one of the following symbols:
56@code{alt}, @code{control}, @code{hyper}, @code{meta}, @code{super}, and
57@code{nil} (no particular assignment). By default, the @key{control}
58key works as @key{CTRL}, and the @key{command} key as @key{META}.
59
60 For the @key{option} key, if @code{mac-option-modifier} is set to
61@code{nil}, which is the default, the key works as the normal
62@key{option} key, i.e., dead-key processing will work. This is useful
63for entering non-@acronym{ASCII} Latin characters directly from the
64Mac keyboard, for example.
65
66 Emacs recognizes the setting in the Keyboard control panel (Mac OS
67Classic) or the International system preference pane (Mac OS X) and
68supports international and alternative keyboard layouts (e.g., Dvorak).
69Selecting one of the layouts from the keyboard layout pull-down menu
70will affect how the keys typed on the keyboard are interpreted.
71
72@vindex mac-pass-command-to-system
73@vindex mac-pass-control-to-system
74 Mac OS intercepts and handles certain key combinations (e.g.,
75@key{command}-@key{SPC} for switching input languages). These will not
76be passed to Emacs. One can disable this interception by setting
77@code{mac-pass-command-to-system} or @code{mac-pass-control-to-system}
78to @code{nil}.
79
80@vindex mac-emulate-three-button-mouse
81 Especially for one-button mice, the multiple button feature can be
82emulated by setting @code{mac-emulate-three-button-mouse} to @code{t}
83or @code{reverse}. If set to @code{t} (@code{reverse}, respectively),
84pressing the mouse button with the @key{option} key is recognized as
85the second (third) button, and that with the @key{command} key is
86recognized as the third (second) button.
87
88@vindex mac-wheel-button-is-mouse-2
89 For multi-button mice, the wheel button and the secondary button are
90recognized as the second and the third button, respectively. If
91@code{mac-wheel-button-is-mouse-2} is set to @code{nil}, their roles
92are exchanged.
93
94@node Mac International
95@section International Character Set Support on Mac
96@cindex Mac Roman coding system
97@cindex clipboard support (Mac OS)
98
99 Mac uses non-standard encodings for the upper 128 single-byte
100characters. They also deviate from the ISO 2022 standard by using
101character codes in the range 128-159. The coding systems
102@code{mac-roman}, @code{mac-centraleurroman}, and @code{mac-cyrillic}
103are used to represent these Mac encodings.
104
105 You can use input methods provided either by LEIM (@pxref{Input
106Methods}) or Mac OS to enter international characters. To use the
107former, see the International Character Set Support section of the
108manual (@pxref{International}).
109
110 Emacs on Mac OS automatically changes the value of
111@code{keyboard-coding-system} according to the current keyboard
112layout. So users don't need to set it manually, and even if set, it
113will be changed when the keyboard layout change is detected next time.
114
115 The Mac clipboard and the Emacs kill ring (@pxref{Killing}) are
116synchronized by default: you can yank a piece of text and paste it
117into another Mac application, or cut or copy one in another Mac
118application and yank it into a Emacs buffer. This feature can be
119disabled by setting @code{x-select-enable-clipboard} to @code{nil}.
120One can still do copy and paste with another application from the Edit
121menu.
122
123 On Mac, the role of the coding system for selection that is set by
124@code{set-selection-coding-system} (@pxref{Communication Coding}) is
125two-fold. First, it is used as a preferred coding system for the
126traditional text flavor that does not specify any particular encodings
127and is mainly used by applications on Mac OS Classic. Second, it
128specifies the intermediate encoding for the UTF-16 text flavor that is
129mainly used by applications on Mac OS X.
130
131 When pasting UTF-16 text data from the clipboard, it is first
132converted to the encoding specified by the selection coding system
133using the converter in the Mac OS system, and then decoded into the
134Emacs internal encoding using the converter in Emacs. If the first
135conversion failed, then the UTF-16 data is directly converted to Emacs
136internal encoding using the converter in Emacs. Copying UTF-16 text
137to the clipboard goes through the inverse path. The reason for this
138two-pass decoding is to avoid subtle differences in Unicode mappings
139between the Mac OS system and Emacs such as various kinds of hyphens,
140and to minimize users' customization. For example, users that mainly
141use Latin characters would prefer Greek characters to be decoded into
142the @code{mule-unicode-0100-24ff} charset, but Japanese users would
143prefer them to be decoded into the @code{japanese-jisx0208} charset.
144Since the coding system for selection is automatically set according
145to the system locale setting, users usually don't have to set it
146manually.
147
148 The default language environment (@pxref{Language Environments}) is
149set according to the locale setting at the startup time. On Mac OS,
150the locale setting is consulted in the following order:
151
152@enumerate
153@item
154Environment variables @env{LC_ALL}, @env{LC_CTYPE} and @env{LANG} as
155in other systems.
156
157@item
158Preference @code{AppleLocale} that is set by default on Mac OS X 10.3
159and later.
160
161@item
162Preference @code{AppleLanguages} that is set by default on Mac OS X
16310.1 and later.
164
165@item
166Variable @code{mac-system-locale} that is derived from the system
167language and region codes. This variable is available on all
168supported Mac OS versions including Mac OS Classic.
169@end enumerate
170
171 The default values of almost all variables about coding systems are
172also set according to the language environment. So usually you don't
173have to customize these variables manually.
174
175@node Mac Environment Variables
176@section Environment Variables and Command Line Arguments.
177@cindex environment variables (Mac OS)
178
179 On Mac OS X, when Emacs is run in a terminal, it inherits the values
180of environment variables from the shell from which it is invoked.
181However, when it is run from the Finder as a GUI application, it only
182inherits environment variable values defined in the file
183@file{~/.MacOSX/environment.plist} that affects all the applications
184invoked from the Finder or the @command{open} command.
185
186 Command line arguments are specified like
187
188@example
189/Applications/Emacs.app/Contents/MacOS/Emacs -g 80x25 &
190@end example
191
192@noindent
193if Emacs is installed at @file{/Applications/Emacs.app}. If Emacs is
194invoked like this, then it also inherits the values of environment
195variables from the shell from which it is invoked.
196
197 On Mac OS Classic, environment variables and command line arguments
198for Emacs can be set by modifying the @samp{STR#} resources 128 and
199129, respectively. A common environment variable that one may want to
200set is @samp{HOME}.
201
202 The way to set an environment variable is by adding a string of the
203form
204
205@example
206ENV_VAR=VALUE
207@end example
208
209@noindent
210to resource @samp{STR#} number 128 using @code{ResEdit}. To set up the
211program to use unibyte characters exclusively, for example, add the
212string
213
214@example
215EMACS_UNIBYTE=1
216@end example
217
218@cindex Mac Preferences
219 Although Emacs on Mac does not support X resources (@pxref{X
220Resources}) directly, one can use the Preferences system in place of X
221resources. For example, adding the line
222
223@example
224Emacs.cursorType: bar
225@end example
226
227@noindent
228to @file{~/.Xresources} in X11 corresponds to the execution of
229
230@example
231defaults write org.gnu.Emacs Emacs.cursorType bar
232@end example
233
234@noindent
235on Mac OS X. One can use boolean or numeric values as well as string
236values as follows:
237
238@example
239defaults write org.gnu.Emacs Emacs.toolBar -bool false
240defaults write org.gnu.Emacs Emacs.lineSpacing -int 3
241@end example
242
243@noindent
244Try @kbd{M-x man RET defaults RET} for the usage of the
245@command{defaults} command. Alternatively, if you have Developer
246Tools installed on Mac OS X, you can use Property List Editor to edit
247the file @file{~/Library/Preferences/org.gnu.Emacs.plist}.
248
249
250@node Mac Directories
251@section Volumes and Directories on Mac
252@cindex file names (Mac OS)
253
254 This node applies to Mac OS Classic only.
255
256 The directory structure in Mac OS Classic is seen by Emacs as
257
258@example
259/@var{volumename}/@var{filename}
260@end example
261
262So when Emacs requests a file name, doing file name completion on
263@file{/} will display all volumes on the system. You can use @file{..}
264to go up a directory level.
265
266 On Mac OS Classic, to access files and folders on the desktop, look
267in the folder @file{Desktop Folder} in your boot volume (this folder
268is usually invisible in the Mac @code{Finder}).
269
270 On Mac OS Classic, Emacs creates the Mac folder
271@file{:Preferences:Emacs:} in the @file{System Folder} and uses it as
272the temporary directory. Emacs maps the directory name @file{/tmp/}
273to that. Therefore it is best to avoid naming a volume @file{tmp}.
274If everything works correctly, the program should leave no files in it
275when it exits. You should be able to set the environment variable
276@code{TMPDIR} to use another directory but this folder will still be
277created.
278
279
280@node Mac Font Specs
281@section Specifying Fonts on Mac
282@cindex font names (Mac OS)
283
284 It is rare that you need to specify a font name in Emacs; usually
285you specify face attributes instead. For example, you can use 14pt
286Courier by customizing the default face attributes for all frames:
287
288@lisp
289(set-face-attribute 'default nil
290 :family "courier" :height 140)
291@end lisp
292
293@noindent
294Alternatively, an interactive one is also available
295(@pxref{Face Customization}).
296
297But when you do need to specify a font name in Emacs on Mac, use a
298standard X font name:
299
300@smallexample
301-@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{}
302@dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{charset}
303@end smallexample
304
305@noindent
306@xref{Font X}. Wildcards are supported as they are on X.
307
308 Emacs on Mac OS Classic uses QuickDraw Text routines for drawing texts
309by default. Emacs on Mac OS X uses @acronym{ATSUI, Apple Type Services
310for Unicode Imaging} as well as QuickDraw Text, and most of the
311characters other than Chinese, Japanese, and Korean ones are drawn using
312the former by default.
313
314 @acronym{ATSUI}-compatible fonts have maker name @code{apple} and
315charset @code{iso10646-1}. For example, 12-point Monaco can be specified
316by the name:
317
318@example
319-apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1
320@end example
321
322Note that these names must be specified using a format containing all
32314 @samp{-}s (not by
324@samp{-apple-monaco-medium-r-normal--12-*-iso10646-1}, for instance),
325because every @acronym{ATSUI}-compatible font is a scalable one.
326
327 QuickDraw Text fonts have maker name @code{apple} and various charset
328names other than @code{iso10646-1}. Native Apple fonts in Mac Roman
329encoding has charset @code{mac-roman}. You can specify a
330@code{mac-roman} font for @acronym{ASCII} characters like
331
332@smalllisp
333(add-to-list
334 'default-frame-alist
335 '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman"))
336@end smalllisp
337
338@noindent
339but that does not extend to ISO-8859-1: specifying a @code{mac-roman}
340font for Latin-1 characters introduces wrong glyphs.
341
342 Native Apple Traditional Chinese, Simplified Chinese, Japanese,
343Korean, Central European, Cyrillic, Symbol, and Dingbats fonts have
344the charsets @samp{big5-0}, @samp{gb2312.1980-0},
345@samp{jisx0208.1983-sjis} and @samp{jisx0201.1976-0},
346@samp{ksc5601.1989-0}, @samp{mac-centraleurroman},
347@samp{mac-cyrillic}, @samp{mac-symbol}, and @samp{mac-dingbats},
348respectively.
349
350 The use of @code{create-fontset-from-fontset-spec} (@pxref{Defining
351Fontsets}) for defining fontsets often results in wrong ones especially
352when using only OS-bundled QuickDraw Text fonts. The recommended way to
353use them is to create a fontset using
354@code{create-fontset-from-mac-roman-font}:
355
356@lisp
357(create-fontset-from-mac-roman-font
358 "-apple-courier-medium-r-normal--13-*-*-*-*-*-mac-roman"
359 nil "foo")
360@end lisp
361
362@noindent
363and then optionally specifying Chinese, Japanese, or Korean font
364families using @code{set-fontset-font}:
365
366@lisp
367(set-fontset-font "fontset-foo"
368 'chinese-gb2312 '("song" . "gb2312.1980-0"))
369@end lisp
370
371 Single-byte fonts converted from GNU fonts in BDF format, which are not
372in the Mac Roman encoding, have foundry, family, and character sets
373encoded in the names of their font suitcases. E.g., the font suitcase
374@samp{ETL-Fixed-ISO8859-1} contains fonts which can be referred to by
375the name @samp{-ETL-fixed-*-iso8859-1}.
376
377@vindex mac-allow-anti-aliasing
378 Mac OS X 10.2 or later can use two types of text renderings: Quartz 2D
379(aka Core Graphics) and QuickDraw. By default, Emacs uses the former on
380such versions. It can be changed by setting
381@code{mac-allow-anti-aliasing} to @code{t} (Quartz 2D) or @code{nil}
382(QuickDraw). Both @acronym{ATSUI} and QuickDraw Text drawings are
383affected by the value of this variable.
384
385 Appearance of text in small sizes will also be affected by the ``Turn
386off text smoothing for font sizes @var{n} and smaller'' setting in the
387General pane (Mac OS X 10.1 or 10.2) or in the Appearance pane (10.3 or
388later) of the System Preferences. This threshold can alternatively be
389set just for Emacs (i.e., not as the system-wide setting) using the
390@command{defaults} command:
391
392@example
393defaults write org.gnu.Emacs AppleAntiAliasingThreshold @var{n}
394@end example
395
396
397@node Mac Functions
398@section Mac-Specific Lisp Functions
399@cindex Lisp functions specific to Mac OS
400
401@findex do-applescript
402 The function @code{do-applescript} takes a string argument,
403executes it as an AppleScript command, and returns the result as a
404string.
405
406@findex mac-file-name-to-posix
407@findex posix-file-name-to-mac
408 The function @code{mac-file-name-to-posix} takes a Mac file name and
409returns the GNU or Unix equivalent. The function
410@code{posix-file-name-to-mac} performs the opposite conversion. They
411are useful for constructing AppleScript commands to be passed to
412@code{do-applescript}.
413
414@findex mac-set-file-creator
415@findex mac-get-file-creator
416@findex mac-set-file-type
417@findex mac-get-file-type
418 The functions @code{mac-set-file-creator},
419@code{mac-get-file-creator}, @code{mac-set-file-type}, and
420@code{mac-get-file-type} can be used to set and get creator and file
421codes.
422
423@findex mac-get-preference
424 The function @code{mac-get-preference} returns the preferences value
425converted to a Lisp object for a specified key and application.
426
427@ignore
428 arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6
429@end ignore
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
new file mode 100644
index 00000000000..988d5890b8c
--- /dev/null
+++ b/doc/emacs/maintaining.texi
@@ -0,0 +1,862 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
3@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Maintaining, Abbrevs, Building, Top
6@chapter Maintaining Large Programs
7
8 This chapter describes Emacs features for maintaining large
9programs. The version control features (@pxref{Version Control}) are
10also particularly useful for this purpose.
11
12@menu
13* Change Log:: Maintaining a change history for your program.
14* Format of ChangeLog:: What the change log file looks like.
15* Tags:: Go direct to any function in your program in one
16 command. Tags remembers which file it is in.
17@ifnottex
18* Emerge:: A convenient way of merging two versions of a program.
19@end ifnottex
20@end menu
21
22@node Change Log
23@section Change Logs
24
25 A change log file contains a chronological record of when and why you
26have changed a program, consisting of a sequence of entries describing
27individual changes. Normally it is kept in a file called
28@file{ChangeLog} in the same directory as the file you are editing, or
29one of its parent directories. A single @file{ChangeLog} file can
30record changes for all the files in its directory and all its
31subdirectories.
32
33@cindex change log
34@kindex C-x 4 a
35@findex add-change-log-entry-other-window
36 The Emacs command @kbd{C-x 4 a} adds a new entry to the change log
37file for the file you are editing
38(@code{add-change-log-entry-other-window}). If that file is actually
39a backup file, it makes an entry appropriate for the file's
40parent---that is useful for making log entries for functions that
41have been deleted in the current version.
42
43 @kbd{C-x 4 a} visits the change log file and creates a new entry
44unless the most recent entry is for today's date and your name. It
45also creates a new item for the current file. For many languages, it
46can even guess the name of the function or other object that was
47changed.
48
49@vindex add-log-keep-changes-together
50 When the variable @code{add-log-keep-changes-together} is
51non-@code{nil}, @kbd{C-x 4 a} adds to any existing item for the file
52rather than starting a new item.
53
54@vindex add-log-always-start-new-record
55 If @code{add-log-always-start-new-record} is non-@code{nil},
56@kbd{C-x 4 a} always makes a new entry, even if the last entry
57was made by you and on the same date.
58
59@vindex change-log-version-info-enabled
60@vindex change-log-version-number-regexp-list
61@cindex file version in change log entries
62 If the value of the variable @code{change-log-version-info-enabled}
63is non-@code{nil}, @kbd{C-x 4 a} adds the file's version number to the
64change log entry. It finds the version number by searching the first
65ten percent of the file, using regular expressions from the variable
66@code{change-log-version-number-regexp-list}.
67
68@cindex Change Log mode
69@findex change-log-mode
70 The change log file is visited in Change Log mode. In this major
71mode, each bunch of grouped items counts as one paragraph, and each
72entry is considered a page. This facilitates editing the entries.
73@kbd{C-j} and auto-fill indent each new line like the previous line;
74this is convenient for entering the contents of an entry.
75
76@findex change-log-merge
77 You can use the command @kbd{M-x change-log-merge} to merge other
78log files into a buffer in Change Log Mode, preserving the date
79ordering of entries.
80
81 Version control systems are another way to keep track of changes in your
82program and keep a change log. @xref{Log Buffer}.
83
84@node Format of ChangeLog
85@section Format of ChangeLog
86
87 A change log entry starts with a header line that contains the current
88date, your name, and your email address (taken from the variable
89@code{add-log-mailing-address}). Aside from these header lines, every
90line in the change log starts with a space or a tab. The bulk of the
91entry consists of @dfn{items}, each of which starts with a line starting
92with whitespace and a star. Here are two entries, both dated in May
931993, with two items and one item respectively.
94
95@iftex
96@medbreak
97@end iftex
98@smallexample
991993-05-25 Richard Stallman <rms@@gnu.org>
100
101 * man.el: Rename symbols `man-*' to `Man-*'.
102 (manual-entry): Make prompt string clearer.
103
104 * simple.el (blink-matching-paren-distance):
105 Change default to 12,000.
106
1071993-05-24 Richard Stallman <rms@@gnu.org>
108
109 * vc.el (minor-mode-map-alist): Don't use it if it's void.
110 (vc-cancel-version): Doc fix.
111@end smallexample
112
113 One entry can describe several changes; each change should have its
114own item, or its own line in an item. Normally there should be a
115blank line between items. When items are related (parts of the same
116change, in different places), group them by leaving no blank line
117between them.
118
119 You should put a copyright notice and permission notice at the
120end of the change log file. Here is an example:
121
122@smallexample
123Copyright 1997, 1998 Free Software Foundation, Inc.
124Copying and distribution of this file, with or without modification, are
125permitted provided the copyright notice and this notice are preserved.
126@end smallexample
127
128@noindent
129Of course, you should substitute the proper years and copyright holder.
130
131@node Tags
132@section Tags Tables
133@cindex tags table
134
135 A @dfn{tags table} is a description of how a multi-file program is
136broken up into files. It lists the names of the component files and the
137names and positions of the functions (or other named subunits) in each
138file. Grouping the related files makes it possible to search or replace
139through all the files with one command. Recording the function names
140and positions makes possible the @kbd{M-.} command which finds the
141definition of a function by looking up which of the files it is in.
142
143 Tags tables are stored in files called @dfn{tags table files}. The
144conventional name for a tags table file is @file{TAGS}.
145
146 Each entry in the tags table records the name of one tag, the name of the
147file that the tag is defined in (implicitly), and the position in that
148file of the tag's definition. When a file parsed by @code{etags} is
149generated from a different source file, like a C file generated from a
150Cweb source file, the tags of the parsed file reference the source
151file.
152
153 Just what names from the described files are recorded in the tags table
154depends on the programming language of the described file. They
155normally include all file names, functions and subroutines, and may
156also include global variables, data types, and anything else
157convenient. Each name recorded is called a @dfn{tag}.
158
159@cindex C++ class browser, tags
160@cindex tags, C++
161@cindex class browser, C++
162@cindex Ebrowse
163 See also the Ebrowse facility, which is tailored for C++.
164@xref{Top,, Ebrowse, ebrowse, Ebrowse User's Manual}.
165
166@menu
167* Tag Syntax:: Tag syntax for various types of code and text files.
168* Create Tags Table:: Creating a tags table with @code{etags}.
169* Etags Regexps:: Create arbitrary tags using regular expressions.
170* Select Tags Table:: How to visit a tags table.
171* Find Tag:: Commands to find the definition of a specific tag.
172* Tags Search:: Using a tags table for searching and replacing.
173* List Tags:: Listing and finding tags defined in a file.
174@end menu
175
176@node Tag Syntax
177@subsection Source File Tag Syntax
178
179 Here is how tag syntax is defined for the most popular languages:
180
181@itemize @bullet
182@item
183In C code, any C function or typedef is a tag, and so are definitions of
184@code{struct}, @code{union} and @code{enum}.
185@code{#define} macro definitions, @code{#undef} and @code{enum}
186constants are also
187tags, unless you specify @samp{--no-defines} when making the tags table.
188Similarly, global variables are tags, unless you specify
189@samp{--no-globals}, and so are struct members, unless you specify
190@samp{--no-members}. Use of @samp{--no-globals}, @samp{--no-defines}
191and @samp{--no-members} can make the tags table file much smaller.
192
193You can tag function declarations and external variables in addition
194to function definitions by giving the @samp{--declarations} option to
195@code{etags}.
196
197@item
198In C++ code, in addition to all the tag constructs of C code, member
199functions are also recognized; member variables are also recognized,
200unless you use the @samp{--no-members} option. Tags for variables and
201functions in classes are named @samp{@var{class}::@var{variable}} and
202@samp{@var{class}::@var{function}}. @code{operator} definitions have
203tag names like @samp{operator+}.
204
205@item
206In Java code, tags include all the constructs recognized in C++, plus
207the @code{interface}, @code{extends} and @code{implements} constructs.
208Tags for variables and functions in classes are named
209@samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}.
210
211@item
212In La@TeX{} text, the argument of any of the commands @code{\chapter},
213@code{\section}, @code{\subsection}, @code{\subsubsection},
214@code{\eqno}, @code{\label}, @code{\ref}, @code{\cite},
215@code{\bibitem}, @code{\part}, @code{\appendix}, @code{\entry},
216@code{\index}, @code{\def}, @code{\newcommand}, @code{\renewcommand},
217@code{\newenvironment} or @code{\renewenvironment} is a tag.@refill
218
219Other commands can make tags as well, if you specify them in the
220environment variable @env{TEXTAGS} before invoking @code{etags}. The
221value of this environment variable should be a colon-separated list of
222command names. For example,
223
224@example
225TEXTAGS="mycommand:myothercommand"
226export TEXTAGS
227@end example
228
229@noindent
230specifies (using Bourne shell syntax) that the commands
231@samp{\mycommand} and @samp{\myothercommand} also define tags.
232
233@item
234In Lisp code, any function defined with @code{defun}, any variable
235defined with @code{defvar} or @code{defconst}, and in general the first
236argument of any expression that starts with @samp{(def} in column zero is
237a tag.
238
239@item
240In Scheme code, tags include anything defined with @code{def} or with a
241construct whose name starts with @samp{def}. They also include variables
242set with @code{set!} at top level in the file.
243@end itemize
244
245 Several other languages are also supported:
246
247@itemize @bullet
248
249@item
250In Ada code, functions, procedures, packages, tasks and types are
251tags. Use the @samp{--packages-only} option to create tags for
252packages only.
253
254In Ada, the same name can be used for different kinds of entity
255(e.g.@:, for a procedure and for a function). Also, for things like
256packages, procedures and functions, there is the spec (i.e.@: the
257interface) and the body (i.e.@: the implementation). To make it
258easier to pick the definition you want, Ada tag name have suffixes
259indicating the type of entity:
260
261@table @samp
262@item /b
263package body.
264@item /f
265function.
266@item /k
267task.
268@item /p
269procedure.
270@item /s
271package spec.
272@item /t
273type.
274@end table
275
276 Thus, @kbd{M-x find-tag @key{RET} bidule/b @key{RET}} will go
277directly to the body of the package @code{bidule}, while @kbd{M-x
278find-tag @key{RET} bidule @key{RET}} will just search for any tag
279@code{bidule}.
280
281@item
282In assembler code, labels appearing at the beginning of a line,
283followed by a colon, are tags.
284
285@item
286In Bison or Yacc input files, each rule defines as a tag the nonterminal
287it constructs. The portions of the file that contain C code are parsed
288as C code.
289
290@item
291In Cobol code, tags are paragraph names; that is, any word starting in
292column 8 and followed by a period.
293
294@item
295In Erlang code, the tags are the functions, records and macros defined
296in the file.
297
298@item
299In Fortran code, functions, subroutines and block data are tags.
300
301@item
302In HTML input files, the tags are the @code{title} and the @code{h1},
303@code{h2}, @code{h3} headers. Also, tags are @code{name=} in anchors
304and all occurrences of @code{id=}.
305
306@item
307In Lua input files, all functions are tags.
308
309@item
310In makefiles, targets are tags; additionally, variables are tags
311unless you specify @samp{--no-globals}.
312
313@item
314In Objective C code, tags include Objective C definitions for classes,
315class categories, methods and protocols. Tags for variables and
316functions in classes are named @samp{@var{class}::@var{variable}} and
317@samp{@var{class}::@var{function}}.
318
319@item
320In Pascal code, the tags are the functions and procedures defined in
321the file.
322
323@item
324In Perl code, the tags are the packages, subroutines and variables
325defined by the @code{package}, @code{sub}, @code{my} and @code{local}
326keywords. Use @samp{--globals} if you want to tag global variables.
327Tags for subroutines are named @samp{@var{package}::@var{sub}}. The
328name for subroutines defined in the default package is
329@samp{main::@var{sub}}.
330
331@item
332In PHP code, tags are functions, classes and defines. Vars are tags
333too, unless you use the @samp{--no-members} option.
334
335@item
336In PostScript code, the tags are the functions.
337
338@item
339In Prolog code, tags are predicates and rules at the beginning of
340line.
341
342@item
343In Python code, @code{def} or @code{class} at the beginning of a line
344generate a tag.
345@end itemize
346
347 You can also generate tags based on regexp matching (@pxref{Etags
348Regexps}) to handle other formats and languages.
349
350@node Create Tags Table
351@subsection Creating Tags Tables
352@cindex @code{etags} program
353
354 The @code{etags} program is used to create a tags table file. It knows
355the syntax of several languages, as described in
356@iftex
357the previous section.
358@end iftex
359@ifnottex
360@ref{Tag Syntax}.
361@end ifnottex
362Here is how to run @code{etags}:
363
364@example
365etags @var{inputfiles}@dots{}
366@end example
367
368@noindent
369The @code{etags} program reads the specified files, and writes a tags
370table named @file{TAGS} in the current working directory.
371
372 If the specified files don't exist, @code{etags} looks for
373compressed versions of them and uncompresses them to read them. Under
374MS-DOS, @code{etags} also looks for file names like @file{mycode.cgz}
375if it is given @samp{mycode.c} on the command line and @file{mycode.c}
376does not exist.
377
378 @code{etags} recognizes the language used in an input file based on
379its file name and contents. You can specify the language with the
380@samp{--language=@var{name}} option, described below.
381
382 If the tags table data become outdated due to changes in the files
383described in the table, the way to update the tags table is the same
384way it was made in the first place. If the tags table fails to record
385a tag, or records it for the wrong file, then Emacs cannot possibly
386find its definition until you update the tags table. However, if the
387position recorded in the tags table becomes a little bit wrong (due to
388other editing), the worst consequence is a slight delay in finding the
389tag. Even if the stored position is very far wrong, Emacs will still
390find the tag, after searching most of the file for it. That delay is
391hardly noticeable with today's computers.
392
393 Thus, there is no need to update the tags table after each edit.
394You should update a tags table when you define new tags that you want
395to have listed, or when you move tag definitions from one file to
396another, or when changes become substantial.
397
398 One tags table can virtually include another. Specify the included
399tags file name with the @samp{--include=@var{file}} option when
400creating the file that is to include it. The latter file then acts as
401if it covered all the source files specified in the included file, as
402well as the files it directly contains.
403
404 If you specify the source files with relative file names when you run
405@code{etags}, the tags file will contain file names relative to the
406directory where the tags file was initially written. This way, you can
407move an entire directory tree containing both the tags file and the
408source files, and the tags file will still refer correctly to the source
409files. If the tags file is in @file{/dev}, however, the file names are
410made relative to the current working directory. This is useful, for
411example, when writing the tags to @file{/dev/stdout}.
412
413 When using a relative file name, it should not be a symbolic link
414pointing to a tags file in a different directory, because this would
415generally render the file names invalid.
416
417 If you specify absolute file names as arguments to @code{etags}, then
418the tags file will contain absolute file names. This way, the tags file
419will still refer to the same files even if you move it, as long as the
420source files remain in the same place. Absolute file names start with
421@samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows.
422
423 When you want to make a tags table from a great number of files, you
424may have problems listing them on the command line, because some systems
425have a limit on its length. The simplest way to circumvent this limit
426is to tell @code{etags} to read the file names from its standard input,
427by typing a dash in place of the file names, like this:
428
429@smallexample
430find . -name "*.[chCH]" -print | etags -
431@end smallexample
432
433 Use the option @samp{--language=@var{name}} to specify the language
434explicitly. You can intermix these options with file names; each one
435applies to the file names that follow it. Specify
436@samp{--language=auto} to tell @code{etags} to resume guessing the
437language from the file names and file contents. Specify
438@samp{--language=none} to turn off language-specific processing
439entirely; then @code{etags} recognizes tags by regexp matching alone
440(@pxref{Etags Regexps}).
441
442 The option @samp{--parse-stdin=@var{file}} is mostly useful when
443calling @code{etags} from programs. It can be used (only once) in
444place of a file name on the command line. @code{Etags} will read from
445standard input and mark the produced tags as belonging to the file
446@var{file}.
447
448 @samp{etags --help} outputs the list of the languages @code{etags}
449knows, and the file name rules for guessing the language. It also prints
450a list of all the available @code{etags} options, together with a short
451explanation. If followed by one or more @samp{--language=@var{lang}}
452options, it outputs detailed information about how tags are generated for
453@var{lang}.
454
455@node Etags Regexps
456@subsection Etags Regexps
457
458 The @samp{--regex} option provides a general way of recognizing tags
459based on regexp matching. You can freely intermix this option with
460file names, and each one applies to the source files that follow it.
461If you specify multiple @samp{--regex} options, all of them are used
462in parallel. The syntax is:
463
464@smallexample
465--regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers}
466@end smallexample
467
468 The essential part of the option value is @var{tagregexp}, the
469regexp for matching tags. It is always used anchored, that is, it
470only matches at the beginning of a line. If you want to allow
471indented tags, use a regexp that matches initial whitespace; start it
472with @samp{[ \t]*}.
473
474 In these regular expressions, @samp{\} quotes the next character, and
475all the GCC character escape sequences are supported (@samp{\a} for
476bell, @samp{\b} for back space, @samp{\d} for delete, @samp{\e} for
477escape, @samp{\f} for formfeed, @samp{\n} for newline, @samp{\r} for
478carriage return, @samp{\t} for tab, and @samp{\v} for vertical tab).
479
480 Ideally, @var{tagregexp} should not match more characters than are
481needed to recognize what you want to tag. If the syntax requires you
482to write @var{tagregexp} so it matches more characters beyond the tag
483itself, you should add a @var{nameregexp}, to pick out just the tag.
484This will enable Emacs to find tags more accurately and to do
485completion on tag names more reliably. You can find some examples
486below.
487
488 The @var{modifiers} are a sequence of zero or more characters that
489modify the way @code{etags} does the matching. A regexp with no
490modifiers is applied sequentially to each line of the input file, in a
491case-sensitive way. The modifiers and their meanings are:
492
493@table @samp
494@item i
495Ignore case when matching this regexp.
496@item m
497Match this regular expression against the whole file, so that
498multi-line matches are possible.
499@item s
500Match this regular expression against the whole file, and allow
501@samp{.} in @var{tagregexp} to match newlines.
502@end table
503
504 The @samp{-R} option cancels all the regexps defined by preceding
505@samp{--regex} options. It too applies to the file names following
506it. Here's an example:
507
508@smallexample
509etags --regex=/@var{reg1}/i voo.doo --regex=/@var{reg2}/m \
510 bar.ber -R --lang=lisp los.er
511@end smallexample
512
513@noindent
514Here @code{etags} chooses the parsing language for @file{voo.doo} and
515@file{bar.ber} according to their contents. @code{etags} also uses
516@var{reg1} to recognize additional tags in @file{voo.doo}, and both
517@var{reg1} and @var{reg2} to recognize additional tags in
518@file{bar.ber}. @var{reg1} is checked against each line of
519@file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while
520@var{reg2} is checked against the whole @file{bar.ber} file,
521permitting multi-line matches, in a case-sensitive way. @code{etags}
522uses only the Lisp tags rules, with no user-specified regexp matching,
523to recognize tags in @file{los.er}.
524
525 You can restrict a @samp{--regex} option to match only files of a
526given language by using the optional prefix @var{@{language@}}.
527(@samp{etags --help} prints the list of languages recognized by
528@code{etags}.) This is particularly useful when storing many
529predefined regular expressions for @code{etags} in a file. The
530following example tags the @code{DEFVAR} macros in the Emacs source
531files, for the C language only:
532
533@smallexample
534--regex='@{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/'
535@end smallexample
536
537@noindent
538When you have complex regular expressions, you can store the list of
539them in a file. The following option syntax instructs @code{etags} to
540read two files of regular expressions. The regular expressions
541contained in the second file are matched without regard to case.
542
543@smallexample
544--regex=@@@var{case-sensitive-file} --ignore-case-regex=@@@var{ignore-case-file}
545@end smallexample
546
547@noindent
548A regex file for @code{etags} contains one regular expression per
549line. Empty lines, and lines beginning with space or tab are ignored.
550When the first character in a line is @samp{@@}, @code{etags} assumes
551that the rest of the line is the name of another file of regular
552expressions; thus, one such file can include another file. All the
553other lines are taken to be regular expressions. If the first
554non-whitespace text on the line is @samp{--}, that line is a comment.
555
556 For example, we can create a file called @samp{emacs.tags} with the
557following contents:
558
559@smallexample
560 -- This is for GNU Emacs C source files
561@{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/\1/
562@end smallexample
563
564@noindent
565and then use it like this:
566
567@smallexample
568etags --regex=@@emacs.tags *.[ch] */*.[ch]
569@end smallexample
570
571 Here are some more examples. The regexps are quoted to protect them
572from shell interpretation.
573
574@itemize @bullet
575
576@item
577Tag Octave files:
578
579@smallexample
580etags --language=none \
581 --regex='/[ \t]*function.*=[ \t]*\([^ \t]*\)[ \t]*(/\1/' \
582 --regex='/###key \(.*\)/\1/' \
583 --regex='/[ \t]*global[ \t].*/' \
584 *.m
585@end smallexample
586
587@noindent
588Note that tags are not generated for scripts, so that you have to add
589a line by yourself of the form @samp{###key @var{scriptname}} if you
590want to jump to it.
591
592@item
593Tag Tcl files:
594
595@smallexample
596etags --language=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' *.tcl
597@end smallexample
598
599@item
600Tag VHDL files:
601
602@smallexample
603etags --language=none \
604 --regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' \
605 --regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\
606 \( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/'
607@end smallexample
608@end itemize
609
610@node Select Tags Table
611@subsection Selecting a Tags Table
612
613@vindex tags-file-name
614@findex visit-tags-table
615 Emacs has at any time one @dfn{selected} tags table, and all the
616commands for working with tags tables use the selected one. To select
617a tags table, type @kbd{M-x visit-tags-table}, which reads the tags
618table file name as an argument, with @file{TAGS} in the default
619directory as the default.
620
621 Emacs does not actually read in the tags table contents until you
622try to use them; all @code{visit-tags-table} does is store the file
623name in the variable @code{tags-file-name}, and setting the variable
624yourself is just as good. The variable's initial value is @code{nil};
625that value tells all the commands for working with tags tables that
626they must ask for a tags table file name to use.
627
628 Using @code{visit-tags-table} when a tags table is already loaded
629gives you a choice: you can add the new tags table to the current list
630of tags tables, or start a new list. The tags commands use all the tags
631tables in the current list. If you start a new list, the new tags table
632is used @emph{instead} of others. If you add the new table to the
633current list, it is used @emph{as well as} the others.
634
635@vindex tags-table-list
636 You can specify a precise list of tags tables by setting the variable
637@code{tags-table-list} to a list of strings, like this:
638
639@c keep this on two lines for formatting in smallbook
640@example
641@group
642(setq tags-table-list
643 '("~/emacs" "/usr/local/lib/emacs/src"))
644@end group
645@end example
646
647@noindent
648This tells the tags commands to look at the @file{TAGS} files in your
649@file{~/emacs} directory and in the @file{/usr/local/lib/emacs/src}
650directory. The order depends on which file you are in and which tags
651table mentions that file, as explained above.
652
653 Do not set both @code{tags-file-name} and @code{tags-table-list}.
654
655@node Find Tag
656@subsection Finding a Tag
657
658 The most important thing that a tags table enables you to do is to find
659the definition of a specific tag.
660
661@table @kbd
662@item M-.@: @var{tag} @key{RET}
663Find first definition of @var{tag} (@code{find-tag}).
664@item C-u M-.
665Find next alternate definition of last tag specified.
666@item C-u - M-.
667Go back to previous tag found.
668@item C-M-. @var{pattern} @key{RET}
669Find a tag whose name matches @var{pattern} (@code{find-tag-regexp}).
670@item C-u C-M-.
671Find the next tag whose name matches the last pattern used.
672@item C-x 4 .@: @var{tag} @key{RET}
673Find first definition of @var{tag}, but display it in another window
674(@code{find-tag-other-window}).
675@item C-x 5 .@: @var{tag} @key{RET}
676Find first definition of @var{tag}, and create a new frame to select the
677buffer (@code{find-tag-other-frame}).
678@item M-*
679Pop back to where you previously invoked @kbd{M-.} and friends.
680@end table
681
682@kindex M-.
683@findex find-tag
684 @kbd{M-.}@: (@code{find-tag}) is the command to find the definition of
685a specified tag. It searches through the tags table for that tag, as a
686string, and then uses the tags table info to determine the file that the
687definition is in and the approximate character position in the file of
688the definition. Then @code{find-tag} visits that file, moves point to
689the approximate character position, and searches ever-increasing
690distances away to find the tag definition.
691
692 If an empty argument is given (just type @key{RET}), the balanced
693expression in the buffer before or around point is used as the
694@var{tag} argument. @xref{Expressions}.
695
696 You don't need to give @kbd{M-.} the full name of the tag; a part
697will do. This is because @kbd{M-.} finds tags in the table which
698contain @var{tag} as a substring. However, it prefers an exact match
699to a substring match. To find other tags that match the same
700substring, give @code{find-tag} a numeric argument, as in @kbd{C-u
701M-.}; this does not read a tag name, but continues searching the tags
702table's text for another tag containing the same substring last used.
703If you have a real @key{META} key, @kbd{M-0 M-.}@: is an easier
704alternative to @kbd{C-u M-.}.
705
706@kindex C-x 4 .
707@findex find-tag-other-window
708@kindex C-x 5 .
709@findex find-tag-other-frame
710 Like most commands that can switch buffers, @code{find-tag} has a
711variant that displays the new buffer in another window, and one that
712makes a new frame for it. The former is @w{@kbd{C-x 4 .}}, which invokes
713the command @code{find-tag-other-window}. The latter is @w{@kbd{C-x 5 .}},
714which invokes @code{find-tag-other-frame}.
715
716 To move back to places you've found tags recently, use @kbd{C-u -
717M-.}; more generally, @kbd{M-.} with a negative numeric argument. This
718command can take you to another buffer. @w{@kbd{C-x 4 .}} with a negative
719argument finds the previous tag location in another window.
720
721@kindex M-*
722@findex pop-tag-mark
723@vindex find-tag-marker-ring-length
724 As well as going back to places you've found tags recently, you can go
725back to places @emph{from where} you found them. Use @kbd{M-*}, which
726invokes the command @code{pop-tag-mark}, for this. Typically you would
727find and study the definition of something with @kbd{M-.} and then
728return to where you were with @kbd{M-*}.
729
730 Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to
731a depth determined by the variable @code{find-tag-marker-ring-length}.
732
733@findex find-tag-regexp
734@kindex C-M-.
735 The command @kbd{C-M-.} (@code{find-tag-regexp}) visits the tags that
736match a specified regular expression. It is just like @kbd{M-.} except
737that it does regexp matching instead of substring matching.
738
739@node Tags Search
740@subsection Searching and Replacing with Tags Tables
741@cindex search and replace in multiple files
742@cindex multiple-file search and replace
743
744 The commands in this section visit and search all the files listed
745in the selected tags table, one by one. For these commands, the tags
746table serves only to specify a sequence of files to search. These
747commands scan the list of tags tables starting with the first tags
748table (if any) that describes the current file, proceed from there to
749the end of the list, and then scan from the beginning of the list
750until they have covered all the tables in the list.
751
752@table @kbd
753@item M-x tags-search @key{RET} @var{regexp} @key{RET}
754Search for @var{regexp} through the files in the selected tags
755table.
756@item M-x tags-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET}
757Perform a @code{query-replace-regexp} on each file in the selected tags table.
758@item M-,
759Restart one of the commands above, from the current location of point
760(@code{tags-loop-continue}).
761@end table
762
763@findex tags-search
764 @kbd{M-x tags-search} reads a regexp using the minibuffer, then
765searches for matches in all the files in the selected tags table, one
766file at a time. It displays the name of the file being searched so you
767can follow its progress. As soon as it finds an occurrence,
768@code{tags-search} returns.
769
770@kindex M-,
771@findex tags-loop-continue
772 Having found one match, you probably want to find all the rest. To find
773one more match, type @kbd{M-,} (@code{tags-loop-continue}) to resume the
774@code{tags-search}. This searches the rest of the current buffer, followed
775by the remaining files of the tags table.@refill
776
777@findex tags-query-replace
778 @kbd{M-x tags-query-replace} performs a single
779@code{query-replace-regexp} through all the files in the tags table. It
780reads a regexp to search for and a string to replace with, just like
781ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x
782tags-search}, but repeatedly, processing matches according to your
783input. @xref{Replace}, for more information on query replace.
784
785@vindex tags-case-fold-search
786@cindex case-sensitivity and tags search
787 You can control the case-sensitivity of tags search commands by
788customizing the value of the variable @code{tags-case-fold-search}. The
789default is to use the same setting as the value of
790@code{case-fold-search} (@pxref{Search Case}).
791
792 It is possible to get through all the files in the tags table with a
793single invocation of @kbd{M-x tags-query-replace}. But often it is
794useful to exit temporarily, which you can do with any input event that
795has no special query replace meaning. You can resume the query replace
796subsequently by typing @kbd{M-,}; this command resumes the last tags
797search or replace command that you did.
798
799 The commands in this section carry out much broader searches than the
800@code{find-tag} family. The @code{find-tag} commands search only for
801definitions of tags that match your substring or regexp. The commands
802@code{tags-search} and @code{tags-query-replace} find every occurrence
803of the regexp, as ordinary search commands and replace commands do in
804the current buffer.
805
806 These commands create buffers only temporarily for the files that they
807have to search (those which are not already visited in Emacs buffers).
808Buffers in which no match is found are quickly killed; the others
809continue to exist.
810
811 It may have struck you that @code{tags-search} is a lot like
812@code{grep}. You can also run @code{grep} itself as an inferior of
813Emacs and have Emacs show you the matching lines one by one.
814@xref{Grep Searching}.
815
816@node List Tags
817@subsection Tags Table Inquiries
818
819@table @kbd
820@item M-x list-tags @key{RET} @var{file} @key{RET}
821Display a list of the tags defined in the program file @var{file}.
822@item M-x tags-apropos @key{RET} @var{regexp} @key{RET}
823Display a list of all tags matching @var{regexp}.
824@end table
825
826@findex list-tags
827 @kbd{M-x list-tags} reads the name of one of the files described by
828the selected tags table, and displays a list of all the tags defined in
829that file. The ``file name'' argument is really just a string to
830compare against the file names recorded in the tags table; it is read as
831a string rather than as a file name. Therefore, completion and
832defaulting are not available, and you must enter the file name the same
833way it appears in the tags table. Do not include a directory as part of
834the file name unless the file name recorded in the tags table includes a
835directory.
836
837@findex tags-apropos
838@vindex tags-apropos-verbose
839 @kbd{M-x tags-apropos} is like @code{apropos} for tags
840(@pxref{Apropos}). It finds all the tags in the selected tags table
841whose entries match @var{regexp}, and displays them. If the variable
842@code{tags-apropos-verbose} is non-@code{nil}, it displays the names
843of the tags files together with the tag names.
844
845@vindex tags-tag-face
846@vindex tags-apropos-additional-actions
847 You can customize the appearance of the output by setting the
848variable @code{tags-tag-face} to a face. You can display additional
849output with @kbd{M-x tags-apropos} by customizing the variable
850@code{tags-apropos-additional-actions}---see its documentation for
851details.
852
853 You can also use the collection of tag names to complete a symbol
854name in the buffer. @xref{Symbol Completion}.
855
856@ifnottex
857@include emerge-xtra.texi
858@end ifnottex
859
860@ignore
861 arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb
862@end ignore
diff --git a/doc/emacs/major.texi b/doc/emacs/major.texi
new file mode 100644
index 00000000000..1cb76ee5fdf
--- /dev/null
+++ b/doc/emacs/major.texi
@@ -0,0 +1,206 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Major Modes, Indentation, International, Top
6@chapter Major Modes
7@cindex major modes
8@cindex mode, major
9@kindex TAB @r{(and major modes)}
10@kindex DEL @r{(and major modes)}
11@kindex C-j @r{(and major modes)}
12
13 Emacs provides many alternative @dfn{major modes}, each of which
14customizes Emacs for editing text of a particular sort. The major modes
15are mutually exclusive, and each buffer has one major mode at any time.
16The mode line normally shows the name of the current major mode, in
17parentheses (@pxref{Mode Line}).
18
19 The least specialized major mode is called @dfn{Fundamental mode}.
20This mode has no mode-specific redefinitions or variable settings, so
21that each Emacs command behaves in its most general manner, and each
22user option variable is in its default state. For editing text of a
23specific type that Emacs knows about, such as Lisp code or English
24text, you should switch to the appropriate major mode, such as Lisp
25mode or Text mode.
26
27 Selecting a major mode changes the meanings of a few keys to become
28more specifically adapted to the language being edited. The ones that
29are changed frequently are @key{TAB}, @key{DEL}, and @kbd{C-j}. The
30prefix key @kbd{C-c} normally contains mode-specific commands. In
31addition, the commands which handle comments use the mode to determine
32how comments are to be delimited. Many major modes redefine the
33syntactical properties of characters appearing in the buffer.
34@xref{Syntax}.
35
36 The major modes fall into three major groups. The first group
37contains modes for normal text, either plain or with mark-up. It
38includes Text mode, HTML mode, SGML mode, @TeX{} mode and Outline
39mode. The second group contains modes for specific programming
40languages. These include Lisp mode (which has several variants), C
41mode, Fortran mode, and others. The remaining major modes are not
42intended for use on users' files; they are used in buffers created for
43specific purposes by Emacs, such as Dired mode for buffers made by
44Dired (@pxref{Dired}), Mail mode for buffers made by @kbd{C-x m}
45(@pxref{Sending Mail}), and Shell mode for buffers used for
46communicating with an inferior shell process (@pxref{Interactive
47Shell}).
48
49 Most programming-language major modes specify that only blank lines
50separate paragraphs. This is to make the paragraph commands useful.
51(@xref{Paragraphs}.) They also cause Auto Fill mode to use the
52definition of @key{TAB} to indent the new lines it creates. This is
53because most lines in a program are usually indented
54(@pxref{Indentation}).
55
56@menu
57* Choosing Modes:: How major modes are specified or chosen.
58@end menu
59
60@node Choosing Modes,,Major Modes,Major Modes
61@section How Major Modes are Chosen
62
63@cindex choosing a major mode
64 You can select a major mode explicitly for the current buffer, but
65most of the time Emacs determines which mode to use based on the file
66name or on special text in the file.
67
68 To explicitly select a new major, you use an @kbd{M-x} command.
69Take the name of a major mode and add @code{-mode} to get the name of
70the command to select that mode. Thus, you can enter Lisp mode by
71executing @kbd{M-x lisp-mode}.
72
73@vindex auto-mode-alist
74 When you visit a file, Emacs usually chooses the right major mode based
75on the file's name. For example, files whose names end in @samp{.c} are
76edited in C mode. The correspondence between file names and major modes is
77controlled by the variable @code{auto-mode-alist}. Its value is a list in
78which each element has this form,
79
80@example
81(@var{regexp} . @var{mode-function})
82@end example
83
84@noindent
85or this form,
86
87@example
88(@var{regexp} @var{mode-function} @var{flag})
89@end example
90
91@noindent
92For example, one element normally found in the list has the form
93@code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C
94mode for files whose names end in @file{.c}. (Note that @samp{\\} is
95needed in Lisp syntax to include a @samp{\} in the string, which must
96be used to suppress the special meaning of @samp{.} in regexps.) If
97the element has the form @code{(@var{regexp} @var{mode-function}
98@var{flag})} and @var{flag} is non-@code{nil}, then after calling
99@var{mode-function}, Emacs discards the suffix that matched
100@var{regexp} and searches the list again for another match.
101
102@vindex magic-mode-alist
103 Sometimes the major mode is determined from the way the file's text
104begins. The variable @code{magic-mode-alist} controls this. Its value
105is a list of elements of these forms:
106
107@example
108(@var{regexp} . @var{mode-function})
109(@var{match-function} . @var{mode-function})
110@end example
111
112@noindent
113The first form looks like an element of @code{auto-mode-alist}, but it
114doesn't work the same: this @var{regexp} is matched against the text
115at the start of the buffer, not against the file name. Likewise, the
116second form calls @var{match-function} at the beginning of the buffer,
117and if the function returns non-@code{nil}, the @var{mode-function} is
118called. @code{magic-mode-alist} takes priority over
119@code{auto-mode-alist}.
120
121 You can specify the major mode to use for editing a certain file by
122special text in the first nonblank line of the file. The
123mode name should appear in this line both preceded and followed by
124@samp{-*-}. Other text may appear on the line as well. For example,
125
126@example
127;-*-Lisp-*-
128@end example
129
130@noindent
131tells Emacs to use Lisp mode. Such an explicit specification overrides
132any defaults based on the file name. Note how the semicolon is used
133to make Lisp treat this line as a comment.
134
135 Another format of mode specification is
136
137@example
138-*- mode: @var{modename};-*-
139@end example
140
141@noindent
142which allows you to specify local variables as well, like this:
143
144@example
145-*- mode: @var{modename}; @var{var}: @var{value}; @dots{} -*-
146@end example
147
148@noindent
149@xref{File Variables}, for more information about this.
150
151@vindex auto-mode-case-fold
152 On systems with case-insensitive file names, only a single
153case-insensitive search through the @code{auto-mode-alist} is made.
154On other systems, Emacs normally performs a single case-sensitive
155search through the alist, but if you set this variable to a
156non-@code{nil} value, Emacs will perform a second case-insensitive
157search if the first search fails.
158
159@vindex interpreter-mode-alist
160 When a file's contents begin with @samp{#!}, it can serve as an
161executable shell command, which works by running an interpreter named on
162the file's first line. The rest of the file is used as input to the
163interpreter.
164
165 When you visit such a file in Emacs, if the file's name does not
166specify a major mode, Emacs uses the interpreter name on the first line
167to choose a mode. If the first line is the name of a recognized
168interpreter program, such as @samp{perl} or @samp{tcl}, Emacs uses a
169mode appropriate for programs for that interpreter. The variable
170@code{interpreter-mode-alist} specifies the correspondence between
171interpreter program names and major modes.
172
173 When the first line starts with @samp{#!}, you cannot (on many
174systems) use the @samp{-*-} feature on the first line, because the
175system would get confused when running the interpreter. So Emacs looks
176for @samp{-*-} on the second line in such files as well as on the
177first line.
178
179@vindex default-major-mode
180 When you visit a file that does not specify a major mode to use, or
181when you create a new buffer with @kbd{C-x b}, the variable
182@code{default-major-mode} specifies which major mode to use. Normally
183its value is the symbol @code{fundamental-mode}, which specifies
184Fundamental mode. If @code{default-major-mode} is @code{nil}, the major
185mode is taken from the previously current buffer.
186
187@findex normal-mode
188 If you change the major mode of a buffer, you can go back to the major
189mode Emacs would choose automatically: use the command @kbd{M-x
190normal-mode} to do this. This is the same function that
191@code{find-file} calls to choose the major mode. It also processes
192the file's @samp{-*-} line or local variables list (if any).
193@xref{File Variables}.
194
195@vindex change-major-mode-with-file-name
196 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to
197a new major mode if the new file name implies a mode (@pxref{Saving}).
198(@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.)
199However, this does not happen if the buffer contents specify a major
200mode, and certain ``special'' major modes do not allow the mode to
201change. You can turn off this mode-changing feature by setting
202@code{change-major-mode-with-file-name} to @code{nil}.
203
204@ignore
205 arch-tag: f2558800-cf32-4839-8acb-7d3b4df2a155
206@end ignore
diff --git a/doc/emacs/makefile.w32-in b/doc/emacs/makefile.w32-in
new file mode 100644
index 00000000000..e7185cd9c03
--- /dev/null
+++ b/doc/emacs/makefile.w32-in
@@ -0,0 +1,144 @@
1#### -*- Makefile -*- for the Emacs Manual and other documentation.
2
3# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4
5# This file is part of GNU Emacs.
6
7# GNU Emacs is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3, or (at your option)
10# any later version.
11
12# GNU Emacs is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with GNU Emacs; see the file COPYING. If not, write to
19# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20# Boston, MA 02110-1301, USA.
21
22# Where to find the source code. The source code for Emacs's C kernel is
23# expected to be in $(srcdir)/src, and the source code for Emacs's
24# utility programs is expected to be in $(srcdir)/lib-src. This is
25# set by the configure script's `--srcdir' option.
26srcdir=.
27
28infodir = $(srcdir)/../info
29
30# The makeinfo program is part of the Texinfo distribution.
31MAKEINFO = makeinfo --force
32MULTI_INSTALL_INFO = $(srcdir)\..\..\nt\multi-install-info.bat
33INFO_TARGETS = $(infodir)/emacs
34DVI_TARGETS = emacs.dvi
35INFOSOURCES = info.texi
36
37# The following rule does not work with all versions of `make'.
38.SUFFIXES: .texi .dvi
39.texi.dvi:
40 texi2dvi $<
41
42TEXI2DVI = texi2dvi
43ENVADD = $(srcdir)\..\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \
44 "MAKEINFO=$(MAKEINFO) -I$(srcdir)" /C
45
46EMACS_XTRA=\
47 $(srcdir)/arevert-xtra.texi \
48 $(srcdir)/cal-xtra.texi \
49 $(srcdir)/dired-xtra.texi \
50 $(srcdir)/picture-xtra.texi \
51 $(srcdir)/emerge-xtra.texi \
52 $(srcdir)/vc-xtra.texi \
53 $(srcdir)/vc1-xtra.texi \
54 $(srcdir)/vc2-xtra.texi \
55 $(srcdir)/fortran-xtra.texi \
56 $(srcdir)/msdog-xtra.texi
57
58EMACSSOURCES= \
59 $(srcdir)/emacs.texi \
60 $(srcdir)/doclicense.texi \
61 $(srcdir)/screen.texi \
62 $(srcdir)/commands.texi \
63 $(srcdir)/entering.texi \
64 $(srcdir)/basic.texi \
65 $(srcdir)/mini.texi \
66 $(srcdir)/m-x.texi \
67 $(srcdir)/help.texi \
68 $(srcdir)/mark.texi \
69 $(srcdir)/killing.texi \
70 $(srcdir)/regs.texi \
71 $(srcdir)/display.texi \
72 $(srcdir)/search.texi \
73 $(srcdir)/fixit.texi \
74 $(srcdir)/files.texi \
75 $(srcdir)/buffers.texi \
76 $(srcdir)/windows.texi \
77 $(srcdir)/frames.texi \
78 $(srcdir)/mule.texi \
79 $(srcdir)/major.texi \
80 $(srcdir)/indent.texi \
81 $(srcdir)/text.texi \
82 $(srcdir)/programs.texi \
83 $(srcdir)/building.texi \
84 $(srcdir)/maintaining.texi \
85 $(srcdir)/abbrevs.texi \
86 $(srcdir)/sending.texi \
87 $(srcdir)/rmail.texi \
88 $(srcdir)/dired.texi \
89 $(srcdir)/calendar.texi \
90 $(srcdir)/misc.texi \
91 $(srcdir)/custom.texi \
92 $(srcdir)/trouble.texi \
93 $(srcdir)/cmdargs.texi \
94 $(srcdir)/xresources.texi \
95 $(srcdir)/anti.texi \
96 $(srcdir)/macos.texi \
97 $(srcdir)/msdog.texi \
98 $(srcdir)/gnu.texi \
99 $(srcdir)/glossary.texi \
100 $(srcdir)/ack.texi \
101 $(srcdir)/kmacro.texi \
102 $(EMACS_XTRA)
103
104info: $(INFO_TARGETS)
105
106dvi: $(DVI_TARGETS)
107
108# Note that all the Info targets build the Info files
109# in srcdir. There is no provision for Info files
110# to exist in the build directory.
111# In a distribution of Emacs, the Info files should be up to date.
112
113$(infodir)/dir:
114 $(MULTI_INSTALL_INFO) --info-dir=$(infodir) $(INFO_TARGETS)
115
116$(infodir)/emacs: $(EMACSSOURCES)
117 $(MAKEINFO) emacs.texi
118
119emacs.dvi: $(EMACSSOURCES)
120 $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs.texi
121
122emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA)
123 $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi
124
125mostlyclean:
126 - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.*
127
128clean: mostlyclean
129 - $(DEL) *.dvi
130 - $(DEL) $(infodir)/emacs*
131
132distclean: clean
133
134maintainer-clean: distclean
135 - $(DEL) *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc
136# Don't delete these, because they are outside the current directory.
137# for file in $(INFO_TARGETS); do rm -f $${file}*; done
138
139
140# Formerly this directory had texindex.c and getopt.c in it
141# and this makefile built them to make texindex.
142# That caused trouble because this is run entirely in the source directory.
143# Since we expect to get texi2dvi from elsewhere,
144# it is ok to expect texindex from elsewhere also.
diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi
new file mode 100644
index 00000000000..be446ab6bfc
--- /dev/null
+++ b/doc/emacs/mark.texi
@@ -0,0 +1,452 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Mark, Killing, Help, Top
6@chapter The Mark and the Region
7@cindex mark
8@cindex setting a mark
9@cindex region
10
11 Many Emacs commands operate on an arbitrary contiguous part of the
12current buffer. To specify the text for such a command to operate on,
13you set @dfn{the mark} at one end of it, and move point to the other
14end. The text between point and the mark is called @dfn{the region}.
15Emacs highlights the region whenever there is one, if you enable
16Transient Mark mode (@pxref{Transient Mark}).
17
18 Certain Emacs commands set the mark; other editing commands do not
19affect it, so the mark remains where you set it last. Each Emacs
20buffer has its own mark, and setting the mark in one buffer has no
21effect on other buffers' marks. When you return to a buffer that was
22current earlier, its mark is at the same place as before.
23
24 The ends of the region are always point and the mark. It doesn't
25matter which of them was put in its current place first, or which one
26comes earlier in the text---the region starts from point or the mark
27(whichever comes first), and ends at point or the mark (whichever
28comes last). Every time you move point, or set the mark in a new
29place, the region changes.
30
31 Many commands that insert text, such as @kbd{C-y} (@code{yank}) and
32@kbd{M-x insert-buffer}, position point and the mark at opposite ends
33of the inserted text, so that the region consists of the text just
34inserted.
35
36 Aside from delimiting the region, the mark is also useful for
37remembering a spot that you may want to go back to. To make this
38feature more useful, each buffer remembers 16 previous locations of the
39mark in the @dfn{mark ring}.
40
41@menu
42* Setting Mark:: Commands to set the mark.
43* Transient Mark:: How to make Emacs highlight the region--
44 when there is one.
45* Momentary Mark:: Enabling Transient Mark mode momentarily.
46* Using Region:: Summary of ways to operate on contents of the region.
47* Marking Objects:: Commands to put region around textual units.
48* Mark Ring:: Previous mark positions saved so you can go back there.
49* Global Mark Ring:: Previous mark positions in various buffers.
50@end menu
51
52@node Setting Mark
53@section Setting the Mark
54
55 Here are some commands for setting the mark:
56
57@table @kbd
58@item C-@key{SPC}
59Set the mark where point is (@code{set-mark-command}).
60@item C-@@
61The same.
62@item C-x C-x
63Interchange mark and point (@code{exchange-point-and-mark}).
64@item Drag-Mouse-1
65Set point and the mark around the text you drag across.
66@item Mouse-3
67Set the mark where point is, then move point to where you click
68(@code{mouse-save-then-kill}).
69@end table
70
71 For example, suppose you wish to convert part of the buffer to
72upper case, using the @kbd{C-x C-u} (@code{upcase-region}) command,
73which operates on the text in the region. You can first go to the
74beginning of the text to be capitalized, type @kbd{C-@key{SPC}} to put
75the mark there, move to the end, and then type @kbd{C-x C-u}. Or, you
76can set the mark at the end of the text, move to the beginning, and then
77type @kbd{C-x C-u}.
78
79@kindex C-SPC
80@findex set-mark-command
81 The most common way to set the mark is with the @kbd{C-@key{SPC}} command
82(@code{set-mark-command}). This sets the mark where point is. Then you
83can move point away, leaving the mark behind.
84
85 There are two ways to set the mark with the mouse. You can drag mouse
86button one across a range of text; that puts point where you release the
87mouse button, and sets the mark at the other end of that range. Or you
88can click mouse button three, which sets the mark at point (like
89@kbd{C-@key{SPC}}) and then moves point where you clicked (like
90@kbd{Mouse-1}).
91
92 Using the mouse to mark a region copies the region into the kill
93ring in addition to setting the mark; that gives behavior consistent
94with other window-driven applications. If you don't want to modify
95the kill ring, you must use keyboard commands to set the mark.
96@xref{Mouse Commands}.
97
98@kindex C-x C-x
99@findex exchange-point-and-mark
100 When Emacs was developed, terminals had only one cursor, so Emacs
101does not show where the mark is located--you have to remember. If you
102enable Transient Mark mode (see below), then the region is highlighted
103when it is active; you can tell mark is at the other end of the
104highlighted region. But this only applies when the mark is active.
105
106 The usual solution to this problem is to set the mark and then use
107it soon, before you forget where it is. Alternatively, you can see
108where the mark is with the command @kbd{C-x C-x}
109(@code{exchange-point-and-mark}) which puts the mark where point was
110and point where the mark was. The extent of the region is unchanged,
111but the cursor and point are now at the previous position of the mark.
112In Transient Mark mode, this command also reactivates the mark.
113
114 @kbd{C-x C-x} is also useful when you are satisfied with the position
115of point but want to move the other end of the region (where the mark
116is); do @kbd{C-x C-x} to put point at that end of the region, and then
117move it. Using @kbd{C-x C-x} a second time, if necessary, puts the mark at
118the new position with point back at its original position.
119
120 For more facilities that allow you to go to previously set marks, see
121@ref{Mark Ring}.
122
123@kindex C-@@
124 There is no such character as @kbd{C-@key{SPC}} in @acronym{ASCII};
125when you type @key{SPC} while holding down @key{CTRL} on a text
126terminal, what you get is the character @kbd{C-@@}. This key is also
127bound to @code{set-mark-command}--so unless you are unlucky enough to
128have a text terminal where typing @kbd{C-@key{SPC}} does not produce
129@kbd{C-@@}, you might as well think of this character as
130@kbd{C-@key{SPC}}.
131
132@node Transient Mark
133@section Transient Mark Mode
134@cindex mode, Transient Mark
135@cindex Transient Mark mode
136@cindex highlighting region
137@cindex region highlighting
138
139 On a terminal that supports colors, Emacs has the ability to
140highlight the current region. But normally it does not. Why not?
141
142 In the normal mode of use, every command that sets the mark also
143activates it, and nothing ever deactivates it. Thus, once you have
144set the mark in a buffer, there is @emph{always} a region in that
145buffer. Highlighting the region all the time would be a nuisance. So
146normally Emacs highlights the region only immediately after you have
147selected one with the mouse.
148
149 If you want region highlighting, you can use Transient Mark mode.
150This is a more rigid mode of operation in which the region ``lasts''
151only until you use it; operating on the region text deactivates the
152mark, so there is no region any more. Therefore, you must explicitly
153set up a region for each command that uses one.
154
155 When Transient Mark mode is enabled, Emacs highlights the region,
156whenever there is a region. In Transient Mark mode, most of the time
157there is no region; therefore, highlighting the region when it exists
158is useful and not annoying.
159
160@findex transient-mark-mode
161 To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}.
162This command toggles the mode; you can use the same command to turn
163the mode off again.
164
165 Here are the details of Transient Mark mode:
166
167@itemize @bullet
168@item
169To set the mark, type @kbd{C-@key{SPC}} (@code{set-mark-command}).
170This makes the mark active and thus begins highlighting of the region.
171As you move point, you will see the highlighted region grow and
172shrink.
173
174@item
175The mouse commands for specifying the mark also make it active. So do
176keyboard commands whose purpose is to specify a region, including
177@kbd{M-@@}, @kbd{C-M-@@}, @kbd{M-h}, @kbd{C-M-h}, @kbd{C-x C-p}, and
178@kbd{C-x h}.
179
180@item
181You can tell that the mark is active because the region is highlighted.
182
183@item
184When the mark is active, you can execute commands that operate on the
185region, such as killing, indenting, or writing to a file.
186
187@item
188Any change to the buffer, such as inserting or deleting a character,
189deactivates the mark. This means any subsequent command that operates
190on a region will get an error and refuse to operate. You can make the
191region active again by typing @kbd{C-x C-x}.
192
193@item
194If Delete Selection mode is also enabled, some commands delete the
195region when used while the mark is active. @xref{Mouse Commands}.
196
197@item
198Quitting with @kbd{C-g} deactivates the mark.
199
200@item
201Commands like @kbd{M->} and @kbd{C-s}, that ``leave the mark behind'' in
202addition to some other primary purpose, do not activate the new mark.
203You can activate the new region by executing @kbd{C-x C-x}
204(@code{exchange-point-and-mark}).
205
206@item
207Commands that normally set the mark before moving long distances (like
208@kbd{M-<} and @kbd{C-s}) do not alter the mark in Transient Mark mode
209when the mark is active.
210
211@item
212Some commands operate on the region if a region is active. For
213instance, @kbd{C-x u} in Transient Mark mode operates on the region,
214when there is a region. (Outside Transient Mark mode, you must type
215@kbd{C-u C-x u} if you want it to operate on the region.)
216@xref{Undo}. Other commands that act this way are identified in their
217own documentation.
218@end itemize
219
220 The highlighting of the region uses the @code{region} face; you can
221customize the appearance of the highlighted region by changing this
222face. @xref{Face Customization}.
223
224@vindex highlight-nonselected-windows
225 When multiple windows show the same buffer, they can have different
226regions, because they can have different values of point (though they
227all share one common mark position). Ordinarily, only the selected
228window highlights its region (@pxref{Windows}). However, if the
229variable @code{highlight-nonselected-windows} is non-@code{nil}, then
230each window highlights its own region (provided that Transient Mark mode
231is enabled and the mark in the window's buffer is active).
232
233@vindex mark-even-if-inactive
234 If the variable @code{mark-even-if-inactive} is non-@code{nil} in
235Transient Mark mode, then commands can use the mark and the region
236even when it is inactive. Region highlighting appears and disappears
237just as it normally does in Transient Mark mode, but the mark doesn't
238really go away when the highlighting disappears, so you can still use
239region commands.
240
241@cindex Zmacs mode
242 Transient Mark mode is also sometimes known as ``Zmacs mode''
243because the Zmacs editor on the MIT Lisp Machine handled the mark in a
244similar way.
245
246@node Momentary Mark
247@section Using Transient Mark Mode Momentarily
248
249 If you don't like Transient Mark mode in general, you might still
250want to use it once in a while. To do this, type @kbd{C-@key{SPC}
251C-@key{SPC}} or @kbd{C-u C-x C-x}. These commands set or activate the
252mark, and enable Transient Mark mode only until the mark is
253deactivated.
254
255@table @kbd
256@item C-@key{SPC} C-@key{SPC}
257@kindex C-@key{SPC} C-@key{SPC}
258Set the mark at point (like plain @kbd{C-@key{SPC}}), and enable
259Transient Mark mode just once until the mark is deactivated. (This is
260not really a separate command; you are using the @kbd{C-@key{SPC}}
261command twice.)
262
263@item C-u C-x C-x
264@kindex C-u C-x C-x
265Activate the mark without changing it; enable Transient Mark mode just
266once, until the mark is deactivated. (This is the @kbd{C-x C-x}
267command, @code{exchange-point-and-mark}, with a prefix argument.)
268@end table
269
270 One of the secondary features of Transient Mark mode is that certain
271commands operate only on the region, when there is an active region.
272If you don't use Transient Mark mode, the region once set never
273becomes inactive, so there is no way for these commands to make such a
274distinction. Enabling Transient Mark mode momentarily gives you a way
275to use these commands on the region.
276
277 Momentary use of Transient Mark mode is also a way to highlight the
278region for the time being.
279
280@node Using Region
281@section Operating on the Region
282
283@cindex operations on a marked region
284 Once you have a region and the mark is active, here are some of the
285ways you can operate on the region:
286
287@itemize @bullet
288@item
289Kill it with @kbd{C-w} (@pxref{Killing}).
290@item
291Save it in a register with @kbd{C-x r s} (@pxref{Registers}).
292@item
293Save it in a buffer or a file (@pxref{Accumulating Text}).
294@item
295Convert case with @kbd{C-x C-l} or @kbd{C-x C-u} (@pxref{Case}).
296@item
297Indent it with @kbd{C-x @key{TAB}} or @kbd{C-M-\} (@pxref{Indentation}).
298@item
299Fill it as text with @kbd{M-x fill-region} (@pxref{Filling}).
300@item
301Print hardcopy with @kbd{M-x print-region} (@pxref{Printing}).
302@item
303Evaluate it as Lisp code with @kbd{M-x eval-region} (@pxref{Lisp Eval}).
304@item
305Undo changes within it using @kbd{C-u C-x u} (@pxref{Undo}).
306@end itemize
307
308 Most commands that operate on the text in the region have the word
309@code{region} in their names.
310
311@node Marking Objects
312@section Commands to Mark Textual Objects
313
314@cindex marking sections of text
315 Here are the commands for placing point and the mark around a textual
316object such as a word, list, paragraph or page.
317
318@table @kbd
319@item M-@@
320Set mark after end of next word (@code{mark-word}). This command and
321the following one do not move point.
322@item C-M-@@
323Set mark after end of following balanced expression (@code{mark-sexp}).
324@item M-h
325Put region around current paragraph (@code{mark-paragraph}).
326@item C-M-h
327Put region around current defun (@code{mark-defun}).
328@item C-x h
329Put region around the entire buffer (@code{mark-whole-buffer}).
330@item C-x C-p
331Put region around current page (@code{mark-page}).
332@end table
333
334@kbd{M-@@} (@code{mark-word}) puts the mark at the end of the next
335word, while @kbd{C-M-@@} (@code{mark-sexp}) puts it at the end of the
336next balanced expression (@pxref{Expressions}). These commands handle
337arguments just like @kbd{M-f} and @kbd{C-M-f}. Repeating these
338commands extends the region. For example, you can type either
339@kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words. These
340commands also extend the region in Transient Mark mode, regardless of
341the last command.
342
343@kindex C-x h
344@findex mark-whole-buffer
345 Other commands set both point and mark, to delimit an object in the
346buffer. For example, @kbd{M-h} (@code{mark-paragraph}) moves point to
347the beginning of the paragraph that surrounds or follows point, and
348puts the mark at the end of that paragraph (@pxref{Paragraphs}). It
349prepares the region so you can indent, case-convert, or kill a whole
350paragraph. With a prefix argument, if the argument's value is positive,
351@kbd{M-h} marks that many paragraphs starting with the one surrounding
352point. If the prefix argument is @minus{}@var{n}, @kbd{M-h} also
353marks @var{n} paragraphs, running back form the one surrounding point.
354In that last case, point moves forward to the end of that paragraph,
355and the mark goes at the start of the region. Repeating the @kbd{M-h}
356command extends the region to subsequent paragraphs.
357
358 @kbd{C-M-h} (@code{mark-defun}) similarly puts point before, and the
359mark after, the current (or following) major top-level definition, or
360defun (@pxref{Moving by Defuns}). Repeating @kbd{C-M-h} extends
361the region to subsequent defuns.
362
363 @kbd{C-x C-p} (@code{mark-page}) puts point before the current page,
364and mark at the end (@pxref{Pages}). The mark goes after the
365terminating page delimiter (to include it in the region), while point
366goes after the preceding page delimiter (to exclude it). A numeric
367argument specifies a later page (if positive) or an earlier page (if
368negative) instead of the current page.
369
370 Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire
371buffer as the region, by putting point at the beginning and the mark at
372the end. (In some programs this is called ``select all.'')
373
374 In Transient Mark mode, all of these commands activate the mark.
375
376@node Mark Ring
377@section The Mark Ring
378
379@kindex C-u C-SPC
380@cindex mark ring
381@kindex C-u C-@@
382 Aside from delimiting the region, the mark is also useful for
383remembering a spot that you may want to go back to. To make this
384feature more useful, each buffer remembers 16 previous locations of the
385mark, in the @dfn{mark ring}. Commands that set the mark also push the
386old mark onto this ring. To return to a marked location, use @kbd{C-u
387C-@key{SPC}} (or @kbd{C-u C-@@}); this is the command
388@code{set-mark-command} given a numeric argument. It moves point to
389where the mark was, and restores the mark from the ring of former
390marks.
391
392@vindex set-mark-command-repeat-pop
393 If you set @code{set-mark-command-repeat-pop} to non-@code{nil},
394then when you repeat the character @kbd{C-@key{SPC}} after typing
395@kbd{C-u C-@key{SPC}}, each repetition moves point to a previous mark
396position from the ring. The mark positions you move through in this
397way are not lost; they go to the end of the ring.
398
399 Each buffer has its own mark ring. All editing commands use the current
400buffer's mark ring. In particular, @kbd{C-u C-@key{SPC}} always stays in
401the same buffer.
402
403 Many commands that can move long distances, such as @kbd{M-<}
404(@code{beginning-of-buffer}), start by setting the mark and saving the
405old mark on the mark ring. This is to make it easier for you to move
406back later. Searches set the mark if they move point. However, in
407Transient Mark mode, these commands do not set the mark when the mark
408is already active. You can tell when a command sets the mark because
409it displays @samp{Mark set} in the echo area.
410
411 If you want to move back to the same place over and over, the mark
412ring may not be convenient enough. If so, you can record the position
413in a register for later retrieval (@pxref{RegPos,, Saving Positions in
414Registers}).
415
416@vindex mark-ring-max
417 The variable @code{mark-ring-max} specifies the maximum number of
418entries to keep in the mark ring. If that many entries exist and
419another one is pushed, the earliest one in the list is discarded. Repeating
420@kbd{C-u C-@key{SPC}} cycles through the positions currently in the
421ring.
422
423@vindex mark-ring
424 The variable @code{mark-ring} holds the mark ring itself, as a list of
425marker objects, with the most recent first. This variable is local in
426every buffer.
427
428@node Global Mark Ring
429@section The Global Mark Ring
430@cindex global mark ring
431
432 In addition to the ordinary mark ring that belongs to each buffer,
433Emacs has a single @dfn{global mark ring}. It records a sequence of
434buffers in which you have recently set the mark, so you can go back
435to those buffers.
436
437 Setting the mark always makes an entry on the current buffer's mark
438ring. If you have switched buffers since the previous mark setting, the
439new mark position makes an entry on the global mark ring also. The
440result is that the global mark ring records a sequence of buffers that
441you have been in, and, for each buffer, a place where you set the mark.
442
443@kindex C-x C-@key{SPC}
444@findex pop-global-mark
445 The command @kbd{C-x C-@key{SPC}} (@code{pop-global-mark}) jumps to
446the buffer and position of the latest entry in the global ring. It also
447rotates the ring, so that successive uses of @kbd{C-x C-@key{SPC}} take
448you to earlier and earlier buffers.
449
450@ignore
451 arch-tag: f35e4d82-911b-4cfc-a3d7-3c87b2abba20
452@end ignore
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi
new file mode 100644
index 00000000000..b57e79420b6
--- /dev/null
+++ b/doc/emacs/mini.texi
@@ -0,0 +1,580 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Minibuffer, M-x, Basic, Top
6@chapter The Minibuffer
7@cindex minibuffer
8
9 The @dfn{minibuffer} is where Emacs commands read complicated
10arguments (anything more a single number). We call it the
11``minibuffer'' because it's a special-purpose buffer with a small
12amount of screen space. Minibuffer arguments can be file names,
13buffer names, Lisp function names, Emacs command names, Lisp
14expressions, and many other things---whatever the command wants to
15read. You can use the usual Emacs editing commands in the minibuffer
16to edit the argument text.
17
18@cindex prompt
19 When the minibuffer is in use, it appears in the echo area, with a
20cursor. The minibuffer display starts with a @dfn{prompt} in a
21distinct color; it says what kind of input is expected and how it will
22be used. Often the prompt is derived from the name of the command
23that is reading the argument. The prompt normally ends with a colon.
24
25@cindex default argument
26 Sometimes a @dfn{default argument} appears in the prompt, inside
27parentheses before the colon. The default will be used as the
28argument value if you just type @key{RET}. For example, commands that
29read buffer names show a buffer name as the default. You can type
30@key{RET} to operate on that default buffer.
31
32 The simplest way to enter a minibuffer argument is to type the text,
33then @key{RET} to exit the minibuffer. You can cancel the minibuffer,
34and the command that wants the argument, by typing @kbd{C-g}.
35
36 Since the minibuffer appears in the echo area, it can conflict with
37other uses of the echo area. Here is how Emacs handles such
38conflicts:
39
40@itemize @bullet
41@item
42An error occurs while the minibuffer is active.
43
44The error message hides the minibuffer for a few seconds, or until you
45type something. Then the minibuffer comes back.
46
47@item
48A command such as @kbd{C-x =} needs to display a message in the echo
49area.
50
51The message hides the minibuffer for a few seconds, or until you type
52something. Then the minibuffer comes back.
53
54@item
55Keystrokes don't echo while the minibuffer is in use.
56@end itemize
57
58@menu
59* File: Minibuffer File. Entering file names with the minibuffer.
60* Edit: Minibuffer Edit. How to edit in the minibuffer.
61* Completion:: An abbreviation facility for minibuffer input.
62* Minibuffer History:: Reusing recent minibuffer arguments.
63* Repetition:: Re-executing commands that used the minibuffer.
64@end menu
65
66@node Minibuffer File
67@section Minibuffers for File Names
68
69 When you use the minibuffer to enter a file name, it starts out with
70some initial text---the @dfn{default directory}, ending in a slash.
71The file you specify will be in this directory unless you alter or
72replace it.
73
74@c Separate paragraph to clean up ugly page break--rms
75@need 1500
76 For example, if the minibuffer starts out with these contents:
77
78@example
79Find File: /u2/emacs/src/
80@end example
81
82@noindent
83(where @samp{Find File:@: } is the prompt), and you type
84@kbd{buffer.c} as input, that specifies the file
85@file{/u2/emacs/src/buffer.c}. You can specify the parent directory
86by adding @file{..}; thus, if you type @kbd{../lisp/simple.el}, you
87will get @file{/u2/emacs/lisp/simple.el}. Alternatively, you can use
88@kbd{M-@key{DEL}} to kill the directory names you don't want
89(@pxref{Words}).
90
91 You can kill the entire default with @kbd{C-a C-k}, but there's no
92need to do that. It's easier to ignore the default, and enter an
93absolute file name starting with a slash or a tilde after the default
94directory. For example, to specify @file{/etc/termcap}, just type
95that name:
96
97@example
98Find File: /u2/emacs/src//etc/termcap
99@end example
100
101@noindent
102@cindex // in file name
103@cindex double slash in file name
104@cindex slashes repeated in file name
105@findex file-name-shadow-mode
106GNU Emacs interprets a double slash (which is not normally useful in
107file names) as, ``ignore everything before the second slash in the
108pair.'' In the example above. @samp{/u2/emacs/src/} is ignored, so
109you get @file{/etc/termcap}. The ignored part of the file name is
110dimmed if the terminal allows it; to disable this dimming, turn off
111File Name Shadow mode (a minor mode) with the command
112@kbd{M-x file-name-shadow-mode}.
113
114 If the variable @code{insert-default-directory} is @code{nil}, the
115default directory is never inserted in the minibuffer---so the
116minibuffer starts out empty. Nonetheless, relative file name
117arguments are still interpreted based on the same default directory.
118
119@node Minibuffer Edit
120@section Editing in the Minibuffer
121
122 The minibuffer is an Emacs buffer (albeit a peculiar one), and the
123usual Emacs commands are available for editing the argument text.
124
125 Since @key{RET} in the minibuffer is defined to exit the minibuffer,
126you can't use it to insert a newline in the minibuffer. To do that,
127type @kbd{C-o} or @kbd{C-q C-j}. (The newline character is really the
128@acronym{ASCII} character control-J.)
129
130 The minibuffer has its own window, which normally has space in the
131frame at all times, but it only acts like an Emacs window when the
132minibuffer is active. When active, this window is much like any other
133Emacs window; for instance, you can switch to another window (with
134@kbd{C-x o}), edit text there, then return to the minibuffer window to
135finish the argument. You can even kill text in another window, return
136to the minibuffer window, and then yank the text into the argument.
137@xref{Windows}.
138
139@cindex height of minibuffer
140@cindex size of minibuffer
141@cindex growing minibuffer
142@cindex resizing minibuffer
143 There are some restrictions on the minibuffer window, however: you
144cannot kill it, or split it, or switch buffers in it---the minibuffer
145and its window are permanently attached.
146
147@vindex resize-mini-windows
148 The minibuffer window expands vertically as necessary to hold the
149text that you put in the minibuffer. If @code{resize-mini-windows} is
150@code{t} (the default), the window always resizes as needed by its
151contents. If its value is the symbol @code{grow-only}, the window
152grows automatically as needed, but shrinks (back to the normal size)
153only when the minibuffer becomes inactive. If its value is
154@code{nil}, you have to adjust the height yourself.
155
156@vindex max-mini-window-height
157 The variable @code{max-mini-window-height} controls the maximum
158height for resizing the minibuffer window: a floating-point number
159specifies a fraction of the frame's height; an integer specifies the
160maximum number of lines; @code{nil} means do not resize the minibuffer
161window automatically. The default value is 0.25.
162
163 The @kbd{C-M-v} command in the minibuffer scrolls the help text from
164commands that display help text of any sort in another window.
165@kbd{M-@key{PAGEUP}} and @kbd{M-@key{PAGEDOWN}} also operate on that
166help text. This is especially useful with long lists of possible
167completions. @xref{Other Window}.
168
169@vindex enable-recursive-minibuffers
170 Emacs normally disallows most commands that use the minibuffer while
171the minibuffer is active. (Entering the minibuffer from the
172minibuffer can be confusing.) To allow such commands in the
173minibuffer, set the variable @code{enable-recursive-minibuffers} to
174@code{t}.
175
176@node Completion
177@section Completion
178@cindex completion
179
180 Some arguments allow @dfn{completion} to enter their value. This
181means that after you type part of the argument, Emacs can fill in the
182rest, or some of it, based on what you have typed so far.
183
184 When completion is available, certain keys---@key{TAB}, @key{RET},
185and @key{SPC}---are rebound to complete the text in the minibuffer
186before point into a longer string chosen from a set of @dfn{completion
187alternatives} provided by the command that requested the argument.
188(@key{SPC} does not do completion in reading file names, because it is
189common to use spaces in file names on some systems.) @kbd{?} displays
190a list of the possible completions at any time.
191
192 For example, @kbd{M-x} uses the minibuffer to read the name of a
193command, so it provides a list of all Emacs command names for
194completion candidates. The completion keys match the minibuffer text
195against these candidates, find any additional name characters implied
196by the text already present in the minibuffer, and add those
197characters. This makes it possible to type @kbd{M-x ins @key{SPC} b
198@key{RET}} instead of @kbd{M-x insert-buffer @key{RET}}, for example.
199
200 Case is significant in completion when it is significant in the
201argument you are entering (buffer names, file names, command names,
202for instance). Thus, @samp{fo} does not complete to @samp{Foo}.
203Completion ignores case distinctions for certain arguments in which
204case does not matter.
205
206 Completion acts only on the text before point. If there is text in
207the minibuffer after point---i.e., if you move point backward after
208typing some text into the minibuffer---it remains unchanged.
209
210@menu
211* Example: Completion Example. Examples of using completion.
212* Commands: Completion Commands. A list of completion commands.
213* Strict Completion:: Different types of completion.
214* Options: Completion Options. Options for completion.
215@end menu
216
217@node Completion Example
218@subsection Completion Example
219
220@kindex TAB @r{(completion)}
221 A concrete example may help here. If you type @kbd{M-x au
222@key{TAB}}, the @key{TAB} looks for alternatives (in this case,
223command names) that start with @samp{au}. There are several,
224including @code{auto-fill-mode} and @code{auto-save-mode}, but they
225all begin with @code{auto-}, so the @samp{au} in the minibuffer
226completes to @samp{auto-}.
227
228 If you type @key{TAB} again immediately, it cannot determine the
229next character; it could be any of @samp{cfilrs}. So it does not add
230any characters; instead, @key{TAB} displays a list of all possible
231completions in another window.
232
233 Now type @kbd{f @key{TAB}}. This @key{TAB} sees @samp{auto-f}. The
234only command name starting with that is @code{auto-fill-mode}, so
235completion fills in the rest of that. You have been able to enter
236@samp{auto-fill-mode} by typing just @kbd{au @key{TAB} f @key{TAB}}.
237
238@node Completion Commands
239@subsection Completion Commands
240
241 Here is a list of the completion commands defined in the minibuffer
242when completion is allowed.
243
244@table @kbd
245@item @key{TAB}
246@findex minibuffer-complete
247Complete the text before point in the minibuffer as much as possible
248(@code{minibuffer-complete}).
249@item @key{SPC}
250Complete up to one word from the minibuffer text before point
251(@code{minibuffer-complete-word}). @key{SPC} for completion is not
252available when entering a file name, since file names often include
253spaces.
254@item @key{RET}
255Submit the text in the minibuffer as the argument, possibly completing
256first as described
257@iftex
258in the next subsection (@code{minibuffer-complete-and-exit}).
259@end iftex
260@ifnottex
261in the next node (@code{minibuffer-complete-and-exit}). @xref{Strict
262Completion}.
263@end ifnottex
264@item ?
265Display a list of possible completions of the text before point
266(@code{minibuffer-completion-help}).
267@end table
268
269@kindex SPC
270@findex minibuffer-complete-word
271 @key{SPC} completes like @key{TAB}, but only up to the next hyphen
272or space. If you have @samp{auto-f} in the minibuffer and type
273@key{SPC}, it finds that the completion is @samp{auto-fill-mode}, but
274it only inserts @samp{ill-}, giving @samp{auto-fill-}. Another
275@key{SPC} at this point completes all the way to
276@samp{auto-fill-mode}. The command that implements this behavior is
277called @code{minibuffer-complete-word}.
278
279 When you display a list of possible completions, you can choose
280one from it:
281
282@table @kbd
283@findex mouse-choose-completion
284@item Mouse-1
285@itemx Mouse-2
286Clicking mouse button 1 or 2 on a completion possibility chooses that
287completion (@code{mouse-choose-completion}). You must click in the
288list of completions, not in the minibuffer.
289
290@findex switch-to-completions
291@item @key{PRIOR}
292@itemx M-v
293Typing @key{PRIOR} or @key{PAGE-UP}, or @kbd{M-v}, while in the
294minibuffer, selects the window showing the completion list buffer
295(@code{switch-to-completions}). This paves the way for using the
296commands below. (Selecting that window in other ways has the same
297effect.)
298
299@findex choose-completion
300@item @key{RET}
301Typing @key{RET} @emph{in the completion list buffer} chooses the
302completion that point is in or next to (@code{choose-completion}). To
303use this command, you must first switch to the completion list window.
304
305@findex next-completion
306@item @key{RIGHT}
307Typing the right-arrow key @key{RIGHT} @emph{in the completion list
308buffer} moves point to the following completion possibility
309(@code{next-completion}).
310
311@findex previous-completion
312@item @key{LEFT}
313Typing the left-arrow key @key{LEFT} @emph{in the completion list
314buffer} moves point to the previous completion possibility
315(@code{previous-completion}).
316@end table
317
318@node Strict Completion
319@subsection Strict Completion
320
321 There are three different ways that @key{RET} can do completion,
322depending on how the argument will be used.
323
324@itemize @bullet
325@item
326@dfn{Strict} completion accepts only known completion candidates. For
327example, when @kbd{C-x k} reads the name of a buffer to kill, only the
328name of an existing buffer makes sense. In strict completion,
329@key{RET} refuses to exit if the text in the minibuffer does not
330complete to an exact match.
331
332@item
333@dfn{Cautious} completion is similar to strict completion, except that
334@key{RET} exits only if the text is an already exact match.
335Otherwise, @key{RET} does not exit, but it does complete the text. If
336that completes to an exact match, a second @key{RET} will exit.
337
338Cautious completion is used for reading file names for files that must
339already exist, for example.
340
341@item
342@dfn{Permissive} completion allows any input; the completion
343candidates are just suggestions. For example, when @kbd{C-x C-f}
344reads the name of a file to visit, any file name is allowed, including
345nonexistent file (in case you want to create a file). In permissive
346completion, @key{RET} does not complete, it just submits the argument
347as you have entered it.
348@end itemize
349
350 The completion commands display a list of all possible completions
351whenever they can't determine even one more character by completion.
352Also, typing @kbd{?} explicitly requests such a list. You can scroll
353the list with @kbd{C-M-v} (@pxref{Other Window}).
354
355@node Completion Options
356@subsection Completion Options
357
358@vindex completion-ignored-extensions
359@cindex ignored file names, in completion
360 When completing file names, certain file names are usually ignored.
361The variable @code{completion-ignored-extensions} contains a list of
362strings; a file name ending in any of those strings is ignored as a
363completion candidate. The standard value of this variable has several
364elements including @code{".o"}, @code{".elc"}, @code{".dvi"} and
365@code{"~"}. The effect is that, for example, @samp{foo} can complete
366to @samp{foo.c} even though @samp{foo.o} exists as well. However, if
367@emph{all} the possible completions end in ``ignored'' strings, then
368they are not ignored. Displaying a list of possible completions
369disregards @code{completion-ignored-extensions}; it shows them all.
370
371 If an element of @code{completion-ignored-extensions} ends in a
372slash (@file{/}), it's a subdirectory name; then that directory and
373its contents are ignored. Elements of
374@code{completion-ignored-extensions} which do not end in a slash are
375ordinary file names, and do not apply to names of directories.
376
377@vindex completion-auto-help
378 If @code{completion-auto-help} is set to @code{nil}, the completion
379commands never display a list of possibilities; you must type @kbd{?}
380to display the list.
381
382@cindex Partial Completion mode
383@vindex partial-completion-mode
384@findex partial-completion-mode
385 Partial Completion mode implements a more powerful kind of
386completion that can complete multiple words in parallel. For example,
387it can complete the command name abbreviation @code{p-b} into
388@code{print-buffer} if no other command starts with two words whose
389initials are @samp{p} and @samp{b}.
390
391 To enable this mode, use @kbd{M-x partial-completion-mode}, or
392customize the variable @code{partial-completion-mode}. This mode
393binds special partial completion commands to @key{TAB}, @key{SPC},
394@key{RET}, and @kbd{?} in the minibuffer. The usual completion
395commands are available on @kbd{M-@key{TAB}} (or @kbd{C-M-i}),
396@kbd{M-@key{SPC}}, @kbd{M-@key{RET}} and @kbd{M-?}.
397
398 Partial completion of directories in file names uses @samp{*} to
399indicate the places for completion; thus, @file{/u*/b*/f*} might
400complete to @file{/usr/bin/foo}. For remote files, partial completion
401enables completion of methods, user names and host names.
402@xref{Remote Files}.
403
404@vindex PC-include-file-path
405@vindex PC-disable-includes
406 Partial Completion mode also extends @code{find-file} so that
407@samp{<@var{include}>} looks for the file named @var{include} in the
408directories in the path @code{PC-include-file-path}. If you set
409@code{PC-disable-includes} to non-@code{nil}, this feature is
410disabled.
411
412@cindex Icomplete mode
413@findex icomplete-mode
414 Icomplete mode presents a constantly-updated display that tells you
415what completions are available for the text you've entered so far. The
416command to enable or disable this minor mode is @kbd{M-x
417icomplete-mode}.
418
419@node Minibuffer History
420@section Minibuffer History
421@cindex minibuffer history
422@cindex history of minibuffer input
423
424 Every argument that you enter with the minibuffer is saved on a
425@dfn{minibuffer history list} so you can easily use it again later.
426Special commands fetch the text of an earlier argument into the
427minibuffer, replacing the old minibuffer contents. You can think of
428them as moving through the history of previous arguments.
429
430@table @kbd
431@item @key{UP}
432@itemx M-p
433Move to the previous item in the minibuffer history, an earlier argument
434(@code{previous-history-element}).
435@item @key{DOWN}
436@itemx M-n
437Move to the next item in the minibuffer history
438(@code{next-history-element}).
439@item M-r @var{regexp} @key{RET}
440Move to an earlier item in the minibuffer history that
441matches @var{regexp} (@code{previous-matching-history-element}).
442@item M-s @var{regexp} @key{RET}
443Move to a later item in the minibuffer history that matches
444@var{regexp} (@code{next-matching-history-element}).
445@end table
446
447@kindex M-p @r{(minibuffer history)}
448@kindex M-n @r{(minibuffer history)}
449@findex next-history-element
450@findex previous-history-element
451 To move through the minibuffer history list one item at a time, use
452@kbd{M-p} or up-arrow (@code{previous-history-element}) to fetch the
453next earlier minibuffer input, and use @kbd{M-n} or down-arrow
454(@code{next-history-element}) to fetch the next later input. These
455commands don't move the cursor, they pull different saved strings into
456the minibuffer. But you can think of them as ``moving'' through the
457history list.
458
459 The input that you fetch from the history entirely replaces the
460contents of the minibuffer. To use it again unchanged, just type
461@key{RET}. You can also edit the text before you reuse it; this does
462not change the history element that you ``moved'' to, but your new
463argument does go at the end of the history list in its own right.
464
465 For many minibuffer arguments there is a ``default'' value. You can
466insert the default value into the minibuffer as text by using
467@kbd{M-n}. You can think of this as moving ``into the future'' in the
468history.
469
470@findex previous-matching-history-element
471@findex next-matching-history-element
472@kindex M-r @r{(minibuffer history)}
473@kindex M-s @r{(minibuffer history)}
474 There are also commands to search forward or backward through the
475history; they search for history elements that match a regular
476expression. @kbd{M-r} (@code{previous-matching-history-element})
477searches older elements in the history, while @kbd{M-s}
478(@code{next-matching-history-element}) searches newer elements. These
479commands are unusual; they use the minibuffer to read the regular
480expression even though they are invoked from the minibuffer. As with
481incremental searching, an upper-case letter in the regular expression
482makes the search case-sensitive (@pxref{Search Case}).
483
484@ignore
485 We may change the precise way these commands read their arguments.
486Perhaps they will search for a match for the string given so far in the
487minibuffer; perhaps they will search for a literal match rather than a
488regular expression match; perhaps they will only accept matches at the
489beginning of a history element; perhaps they will read the string to
490search for incrementally like @kbd{C-s}. To find out what interface is
491actually available, type @kbd{C-h f previous-matching-history-element}.
492@end ignore
493
494 All uses of the minibuffer record your input on a history list, but
495there are separate history lists for different kinds of arguments.
496For example, there is a list for file names, used by all the commands
497that read file names. (As a special feature, this history list
498records the absolute file name, even if the name you entered was not
499absolute.)
500
501 There are several other specific history lists, including one for
502buffer names, one for arguments of commands like @code{query-replace},
503one used by @kbd{M-x} for command names, and one used by
504@code{compile} for compilation commands. Finally, there is one
505``miscellaneous'' history list that most minibuffer arguments use.
506
507@vindex history-length
508 The variable @code{history-length} specifies the maximum length of a
509minibuffer history list; adding a new element deletes the oldest
510element if the list gets too long. If the value of
511@code{history-length} is @code{t}, though, there is no maximum length.
512
513@vindex history-delete-duplicates
514 The variable @code{history-delete-duplicates} specifies whether to
515delete duplicates in history. If it is @code{t}, adding a new element
516deletes from the list all other elements that are equal to it.
517
518@node Repetition
519@section Repeating Minibuffer Commands
520@cindex command history
521@cindex history of commands
522
523 Every command that uses the minibuffer once is recorded on a special
524history list, the @dfn{command history}, together with the values of
525its arguments, so that you can repeat the entire command. In
526particular, every use of @kbd{M-x} is recorded there, since @kbd{M-x}
527uses the minibuffer to read the command name.
528
529@findex list-command-history
530@table @kbd
531@item C-x @key{ESC} @key{ESC}
532Re-execute a recent minibuffer command from the command history
533 (@code{repeat-complex-command}).
534@item M-x list-command-history
535Display the entire command history, showing all the commands
536@kbd{C-x @key{ESC} @key{ESC}} can repeat, most recent first.
537@end table
538
539@kindex C-x ESC ESC
540@findex repeat-complex-command
541 @kbd{C-x @key{ESC} @key{ESC}} is used to re-execute a recent command
542that used the minibuffer. With no argument, it repeats the last such
543command. A numeric argument specifies which command to repeat; 1
544means the last one, 2 the previous, and so on.
545
546 @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command
547into a Lisp expression and then entering a minibuffer initialized with
548the text for that expression. Even if you don't understand Lisp
549syntax, it will probably be obvious which command is displayed for
550repetition. If you type just @key{RET}, that repeats the command
551unchanged. You can also change the command by editing the Lisp
552expression before you execute it. The repeated command is added to
553the front of the command history unless it is identical to the most
554recently item.
555
556 Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you can
557use the minibuffer history commands (@kbd{M-p}, @kbd{M-n}, @kbd{M-r},
558@kbd{M-s}; @pxref{Minibuffer History}) to move through the history list
559of saved entire commands. After finding the desired previous command,
560you can edit its expression as usual and then repeat it by typing
561@key{RET}.
562
563@vindex isearch-resume-in-command-history
564 Incremental search does not, strictly speaking, use the minibuffer.
565Therefore, although it behaves like a complex command, it normally
566does not appear in the history list for @kbd{C-x @key{ESC} @key{ESC}}.
567You can make incremental search commands appear in the history by
568setting @code{isearch-resume-in-command-history} to a non-@code{nil}
569value. @xref{Incremental Search}.
570
571@vindex command-history
572 The list of previous minibuffer-using commands is stored as a Lisp
573list in the variable @code{command-history}. Each element is a Lisp
574expression which describes one command and its arguments. Lisp programs
575can re-execute a command by calling @code{eval} with the
576@code{command-history} element.
577
578@ignore
579 arch-tag: ba913cfd-b70e-400f-b663-22b2c309227f
580@end ignore
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
new file mode 100644
index 00000000000..c4cdea4359d
--- /dev/null
+++ b/doc/emacs/misc.texi
@@ -0,0 +1,2559 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@iftex
6@chapter Miscellaneous Commands
7
8 This chapter contains several brief topics that do not fit anywhere
9else: reading netnews, running shell commands and shell subprocesses,
10using a single shared Emacs for utilities that expect to run an editor
11as a subprocess, printing hardcopy, sorting text, narrowing display to
12part of the buffer, editing double-column files and binary files,
13saving an Emacs session for later resumption, following hyperlinks,
14browsing images, emulating other editors, and various diversions and
15amusements.
16
17@end iftex
18
19@ifnottex
20@raisesections
21@end ifnottex
22
23@node Gnus, Shell, Calendar/Diary, Top
24@section Gnus
25@cindex Gnus
26@cindex reading netnews
27
28Gnus is an Emacs package primarily designed for reading and posting
29Usenet news. It can also be used to read and respond to messages from a
30number of other sources---mail, remote directories, digests, and so on.
31
32Here we introduce Gnus and describe several basic features.
33@ifnottex
34For full details, see @ref{Top, Gnus,, gnus, The Gnus Manual}.
35@end ifnottex
36@iftex
37For full details on Gnus, type @kbd{M-x info} and then select the Gnus
38manual.
39@end iftex
40
41@findex gnus
42To start Gnus, type @kbd{M-x gnus @key{RET}}.
43
44@menu
45* Buffers of Gnus:: The group, summary, and article buffers.
46* Gnus Startup:: What you should know about starting Gnus.
47* Summary of Gnus:: A short description of the basic Gnus commands.
48@end menu
49
50@node Buffers of Gnus
51@subsection Gnus Buffers
52
53Unlike most Emacs packages, Gnus uses several buffers to display
54information and to receive commands. The three Gnus buffers users use
55most are the @dfn{group buffer}, the @dfn{summary buffer} and the
56@dfn{article buffer}.
57
58The @dfn{group buffer} contains a list of newsgroups. This is the
59first buffer Gnus displays when it starts up. It normally displays
60only the groups to which you subscribe and that contain unread
61articles. Use this buffer to select a specific group.
62
63The @dfn{summary buffer} lists one line for each article in a single
64group. By default, the author, the subject and the line number are
65displayed for each article, but this is customizable, like most aspects
66of Gnus display. The summary buffer is created when you select a group
67in the group buffer, and is killed when you exit the group. Use this
68buffer to select an article.
69
70The @dfn{article buffer} displays the article. In normal Gnus usage,
71you see this buffer but you don't select it---all useful
72article-oriented commands work in the summary buffer. But you can
73select the article buffer, and execute all Gnus commands from that
74buffer, if you want to.
75
76@node Gnus Startup
77@subsection When Gnus Starts Up
78
79At startup, Gnus reads your @file{.newsrc} news initialization file
80and attempts to communicate with the local news server, which is a
81repository of news articles. The news server need not be the same
82computer you are logged in on.
83
84If you start Gnus and connect to the server, but do not see any
85newsgroups listed in the group buffer, type @kbd{L} or @kbd{A k} to get
86a listing of all the groups. Then type @kbd{u} to toggle
87subscription to groups.
88
89The first time you start Gnus, Gnus subscribes you to a few selected
90groups. All other groups start out as @dfn{killed groups} for you; you
91can list them with @kbd{A k}. All new groups that subsequently come to
92exist at the news server become @dfn{zombie groups} for you; type @kbd{A
93z} to list them. You can subscribe to a group shown in these lists
94using the @kbd{u} command.
95
96When you quit Gnus with @kbd{q}, it automatically records in your
97@file{.newsrc} and @file{.newsrc.eld} initialization files the
98subscribed or unsubscribed status of all groups. You should normally
99not edit these files manually, but you may if you know how.
100
101@node Summary of Gnus
102@subsection Summary of Gnus Commands
103
104Reading news is a two-step process:
105
106@enumerate
107@item
108Choose a group in the group buffer.
109
110@item
111Select articles from the summary buffer. Each article selected is
112displayed in the article buffer in a large window, below the summary
113buffer in its small window.
114@end enumerate
115
116 Each Gnus buffer has its own special commands; the meanings of any
117given key in the various Gnus buffers are usually analogous, even if
118not identical. Here are commands for the group and summary buffers:
119
120@table @kbd
121@kindex q @r{(Gnus Group mode)}
122@findex gnus-group-exit
123@item q
124In the group buffer, update your @file{.newsrc} initialization file
125and quit Gnus.
126
127In the summary buffer, exit the current group and return to the
128group buffer. Thus, typing @kbd{q} twice quits Gnus.
129
130@kindex L @r{(Gnus Group mode)}
131@findex gnus-group-list-all-groups
132@item L
133In the group buffer, list all the groups available on your news
134server (except those you have killed). This may be a long list!
135
136@kindex l @r{(Gnus Group mode)}
137@findex gnus-group-list-groups
138@item l
139In the group buffer, list only the groups to which you subscribe and
140which contain unread articles.
141
142@kindex u @r{(Gnus Group mode)}
143@findex gnus-group-unsubscribe-current-group
144@cindex subscribe groups
145@cindex unsubscribe groups
146@item u
147In the group buffer, unsubscribe from (or subscribe to) the group listed
148in the line that point is on. When you quit Gnus by typing @kbd{q},
149Gnus lists in your @file{.newsrc} file which groups you have subscribed
150to. The next time you start Gnus, you won't see this group,
151because Gnus normally displays only subscribed-to groups.
152
153@kindex C-k @r{(Gnus)}
154@findex gnus-group-kill-group
155@item C-k
156In the group buffer, ``kill'' the current line's group---don't
157even list it in @file{.newsrc} from now on. This affects future
158Gnus sessions as well as the present session.
159
160When you quit Gnus by typing @kbd{q}, Gnus writes information
161in the file @file{.newsrc} describing all newsgroups except those you
162have ``killed.''
163
164@kindex SPC @r{(Gnus)}
165@findex gnus-group-read-group
166@item @key{SPC}
167In the group buffer, select the group on the line under the cursor
168and display the first unread article in that group.
169
170@need 1000
171In the summary buffer,
172
173@itemize @bullet
174@item
175Select the article on the line under the cursor if none is selected.
176
177@item
178Scroll the text of the selected article (if there is one).
179
180@item
181Select the next unread article if at the end of the current article.
182@end itemize
183
184Thus, you can move through all the articles by repeatedly typing @key{SPC}.
185
186@kindex DEL @r{(Gnus)}
187@item @key{DEL}
188In the group buffer, move point to the previous group containing
189unread articles.
190
191@findex gnus-summary-prev-page
192In the summary buffer, scroll the text of the article backwards.
193
194@kindex n @r{(Gnus)}
195@findex gnus-group-next-unread-group
196@findex gnus-summary-next-unread-article
197@item n
198Move point to the next unread group, or select the next unread article.
199
200@kindex p @r{(Gnus)}
201@findex gnus-group-prev-unread-group
202@findex gnus-summary-prev-unread-article
203@item p
204Move point to the previous unread group, or select the previous
205unread article.
206
207@kindex C-n @r{(Gnus Group mode)}
208@findex gnus-group-next-group
209@kindex C-p @r{(Gnus Group mode)}
210@findex gnus-group-prev-group
211@kindex C-n @r{(Gnus Summary mode)}
212@findex gnus-summary-next-subject
213@kindex C-p @r{(Gnus Summary mode)}
214@findex gnus-summary-prev-subject
215@item C-n
216@itemx C-p
217Move point to the next or previous item, even if it is marked as read.
218This does not select the article or group on that line.
219
220@kindex s @r{(Gnus Summary mode)}
221@findex gnus-summary-isearch-article
222@item s
223In the summary buffer, do an incremental search of the current text in
224the article buffer, just as if you switched to the article buffer and
225typed @kbd{C-s}.
226
227@kindex M-s @r{(Gnus Summary mode)}
228@findex gnus-summary-search-article-forward
229@item M-s @var{regexp} @key{RET}
230In the summary buffer, search forward for articles containing a match
231for @var{regexp}.
232
233@end table
234
235@ignore
236@node Where to Look
237@subsection Where to Look Further
238
239@c Too many references to the name of the manual if done with xref in TeX!
240Gnus is powerful and customizable. Here are references to a few
241@ifnottex
242additional topics:
243
244@end ifnottex
245@iftex
246additional topics in @cite{The Gnus Manual}:
247
248@itemize @bullet
249@item
250Follow discussions on specific topics.@*
251See section ``Threading.''
252
253@item
254Read digests. See section ``Document Groups.''
255
256@item
257Refer to and jump to the parent of the current article.@*
258See section ``Finding the Parent.''
259
260@item
261Refer to articles by using Message-IDs included in the messages.@*
262See section ``Article Keymap.''
263
264@item
265Save articles. See section ``Saving Articles.''
266
267@item
268Have Gnus score articles according to various criteria, like author
269name, subject, or string in the body of the articles.@*
270See section ``Scoring.''
271
272@item
273Send an article to a newsgroup.@*
274See section ``Composing Messages.''
275@end itemize
276@end iftex
277@ifnottex
278@itemize @bullet
279@item
280Follow discussions on specific topics.@*
281@xref{Threading, , Reading Based on Conversation Threads,
282gnus, The Gnus Manual}.
283
284@item
285Read digests. @xref{Document Groups, , , gnus, The Gnus Manual}.
286
287@item
288Refer to and jump to the parent of the current article.@*
289@xref{Finding the Parent, , , gnus, The Gnus Manual}.
290
291@item
292Refer to articles by using Message-IDs included in the messages.@*
293@xref{Article Keymap, , , gnus, The Gnus Manual}.
294
295@item
296Save articles. @xref{Saving Articles, , , gnus, The Gnus Manual}.
297
298@item
299Have Gnus score articles according to various criteria, like author
300name, subject, or string in the body of the articles.@*
301@xref{Scoring, , , gnus, The Gnus Manual}.
302
303@item
304Send an article to a newsgroup.@*
305@xref{Composing Messages, , , gnus, The Gnus Manual}.
306@end itemize
307@end ifnottex
308@end ignore
309
310@node Shell, Emacs Server, Gnus, Top
311@section Running Shell Commands from Emacs
312@cindex subshell
313@cindex shell commands
314
315 Emacs has commands for passing single command lines to inferior shell
316processes; it can also run a shell interactively with input and output
317to an Emacs buffer named @samp{*shell*} or run a shell inside a terminal
318emulator window.
319
320@table @kbd
321@item M-! @var{cmd} @key{RET}
322Run the shell command line @var{cmd} and display the output
323(@code{shell-command}).
324@item M-| @var{cmd} @key{RET}
325Run the shell command line @var{cmd} with region contents as input;
326optionally replace the region with the output
327(@code{shell-command-on-region}).
328@item M-x shell
329Run a subshell with input and output through an Emacs buffer.
330You can then give commands interactively.
331@item M-x term
332Run a subshell with input and output through an Emacs buffer.
333You can then give commands interactively.
334Full terminal emulation is available.
335@end table
336
337 @kbd{M-x eshell} invokes a shell implemented entirely in Emacs. It
338is documented in a separate manual. @xref{Top,Eshell,Eshell, eshell,
339Eshell: The Emacs Shell}.
340
341@menu
342* Single Shell:: How to run one shell command and return.
343* Interactive Shell:: Permanent shell taking input via Emacs.
344* Shell Mode:: Special Emacs commands used with permanent shell.
345* Shell Prompts:: Two ways to recognize shell prompts.
346* History: Shell History. Repeating previous commands in a shell buffer.
347* Directory Tracking:: Keeping track when the subshell changes directory.
348* Options: Shell Options. Options for customizing Shell mode.
349* Terminal emulator:: An Emacs window as a terminal emulator.
350* Term Mode:: Special Emacs commands used in Term mode.
351* Paging in Term:: Paging in the terminal emulator.
352* Remote Host:: Connecting to another computer.
353@end menu
354
355@node Single Shell
356@subsection Single Shell Commands
357
358@kindex M-!
359@findex shell-command
360 @kbd{M-!} (@code{shell-command}) reads a line of text using the
361minibuffer and executes it as a shell command in a subshell made just
362for that command. Standard input for the command comes from the null
363device. If the shell command produces any output, the output appears
364either in the echo area (if it is short), or in an Emacs buffer named
365@samp{*Shell Command Output*}, which is displayed in another window
366but not selected (if the output is long).
367
368 For instance, one way to decompress a file @file{foo.gz} from Emacs
369is to type @kbd{M-! gunzip foo.gz @key{RET}}. That shell command
370normally creates the file @file{foo} and produces no terminal output.
371
372 A numeric argument, as in @kbd{M-1 M-!}, says to insert terminal
373output into the current buffer instead of a separate buffer. It puts
374point before the output, and sets the mark after the output. For
375instance, @kbd{M-1 M-! gunzip < foo.gz @key{RET}} would insert the
376uncompressed equivalent of @file{foo.gz} into the current buffer.
377
378 If the shell command line ends in @samp{&}, it runs asynchronously.
379For a synchronous shell command, @code{shell-command} returns the
380command's exit status (0 means success), when it is called from a Lisp
381program. You do not get any status information for an asynchronous
382command, since it hasn't finished yet when @code{shell-command} returns.
383
384@kindex M-|
385@findex shell-command-on-region
386 @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!} but
387passes the contents of the region as the standard input to the shell
388command, instead of no input. With a numeric argument, meaning insert
389the output in the current buffer, it deletes the old region and the
390output replaces it as the contents of the region. It returns the
391command's exit status, like @kbd{M-!}.
392
393 One use for @kbd{M-|} is to run @code{gpg} to see what keys are in
394the buffer. For instance, if the buffer contains a GPG key, type
395@kbd{C-x h M-| gpg @key{RET}} to feed the entire buffer contents to
396the @code{gpg} program. That program will ignore everything except
397the encoded keys, and will output a list of the keys the buffer
398contains.
399
400@vindex shell-file-name
401 Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify
402the shell to use. This variable is initialized based on your
403@env{SHELL} environment variable when Emacs is started. If the file
404name is relative, Emacs searches the directories in the list
405@code{exec-path}; this list is initialized based on the environment
406variable @env{PATH} when Emacs is started. Your @file{.emacs} file
407can override either or both of these default initializations.
408
409 Both @kbd{M-!} and @kbd{M-|} wait for the shell command to complete,
410unless you end the command with @samp{&} to make it asynchronous. To
411stop waiting, type @kbd{C-g} to quit; that terminates the shell
412command with the signal @code{SIGINT}---the same signal that @kbd{C-c}
413normally generates in the shell. Emacs then waits until the command
414actually terminates. If the shell command doesn't stop (because it
415ignores the @code{SIGINT} signal), type @kbd{C-g} again; this sends
416the command a @code{SIGKILL} signal which is impossible to ignore.
417
418 Asynchronous commands ending in @samp{&} feed their output into
419the buffer @samp{*Async Shell Command*}. Output arrives in that
420buffer regardless of whether it is visible in a window.
421
422 To specify a coding system for @kbd{M-!} or @kbd{M-|}, use the command
423@kbd{C-x @key{RET} c} immediately beforehand. @xref{Communication Coding}.
424
425@vindex shell-command-default-error-buffer
426 Error output from these commands is normally intermixed with the
427regular output. But if the variable
428@code{shell-command-default-error-buffer} has a string as value, and
429it's the name of a buffer, @kbd{M-!} and @kbd{M-|} insert error output
430before point in that buffer.
431
432@node Interactive Shell
433@subsection Interactive Inferior Shell
434
435@findex shell
436 To run a subshell interactively, putting its typescript in an Emacs
437buffer, use @kbd{M-x shell}. This creates (or reuses) a buffer named
438@samp{*shell*} and runs a subshell with input coming from and output going
439to that buffer. That is to say, any ``terminal output'' from the subshell
440goes into the buffer, advancing point, and any ``terminal input'' for
441the subshell comes from text in the buffer. To give input to the subshell,
442go to the end of the buffer and type the input, terminated by @key{RET}.
443
444 Emacs does not wait for the subshell to do anything. You can switch
445windows or buffers and edit them while the shell is waiting, or while it is
446running a command. Output from the subshell waits until Emacs has time to
447process it; this happens whenever Emacs is waiting for keyboard input or
448for time to elapse.
449
450@cindex @code{comint-highlight-input} face
451@cindex @code{comint-highlight-prompt} face
452 Input lines, once you submit them, are displayed using the face
453@code{comint-highlight-input}, and prompts are displayed using the
454face @code{comint-highlight-prompt}. This makes it easier to see
455previous input lines in the buffer. @xref{Faces}.
456
457 To make multiple subshells, you can invoke @kbd{M-x shell} with a
458prefix argument (e.g. @kbd{C-u M-x shell}), which will read a buffer
459name and create (or reuse) a subshell in that buffer. You can also
460rename the @samp{*shell*} buffer using @kbd{M-x rename-uniquely}, then
461create a new @samp{*shell*} buffer using plain @kbd{M-x shell}.
462Subshells in different buffers run independently and in parallel.
463
464@vindex explicit-shell-file-name
465@cindex environment variables for subshells
466@cindex @env{ESHELL} environment variable
467@cindex @env{SHELL} environment variable
468 The file name used to load the subshell is the value of the variable
469@code{explicit-shell-file-name}, if that is non-@code{nil}. Otherwise,
470the environment variable @env{ESHELL} is used, or the environment
471variable @env{SHELL} if there is no @env{ESHELL}. If the file name
472specified is relative, the directories in the list @code{exec-path} are
473searched; this list is initialized based on the environment variable
474@env{PATH} when Emacs is started. Your @file{.emacs} file can override
475either or both of these default initializations.
476
477 Emacs sends the new shell the contents of the file
478@file{~/.emacs_@var{shellname}} as input, if it exists, where
479@var{shellname} is the name of the file that the shell was loaded
480from. For example, if you use bash, the file sent to it is
481@file{~/.emacs_bash}. If this file is not found, Emacs tries to fallback
482on @file{~/.emacs.d/init_@var{shellname}.sh}.
483
484 To specify a coding system for the shell, you can use the command
485@kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}. You can
486also change the coding system for a running subshell by typing
487@kbd{C-x @key{RET} p} in the shell buffer. @xref{Communication
488Coding}.
489
490@cindex @env{INSIDE_EMACS} environment variable
491 Emacs sets the envitonment variable @env{INSIDE_EMACS} to @code{t}
492in the subshell. Programs can check this variable to determine
493whether they are running inside an Emacs subshell.
494
495@cindex @env{EMACS} environment variable
496 Emacs also sets the @env{EMACS} environment variable to @code{t} if
497it is not already defined. @strong{Warning:} This environment
498variable is deprecated. Programs that check this variable should be
499changed to check @env{INSIDE_EMACS} instead.
500
501@node Shell Mode
502@subsection Shell Mode
503@cindex Shell mode
504@cindex mode, Shell
505
506 Shell buffers use Shell mode, which defines several special keys
507attached to the @kbd{C-c} prefix. They are chosen to resemble the usual
508editing and job control characters present in shells that are not under
509Emacs, except that you must type @kbd{C-c} first. Here is a complete list
510of the special key bindings of Shell mode:
511
512@table @kbd
513@item @key{RET}
514@kindex RET @r{(Shell mode)}
515@findex comint-send-input
516At end of buffer send line as input; otherwise, copy current line to
517end of buffer and send it (@code{comint-send-input}). Copying a line
518in this way omits any prompt at the beginning of the line (text output
519by programs preceding your input). @xref{Shell Prompts}, for how
520Shell mode recognizes prompts.
521
522@item @key{TAB}
523@kindex TAB @r{(Shell mode)}
524@findex comint-dynamic-complete
525Complete the command name or file name before point in the shell buffer
526(@code{comint-dynamic-complete}). @key{TAB} also completes history
527references (@pxref{History References}) and environment variable names.
528
529@vindex shell-completion-fignore
530@vindex comint-completion-fignore
531The variable @code{shell-completion-fignore} specifies a list of file
532name extensions to ignore in Shell mode completion. The default
533setting is @code{nil}, but some users prefer @code{("~" "#" "%")} to
534ignore file names ending in @samp{~}, @samp{#} or @samp{%}. Other
535related Comint modes use the variable @code{comint-completion-fignore}
536instead.
537
538@item M-?
539@kindex M-? @r{(Shell mode)}
540@findex comint-dynamic-list-filename@dots{}
541Display temporarily a list of the possible completions of the file name
542before point in the shell buffer
543(@code{comint-dynamic-list-filename-completions}).
544
545@item C-d
546@kindex C-d @r{(Shell mode)}
547@findex comint-delchar-or-maybe-eof
548Either delete a character or send @acronym{EOF}
549(@code{comint-delchar-or-maybe-eof}). Typed at the end of the shell
550buffer, @kbd{C-d} sends @acronym{EOF} to the subshell. Typed at any other
551position in the buffer, @kbd{C-d} deletes a character as usual.
552
553@item C-c C-a
554@kindex C-c C-a @r{(Shell mode)}
555@findex comint-bol-or-process-mark
556Move to the beginning of the line, but after the prompt if any
557(@code{comint-bol-or-process-mark}). If you repeat this command twice
558in a row, the second time it moves back to the process mark, which is
559the beginning of the input that you have not yet sent to the subshell.
560(Normally that is the same place---the end of the prompt on this
561line---but after @kbd{C-c @key{SPC}} the process mark may be in a
562previous line.)
563
564@item C-c @key{SPC}
565Accumulate multiple lines of input, then send them together. This
566command inserts a newline before point, but does not send the preceding
567text as input to the subshell---at least, not yet. Both lines, the one
568before this newline and the one after, will be sent together (along with
569the newline that separates them), when you type @key{RET}.
570
571@item C-c C-u
572@kindex C-c C-u @r{(Shell mode)}
573@findex comint-kill-input
574Kill all text pending at end of buffer to be sent as input
575(@code{comint-kill-input}). If point is not at end of buffer,
576this only kills the part of this text that precedes point.
577
578@item C-c C-w
579@kindex C-c C-w @r{(Shell mode)}
580Kill a word before point (@code{backward-kill-word}).
581
582@item C-c C-c
583@kindex C-c C-c @r{(Shell mode)}
584@findex comint-interrupt-subjob
585Interrupt the shell or its current subjob if any
586(@code{comint-interrupt-subjob}). This command also kills
587any shell input pending in the shell buffer and not yet sent.
588
589@item C-c C-z
590@kindex C-c C-z @r{(Shell mode)}
591@findex comint-stop-subjob
592Stop the shell or its current subjob if any (@code{comint-stop-subjob}).
593This command also kills any shell input pending in the shell buffer and
594not yet sent.
595
596@item C-c C-\
597@findex comint-quit-subjob
598@kindex C-c C-\ @r{(Shell mode)}
599Send quit signal to the shell or its current subjob if any
600(@code{comint-quit-subjob}). This command also kills any shell input
601pending in the shell buffer and not yet sent.
602
603@item C-c C-o
604@kindex C-c C-o @r{(Shell mode)}
605@findex comint-delete-output
606Delete the last batch of output from a shell command
607(@code{comint-delete-output}). This is useful if a shell command spews
608out lots of output that just gets in the way. This command used to be
609called @code{comint-kill-output}.
610
611@item C-c C-s
612@kindex C-c C-s @r{(Shell mode)}
613@findex comint-write-output
614Write the last batch of output from a shell command to a file
615(@code{comint-write-output}). With a prefix argument, the file is
616appended to instead. Any prompt at the end of the output is not
617written.
618
619@item C-c C-r
620@itemx C-M-l
621@kindex C-c C-r @r{(Shell mode)}
622@kindex C-M-l @r{(Shell mode)}
623@findex comint-show-output
624Scroll to display the beginning of the last batch of output at the top
625of the window; also move the cursor there (@code{comint-show-output}).
626
627@item C-c C-e
628@kindex C-c C-e @r{(Shell mode)}
629@findex comint-show-maximum-output
630Scroll to put the end of the buffer at the bottom of the window
631(@code{comint-show-maximum-output}).
632
633@item C-c C-f
634@kindex C-c C-f @r{(Shell mode)}
635@findex shell-forward-command
636@vindex shell-command-regexp
637Move forward across one shell command, but not beyond the current line
638(@code{shell-forward-command}). The variable @code{shell-command-regexp}
639specifies how to recognize the end of a command.
640
641@item C-c C-b
642@kindex C-c C-b @r{(Shell mode)}
643@findex shell-backward-command
644Move backward across one shell command, but not beyond the current line
645(@code{shell-backward-command}).
646
647@item M-x dirs
648Ask the shell what its current directory is, so that Emacs can agree
649with the shell.
650
651@item M-x send-invisible @key{RET} @var{text} @key{RET}
652@findex send-invisible
653Send @var{text} as input to the shell, after reading it without
654echoing. This is useful when a shell command runs a program that asks
655for a password.
656
657Please note that Emacs will not echo passwords by default. If you
658really want them to be echoed, evaluate the following Lisp
659expression:
660
661@example
662(remove-hook 'comint-output-filter-functions
663 'comint-watch-for-password-prompt)
664@end example
665
666@item M-x comint-continue-subjob
667@findex comint-continue-subjob
668Continue the shell process. This is useful if you accidentally suspend
669the shell process.@footnote{You should not suspend the shell process.
670Suspending a subjob of the shell is a completely different matter---that
671is normal practice, but you must use the shell to continue the subjob;
672this command won't do it.}
673
674@item M-x comint-strip-ctrl-m
675@findex comint-strip-ctrl-m
676Discard all control-M characters from the current group of shell output.
677The most convenient way to use this command is to make it run
678automatically when you get output from the subshell. To do that,
679evaluate this Lisp expression:
680
681@example
682(add-hook 'comint-output-filter-functions
683 'comint-strip-ctrl-m)
684@end example
685
686@item M-x comint-truncate-buffer
687@findex comint-truncate-buffer
688This command truncates the shell buffer to a certain maximum number of
689lines, specified by the variable @code{comint-buffer-maximum-size}.
690Here's how to do this automatically each time you get output from the
691subshell:
692
693@example
694(add-hook 'comint-output-filter-functions
695 'comint-truncate-buffer)
696@end example
697@end table
698
699@cindex Comint mode
700@cindex mode, Comint
701 Shell mode is a derivative of Comint mode, a general-purpose mode for
702communicating with interactive subprocesses. Most of the features of
703Shell mode actually come from Comint mode, as you can see from the
704command names listed above. The special features of Shell mode include
705the directory tracking feature, and a few user commands.
706
707 Other Emacs features that use variants of Comint mode include GUD
708(@pxref{Debuggers}) and @kbd{M-x run-lisp} (@pxref{External Lisp}).
709
710@findex comint-run
711 You can use @kbd{M-x comint-run} to execute any program of your choice
712in a subprocess using unmodified Comint mode---without the
713specializations of Shell mode.
714
715@node Shell Prompts
716@subsection Shell Prompts
717
718@vindex shell-prompt-pattern
719@vindex comint-prompt-regexp
720@vindex comint-use-prompt-regexp
721@cindex prompt, shell
722 A prompt is text output by a program to show that it is ready to
723accept new user input. Normally, Comint mode (and thus Shell mode)
724considers the prompt to be any text output by a program at the
725beginning of an input line. However, if the variable
726@code{comint-use-prompt-regexp} is non-@code{nil}, then Comint mode
727uses a regular expression to recognize prompts. In Shell mode,
728@code{shell-prompt-pattern} specifies the regular expression.
729
730 The value of @code{comint-use-prompt-regexp} also affects many
731motion and paragraph commands. If the value is non-@code{nil}, the
732general Emacs motion commands behave as they normally do in buffers
733without special text properties. However, if the value is @code{nil},
734the default, then Comint mode divides the buffer into two types of
735``fields'' (ranges of consecutive characters having the same
736@code{field} text property): input and output. Prompts are part of
737the output. Most Emacs motion commands do not cross field boundaries,
738unless they move over multiple lines. For instance, when point is in
739input on the same line as a prompt, @kbd{C-a} puts point at the
740beginning of the input if @code{comint-use-prompt-regexp} is
741@code{nil} and at the beginning of the line otherwise.
742
743 In Shell mode, only shell prompts start new paragraphs. Thus, a
744paragraph consists of a prompt and the input and output that follow
745it. However, if @code{comint-use-prompt-regexp} is @code{nil}, the
746default, most paragraph commands do not cross field boundaries. This
747means that prompts, ranges of input, and ranges of non-prompt output
748behave mostly like separate paragraphs; with this setting, numeric
749arguments to most paragraph commands yield essentially undefined
750behavior. For the purpose of finding paragraph boundaries, Shell mode
751uses @code{shell-prompt-pattern}, regardless of
752@code{comint-use-prompt-regexp}.
753
754@node Shell History
755@subsection Shell Command History
756
757 Shell buffers support three ways of repeating earlier commands. You
758can use keys like those used for the minibuffer history; these work
759much as they do in the minibuffer, inserting text from prior commands
760while point remains always at the end of the buffer. You can move
761through the buffer to previous inputs in their original place, then
762resubmit them or copy them to the end. Or you can use a
763@samp{!}-style history reference.
764
765@menu
766* Ring: Shell Ring. Fetching commands from the history list.
767* Copy: Shell History Copying. Moving to a command and then copying it.
768* History References:: Expanding @samp{!}-style history references.
769@end menu
770
771@node Shell Ring
772@subsubsection Shell History Ring
773
774@table @kbd
775@findex comint-previous-input
776@kindex M-p @r{(Shell mode)}
777@item M-p
778@itemx C-@key{UP}
779Fetch the next earlier old shell command.
780
781@kindex M-n @r{(Shell mode)}
782@findex comint-next-input
783@item M-n
784@itemx C-@key{DOWN}
785Fetch the next later old shell command.
786
787@kindex M-r @r{(Shell mode)}
788@kindex M-s @r{(Shell mode)}
789@findex comint-previous-matching-input
790@findex comint-next-matching-input
791@item M-r @var{regexp} @key{RET}
792@itemx M-s @var{regexp} @key{RET}
793Search backwards or forwards for old shell commands that match @var{regexp}.
794
795@item C-c C-x
796@kindex C-c C-x @r{(Shell mode)}
797@findex comint-get-next-from-history
798Fetch the next subsequent command from the history.
799
800@item C-c .
801@kindex C-c . @r{(Shell mode)}
802@findex comint-input-previous-argument
803Fetch one argument from an old shell command.
804
805@item C-c C-l
806@kindex C-c C-l @r{(Shell mode)}
807@findex comint-dynamic-list-input-ring
808Display the buffer's history of shell commands in another window
809(@code{comint-dynamic-list-input-ring}).
810@end table
811
812 Shell buffers provide a history of previously entered shell commands. To
813reuse shell commands from the history, use the editing commands @kbd{M-p},
814@kbd{M-n}, @kbd{M-r} and @kbd{M-s}. These work just like the minibuffer
815history commands except that they operate on the text at the end of the
816shell buffer, where you would normally insert text to send to the shell.
817
818 @kbd{M-p} fetches an earlier shell command to the end of the shell
819buffer. Successive use of @kbd{M-p} fetches successively earlier
820shell commands, each replacing any text that was already present as
821potential shell input. @kbd{M-n} does likewise except that it finds
822successively more recent shell commands from the buffer.
823@kbd{C-@key{UP}} works like @kbd{M-p}, and @kbd{C-@key{DOWN}} like
824@kbd{M-n}.
825
826 The history search commands @kbd{M-r} and @kbd{M-s} read a regular
827expression and search through the history for a matching command. Aside
828from the choice of which command to fetch, they work just like @kbd{M-p}
829and @kbd{M-n}. If you enter an empty regexp, these commands reuse the
830same regexp used last time.
831
832 When you find the previous input you want, you can resubmit it by
833typing @key{RET}, or you can edit it first and then resubmit it if you
834wish. Any partial input you were composing before navigating the
835history list is restored when you go to the beginning or end of the
836history ring.
837
838 Often it is useful to reexecute several successive shell commands that
839were previously executed in sequence. To do this, first find and
840reexecute the first command of the sequence. Then type @kbd{C-c C-x};
841that will fetch the following command---the one that follows the command
842you just repeated. Then type @key{RET} to reexecute this command. You
843can reexecute several successive commands by typing @kbd{C-c C-x
844@key{RET}} over and over.
845
846 The command @kbd{C-c .}@: (@code{comint-input-previous-argument})
847copies an individual argument from a previous command, like @kbd{ESC
848.} in Bash. The simplest use copies the last argument from the
849previous shell command. With a prefix argument @var{n}, it copies the
850@var{n}th argument instead. Repeating @kbd{C-c .} copies from an
851earlier shell command instead, always using the same value of @var{n}
852(don't give a prefix argument when you repeat the @kbd{C-c .}
853command).
854
855 These commands get the text of previous shell commands from a special
856history list, not from the shell buffer itself. Thus, editing the shell
857buffer, or even killing large parts of it, does not affect the history
858that these commands access.
859
860@vindex shell-input-ring-file-name
861 Some shells store their command histories in files so that you can
862refer to commands from previous shell sessions. Emacs reads
863the command history file for your chosen shell, to initialize its own
864command history. The file name is @file{~/.bash_history} for bash,
865@file{~/.sh_history} for ksh, and @file{~/.history} for other shells.
866
867@node Shell History Copying
868@subsubsection Shell History Copying
869
870@table @kbd
871@kindex C-c C-p @r{(Shell mode)}
872@findex comint-previous-prompt
873@item C-c C-p
874Move point to the previous prompt (@code{comint-previous-prompt}).
875
876@kindex C-c C-n @r{(Shell mode)}
877@findex comint-next-prompt
878@item C-c C-n
879Move point to the following prompt (@code{comint-next-prompt}).
880
881@kindex C-c RET @r{(Shell mode)}
882@findex comint-copy-old-input
883@item C-c @key{RET}
884Copy the input command which point is in, inserting the copy at the end
885of the buffer (@code{comint-copy-old-input}). This is useful if you
886move point back to a previous command. After you copy the command, you
887can submit the copy as input with @key{RET}. If you wish, you can
888edit the copy before resubmitting it. If you use this command on an
889output line, it copies that line to the end of the buffer.
890
891@item Mouse-2
892If @code{comint-use-prompt-regexp} is @code{nil} (the default), copy
893the old input command that you click on, inserting the copy at the end
894of the buffer (@code{comint-insert-input}). If
895@code{comint-use-prompt-regexp} is non-@code{nil}, or if the click is
896not over old input, just yank as usual.
897@end table
898
899 Moving to a previous input and then copying it with @kbd{C-c
900@key{RET}} or @kbd{Mouse-2} produces the same results---the same
901buffer contents---that you would get by using @kbd{M-p} enough times
902to fetch that previous input from the history list. However, @kbd{C-c
903@key{RET}} copies the text from the buffer, which can be different
904from what is in the history list if you edit the input text in the
905buffer after it has been sent.
906
907@node History References
908@subsubsection Shell History References
909@cindex history reference
910
911 Various shells including csh and bash support @dfn{history
912references} that begin with @samp{!} and @samp{^}. Shell mode
913recognizes these constructs, and can perform the history substitution
914for you.
915
916 If you insert a history reference and type @key{TAB}, this searches
917the input history for a matching command, performs substitution if
918necessary, and places the result in the buffer in place of the history
919reference. For example, you can fetch the most recent command
920beginning with @samp{mv} with @kbd{! m v @key{TAB}}. You can edit the
921command if you wish, and then resubmit the command to the shell by
922typing @key{RET}.
923
924@vindex comint-input-autoexpand
925@findex comint-magic-space
926 Shell mode can optionally expand history references in the buffer
927when you send them to the shell. To request this, set the variable
928@code{comint-input-autoexpand} to @code{input}. You can make
929@key{SPC} perform history expansion by binding @key{SPC} to the
930command @code{comint-magic-space}.
931
932 Shell mode recognizes history references when they follow a prompt.
933@xref{Shell Prompts}, for how Shell mode recognizes prompts.
934
935@node Directory Tracking
936@subsection Directory Tracking
937@cindex directory tracking
938
939@vindex shell-pushd-regexp
940@vindex shell-popd-regexp
941@vindex shell-cd-regexp
942 Shell mode keeps track of @samp{cd}, @samp{pushd} and @samp{popd}
943commands given to the inferior shell, so it can keep the
944@samp{*shell*} buffer's default directory the same as the shell's
945working directory. It recognizes these commands syntactically, by
946examining lines of input that are sent.
947
948 If you use aliases for these commands, you can tell Emacs to
949recognize them also. For example, if the value of the variable
950@code{shell-pushd-regexp} matches the beginning of a shell command
951line, that line is regarded as a @code{pushd} command. Change this
952variable when you add aliases for @samp{pushd}. Likewise,
953@code{shell-popd-regexp} and @code{shell-cd-regexp} are used to
954recognize commands with the meaning of @samp{popd} and @samp{cd}.
955These commands are recognized only at the beginning of a shell command
956line.
957
958@ignore @c This seems to have been deleted long ago.
959@vindex shell-set-directory-error-hook
960 If Emacs gets an error while trying to handle what it believes is a
961@samp{cd}, @samp{pushd} or @samp{popd} command, it runs the hook
962@code{shell-set-directory-error-hook} (@pxref{Hooks}).
963@end ignore
964
965@findex dirs
966 If Emacs gets confused about changes in the current directory of the
967subshell, use the command @kbd{M-x dirs} to ask the shell what its
968current directory is. This command works for shells that support the
969most common command syntax; it may not work for unusual shells.
970
971@findex dirtrack-mode
972 You can also use @kbd{M-x dirtrack-mode} to enable (or disable) an
973alternative and more aggressive method of tracking changes in the
974current directory.
975
976@node Shell Options
977@subsection Shell Mode Options
978
979@vindex comint-scroll-to-bottom-on-input
980 If the variable @code{comint-scroll-to-bottom-on-input} is
981non-@code{nil}, insertion and yank commands scroll the selected window
982to the bottom before inserting. The default is @code{nil}.
983
984@vindex comint-scroll-show-maximum-output
985 If @code{comint-scroll-show-maximum-output} is non-@code{nil}, then
986arrival of output when point is at the end tries to scroll the last
987line of text to the bottom line of the window, showing as much useful
988text as possible. (This mimics the scrolling behavior of most
989terminals.) The default is @code{t}.
990
991@vindex comint-move-point-for-output
992 By setting @code{comint-move-point-for-output}, you can opt for
993having point jump to the end of the buffer whenever output arrives---no
994matter where in the buffer point was before. If the value is
995@code{this}, point jumps in the selected window. If the value is
996@code{all}, point jumps in each window that shows the Comint buffer. If
997the value is @code{other}, point jumps in all nonselected windows that
998show the current buffer. The default value is @code{nil}, which means
999point does not jump to the end.
1000
1001@vindex comint-prompt-read-only
1002 If you set @code{comint-prompt-read-only}, the prompts in the Comint
1003buffer are read-only.
1004
1005@vindex comint-input-ignoredups
1006 The variable @code{comint-input-ignoredups} controls whether successive
1007identical inputs are stored in the input history. A non-@code{nil}
1008value means to omit an input that is the same as the previous input.
1009The default is @code{nil}, which means to store each input even if it is
1010equal to the previous input.
1011
1012@vindex comint-completion-addsuffix
1013@vindex comint-completion-recexact
1014@vindex comint-completion-autolist
1015 Three variables customize file name completion. The variable
1016@code{comint-completion-addsuffix} controls whether completion inserts a
1017space or a slash to indicate a fully completed file or directory name
1018(non-@code{nil} means do insert a space or slash).
1019@code{comint-completion-recexact}, if non-@code{nil}, directs @key{TAB}
1020to choose the shortest possible completion if the usual Emacs completion
1021algorithm cannot add even a single character.
1022@code{comint-completion-autolist}, if non-@code{nil}, says to list all
1023the possible completions whenever completion is not exact.
1024
1025@vindex shell-completion-execonly
1026 Command completion normally considers only executable files.
1027If you set @code{shell-completion-execonly} to @code{nil},
1028it considers nonexecutable files as well.
1029
1030@findex shell-pushd-tohome
1031@findex shell-pushd-dextract
1032@findex shell-pushd-dunique
1033 You can configure the behavior of @samp{pushd}. Variables control
1034whether @samp{pushd} behaves like @samp{cd} if no argument is given
1035(@code{shell-pushd-tohome}), pop rather than rotate with a numeric
1036argument (@code{shell-pushd-dextract}), and only add directories to the
1037directory stack if they are not already on it
1038(@code{shell-pushd-dunique}). The values you choose should match the
1039underlying shell, of course.
1040
1041 If you want Shell mode to handle color output from shell commands,
1042you can enable ANSI Color mode. Here is how to do this:
1043
1044@example
1045(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
1046@end example
1047
1048@node Terminal emulator
1049@subsection Emacs Terminal Emulator
1050@findex term
1051
1052 To run a subshell in a terminal emulator, putting its typescript in
1053an Emacs buffer, use @kbd{M-x term}. This creates (or reuses) a
1054buffer named @samp{*terminal*}, and runs a subshell with input coming
1055from your keyboard, and output going to that buffer.
1056
1057 The terminal emulator uses Term mode, which has two input modes. In
1058line mode, Term basically acts like Shell mode; see @ref{Shell Mode}.
1059
1060 In char mode, each character is sent directly to the inferior
1061subshell, as ``terminal input.'' Any ``echoing'' of your input is the
1062responsibility of the subshell. The sole exception is the terminal
1063escape character, which by default is @kbd{C-c} (@pxref{Term Mode}).
1064Any ``terminal output'' from the subshell goes into the buffer,
1065advancing point.
1066
1067 Some programs (such as Emacs itself) need to control the appearance
1068on the terminal screen in detail. They do this by sending special
1069control codes. The exact control codes needed vary from terminal to
1070terminal, but nowadays most terminals and terminal emulators
1071(including @code{xterm}) understand the ANSI-standard (VT100-style)
1072escape sequences. Term mode recognizes these escape sequences, and
1073handles each one appropriately, changing the buffer so that the
1074appearance of the window matches what it would be on a real terminal.
1075You can actually run Emacs inside an Emacs Term window.
1076
1077 The file name used to load the subshell is determined the same way
1078as for Shell mode. To make multiple terminal emulators, rename the
1079buffer @samp{*terminal*} to something different using @kbd{M-x
1080rename-uniquely}, just as with Shell mode.
1081
1082 Unlike Shell mode, Term mode does not track the current directory by
1083examining your input. But some shells can tell Term what the current
1084directory is. This is done automatically by @code{bash} version 1.15
1085and later.
1086
1087@node Term Mode
1088@subsection Term Mode
1089@cindex Term mode
1090@cindex mode, Term
1091
1092 The terminal emulator uses Term mode, which has two input modes. In
1093line mode, Term basically acts like Shell mode; see @ref{Shell Mode}.
1094In char mode, each character is sent directly to the inferior
1095subshell, except for the Term escape character, normally @kbd{C-c}.
1096
1097 To switch between line and char mode, use these commands:
1098
1099@table @kbd
1100@kindex C-c C-j @r{(Term mode)}
1101@findex term-char-mode
1102@item C-c C-j
1103Switch to line mode. Do nothing if already in line mode.
1104
1105@kindex C-c C-k @r{(Term mode)}
1106@findex term-line-mode
1107@item C-c C-k
1108Switch to char mode. Do nothing if already in char mode.
1109@end table
1110
1111 The following commands are only available in char mode:
1112
1113@table @kbd
1114@item C-c C-c
1115Send a literal @key{C-c} to the sub-shell.
1116
1117@item C-c @var{char}
1118This is equivalent to @kbd{C-x @var{char}} in normal Emacs. For
1119example, @kbd{C-c o} invokes the global binding of @kbd{C-x o}, which
1120is normally @samp{other-window}.
1121@end table
1122
1123@node Paging in Term
1124@subsection Page-At-A-Time Output
1125@cindex page-at-a-time
1126
1127 Term mode has a page-at-a-time feature. When enabled it makes
1128output pause at the end of each screenful.
1129
1130@table @kbd
1131@kindex C-c C-q @r{(Term mode)}
1132@findex term-pager-toggle
1133@item C-c C-q
1134Toggle the page-at-a-time feature. This command works in both line
1135and char modes. When page-at-a-time is enabled, the mode-line
1136displays the word @samp{page}.
1137@end table
1138
1139 With page-at-a-time enabled, whenever Term receives more than a
1140screenful of output since your last input, it pauses, displaying
1141@samp{**MORE**} in the mode-line. Type @key{SPC} to display the next
1142screenful of output. Type @kbd{?} to see your other options. The
1143interface is similar to the @code{more} program.
1144
1145@node Remote Host
1146@subsection Remote Host Shell
1147@cindex remote host
1148@cindex connecting to remote host
1149@cindex Telnet
1150@cindex Rlogin
1151
1152 You can login to a remote computer, using whatever commands you
1153would from a regular terminal (e.g.@: using the @code{telnet} or
1154@code{rlogin} commands), from a Term window.
1155
1156 A program that asks you for a password will normally suppress
1157echoing of the password, so the password will not show up in the
1158buffer. This will happen just as if you were using a real terminal,
1159if the buffer is in char mode. If it is in line mode, the password is
1160temporarily visible, but will be erased when you hit return. (This
1161happens automatically; there is no special password processing.)
1162
1163 When you log in to a different machine, you need to specify the type
1164of terminal you're using, by setting the @env{TERM} environment
1165variable in the environment for the remote login command. (If you use
1166bash, you do that by writing the variable assignment before the remote
1167login command, without separating comma.) Terminal types @samp{ansi}
1168or @samp{vt100} will work on most systems.
1169
1170@c If you are talking to a Bourne-compatible
1171@c shell, and your system understands the @env{TERMCAP} variable,
1172@c you can use the command @kbd{M-x shell-send-termcap}, which
1173@c sends a string specifying the terminal type and size.
1174@c (This command is also useful after the window has changed size.)
1175
1176@c You can of course run @samp{gdb} on that remote computer. One useful
1177@c trick: If you invoke gdb with the @code{--fullname} option,
1178@c it will send special commands to Emacs that will cause Emacs to
1179@c pop up the source files you're debugging. This will work
1180@c whether or not gdb is running on a different computer than Emacs,
1181@c as long as Emacs can access the source files specified by gdb.
1182
1183@ignore
1184 You cannot log in to a remote computer using the Shell mode.
1185@c (This will change when Shell is re-written to use Term.)
1186Instead, Emacs provides two commands for logging in to another computer
1187and communicating with it through an Emacs buffer using Comint mode:
1188
1189@table @kbd
1190@item M-x telnet @key{RET} @var{hostname} @key{RET}
1191Set up a Telnet connection to the computer named @var{hostname}.
1192@item M-x rlogin @key{RET} @var{hostname} @key{RET}
1193Set up an Rlogin connection to the computer named @var{hostname}.
1194@end table
1195
1196@findex telnet
1197 Use @kbd{M-x telnet} to set up a Telnet connection to another
1198computer. (Telnet is the standard Internet protocol for remote login.)
1199It reads the host name of the other computer as an argument with the
1200minibuffer. Once the connection is established, talking to the other
1201computer works like talking to a subshell: you can edit input with the
1202usual Emacs commands, and send it a line at a time by typing @key{RET}.
1203The output is inserted in the Telnet buffer interspersed with the input.
1204
1205@findex rlogin
1206@vindex rlogin-explicit-args
1207 Use @kbd{M-x rlogin} to set up an Rlogin connection. Rlogin is
1208another remote login communication protocol, essentially much like the
1209Telnet protocol but incompatible with it, and supported only by certain
1210systems. Rlogin's advantages are that you can arrange not to have to
1211give your user name and password when communicating between two machines
1212you frequently use, and that you can make an 8-bit-clean connection.
1213(To do that in Emacs, set @code{rlogin-explicit-args} to @code{("-8")}
1214before you run Rlogin.)
1215
1216 @kbd{M-x rlogin} sets up the default file directory of the Emacs
1217buffer to access the remote host via FTP (@pxref{File Names}), and it
1218tracks the shell commands that change the current directory, just like
1219Shell mode.
1220
1221@findex rlogin-directory-tracking-mode
1222 There are two ways of doing directory tracking in an Rlogin
1223buffer---either with remote directory names
1224@file{/@var{host}:@var{dir}/} or with local names (that works if the
1225``remote'' machine shares file systems with your machine of origin).
1226You can use the command @code{rlogin-directory-tracking-mode} to switch
1227modes. No argument means use remote directory names, a positive
1228argument means use local names, and a negative argument means turn
1229off directory tracking.
1230
1231@end ignore
1232
1233@node Emacs Server, Printing, Shell, Top
1234@section Using Emacs as a Server
1235@pindex emacsclient
1236@cindex Emacs as a server
1237@cindex server, using Emacs as
1238@cindex @env{EDITOR} environment variable
1239
1240 Various programs such as @code{mail} can invoke your choice of editor
1241to edit a particular piece of text, such as a message that you are
1242sending. By convention, most of these programs use the environment
1243variable @env{EDITOR} to specify which editor to run. If you set
1244@env{EDITOR} to @samp{emacs}, they invoke Emacs---but in an
1245inconvenient fashion, by starting a new, separate Emacs process. This
1246is inconvenient because it takes time and because the new Emacs process
1247doesn't share the buffers with any existing Emacs process.
1248
1249 You can arrange to use your existing Emacs process as the editor for
1250programs like @code{mail} by using the Emacs client program and the
1251server that is part of Emacs. Here is how.
1252
1253@cindex @env{TEXEDIT} environment variable
1254@findex server-start
1255 First, the preparations. Within Emacs, call the function
1256@code{server-start}. (Your @file{.emacs} init file can do this
1257automatically if you add the expression @code{(server-start)} to it,
1258see @ref{Init File}.) Then, outside Emacs, set the @env{EDITOR}
1259environment variable to @samp{emacsclient}. (Note that some programs
1260use a different environment variable; for example, to make @TeX{} use
1261@samp{emacsclient}, you should set the @env{TEXEDIT} environment
1262variable to @samp{emacsclient +%d %s}.)
1263
1264@pindex emacs.bash
1265@cindex Bash command to use Emacs server
1266 As an alternative to using @code{emacsclient}, the file
1267@file{etc/emacs.bash} defines a Bash command @code{edit} which will
1268communicate with a running Emacs session, or start one if none exist.
1269
1270@kindex C-x #
1271@findex server-edit
1272 Now, whenever any program invokes your specified @env{EDITOR}
1273program, the effect is to send a message to your principal Emacs telling
1274it to visit a file. (That's what the program @code{emacsclient} does.)
1275Emacs displays the buffer immediately and you can immediately begin
1276editing it in the already running Emacs session.
1277
1278 When you've finished editing that buffer, type @kbd{C-x #}
1279(@code{server-edit}). This saves the file and sends a message back to
1280the @code{emacsclient} program telling it to exit. The programs that
1281use @env{EDITOR} wait for the ``editor'' (actually, @code{emacsclient})
1282to exit. @kbd{C-x #} also checks for other pending external requests
1283to edit various files, and selects the next such file.
1284
1285 You can switch to a server buffer manually if you wish; you don't
1286have to arrive at it with @kbd{C-x #}. But @kbd{C-x #} is the way to
1287say that you are finished with one.
1288
1289@vindex server-kill-new-buffers
1290@vindex server-temp-file-regexp
1291 Finishing with a server buffer also kills the buffer, unless it
1292already existed in the Emacs session before the server asked to create
1293it. However, if you set @code{server-kill-new-buffers} to @code{nil},
1294then a different criterion is used: finishing with a server buffer
1295kills it if the file name matches the regular expression
1296@code{server-temp-file-regexp}. This is set up to distinguish certain
1297``temporary'' files.
1298
1299@vindex server-window
1300 If you set the variable @code{server-window} to a window or a frame,
1301@kbd{C-x #} displays the server buffer in that window or in that frame.
1302
1303@vindex server-name
1304 You can run multiple Emacs servers on the same machine by giving
1305each one a unique ``server name'', using the variable
1306@code{server-name}. For example, @kbd{M-x set-variable @key{RET}
1307server-name @key{RET} foo @key{RET}} sets the server name to
1308@samp{foo}. The @code{emacsclient} program can specify a server by
1309name using the @samp{-s} option. @xref{Invoking emacsclient}.
1310
1311 While @code{mail} or another application is waiting for
1312@code{emacsclient} to finish, @code{emacsclient} does not read terminal
1313input. So the terminal that @code{mail} was using is effectively
1314blocked for the duration. In order to edit with your principal Emacs,
1315you need to be able to use it without using that terminal. There are
1316three ways to do this:
1317
1318@itemize @bullet
1319@item
1320Using a window system, run @code{mail} and the principal Emacs in two
1321separate windows. While @code{mail} is waiting for @code{emacsclient},
1322the window where it was running is blocked, but you can use Emacs by
1323switching windows.
1324
1325@item
1326Using virtual terminals, run @code{mail} in one virtual terminal
1327and run Emacs in another.
1328
1329@item
1330Use Shell mode or Term mode in Emacs to run the other program such as
1331@code{mail}; then, @code{emacsclient} blocks only the subshell under
1332Emacs, and you can still use Emacs to edit the file.
1333@end itemize
1334
1335 If you run @code{emacsclient} with the option @samp{--no-wait}, it
1336returns immediately without waiting for you to ``finish'' the buffer
1337in Emacs. Note that server buffers created in this way are not killed
1338automatically when you finish with them.
1339
1340@menu
1341* Invoking emacsclient:: Emacs client startup options.
1342@end menu
1343
1344@node Invoking emacsclient,, Emacs Server, Emacs Server
1345@subsection Invoking @code{emacsclient}
1346@cindex @code{emacsclient} invocation and options
1347
1348 To run the @code{emacsclient} program, specify file names as arguments,
1349and optionally line numbers as well, like this:
1350
1351@example
1352emacsclient @r{@{}@r{[}+@var{line}@r{[}@var{column}@r{]}@r{]} @var{filename}@r{@}}@dots{}
1353@end example
1354
1355@noindent
1356This tells Emacs to visit each of the specified files; if you specify a
1357line number for a certain file, Emacs moves to that line in the file.
1358If you specify a column number as well, Emacs puts point on that column
1359in the line.
1360
1361 Ordinarily, @code{emacsclient} does not return until you use the
1362@kbd{C-x #} command on each of these buffers. When that happens,
1363Emacs sends a message to the @code{emacsclient} program telling it to
1364return.
1365
1366 If you invoke @code{emacsclient} for more than one file, the
1367additional client buffers are buried at the bottom of the buffer list
1368(@pxref{Buffers}). If you call @kbd{C-x #} after you are done editing
1369a client buffer, the next client buffer is automatically selected.
1370
1371 But if you use the option @samp{-n} or @samp{--no-wait} when running
1372@code{emacsclient}, then it returns immediately. (You can take as
1373long as you like to edit the files in Emacs.)
1374
1375 The option @samp{-a @var{command}} or
1376@samp{--alternate-editor=@var{command}} specifies a command to run if
1377@code{emacsclient} fails to contact Emacs. This is useful when
1378running @code{emacsclient} in a script. For example, the following
1379setting for the @env{EDITOR} environment variable will always give you
1380an editor, even if no Emacs server is running:
1381
1382@example
1383EDITOR="emacsclient --alternate-editor emacs +%d %s"
1384@end example
1385
1386@noindent
1387@cindex @env{ALTERNATE_EDITOR} environment variable
1388The environment variable @env{ALTERNATE_EDITOR} has the same effect, with
1389the value of the @samp{--alternate-editor} option taking precedence.
1390
1391If you use several displays, you can tell Emacs on which display to
1392open the given files with the @samp{-d @var{display}} or
1393@samp{--display=@var{display}} option to @code{emacsclient}. This is
1394handy when connecting from home to an Emacs session running on your
1395machine at your workplace.
1396
1397If there is more than one Emacs server running, you can specify a
1398server name with the @samp{-s @var{name}} or
1399@samp{--socket-name=@var{name}} option to @code{emacsclient}. (This
1400option is not supported on MS-Windows.)
1401
1402You can also use @code{emacsclient} to execute any piece of Emacs Lisp
1403code, using the @samp{-e} or @samp{--eval} option. When this option
1404is given, the rest of the arguments is interpreted as a list of
1405expressions to evaluate, not a list of files to visit.
1406
1407@cindex @env{EMACS_SERVER_FILE} environment variable
1408When you start the Emacs server (by calling @code{server-start}),
1409Emacs creates a file with information about TCP connection to the
1410server: the host where Emacs is running, the port where it is
1411listening, and an authentication string. @code{emacsclient} uses this
1412information if it needs to connect to the server via TCP. By default,
1413the file goes in the @file{~/.emacs.d/server/} directory@footnote{On
1414MS-Windows, if @env{HOME} is not set or the TCP configuration file
1415cannot be found there, Emacs also looks for the file in the
1416@file{.emacs.d/server/} subdirectory of the directory pointed to by
1417the @env{APPDATA} environment variable.}. You can specify the file
1418name to use with the @samp{-f @var{file}} or
1419@samp{--server-file=@var{file}} options, or by setting
1420@env{EMACS_SERVER_FILE} environment variable to the file name.
1421
1422@node Printing, Sorting, Emacs Server, Top
1423@section Printing Hard Copies
1424@cindex hardcopy
1425@cindex printing
1426
1427 Emacs provides commands for printing hard copies of either an entire
1428buffer or just part of one, with or without page headers. You can
1429invoke the printing commands directly, as detailed in the following
1430section, or using the @samp{File} menu on the menu bar. See also the
1431hardcopy commands of Dired (@pxref{Misc File Ops}) and the diary
1432(@pxref{Displaying the Diary}).
1433
1434@table @kbd
1435@item M-x print-buffer
1436Print hardcopy of current buffer with page headings containing the file
1437name and page number.
1438@item M-x lpr-buffer
1439Print hardcopy of current buffer without page headings.
1440@item M-x print-region
1441Like @code{print-buffer} but print only the current region.
1442@item M-x lpr-region
1443Like @code{lpr-buffer} but print only the current region.
1444@end table
1445
1446@findex print-buffer
1447@findex print-region
1448@findex lpr-buffer
1449@findex lpr-region
1450@vindex lpr-switches
1451 The hardcopy commands (aside from the PostScript commands) pass extra
1452switches to the @code{lpr} program based on the value of the variable
1453@code{lpr-switches}. Its value should be a list of strings, each string
1454an option starting with @samp{-}. For example, to specify a line width
1455of 80 columns for all the printing you do in Emacs, set
1456@code{lpr-switches} like this:
1457
1458@example
1459(setq lpr-switches '("-w80"))
1460@end example
1461
1462@vindex printer-name
1463 You can specify the printer to use by setting the variable
1464@code{printer-name}.
1465
1466@vindex lpr-headers-switches
1467@vindex lpr-commands
1468@vindex lpr-add-switches
1469 The variable @code{lpr-command} specifies the name of the printer
1470program to run; the default value depends on your operating system type.
1471On most systems, the default is @code{"lpr"}. The variable
1472@code{lpr-headers-switches} similarly specifies the extra switches to
1473use to make page headers. The variable @code{lpr-add-switches} controls
1474whether to supply @samp{-T} and @samp{-J} options (suitable for
1475@code{lpr}) to the printer program: @code{nil} means don't add them.
1476@code{lpr-add-switches} should be @code{nil} if your printer program is
1477not compatible with @code{lpr}.
1478
1479@menu
1480* PostScript:: Printing buffers or regions as PostScript.
1481* PostScript Variables:: Customizing the PostScript printing commands.
1482* Printing Package:: An optional advanced printing interface.
1483@end menu
1484
1485@node PostScript, PostScript Variables,, Printing
1486@section PostScript Hardcopy
1487
1488 These commands convert buffer contents to PostScript,
1489either printing it or leaving it in another Emacs buffer.
1490
1491@table @kbd
1492@item M-x ps-print-buffer
1493Print hardcopy of the current buffer in PostScript form.
1494@item M-x ps-print-region
1495Print hardcopy of the current region in PostScript form.
1496@item M-x ps-print-buffer-with-faces
1497Print hardcopy of the current buffer in PostScript form, showing the
1498faces used in the text by means of PostScript features.
1499@item M-x ps-print-region-with-faces
1500Print hardcopy of the current region in PostScript form, showing the
1501faces used in the text.
1502@item M-x ps-spool-buffer
1503Generate PostScript for the current buffer text.
1504@item M-x ps-spool-region
1505Generate PostScript for the current region.
1506@item M-x ps-spool-buffer-with-faces
1507Generate PostScript for the current buffer, showing the faces used.
1508@item M-x ps-spool-region-with-faces
1509Generate PostScript for the current region, showing the faces used.
1510@item M-x handwrite
1511Generates/prints PostScript for the current buffer as if handwritten.
1512@end table
1513
1514@findex ps-print-region
1515@findex ps-print-buffer
1516@findex ps-print-region-with-faces
1517@findex ps-print-buffer-with-faces
1518 The PostScript commands, @code{ps-print-buffer} and
1519@code{ps-print-region}, print buffer contents in PostScript form. One
1520command prints the entire buffer; the other, just the region. The
1521corresponding @samp{-with-faces} commands,
1522@code{ps-print-buffer-with-faces} and @code{ps-print-region-with-faces},
1523use PostScript features to show the faces (fonts and colors) in the text
1524properties of the text being printed.
1525
1526 If you are using a color display, you can print a buffer of program
1527code with color highlighting by turning on Font-Lock mode in that
1528buffer, and using @code{ps-print-buffer-with-faces}.
1529
1530@findex ps-spool-region
1531@findex ps-spool-buffer
1532@findex ps-spool-region-with-faces
1533@findex ps-spool-buffer-with-faces
1534 The commands whose names have @samp{spool} instead of @samp{print}
1535generate the PostScript output in an Emacs buffer instead of sending
1536it to the printer.
1537
1538@findex handwrite
1539@cindex handwriting
1540@kbd{M-x handwrite} is more frivolous. It generates a PostScript
1541rendition of the current buffer as a cursive handwritten document. It
1542can be customized in group @code{handwrite}. This function only
1543supports ISO 8859-1 characters.
1544
1545@ifnottex
1546 The following section describes variables for customizing these commands.
1547@end ifnottex
1548
1549@node PostScript Variables, Printing Package, PostScript, Printing
1550@section Variables for PostScript Hardcopy
1551
1552@vindex ps-lpr-command
1553@vindex ps-lpr-switches
1554@vindex ps-printer-name
1555 All the PostScript hardcopy commands use the variables
1556@code{ps-lpr-command} and @code{ps-lpr-switches} to specify how to print
1557the output. @code{ps-lpr-command} specifies the command name to run,
1558@code{ps-lpr-switches} specifies command line options to use, and
1559@code{ps-printer-name} specifies the printer. If you don't set the
1560first two variables yourself, they take their initial values from
1561@code{lpr-command} and @code{lpr-switches}. If @code{ps-printer-name}
1562is @code{nil}, @code{printer-name} is used.
1563
1564@vindex ps-print-header
1565 The variable @code{ps-print-header} controls whether these commands
1566add header lines to each page---set it to @code{nil} to turn headers
1567off.
1568
1569@cindex color emulation on black-and-white printers
1570@vindex ps-print-color-p
1571 If your printer doesn't support colors, you should turn off color
1572processing by setting @code{ps-print-color-p} to @code{nil}. By
1573default, if the display supports colors, Emacs produces hardcopy output
1574with color information; on black-and-white printers, colors are emulated
1575with shades of gray. This might produce illegible output, even if your
1576screen colors only use shades of gray.
1577
1578@vindex ps-use-face-background
1579 By default, PostScript printing ignores the background colors of the
1580faces, unless the variable @code{ps-use-face-background} is
1581non-@code{nil}. This is to avoid unwanted interference with the zebra
1582stripes and background image/text.
1583
1584@vindex ps-paper-type
1585@vindex ps-page-dimensions-database
1586 The variable @code{ps-paper-type} specifies which size of paper to
1587format for; legitimate values include @code{a4}, @code{a3},
1588@code{a4small}, @code{b4}, @code{b5}, @code{executive}, @code{ledger},
1589@code{legal}, @code{letter}, @code{letter-small}, @code{statement},
1590@code{tabloid}. The default is @code{letter}. You can define
1591additional paper sizes by changing the variable
1592@code{ps-page-dimensions-database}.
1593
1594@vindex ps-landscape-mode
1595 The variable @code{ps-landscape-mode} specifies the orientation of
1596printing on the page. The default is @code{nil}, which stands for
1597``portrait'' mode. Any non-@code{nil} value specifies ``landscape''
1598mode.
1599
1600@vindex ps-number-of-columns
1601 The variable @code{ps-number-of-columns} specifies the number of
1602columns; it takes effect in both landscape and portrait mode. The
1603default is 1.
1604
1605@vindex ps-font-family
1606@vindex ps-font-size
1607@vindex ps-font-info-database
1608 The variable @code{ps-font-family} specifies which font family to use
1609for printing ordinary text. Legitimate values include @code{Courier},
1610@code{Helvetica}, @code{NewCenturySchlbk}, @code{Palatino} and
1611@code{Times}. The variable @code{ps-font-size} specifies the size of
1612the font for ordinary text. It defaults to 8.5 points.
1613
1614@vindex ps-multibyte-buffer
1615@cindex Intlfonts for PostScript printing
1616@cindex fonts for PostScript printing
1617 Emacs supports more scripts and characters than a typical PostScript
1618printer. Thus, some of the characters in your buffer might not be
1619printable using the fonts built into your printer. You can augment
1620the fonts supplied with the printer with those from the GNU Intlfonts
1621package, or you can instruct Emacs to use Intlfonts exclusively. The
1622variable @code{ps-multibyte-buffer} controls this: the default value,
1623@code{nil}, is appropriate for printing @acronym{ASCII} and Latin-1
1624characters; a value of @code{non-latin-printer} is for printers which
1625have the fonts for @acronym{ASCII}, Latin-1, Japanese, and Korean
1626characters built into them. A value of @code{bdf-font} arranges for
1627the BDF fonts from the Intlfonts package to be used for @emph{all}
1628characters. Finally, a value of @code{bdf-font-except-latin}
1629instructs the printer to use built-in fonts for @acronym{ASCII} and Latin-1
1630characters, and Intlfonts BDF fonts for the rest.
1631
1632@vindex bdf-directory-list
1633 To be able to use the BDF fonts, Emacs needs to know where to find
1634them. The variable @code{bdf-directory-list} holds the list of
1635directories where Emacs should look for the fonts; the default value
1636includes a single directory @file{/usr/local/share/emacs/fonts/bdf}.
1637
1638 Many other customization variables for these commands are defined and
1639described in the Lisp files @file{ps-print.el} and @file{ps-mule.el}.
1640
1641@node Printing Package,, PostScript Variables, Printing
1642@section Printing Package
1643@cindex Printing package
1644
1645 The basic Emacs facilities for printing hardcopy can be extended
1646using the Printing package. This provides an easy-to-use interface
1647for choosing what to print, previewing PostScript files before
1648printing, and setting various printing options such as print headers,
1649landscape or portrait modes, duplex modes, and so forth. On GNU/Linux
1650or Unix systems, the Printing package relies on the @file{gs} and
1651@file{gv} utilities, which are distributed as part of the GhostScript
1652program. On MS-Windows, the @file{gstools} port of Ghostscript can be
1653used.
1654
1655@findex pr-interface
1656 To use the Printing package, add @code{(require 'printing)} to your
1657init file (@pxref{Init File}), followed by @code{(pr-update-menus)}.
1658This function replaces the usual printing commands in the menu bar
1659with a @samp{Printing} submenu that contains various printing options.
1660You can also type @kbd{M-x pr-interface RET}; this creates a
1661@samp{*Printing Interface*} buffer, similar to a customization buffer,
1662where you can set the printing options. After selecting what and how
1663to print, you start the print job using the @samp{Print} button (click
1664@kbd{mouse-2} on it, or move point over it and type @kbd{RET}). For
1665further information on the various options, use the @samp{Interface
1666Help} button.
1667
1668@node Sorting, Narrowing, Printing, Top
1669@section Sorting Text
1670@cindex sorting
1671
1672 Emacs provides several commands for sorting text in the buffer. All
1673operate on the contents of the region.
1674They divide the text of the region into many @dfn{sort records},
1675identify a @dfn{sort key} for each record, and then reorder the records
1676into the order determined by the sort keys. The records are ordered so
1677that their keys are in alphabetical order, or, for numeric sorting, in
1678numeric order. In alphabetic sorting, all upper-case letters `A' through
1679`Z' come before lower-case `a', in accord with the @acronym{ASCII} character
1680sequence.
1681
1682 The various sort commands differ in how they divide the text into sort
1683records and in which part of each record is used as the sort key. Most of
1684the commands make each line a separate sort record, but some commands use
1685paragraphs or pages as sort records. Most of the sort commands use each
1686entire sort record as its own sort key, but some use only a portion of the
1687record as the sort key.
1688
1689@findex sort-lines
1690@findex sort-paragraphs
1691@findex sort-pages
1692@findex sort-fields
1693@findex sort-numeric-fields
1694@vindex sort-numeric-base
1695@table @kbd
1696@item M-x sort-lines
1697Divide the region into lines, and sort by comparing the entire
1698text of a line. A numeric argument means sort into descending order.
1699
1700@item M-x sort-paragraphs
1701Divide the region into paragraphs, and sort by comparing the entire
1702text of a paragraph (except for leading blank lines). A numeric
1703argument means sort into descending order.
1704
1705@item M-x sort-pages
1706Divide the region into pages, and sort by comparing the entire
1707text of a page (except for leading blank lines). A numeric
1708argument means sort into descending order.
1709
1710@item M-x sort-fields
1711Divide the region into lines, and sort by comparing the contents of
1712one field in each line. Fields are defined as separated by
1713whitespace, so the first run of consecutive non-whitespace characters
1714in a line constitutes field 1, the second such run constitutes field
17152, etc.
1716
1717Specify which field to sort by with a numeric argument: 1 to sort by
1718field 1, etc. A negative argument means count fields from the right
1719instead of from the left; thus, minus 1 means sort by the last field.
1720If several lines have identical contents in the field being sorted, they
1721keep the same relative order that they had in the original buffer.
1722
1723@item M-x sort-numeric-fields
1724Like @kbd{M-x sort-fields} except the specified field is converted
1725to an integer for each line, and the numbers are compared. @samp{10}
1726comes before @samp{2} when considered as text, but after it when
1727considered as a number. By default, numbers are interpreted according
1728to @code{sort-numeric-base}, but numbers beginning with @samp{0x} or
1729@samp{0} are interpreted as hexadecimal and octal, respectively.
1730
1731@item M-x sort-columns
1732Like @kbd{M-x sort-fields} except that the text within each line
1733used for comparison comes from a fixed range of columns. See below
1734for an explanation.
1735
1736@item M-x reverse-region
1737Reverse the order of the lines in the region. This is useful for
1738sorting into descending order by fields or columns, since those sort
1739commands do not have a feature for doing that.
1740@end table
1741
1742 For example, if the buffer contains this:
1743
1744@smallexample
1745On systems where clash detection (locking of files being edited) is
1746implemented, Emacs also checks the first time you modify a buffer
1747whether the file has changed on disk since it was last visited or
1748saved. If it has, you are asked to confirm that you want to change
1749the buffer.
1750@end smallexample
1751
1752@noindent
1753applying @kbd{M-x sort-lines} to the entire buffer produces this:
1754
1755@smallexample
1756On systems where clash detection (locking of files being edited) is
1757implemented, Emacs also checks the first time you modify a buffer
1758saved. If it has, you are asked to confirm that you want to change
1759the buffer.
1760whether the file has changed on disk since it was last visited or
1761@end smallexample
1762
1763@noindent
1764where the upper-case @samp{O} sorts before all lower-case letters. If
1765you use @kbd{C-u 2 M-x sort-fields} instead, you get this:
1766
1767@smallexample
1768implemented, Emacs also checks the first time you modify a buffer
1769saved. If it has, you are asked to confirm that you want to change
1770the buffer.
1771On systems where clash detection (locking of files being edited) is
1772whether the file has changed on disk since it was last visited or
1773@end smallexample
1774
1775@noindent
1776where the sort keys were @samp{Emacs}, @samp{If}, @samp{buffer},
1777@samp{systems} and @samp{the}.
1778
1779@findex sort-columns
1780 @kbd{M-x sort-columns} requires more explanation. You specify the
1781columns by putting point at one of the columns and the mark at the other
1782column. Because this means you cannot put point or the mark at the
1783beginning of the first line of the text you want to sort, this command
1784uses an unusual definition of ``region'': all of the line point is in is
1785considered part of the region, and so is all of the line the mark is in,
1786as well as all the lines in between.
1787
1788 For example, to sort a table by information found in columns 10 to 15,
1789you could put the mark on column 10 in the first line of the table, and
1790point on column 15 in the last line of the table, and then run
1791@code{sort-columns}. Equivalently, you could run it with the mark on
1792column 15 in the first line and point on column 10 in the last line.
1793
1794 This can be thought of as sorting the rectangle specified by point and
1795the mark, except that the text on each line to the left or right of the
1796rectangle moves along with the text inside the rectangle.
1797@xref{Rectangles}.
1798
1799@vindex sort-fold-case
1800 Many of the sort commands ignore case differences when comparing, if
1801@code{sort-fold-case} is non-@code{nil}.
1802
1803@node Narrowing, Two-Column, Sorting, Top
1804@section Narrowing
1805@cindex widening
1806@cindex restriction
1807@cindex narrowing
1808@cindex accessible portion
1809
1810 @dfn{Narrowing} means focusing in on some portion of the buffer,
1811making the rest temporarily inaccessible. The portion which you can
1812still get to is called the @dfn{accessible portion}. Canceling the
1813narrowing, which makes the entire buffer once again accessible, is
1814called @dfn{widening}. The bounds of narrowing in effect in a buffer
1815are called the buffer's @dfn{restriction}.
1816
1817 Narrowing can make it easier to concentrate on a single subroutine or
1818paragraph by eliminating clutter. It can also be used to limit the
1819range of operation of a replace command or repeating keyboard macro.
1820
1821@table @kbd
1822@item C-x n n
1823Narrow down to between point and mark (@code{narrow-to-region}).
1824@item C-x n w
1825Widen to make the entire buffer accessible again (@code{widen}).
1826@item C-x n p
1827Narrow down to the current page (@code{narrow-to-page}).
1828@item C-x n d
1829Narrow down to the current defun (@code{narrow-to-defun}).
1830@end table
1831
1832 When you have narrowed down to a part of the buffer, that part appears
1833to be all there is. You can't see the rest, you can't move into it
1834(motion commands won't go outside the accessible part), you can't change
1835it in any way. However, it is not gone, and if you save the file all
1836the inaccessible text will be saved. The word @samp{Narrow} appears in
1837the mode line whenever narrowing is in effect.
1838
1839@kindex C-x n n
1840@findex narrow-to-region
1841 The primary narrowing command is @kbd{C-x n n} (@code{narrow-to-region}).
1842It sets the current buffer's restrictions so that the text in the current
1843region remains accessible, but all text before the region or after the
1844region is inaccessible. Point and mark do not change.
1845
1846@kindex C-x n p
1847@findex narrow-to-page
1848@kindex C-x n d
1849@findex narrow-to-defun
1850 Alternatively, use @kbd{C-x n p} (@code{narrow-to-page}) to narrow
1851down to the current page. @xref{Pages}, for the definition of a page.
1852@kbd{C-x n d} (@code{narrow-to-defun}) narrows down to the defun
1853containing point (@pxref{Defuns}).
1854
1855@kindex C-x n w
1856@findex widen
1857 The way to cancel narrowing is to widen with @kbd{C-x n w}
1858(@code{widen}). This makes all text in the buffer accessible again.
1859
1860 You can get information on what part of the buffer you are narrowed down
1861to using the @kbd{C-x =} command. @xref{Position Info}.
1862
1863 Because narrowing can easily confuse users who do not understand it,
1864@code{narrow-to-region} is normally a disabled command. Attempting to use
1865this command asks for confirmation and gives you the option of enabling it;
1866if you enable the command, confirmation will no longer be required for
1867it. @xref{Disabling}.
1868
1869@node Two-Column, Editing Binary Files, Narrowing, Top
1870@section Two-Column Editing
1871@cindex two-column editing
1872@cindex splitting columns
1873@cindex columns, splitting
1874
1875 Two-column mode lets you conveniently edit two side-by-side columns of
1876text. It uses two side-by-side windows, each showing its own
1877buffer.
1878
1879 There are three ways to enter two-column mode:
1880
1881@table @asis
1882@item @kbd{@key{F2} 2} or @kbd{C-x 6 2}
1883@kindex F2 2
1884@kindex C-x 6 2
1885@findex 2C-two-columns
1886Enter two-column mode with the current buffer on the left, and on the
1887right, a buffer whose name is based on the current buffer's name
1888(@code{2C-two-columns}). If the right-hand buffer doesn't already
1889exist, it starts out empty; the current buffer's contents are not
1890changed.
1891
1892This command is appropriate when the current buffer is empty or contains
1893just one column and you want to add another column.
1894
1895@item @kbd{@key{F2} s} or @kbd{C-x 6 s}
1896@kindex F2 s
1897@kindex C-x 6 s
1898@findex 2C-split
1899Split the current buffer, which contains two-column text, into two
1900buffers, and display them side by side (@code{2C-split}). The current
1901buffer becomes the left-hand buffer, but the text in the right-hand
1902column is moved into the right-hand buffer. The current column
1903specifies the split point. Splitting starts with the current line and
1904continues to the end of the buffer.
1905
1906This command is appropriate when you have a buffer that already contains
1907two-column text, and you wish to separate the columns temporarily.
1908
1909@item @kbd{@key{F2} b @var{buffer} @key{RET}}
1910@itemx @kbd{C-x 6 b @var{buffer} @key{RET}}
1911@kindex F2 b
1912@kindex C-x 6 b
1913@findex 2C-associate-buffer
1914Enter two-column mode using the current buffer as the left-hand buffer,
1915and using buffer @var{buffer} as the right-hand buffer
1916(@code{2C-associate-buffer}).
1917@end table
1918
1919 @kbd{@key{F2} s} or @kbd{C-x 6 s} looks for a column separator, which
1920is a string that appears on each line between the two columns. You can
1921specify the width of the separator with a numeric argument to
1922@kbd{@key{F2} s}; that many characters, before point, constitute the
1923separator string. By default, the width is 1, so the column separator
1924is the character before point.
1925
1926 When a line has the separator at the proper place, @kbd{@key{F2} s}
1927puts the text after the separator into the right-hand buffer, and
1928deletes the separator. Lines that don't have the column separator at
1929the proper place remain unsplit; they stay in the left-hand buffer, and
1930the right-hand buffer gets an empty line to correspond. (This is the
1931way to write a line that ``spans both columns while in two-column
1932mode'': write it in the left-hand buffer, and put an empty line in the
1933right-hand buffer.)
1934
1935@kindex F2 RET
1936@kindex C-x 6 RET
1937@findex 2C-newline
1938 The command @kbd{C-x 6 @key{RET}} or @kbd{@key{F2} @key{RET}}
1939(@code{2C-newline}) inserts a newline in each of the two buffers at
1940corresponding positions. This is the easiest way to add a new line to
1941the two-column text while editing it in split buffers.
1942
1943@kindex F2 1
1944@kindex C-x 6 1
1945@findex 2C-merge
1946 When you have edited both buffers as you wish, merge them with
1947@kbd{@key{F2} 1} or @kbd{C-x 6 1} (@code{2C-merge}). This copies the
1948text from the right-hand buffer as a second column in the other buffer.
1949To go back to two-column editing, use @kbd{@key{F2} s}.
1950
1951@kindex F2 d
1952@kindex C-x 6 d
1953@findex 2C-dissociate
1954 Use @kbd{@key{F2} d} or @kbd{C-x 6 d} to dissociate the two buffers,
1955leaving each as it stands (@code{2C-dissociate}). If the other buffer,
1956the one not current when you type @kbd{@key{F2} d}, is empty,
1957@kbd{@key{F2} d} kills it.
1958
1959@node Editing Binary Files, Saving Emacs Sessions, Two-Column, Top
1960@section Editing Binary Files
1961
1962@cindex Hexl mode
1963@cindex mode, Hexl
1964@cindex editing binary files
1965@cindex hex editing
1966 There is a special major mode for editing binary files: Hexl mode. To
1967use it, use @kbd{M-x hexl-find-file} instead of @kbd{C-x C-f} to visit
1968the file. This command converts the file's contents to hexadecimal and
1969lets you edit the translation. When you save the file, it is converted
1970automatically back to binary.
1971
1972 You can also use @kbd{M-x hexl-mode} to translate an existing buffer
1973into hex. This is useful if you visit a file normally and then discover
1974it is a binary file.
1975
1976 Ordinary text characters overwrite in Hexl mode. This is to reduce
1977the risk of accidentally spoiling the alignment of data in the file.
1978There are special commands for insertion. Here is a list of the
1979commands of Hexl mode:
1980
1981@c I don't think individual index entries for these commands are useful--RMS.
1982@table @kbd
1983@item C-M-d
1984Insert a byte with a code typed in decimal.
1985
1986@item C-M-o
1987Insert a byte with a code typed in octal.
1988
1989@item C-M-x
1990Insert a byte with a code typed in hex.
1991
1992@item C-x [
1993Move to the beginning of a 1k-byte ``page.''
1994
1995@item C-x ]
1996Move to the end of a 1k-byte ``page.''
1997
1998@item M-g
1999Move to an address specified in hex.
2000
2001@item M-j
2002Move to an address specified in decimal.
2003
2004@item C-c C-c
2005Leave Hexl mode, going back to the major mode this buffer had before you
2006invoked @code{hexl-mode}.
2007@end table
2008
2009@noindent
2010Other Hexl commands let you insert strings (sequences) of binary
2011bytes, move by @code{short}s or @code{int}s, etc.; type @kbd{C-h a
2012hexl-@key{RET}} for details.
2013
2014
2015@node Saving Emacs Sessions, Recursive Edit, Editing Binary Files, Top
2016@section Saving Emacs Sessions
2017@cindex saving sessions
2018@cindex restore session
2019@cindex remember editing session
2020@cindex reload files
2021@cindex desktop
2022
2023 Use the desktop library to save the state of Emacs from one session
2024to another. Once you save the Emacs @dfn{desktop}---the buffers,
2025their file names, major modes, buffer positions, and so on---then
2026subsequent Emacs sessions reload the saved desktop.
2027
2028@findex desktop-save
2029@vindex desktop-save-mode
2030 You can save the desktop manually with the command @kbd{M-x
2031desktop-save}. You can also enable automatic saving of the desktop
2032when you exit Emacs, and automatic restoration of the last saved
2033desktop when Emacs starts: use the Customization buffer (@pxref{Easy
2034Customization}) to set @code{desktop-save-mode} to @code{t} for future
2035sessions, or add this line in your @file{~/.emacs} file:
2036
2037@example
2038(desktop-save-mode 1)
2039@end example
2040
2041@findex desktop-change-dir
2042@findex desktop-revert
2043 If you turn on @code{desktop-save-mode} in your @file{~/.emacs},
2044then when Emacs starts, it looks for a saved desktop in the current
2045directory. Thus, you can have separate saved desktops in different
2046directories, and the starting directory determines which one Emacs
2047reloads. You can save the current desktop and reload one saved in
2048another directory by typing @kbd{M-x desktop-change-dir}. Typing
2049@kbd{M-x desktop-revert} reverts to the desktop previously reloaded.
2050
2051 Specify the option @samp{--no-desktop} on the command line when you
2052don't want it to reload any saved desktop. This turns off
2053@code{desktop-save-mode} for the current session. Starting Emacs with
2054the @samp{--no-init-file} option also disables desktop reloading,
2055since it bypasses the @file{.emacs} init file, where
2056@code{desktop-save-mode} is usually turned on.
2057
2058@vindex desktop-restore-eager
2059 By default, all the buffers in the desktop are restored at one go.
2060However, this may be slow if there are a lot of buffers in the
2061desktop. You can specify the maximum number of buffers to restore
2062immediately with the variable @code{desktop-restore-eager}; the
2063remaining buffers are restored ``lazily,'' when Emacs is idle.
2064
2065@findex desktop-clear
2066@vindex desktop-globals-to-clear
2067@vindex desktop-clear-preserve-buffers-regexp
2068 Type @kbd{M-x desktop-clear} to empty the Emacs desktop. This kills
2069all buffers except for internal ones, and clears the global variables
2070listed in @code{desktop-globals-to-clear}. If you want this to
2071preserve certain buffers, customize the variable
2072@code{desktop-clear-preserve-buffers-regexp}, whose value is a regular
2073expression matching the names of buffers not to kill.
2074
2075 If you want to save minibuffer history from one session to
2076another, use the @code{savehist} library.
2077
2078@node Recursive Edit, Emulation, Saving Emacs Sessions, Top
2079@section Recursive Editing Levels
2080@cindex recursive editing level
2081@cindex editing level, recursive
2082
2083 A @dfn{recursive edit} is a situation in which you are using Emacs
2084commands to perform arbitrary editing while in the middle of another
2085Emacs command. For example, when you type @kbd{C-r} inside of a
2086@code{query-replace}, you enter a recursive edit in which you can change
2087the current buffer. On exiting from the recursive edit, you go back to
2088the @code{query-replace}.
2089
2090@kindex C-M-c
2091@findex exit-recursive-edit
2092@cindex exiting recursive edit
2093 @dfn{Exiting} the recursive edit means returning to the unfinished
2094command, which continues execution. The command to exit is @kbd{C-M-c}
2095(@code{exit-recursive-edit}).
2096
2097 You can also @dfn{abort} the recursive edit. This is like exiting,
2098but also quits the unfinished command immediately. Use the command
2099@kbd{C-]} (@code{abort-recursive-edit}) to do this. @xref{Quitting}.
2100
2101 The mode line shows you when you are in a recursive edit by displaying
2102square brackets around the parentheses that always surround the major and
2103minor mode names. Every window's mode line shows this in the same way,
2104since being in a recursive edit is true of Emacs as a whole rather than
2105any particular window or buffer.
2106
2107 It is possible to be in recursive edits within recursive edits. For
2108example, after typing @kbd{C-r} in a @code{query-replace}, you may type a
2109command that enters the debugger. This begins a recursive editing level
2110for the debugger, within the recursive editing level for @kbd{C-r}.
2111Mode lines display a pair of square brackets for each recursive editing
2112level currently in progress.
2113
2114 Exiting the inner recursive edit (such as with the debugger @kbd{c}
2115command) resumes the command running in the next level up. When that
2116command finishes, you can then use @kbd{C-M-c} to exit another recursive
2117editing level, and so on. Exiting applies to the innermost level only.
2118Aborting also gets out of only one level of recursive edit; it returns
2119immediately to the command level of the previous recursive edit. If you
2120wish, you can then abort the next recursive editing level.
2121
2122 Alternatively, the command @kbd{M-x top-level} aborts all levels of
2123recursive edits, returning immediately to the top-level command reader.
2124
2125 The text being edited inside the recursive edit need not be the same text
2126that you were editing at top level. It depends on what the recursive edit
2127is for. If the command that invokes the recursive edit selects a different
2128buffer first, that is the buffer you will edit recursively. In any case,
2129you can switch buffers within the recursive edit in the normal manner (as
2130long as the buffer-switching keys have not been rebound). You could
2131probably do all the rest of your editing inside the recursive edit,
2132visiting files and all. But this could have surprising effects (such as
2133stack overflow) from time to time. So remember to exit or abort the
2134recursive edit when you no longer need it.
2135
2136 In general, we try to minimize the use of recursive editing levels in
2137GNU Emacs. This is because they constrain you to ``go back'' in a
2138particular order---from the innermost level toward the top level. When
2139possible, we present different activities in separate buffers so that
2140you can switch between them as you please. Some commands switch to a
2141new major mode which provides a command to switch back. These
2142approaches give you more flexibility to go back to unfinished tasks in
2143the order you choose.
2144
2145@node Emulation, Hyperlinking, Recursive Edit, Top
2146@section Emulation
2147@cindex emulating other editors
2148@cindex other editors
2149@cindex EDT
2150@cindex vi
2151@cindex PC key bindings
2152@cindex scrolling all windows
2153@cindex PC selection
2154@cindex Motif key bindings
2155@cindex Macintosh key bindings
2156@cindex WordStar
2157
2158 GNU Emacs can be programmed to emulate (more or less) most other
2159editors. Standard facilities can emulate these:
2160
2161@table @asis
2162@item CRiSP/Brief (PC editor)
2163@findex crisp-mode
2164@vindex crisp-override-meta-x
2165@findex scroll-all-mode
2166@cindex CRiSP mode
2167@cindex Brief emulation
2168@cindex emulation of Brief
2169@cindex mode, CRiSP
2170You can turn on key bindings to emulate the CRiSP/Brief editor with
2171@kbd{M-x crisp-mode}. Note that this rebinds @kbd{M-x} to exit Emacs
2172unless you set the variable @code{crisp-override-meta-x}. You can
2173also use the command @kbd{M-x scroll-all-mode} or set the variable
2174@code{crisp-load-scroll-all} to emulate CRiSP's scroll-all feature
2175(scrolling all windows together).
2176
2177@item EDT (DEC VMS editor)
2178@findex edt-emulation-on
2179@findex edt-emulation-off
2180Turn on EDT emulation with the command @kbd{M-x edt-emulation-on},
2181while @kbd{M-x edt-emulation-off} restores normal Emacs command
2182bindings.
2183
2184Most of the EDT emulation commands are keypad keys, and most standard
2185Emacs key bindings are still available. The EDT emulation rebindings
2186are done in the global keymap, so there is no problem switching
2187buffers or major modes while in EDT emulation.
2188
2189@item TPU (DEC VMS editor)
2190@findex tpu-edt-on
2191@cindex TPU
2192@kbd{M-x tpu-edt-on} turns on emulation of the TPU editor emulating EDT.
2193
2194@item vi (Berkeley editor)
2195@findex viper-mode
2196Viper is the newest emulator for vi. It implements several levels of
2197emulation; level 1 is closest to vi itself, while level 5 departs
2198somewhat from strict emulation to take advantage of the capabilities of
2199Emacs. To invoke Viper, type @kbd{M-x viper-mode}; it will guide you
2200the rest of the way and ask for the emulation level. @inforef{Top,
2201Viper, viper}.
2202
2203@item vi (another emulator)
2204@findex vi-mode
2205@kbd{M-x vi-mode} enters a major mode that replaces the previously
2206established major mode. All of the vi commands that, in real vi, enter
2207``input'' mode are programmed instead to return to the previous major
2208mode. Thus, ordinary Emacs serves as vi's ``input'' mode.
2209
2210Because vi emulation works through major modes, it does not work
2211to switch buffers during emulation. Return to normal Emacs first.
2212
2213If you plan to use vi emulation much, you probably want to bind a key
2214to the @code{vi-mode} command.
2215
2216@item vi (alternate emulator)
2217@findex vip-mode
2218@kbd{M-x vip-mode} invokes another vi emulator, said to resemble real vi
2219more thoroughly than @kbd{M-x vi-mode}. ``Input'' mode in this emulator
2220is changed from ordinary Emacs so you can use @key{ESC} to go back to
2221emulated vi command mode. To get from emulated vi command mode back to
2222ordinary Emacs, type @kbd{C-z}.
2223
2224This emulation does not work through major modes, and it is possible
2225to switch buffers in various ways within the emulator. It is not
2226so necessary to assign a key to the command @code{vip-mode} as
2227it is with @code{vi-mode} because terminating insert mode does
2228not use it.
2229
2230@inforef{Top, VIP, vip}, for full information.
2231
2232@item WordStar (old wordprocessor)
2233@findex wordstar-mode
2234@kbd{M-x wordstar-mode} provides a major mode with WordStar-like
2235key bindings.
2236@end table
2237
2238@node Hyperlinking, Dissociated Press, Emulation, Top
2239@section Hyperlinking and Navigation Features
2240
2241@cindex hyperlinking
2242@cindex navigation
2243 Various modes documented elsewhere have hypertext features so that
2244you can follow links, usually by clicking @kbd{Mouse-2} on the link or
2245typing @key{RET} while point is on the link. Clicking @kbd{Mouse-1}
2246quickly on the link also follows it. (Hold @kbd{Mouse-1} for longer
2247if you want to set point instead.)
2248
2249 Info mode, Help mode and the Dired-like modes are examples of modes
2250that have links in the buffer. The Tags facility links between uses
2251and definitions in source files, see @ref{Tags}. Imenu provides
2252navigation amongst items indexed in the current buffer, see
2253@ref{Imenu}. Info-lookup provides mode-specific lookup of definitions
2254in Info indexes, see @ref{Documentation}. Speedbar maintains a frame
2255in which links to files, and locations in files are displayed, see
2256@ref{Speedbar}.
2257
2258 Other non-mode-specific facilities described in this section enable
2259following links from the current buffer in a context-sensitive
2260fashion.
2261
2262@menu
2263* Browse-URL:: Following URLs.
2264* Goto-address:: Activating URLs.
2265* FFAP:: Finding files etc. at point.
2266@end menu
2267
2268@node Browse-URL
2269@subsection Following URLs
2270@cindex World Wide Web
2271@cindex Web
2272@findex browse-url
2273@findex browse-url-at-point
2274@findex browse-url-at-mouse
2275@cindex Browse-URL
2276@cindex URLs
2277
2278@table @kbd
2279@item M-x browse-url @key{RET} @var{url} @key{RET}
2280Load a URL into a Web browser.
2281@end table
2282
2283The Browse-URL package provides facilities for following URLs specifying
2284links on the World Wide Web. Usually this works by invoking a web
2285browser, but you can, for instance, arrange to invoke @code{compose-mail}
2286from @samp{mailto:} URLs.
2287
2288 The general way to use this feature is to type @kbd{M-x browse-url},
2289which displays a specified URL. If point is located near a plausible
2290URL, that URL is used as the default. Other commands are available
2291which you might like to bind to keys, such as
2292@code{browse-url-at-point} and @code{browse-url-at-mouse}.
2293
2294@vindex browse-url-browser-function
2295 You can customize Browse-URL's behavior via various options in the
2296@code{browse-url} Customize group, particularly
2297@code{browse-url-browser-function}. You can invoke actions dependent
2298on the type of URL by defining @code{browse-url-browser-function} as
2299an association list. The package's commentary available via @kbd{C-h
2300p} under the @samp{hypermedia} keyword provides more information.
2301Packages with facilities for following URLs should always go through
2302Browse-URL, so that the customization options for Browse-URL will
2303affect all browsing in Emacs.
2304
2305@node Goto-address
2306@subsection Activating URLs
2307@findex goto-address
2308@cindex Goto-address
2309@cindex URLs, activating
2310
2311@table @kbd
2312@item M-x goto-address
2313Activate URLs and e-mail addresses in the current buffer.
2314@end table
2315
2316 You can make URLs in the current buffer active with @kbd{M-x
2317goto-address}. This finds all the URLs in the buffer, and establishes
2318bindings for @kbd{Mouse-2} and @kbd{C-c @key{RET}} on them. After
2319activation, if you click on a URL with @kbd{Mouse-2}, or move to a URL
2320and type @kbd{C-c @key{RET}}, that will display the web page that the URL
2321specifies. For a @samp{mailto} URL, it sends mail instead, using your
2322selected mail-composition method (@pxref{Mail Methods}).
2323
2324 It can be useful to add @code{goto-address} to mode hooks and the
2325hooks used to display an incoming message.
2326@code{rmail-show-message-hook} is the appropriate hook for Rmail, and
2327@code{mh-show-mode-hook} for MH-E. This is not needed for Gnus,
2328which has a similar feature of its own.
2329
2330
2331@node FFAP
2332@subsection Finding Files and URLs at Point
2333@findex find-file-at-point
2334@findex ffap
2335@findex dired-at-point
2336@findex ffap-next
2337@findex ffap-menu
2338@cindex finding file at point
2339
2340 FFAP mode replaces certain key bindings for finding files, including
2341@kbd{C-x C-f}, with commands that provide more sensitive defaults.
2342These commands behave like the ordinary ones when given a prefix
2343argument. Otherwise, they get the default file name or URL from the
2344text around point. If what is found in the buffer has the form of a
2345URL rather than a file name, the commands use @code{browse-url} to
2346view it.
2347
2348 This feature is useful for following references in mail or news
2349buffers, @file{README} files, @file{MANIFEST} files, and so on. The
2350@samp{ffap} package's commentary available via @kbd{C-h p} under the
2351@samp{files} keyword and the @code{ffap} Custom group provide details.
2352
2353@cindex FFAP minor mode
2354@findex ffap-mode
2355 You can turn on FFAP minor mode by calling @code{ffap-bindings} to
2356make the following key bindings and to install hooks for using
2357@code{ffap} in Rmail, Gnus and VM article buffers.
2358
2359@table @kbd
2360@item C-x C-f @var{filename} @key{RET}
2361@kindex C-x C-f @r{(FFAP)}
2362Find @var{filename}, guessing a default from text around point
2363(@code{find-file-at-point}).
2364@item C-x C-r
2365@kindex C-x C-r @r{(FFAP)}
2366@code{ffap-read-only}, analogous to @code{find-file-read-only}.
2367@item C-x C-v
2368@kindex C-x C-v @r{(FFAP)}
2369@code{ffap-alternate-file}, analogous to @code{find-alternate-file}.
2370@item C-x d @var{directory} @key{RET}
2371@kindex C-x d @r{(FFAP)}
2372Start Dired on @var{directory}, defaulting to the directory name at
2373point (@code{dired-at-point}).
2374@item C-x C-d
2375@code{ffap-list-directory}, analogous to @code{list-directory}.
2376@item C-x 4 f
2377@kindex C-x 4 f @r{(FFAP)}
2378@code{ffap-other-window}, analogous to @code{find-file-other-window}.
2379@item C-x 4 r
2380@code{ffap-read-only-other-window}, analogous to
2381@code{find-file-read-only-other-window}.
2382@item C-x 4 d
2383@code{ffap-dired-other-window}, analogous to @code{dired-other-window}.
2384@item C-x 5 f
2385@kindex C-x 5 f @r{(FFAP)}
2386@code{ffap-other-frame}, analogous to @code{find-file-other-frame}.
2387@item C-x 5 r
2388@code{ffap-read-only-other-frame}, analogous to
2389@code{find-file-read-only-other-frame}.
2390@item C-x 5 d
2391@code{ffap-dired-other-frame}, analogous to @code{dired-other-frame}.
2392@item M-x ffap-next
2393Search buffer for next file name or URL, then find that file or URL.
2394@item S-Mouse-3
2395@kindex S-Mouse-3 @r{(FFAP)}
2396@code{ffap-at-mouse} finds the file guessed from text around the position
2397of a mouse click.
2398@item C-S-Mouse-3
2399@kindex C-S-Mouse-3 @r{(FFAP)}
2400Display a menu of files and URLs mentioned in current buffer, then
2401find the one you select (@code{ffap-menu}).
2402@end table
2403
2404@node Dissociated Press, Amusements, Hyperlinking, Top
2405@section Dissociated Press
2406
2407@findex dissociated-press
2408 @kbd{M-x dissociated-press} is a command for scrambling a file of text
2409either word by word or character by character. Starting from a buffer of
2410straight English, it produces extremely amusing output. The input comes
2411from the current Emacs buffer. Dissociated Press writes its output in a
2412buffer named @samp{*Dissociation*}, and redisplays that buffer after every
2413couple of lines (approximately) so you can read the output as it comes out.
2414
2415 Dissociated Press asks every so often whether to continue generating
2416output. Answer @kbd{n} to stop it. You can also stop at any time by
2417typing @kbd{C-g}. The dissociation output remains in the
2418@samp{*Dissociation*} buffer for you to copy elsewhere if you wish.
2419
2420@cindex presidentagon
2421 Dissociated Press operates by jumping at random from one point in the
2422buffer to another. In order to produce plausible output rather than
2423gibberish, it insists on a certain amount of overlap between the end of
2424one run of consecutive words or characters and the start of the next.
2425That is, if it has just output `president' and then decides to jump
2426to a different point in the file, it might spot the `ent' in `pentagon'
2427and continue from there, producing `presidentagon'.@footnote{This
2428dissociword actually appeared during the Vietnam War, when it was very
2429appropriate. Bush has made it appropriate again.} Long sample texts
2430produce the best results.
2431
2432@cindex againformation
2433 A positive argument to @kbd{M-x dissociated-press} tells it to operate
2434character by character, and specifies the number of overlap characters. A
2435negative argument tells it to operate word by word, and specifies the number
2436of overlap words. In this mode, whole words are treated as the elements to
2437be permuted, rather than characters. No argument is equivalent to an
2438argument of two. For your againformation, the output goes only into the
2439buffer @samp{*Dissociation*}. The buffer you start with is not changed.
2440
2441@cindex Markov chain
2442@cindex ignoriginal
2443@cindex techniquitous
2444 Dissociated Press produces results fairly like those of a Markov
2445chain based on a frequency table constructed from the sample text. It
2446is, however, an independent, ignoriginal invention. Dissociated Press
2447techniquitously copies several consecutive characters from the sample
2448between random choices, whereas a Markov chain would choose randomly
2449for each word or character. This makes for more plausible sounding
2450results, and runs faster.
2451
2452@cindex outragedy
2453@cindex buggestion
2454@cindex properbose
2455@cindex mustatement
2456@cindex developediment
2457@cindex userenced
2458 It is a mustatement that too much use of Dissociated Press can be a
2459developediment to your real work, sometimes to the point of outragedy.
2460And keep dissociwords out of your documentation, if you want it to be well
2461userenced and properbose. Have fun. Your buggestions are welcome.
2462
2463@node Amusements, Customization, Dissociated Press, Top
2464@section Other Amusements
2465@cindex boredom
2466@findex hanoi
2467@findex yow
2468@findex gomoku
2469@cindex tower of Hanoi
2470
2471 If you are a little bit bored, you can try @kbd{M-x hanoi}. If you are
2472considerably bored, give it a numeric argument. If you are very, very
2473bored, try an argument of 9. Sit back and watch.
2474
2475@cindex Go Moku
2476 If you want a little more personal involvement, try @kbd{M-x gomoku},
2477which plays the game Go Moku with you.
2478
2479@findex blackbox
2480@findex mpuz
2481@findex 5x5
2482@cindex puzzles
2483 @kbd{M-x blackbox}, @kbd{M-x mpuz} and @kbd{M-x 5x5} are puzzles.
2484@code{blackbox} challenges you to determine the location of objects
2485inside a box by tomography. @code{mpuz} displays a multiplication
2486puzzle with letters standing for digits in a code that you must
2487guess---to guess a value, type a letter and then the digit you think it
2488stands for. The aim of @code{5x5} is to fill in all the squares.
2489
2490@findex decipher
2491@cindex ciphers
2492@cindex cryptanalysis
2493@kbd{M-x decipher} helps you to cryptanalyze a buffer which is encrypted
2494in a simple monoalphabetic substitution cipher.
2495
2496@findex dunnet
2497 @kbd{M-x dunnet} runs an adventure-style exploration game, which is
2498a bigger sort of puzzle.
2499
2500@findex lm
2501@cindex landmark game
2502@kbd{M-x lm} runs a relatively non-participatory game in which a robot
2503attempts to maneuver towards a tree at the center of the window based on
2504unique olfactory cues from each of the four directions.
2505
2506@findex life
2507@cindex Life
2508@kbd{M-x life} runs Conway's ``Life'' cellular automaton.
2509
2510@findex morse-region
2511@findex unmorse-region
2512@cindex Morse code
2513@cindex --/---/.-./.../.
2514@kbd{M-x morse-region} converts text in a region to Morse code and
2515@kbd{M-x unmorse-region} converts it back. No cause for remorse.
2516
2517@findex pong
2518@cindex Pong game
2519@kbd{M-x pong} plays a Pong-like game, bouncing the ball off opposing
2520bats.
2521
2522@findex solitaire
2523@cindex solitaire
2524@kbd{M-x solitaire} plays a game of solitaire in which you jump pegs
2525across other pegs.
2526
2527@findex studlify-region
2528@cindex StudlyCaps
2529@kbd{M-x studlify-region} studlify-cases the region, producing
2530text like this:
2531
2532@example
2533M-x stUdlIfY-RegioN stUdlIfY-CaSeS thE region.
2534@end example
2535
2536@findex tetris
2537@cindex Tetris
2538@findex snake
2539@cindex Snake
2540@kbd{M-x tetris} runs an implementation of the well-known Tetris game.
2541Likewise, @kbd{M-x snake} provides an implementation of Snake.
2542
2543 When you are frustrated, try the famous Eliza program. Just do
2544@kbd{M-x doctor}. End each input by typing @key{RET} twice.
2545
2546@cindex Zippy
2547 When you are feeling strange, type @kbd{M-x yow}.
2548
2549@findex zone
2550The command @kbd{M-x zone} plays games with the display when Emacs is
2551idle.
2552
2553@ifnottex
2554@lowersections
2555@end ifnottex
2556
2557@ignore
2558 arch-tag: 8f094220-c0d5-4e9e-af7d-3e0da8187474
2559@end ignore
diff --git a/doc/emacs/msdog-xtra.texi b/doc/emacs/msdog-xtra.texi
new file mode 100644
index 00000000000..432f28888f6
--- /dev/null
+++ b/doc/emacs/msdog-xtra.texi
@@ -0,0 +1,687 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node MS-DOS
8@section Emacs and MS-DOS
9@cindex MS-DOG
10@cindex MS-DOS peculiarities
11
12 This section briefly describes the peculiarities of using Emacs on
13the MS-DOS ``operating system'' (also known as ``MS-DOG'').
14@iftex
15Information about Emacs and Microsoft's current operating system
16Windows (also known as ``Losedows) is in the main Emacs manual
17(@pxref{Microsoft Systems,,, emacs, the Emacs Manual}).
18@end iftex
19@ifnottex
20Information about peculiarities common to MS-DOS and Microsoft's
21current operating systems Windows (also known as ``Losedows) is in
22@ref{Microsoft Windows}.
23@end ifnottex
24
25 If you build Emacs for MS-DOS, the binary will also run on Windows
263.X, Windows NT, Windows 9X/ME, Windows 2000/XP, or OS/2 as a DOS
27application; all of this chapter applies for all of those systems, if
28you use an Emacs that was built for MS-DOS.
29
30@iftex
31 @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
32@end iftex
33@ifnottex
34 @xref{Text and Binary}, for information
35@end ifnottex
36about Emacs' special handling of text files under MS-DOS (and Windows).
37
38@menu
39* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS.
40* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
41* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
42* Files: MS-DOS File Names. File name conventions on MS-DOS.
43* Printing: MS-DOS Printing. Printing specifics on MS-DOS.
44* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
45* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
46@end menu
47
48@node MS-DOS Keyboard
49@subsection Keyboard Usage on MS-DOS
50
51@kindex DEL @r{(MS-DOS)}
52@kindex BS @r{(MS-DOS)}
53 The key that is called @key{DEL} in Emacs (because that's how it is
54designated on most workstations) is known as @key{BS} (backspace) on a
55PC. That is why the PC-specific terminal initialization remaps the
56@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
57as @kbd{C-d} for the same reasons.
58
59@kindex C-g @r{(MS-DOS)}
60@kindex C-BREAK @r{(MS-DOS)}
61@cindex quitting on MS-DOS
62 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
63character, just like @kbd{C-g}. This is because Emacs cannot detect
64that you have typed @kbd{C-g} until it is ready for more input. As a
65consequence, you cannot use @kbd{C-g} to stop a running command
66@iftex
67(@pxref{Quitting,,,emacs, the Emacs Manual}).
68@end iftex
69@ifnottex
70(@pxref{Quitting}).
71@end ifnottex
72By contrast, @kbd{C-@key{BREAK}} @emph{is} detected as soon as you
73type it (as @kbd{C-g} is on other systems), so it can be used to stop
74a running command and for emergency escape
75@iftex
76(@pxref{Emergency Escape,,,emacs, the Emacs Manual}).
77@end iftex
78@ifnottex
79(@pxref{Emergency Escape}).
80@end ifnottex
81
82@cindex Meta (under MS-DOS)
83@cindex Hyper (under MS-DOS)
84@cindex Super (under MS-DOS)
85@vindex dos-super-key
86@vindex dos-hyper-key
87 The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
88You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
89choose either the right @key{CTRL} key or the right @key{ALT} key by
90setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
91or 2 respectively. If neither @code{dos-super-key} nor
92@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
93also mapped to the @key{META} key. However, if the MS-DOS international
94keyboard support program @file{KEYB.COM} is installed, Emacs will
95@emph{not} map the right @key{ALT} to @key{META}, since it is used for
96accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
97layouts; in this case, you may only use the left @key{ALT} as @key{META}
98key.
99
100@kindex C-j @r{(MS-DOS)}
101@vindex dos-keypad-mode
102 The variable @code{dos-keypad-mode} is a flag variable that controls
103what key codes are returned by keys in the numeric keypad. You can also
104define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
105following line into your @file{_emacs} file:
106
107@smallexample
108;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
109(define-key function-key-map [kp-enter] [?\C-j])
110@end smallexample
111
112@node MS-DOS Mouse
113@subsection Mouse Usage on MS-DOS
114
115@cindex mouse support under MS-DOS
116 Emacs on MS-DOS supports a mouse (on the default terminal only).
117The mouse commands work as documented, including those that use menus
118and the menu bar
119@iftex
120(@pxref{Menu Bar,,,emacs, the Emacs Manual}).
121@end iftex
122@ifnottex
123(@pxref{Menu Bar}).
124@end ifnottex
125 Scroll bars don't work in MS-DOS Emacs. PC mice usually have only
126two buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
127press both of them together, that has the effect of @kbd{Mouse-3}. If
128the mouse does have 3 buttons, Emacs detects that at startup, and all
129the 3 buttons function normally, as on X.
130
131 Help strings for menu-bar and pop-up menus are displayed in the echo
132area when the mouse pointer moves across the menu items. Highlighting
133of mouse-sensitive text
134@iftex
135(@pxref{Mouse References,,,emacs, the Emacs Manual})
136@end iftex
137@ifnottex
138(@pxref{Mouse References})
139@end ifnottex
140is also supported.
141
142@cindex mouse, set number of buttons
143@findex msdos-set-mouse-buttons
144 Some versions of mouse drivers don't report the number of mouse
145buttons correctly. For example, mice with a wheel report that they
146have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
147the wheel, which serves as the middle button, are not passed. In
148these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
149to tell Emacs how many mouse buttons to expect. You could make such a
150setting permanent by adding this fragment to your @file{_emacs} init
151file:
152
153@example
154;; @r{Treat the mouse like a 2-button mouse.}
155(msdos-set-mouse-buttons 2)
156@end example
157
158@cindex Windows clipboard support
159 Emacs built for MS-DOS supports clipboard operations when it runs on
160Windows. Commands that put text on the kill ring, or yank text from
161the ring, check the Windows clipboard first, just as Emacs does on the
162X Window System
163@iftex
164(@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
165@end iftex
166@ifnottex
167(@pxref{Mouse Commands}).
168@end ifnottex
169Only the primary selection and the cut buffer are supported by MS-DOS
170Emacs on Windows; the secondary selection always appears as empty.
171
172 Due to the way clipboard access is implemented by Windows, the
173length of text you can put into the clipboard is limited by the amount
174of free DOS memory that is available to Emacs. Usually, up to 620KB of
175text can be put into the clipboard, but this limit depends on the system
176configuration and is lower if you run Emacs as a subprocess of
177another program. If the killed text does not fit, Emacs outputs a
178message saying so, and does not put the text into the clipboard.
179
180 Null characters also cannot be put into the Windows clipboard. If the
181killed text includes null characters, Emacs does not put such text into
182the clipboard, and displays in the echo area a message to that effect.
183
184@vindex dos-display-scancodes
185 The variable @code{dos-display-scancodes}, when non-@code{nil},
186directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
187each keystroke; this feature serves as a complement to the
188@code{view-lossage} command, for debugging.
189
190@node MS-DOS Display
191@subsection Display on MS-DOS
192@cindex faces under MS-DOS
193@cindex fonts, emulating under MS-DOS
194
195 Display on MS-DOS cannot use font variants, like bold or italic, but
196it does support multiple faces, each of which can specify a foreground
197and a background color. Therefore, you can get the full functionality
198of Emacs packages that use fonts (such as @code{font-lock}, Enriched
199Text mode, and others) by defining the relevant faces to use different
200colors. Use the @code{list-colors-display} command
201@iftex
202(@pxref{Frame Parameters,,,emacs, the Emacs Manual})
203@end iftex
204@ifnottex
205(@pxref{Frame Parameters})
206@end ifnottex
207and the @code{list-faces-display} command
208@iftex
209(@pxref{Faces,,,emacs, the Emacs Manual})
210@end iftex
211@ifnottex
212(@pxref{Faces})
213@end ifnottex
214to see what colors and faces are available and what they look like.
215
216 @xref{MS-DOS and MULE}, later in this chapter, for information on
217how Emacs displays glyphs and characters that aren't supported by the
218native font built into the DOS display.
219
220@cindex cursor shape on MS-DOS
221 When Emacs starts, it changes the cursor shape to a solid box. This
222is for compatibility with other systems, where the box cursor is the
223default in Emacs. This default shape can be changed to a bar by
224specifying the @code{cursor-type} parameter in the variable
225@code{default-frame-alist}
226@iftex
227(@pxref{Creating Frames,,,emacs, the Emacs Manual}).
228@end iftex
229@ifnottex
230(@pxref{Creating Frames}).
231@end ifnottex
232The MS-DOS terminal doesn't support a vertical-bar cursor,
233so the bar cursor is horizontal, and the @code{@var{width}} parameter,
234if specified by the frame parameters, actually determines its height.
235For this reason, the @code{bar} and @code{hbar} cursor types produce
236the same effect on MS-DOS. As an extension, the bar cursor
237specification can include the starting scan line of the cursor as well
238as its width, like this:
239
240@example
241 '(cursor-type bar @var{width} . @var{start})
242@end example
243
244@noindent
245In addition, if the @var{width} parameter is negative, the cursor bar
246begins at the top of the character cell.
247
248@cindex frames on MS-DOS
249 The MS-DOS terminal can only display a single frame at a time. The
250Emacs frame facilities work on MS-DOS much as they do on text-only
251terminals
252@iftex
253(@pxref{Frames,,,emacs, the Emacs Manual}).
254@end iftex
255@ifnottex
256(@pxref{Frames}).
257@end ifnottex
258When you run Emacs from a DOS window on MS-Windows, you can make the
259visible frame smaller than the full screen, but Emacs still cannot
260display more than a single frame at a time.
261
262@cindex frame size under MS-DOS
263@findex mode4350
264@findex mode25
265 The @code{mode4350} command switches the display to 43 or 50
266lines, depending on your hardware; the @code{mode25} command switches
267to the default 80x25 screen size.
268
269 By default, Emacs only knows how to set screen sizes of 80 columns by
27025, 28, 35, 40, 43 or 50 rows. However, if your video adapter has
271special video modes that will switch the display to other sizes, you can
272have Emacs support those too. When you ask Emacs to switch the frame to
273@var{n} rows by @var{m} columns dimensions, it checks if there is a
274variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
275uses its value (which must be an integer) as the video mode to switch
276to. (Emacs switches to that video mode by calling the BIOS @code{Set
277Video Mode} function with the value of
278@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
279For example, suppose your adapter will switch to 66x80 dimensions when
280put into video mode 85. Then you can make Emacs support this screen
281size by putting the following into your @file{_emacs} file:
282
283@example
284(setq screen-dimensions-66x80 85)
285@end example
286
287 Since Emacs on MS-DOS can only set the frame size to specific
288supported dimensions, it cannot honor every possible frame resizing
289request. When an unsupported size is requested, Emacs chooses the next
290larger supported size beyond the specified size. For example, if you
291ask for 36x80 frame, you will get 40x80 instead.
292
293 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
294when they exactly match the specified size; the search for the next
295larger supported size ignores them. In the above example, even if your
296VGA supports 38x80 dimensions and you define a variable
297@code{screen-dimensions-38x80} with a suitable value, you will still get
29840x80 screen when you ask for a 36x80 frame. If you want to get the
29938x80 size in this case, you can do it by setting the variable named
300@code{screen-dimensions-36x80} with the same video mode value as
301@code{screen-dimensions-38x80}.
302
303 Changing frame dimensions on MS-DOS has the effect of changing all the
304other frames to the new dimensions.
305
306@node MS-DOS File Names
307@subsection File Names on MS-DOS
308@cindex file names under MS-DOS
309@cindex init file, default name under MS-DOS
310
311 On MS-DOS, file names are case-insensitive and limited to eight
312characters, plus optionally a period and three more characters. Emacs
313knows enough about these limitations to handle file names that were
314meant for other operating systems. For instance, leading dots
315@samp{.} in file names are invalid in MS-DOS, so Emacs transparently
316converts them to underscores @samp{_}; thus your default init file
317@iftex
318(@pxref{Init File,,,emacs, the Emacs Manual})
319@end iftex
320@ifnottex
321(@pxref{Init File})
322@end ifnottex
323is called @file{_emacs} on MS-DOS. Excess characters before or after
324the period are generally ignored by MS-DOS itself; thus, if you visit
325the file @file{LongFileName.EvenLongerExtension}, you will silently
326get @file{longfile.eve}, but Emacs will still display the long file
327name on the mode line. Other than that, it's up to you to specify
328file names which are valid under MS-DOS; the transparent conversion as
329described above only works on file names built into Emacs.
330
331@cindex backup file names on MS-DOS
332 The above restrictions on the file names on MS-DOS make it almost
333impossible to construct the name of a backup file
334@iftex
335(@pxref{Backup Names,,,emacs, the Emacs Manual})
336@end iftex
337@ifnottex
338(@pxref{Backup Names})
339@end ifnottex
340without losing some of the original file name characters. For
341example, the name of a backup file for @file{docs.txt} is
342@file{docs.tx~} even if single backup is used.
343
344@cindex file names under Windows 95/NT
345@cindex long file names in DOS box under Windows 95/NT
346 If you run Emacs as a DOS application under Windows 9X, Windows ME, or
347Windows 2000/XP, you can turn on support for long file names. If you do
348that, Emacs doesn't truncate file names or convert them to lower case;
349instead, it uses the file names that you specify, verbatim. To enable
350long file name support, set the environment variable @env{LFN} to
351@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow
352DOS programs to access long file names, so Emacs built for MS-DOS will
353only see their short 8+3 aliases.
354
355@cindex @env{HOME} directory under MS-DOS
356 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
357that the directory where it is installed is the value of the @env{HOME}
358environment variable. That is, if your Emacs binary,
359@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
360Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
361particular, that is where Emacs looks for the init file @file{_emacs}.
362With this in mind, you can use @samp{~} in file names as an alias for
363the home directory, as you would on GNU or Unix. You can also set
364@env{HOME} variable in the environment before starting Emacs; its
365value will then override the above default behavior.
366
367 Emacs on MS-DOS handles the directory name @file{/dev} specially,
368because of a feature in the emulator libraries of DJGPP that pretends
369I/O devices have names in that directory. We recommend that you avoid
370using an actual directory named @file{/dev} on any disk.
371
372@node MS-DOS Printing
373@subsection Printing and MS-DOS
374
375 Printing commands, such as @code{lpr-buffer}
376@iftex
377(@pxref{Printing,,,emacs, the Emacs Manual}) and @code{ps-print-buffer}
378(@pxref{PostScript,,,emacs, the Emacs Manual})
379@end iftex
380@ifnottex
381(@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript})
382@end ifnottex
383can work on MS-DOS by sending the output to one of the printer ports,
384if a Posix-style @code{lpr} program is unavailable. The same Emacs
385variables control printing on all systems, but in some cases they have
386different default values on MS-DOS.
387
388@iftex
389@xref{Windows Printing,,,emacs, the Emacs Manual},
390@end iftex
391@ifnottex
392@xref{Windows Printing},
393@end ifnottex
394for details about setting up printing to a networked printer.
395
396 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
397though they are connected to a Windows machine which uses a different
398encoding for the same locale. For example, in the Latin-1 locale, DOS
399uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and
400MULE}. When you print to such printers from Windows, you can use the
401@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
402@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
403codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET
404M-x lpr-region RET} will print the region while converting it to the
405codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
406coding system with @kbd{M-x codepage-setup}.
407
408@vindex dos-printer
409@vindex dos-ps-printer
410 For backwards compatibility, the value of @code{dos-printer}
411(@code{dos-ps-printer}), if it has a value, overrides the value of
412@code{printer-name} (@code{ps-printer-name}), on MS-DOS.
413
414
415@node MS-DOS and MULE
416@subsection International Support on MS-DOS
417@cindex international support @r{(MS-DOS)}
418
419 Emacs on MS-DOS supports the same international character sets as it
420does on GNU, Unix and other platforms
421@iftex
422(@pxref{International,,,emacs, the Emacs Manual}),
423@end iftex
424@ifnottex
425(@pxref{International}),
426@end ifnottex
427including coding systems for converting between the different
428character sets. However, due to incompatibilities between
429MS-DOS/MS-Windows and other systems, there are several DOS-specific
430aspects of this support that you should be aware of. This section
431describes these aspects.
432
433 The description below is largely specific to the MS-DOS port of
434Emacs, especially where it talks about practical implications for
435Emacs users. For other operating systems, see the @file{code-pages.el}
436package, which implements support for MS-DOS- and MS-Windows-specific
437encodings for all platforms other than MS-DOS.
438
439@table @kbd
440@item M-x dos-codepage-setup
441Set up Emacs display and coding systems as appropriate for the current
442DOS codepage.
443
444@item M-x codepage-setup
445Create a coding system for a certain DOS codepage.
446@end table
447
448@cindex codepage, MS-DOS
449@cindex DOS codepages
450 MS-DOS is designed to support one character set of 256 characters at
451any given time, but gives you a variety of character sets to choose
452from. The alternative character sets are known as @dfn{DOS codepages}.
453Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
454characters (codes 128 through 255) vary from one codepage to another.
455Each DOS codepage is identified by a 3-digit number, such as 850, 862,
456etc.
457
458 In contrast to X, which lets you use several fonts at the same time,
459MS-DOS normally doesn't allow use of several codepages in a single
460session. MS-DOS was designed to load a single codepage at system
461startup, and require you to reboot in order to change
462it@footnote{Normally, one particular codepage is burnt into the
463display memory, while other codepages can be installed by modifying
464system configuration files, such as @file{CONFIG.SYS}, and rebooting.
465While there is third-party software that allows changing the codepage
466without rebooting, we describe here how a stock MS-DOS system
467behaves.}. Much the same limitation applies when you run DOS
468executables on other systems such as MS-Windows.
469
470@cindex unibyte operation @r{(MS-DOS)}
471 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
472@iftex
473(@pxref{Initial Options,,,emacs, the Emacs Manual}),
474@end iftex
475@ifnottex
476(@pxref{Initial Options}),
477@end ifnottex
478Emacs does not perform any conversion of non-@acronym{ASCII}
479characters. Instead, it reads and writes any non-@acronym{ASCII}
480characters verbatim, and sends their 8-bit codes to the display
481verbatim. Thus, unibyte Emacs on MS-DOS supports the current
482codepage, whatever it may be, but cannot even represent any other
483characters.
484
485@vindex dos-codepage
486 For multibyte operation on MS-DOS, Emacs needs to know which
487characters the chosen DOS codepage can display. So it queries the
488system shortly after startup to get the chosen codepage number, and
489stores the number in the variable @code{dos-codepage}. Some systems
490return the default value 437 for the current codepage, even though the
491actual codepage is different. (This typically happens when you use the
492codepage built into the display hardware.) You can specify a different
493codepage for Emacs to use by setting the variable @code{dos-codepage} in
494your init file.
495
496@cindex language environment, automatic selection on @r{MS-DOS}
497 Multibyte Emacs supports only certain DOS codepages: those which can
498display Far-Eastern scripts, like the Japanese codepage 932, and those
499that encode a single ISO 8859 character set.
500
501 The Far-Eastern codepages can directly display one of the MULE
502character sets for these countries, so Emacs simply sets up to use the
503appropriate terminal coding system that is supported by the codepage.
504The special features described in the rest of this section mostly
505pertain to codepages that encode ISO 8859 character sets.
506
507 For the codepages which correspond to one of the ISO character sets,
508Emacs knows the character set name based on the codepage number. Emacs
509automatically creates a coding system to support reading and writing
510files that use the current codepage, and uses this coding system by
511default. The name of this coding system is @code{cp@var{nnn}}, where
512@var{nnn} is the codepage number.@footnote{The standard Emacs coding
513systems for ISO 8859 are not quite right for the purpose, because
514typically the DOS codepage does not match the standard ISO character
515codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
516code 231 in the standard Latin-1 character set, but the corresponding
517DOS codepage 850 uses code 135 for this glyph.}
518
519@cindex mode line @r{(MS-DOS)}
520 All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
521(for ``DOS'') as their mode-line mnemonic. Since both the terminal
522coding system and the default coding system for file I/O are set to
523the proper @code{cp@var{nnn}} coding system at startup, it is normal
524for the mode line on MS-DOS to begin with @samp{-DD\-}.
525@iftex
526@xref{Mode Line,,,emacs, the Emacs Manual}.
527@end iftex
528@ifnottex
529@xref{Mode Line}.
530@end ifnottex
531Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding
532systems, and thus their initial mode line looks like the Emacs
533default.
534
535 Since the codepage number also indicates which script you are using,
536Emacs automatically runs @code{set-language-environment} to select the
537language environment for that script
538@iftex
539(@pxref{Language Environments,,,emacs, the Emacs Manual}).
540@end iftex
541@ifnottex
542(@pxref{Language Environments}).
543@end ifnottex
544
545 If a buffer contains a character belonging to some other ISO 8859
546character set, not the one that the chosen DOS codepage supports, Emacs
547displays it using a sequence of @acronym{ASCII} characters. For example, if the
548current codepage doesn't have a glyph for the letter @samp{@`o} (small
549@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
550the braces serve as a visual indication that this is a single character.
551(This may look awkward for some non-Latin characters, such as those from
552Greek or Hebrew alphabets, but it is still readable by a person who
553knows the language.) Even though the character may occupy several
554columns on the screen, it is really still just a single character, and
555all Emacs commands treat it as one.
556
557@cindex IBM graphics characters (MS-DOS)
558@cindex box-drawing characters (MS-DOS)
559@cindex line-drawing characters (MS-DOS)
560 Not all characters in DOS codepages correspond to ISO 8859
561characters---some are used for other purposes, such as box-drawing
562characters and other graphics. Emacs maps these characters to two
563special character sets called @code{eight-bit-control} and
564@code{eight-bit-graphic}, and displays them as their IBM glyphs.
565However, you should be aware that other systems might display these
566characters differently, so you should avoid them in text that might be
567copied to a different operating system, or even to another DOS machine
568that uses a different codepage.
569
570@vindex dos-unsupported-character-glyph
571 Emacs supports many other characters sets aside from ISO 8859, but it
572cannot display them on MS-DOS. So if one of these multibyte characters
573appears in a buffer, Emacs on MS-DOS displays them as specified by the
574@code{dos-unsupported-character-glyph} variable; by default, this glyph
575is an empty triangle. Use the @kbd{C-u C-x =} command to display the
576actual code and character set of such characters.
577@iftex
578@xref{Position Info,,,emacs, the Emacs Manual}.
579@end iftex
580@ifnottex
581@xref{Position Info}.
582@end ifnottex
583
584@findex codepage-setup
585 By default, Emacs defines a coding system to support the current
586codepage. To define a coding system for some other codepage (e.g., to
587visit a file written on a DOS machine in another country), use the
588@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of
589the codepage, with completion, then creates the coding system for the
590specified codepage. You can then use the new coding system to read and
591write files, but you must specify it explicitly for the file command
592when you want to use it
593@iftex
594(@pxref{Text Coding,,,emacs, the Emacs Manual}).
595@end iftex
596@ifnottex
597(@pxref{Text Coding}).
598@end ifnottex
599
600 These coding systems are also useful for visiting a file encoded using
601a DOS codepage, using Emacs running on some other operating system.
602
603@cindex MS-Windows codepages
604 MS-Windows provides its own codepages, which are different from the
605DOS codepages for the same locale. For example, DOS codepage 850
606supports the same character set as Windows codepage 1252; DOS codepage
607855 supports the same character set as Windows codepage 1251, etc.
608The MS-Windows version of Emacs uses the current codepage for display
609when invoked with the @samp{-nw} option. Support for codepages in the
610Windows port of Emacs is part of the @file{code-pages.el} package.
611
612@node MS-DOS Processes
613@subsection Subprocesses on MS-DOS
614
615@cindex compilation under MS-DOS
616@cindex inferior processes under MS-DOS
617@findex compile @r{(MS-DOS)}
618@findex grep @r{(MS-DOS)}
619 Because MS-DOS is a single-process ``operating system,''
620asynchronous subprocesses are not available. In particular, Shell
621mode and its variants do not work. Most Emacs features that use
622asynchronous subprocesses also don't work on MS-DOS, including
623Shell mode and GUD. When in doubt, try and see; commands that
624don't work output an error message saying that asynchronous processes
625aren't supported.
626
627 Compilation under Emacs with @kbd{M-x compile}, searching files with
628@kbd{M-x grep} and displaying differences between files with @kbd{M-x
629diff} do work, by running the inferior processes synchronously. This
630means you cannot do any more editing until the inferior process
631finishes.
632
633 Spell checking also works, by means of special support for synchronous
634invocation of the @code{ispell} program. This is slower than the
635asynchronous invocation on other platforms
636
637 Instead of the Shell mode, which doesn't work on MS-DOS, you can use
638the @kbd{M-x eshell} command. This invokes the Eshell package that
639implements a Posix-like shell entirely in Emacs Lisp.
640
641 By contrast, Emacs compiled as a native Windows application
642@strong{does} support asynchronous subprocesses.
643@iftex
644@xref{Windows Processes,,,emacs, the Emacs Manual}.
645@end iftex
646@ifnottex
647@xref{Windows Processes}.
648@end ifnottex
649
650@cindex printing under MS-DOS
651 Printing commands, such as @code{lpr-buffer}
652@iftex
653(@pxref{Printing,,,emacs, the Emacs Manual}) and
654@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
655work in MS-DOS by sending the output to one of the printer ports.
656@xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
657@end iftex
658@ifnottex
659(@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}),
660work in MS-DOS by sending the output to one of the printer ports.
661@xref{MS-DOS Printing}.
662@end ifnottex
663
664 When you run a subprocess synchronously on MS-DOS, make sure the
665program terminates and does not try to read keyboard input. If the
666program does not terminate on its own, you will be unable to terminate
667it, because MS-DOS provides no general way to terminate a process.
668Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
669cases.
670
671 Accessing files on other machines is not supported on MS-DOS. Other
672network-oriented commands such as sending mail, Web browsing, remote
673login, etc., don't work either, unless network access is built into
674MS-DOS with some network redirector.
675
676@cindex directory listing on MS-DOS
677@vindex dired-listing-switches @r{(MS-DOS)}
678 Dired on MS-DOS uses the @code{ls-lisp} package where other
679platforms use the system @code{ls} command. Therefore, Dired on
680MS-DOS supports only some of the possible options you can mention in
681the @code{dired-listing-switches} variable. The options that work are
682@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
683@samp{-s}, @samp{-t}, and @samp{-u}.
684
685@ignore
686 arch-tag: 868d50ff-07f8-4a13-a807-dab6f1cdb431
687@end ignore
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi
new file mode 100644
index 00000000000..0ed15229b7c
--- /dev/null
+++ b/doc/emacs/msdog.texi
@@ -0,0 +1,766 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Microsoft Windows, Manifesto, Mac OS, Top
6@appendix Emacs and Microsoft Windows/MS-DOS
7@cindex Microsoft Windows
8@cindex MS-Windows, Emacs peculiarities
9
10 This section describes peculiarities of using Emacs on Microsoft
11Windows. Some of these peculiarities are also relevant to Microsoft's
12older MS-DOS ``operating system'' (also known as ``MS-DOG'').
13However, Emacs features that are relevant @emph{only} to MS-DOS are
14described in a separate
15@iftex
16manual (@pxref{MS-DOS,,, emacs-xtra, Specialized Emacs Features}).
17@end iftex
18@ifnottex
19section (@pxref{MS-DOS}).
20@end ifnottex
21
22
23 The behavior of Emacs on MS-Windows is reasonably similar to what is
24documented in the rest of the manual, including support for long file
25names, multiple frames, scroll bars, mouse menus, and subprocesses.
26However, a few special considerations apply, and they are described
27here.
28
29@menu
30* Text and Binary:: Text files use CRLF to terminate lines.
31* Windows Files:: File-name conventions on Windows.
32* ls in Lisp:: Emulation of @code{ls} for Dired.
33* Windows HOME:: Where Emacs looks for your @file{.emacs}.
34* Windows Keyboard:: Windows-specific keyboard features.
35* Windows Mouse:: Windows-specific mouse features.
36* Windows Processes:: Running subprocesses on Windows.
37* Windows Printing:: How to specify the printer on MS-Windows.
38* Windows Misc:: Miscellaneous Windows features.
39@ifnottex
40* MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}).
41@end ifnottex
42@end menu
43
44@node Text and Binary
45@section Text Files and Binary Files
46@cindex text and binary files on MS-DOS/MS-Windows
47
48 GNU Emacs uses newline characters to separate text lines. This is the
49convention used on GNU, Unix, and other Posix-compliant systems.
50
51@cindex end-of-line conversion on MS-DOS/MS-Windows
52 By contrast, MS-DOS and MS-Windows normally use carriage-return linefeed,
53a two-character sequence, to separate text lines. (Linefeed is the same
54character as newline.) Therefore, convenient editing of typical files
55with Emacs requires conversion of these end-of-line (EOL) sequences.
56And that is what Emacs normally does: it converts carriage-return
57linefeed into newline when reading files, and converts newline into
58carriage-return linefeed when writing files. The same mechanism that
59handles conversion of international character codes does this conversion
60also (@pxref{Coding Systems}).
61
62@cindex cursor location, on MS-DOS
63@cindex point location, on MS-DOS
64 One consequence of this special format-conversion of most files is
65that character positions as reported by Emacs (@pxref{Position Info}) do
66not agree with the file size information known to the operating system.
67
68 In addition, if Emacs recognizes from a file's contents that it uses
69newline rather than carriage-return linefeed as its line separator, it
70does not perform EOL conversion when reading or writing that file.
71Thus, you can read and edit files from GNU and Unix systems on MS-DOS
72with no special effort, and they will retain their Unix-style
73end-of-line convention after you edit them.
74
75 The mode line indicates whether end-of-line translation was used for
76the current buffer. If MS-DOS end-of-line translation is in use for the
77buffer, the MS-Windows build of Emacs displays a backslash @samp{\} after
78the coding system mnemonic near the beginning of the mode line
79(@pxref{Mode Line}). If no EOL translation was performed, the string
80@samp{(Unix)} is displayed instead of the backslash, to alert you that the
81file's EOL format is not the usual carriage-return linefeed.
82
83@cindex DOS-to-Unix conversion of files
84 To visit a file and specify whether it uses DOS-style or Unix-style
85end-of-line, specify a coding system (@pxref{Text Coding}). For
86example, @kbd{C-x @key{RET} c unix @key{RET} C-x C-f foobar.txt}
87visits the file @file{foobar.txt} without converting the EOLs; if some
88line ends with a carriage-return linefeed pair, Emacs will display
89@samp{^M} at the end of that line. Similarly, you can direct Emacs to
90save a buffer in a specified EOL format with the @kbd{C-x @key{RET} f}
91command. For example, to save a buffer with Unix EOL format, type
92@kbd{C-x @key{RET} f unix @key{RET} C-x C-s}. If you visit a file
93with DOS EOL conversion, then save it with Unix EOL format, that
94effectively converts the file to Unix EOL style, like @code{dos2unix}.
95
96@cindex untranslated file system
97@findex add-untranslated-filesystem
98 When you use NFS, Samba, or some other similar method to access file
99systems that reside on computers using GNU or Unix systems, Emacs
100should not perform end-of-line translation on any files in these file
101systems---not even when you create a new file. To request this,
102designate these file systems as @dfn{untranslated} file systems by
103calling the function @code{add-untranslated-filesystem}. It takes one
104argument: the file system name, including a drive letter and
105optionally a directory. For example,
106
107@example
108(add-untranslated-filesystem "Z:")
109@end example
110
111@noindent
112designates drive Z as an untranslated file system, and
113
114@example
115(add-untranslated-filesystem "Z:\\foo")
116@end example
117
118@noindent
119designates directory @file{\foo} on drive Z as an untranslated file
120system.
121
122 Most often you would use @code{add-untranslated-filesystem} in your
123@file{.emacs} file, or in @file{site-start.el} so that all the users at
124your site get the benefit of it.
125
126@findex remove-untranslated-filesystem
127 To countermand the effect of @code{add-untranslated-filesystem}, use
128the function @code{remove-untranslated-filesystem}. This function takes
129one argument, which should be a string just like the one that was used
130previously with @code{add-untranslated-filesystem}.
131
132 Designating a file system as untranslated does not affect character
133set conversion, only end-of-line conversion. Essentially, it directs
134Emacs to create new files with the Unix-style convention of using
135newline at the end of a line. @xref{Coding Systems}.
136
137@vindex file-name-buffer-file-type-alist
138@cindex binary files, on MS-DOS/MS-Windows
139 Some kinds of files should not be converted at all, because their
140contents are not really text. Therefore, Emacs on MS-Windows distinguishes
141certain files as @dfn{binary files}. (This distinction is not part of
142MS-Windows; it is made by Emacs only.) Binary files include executable
143programs, compressed archives, etc. Emacs uses the file name to decide
144whether to treat a file as binary: the variable
145@code{file-name-buffer-file-type-alist} defines the file-name patterns
146that indicate binary files. If a file name matches one of the patterns
147for binary files (those whose associations are of the type
148@code{(@var{pattern} . t)}, Emacs reads and writes that file using the
149@code{no-conversion} coding system (@pxref{Coding Systems}) which turns
150off @emph{all} coding-system conversions, not only the EOL conversion.
151@code{file-name-buffer-file-type-alist} also includes file-name patterns
152for files which are known to be Windows-style text files with
153carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs
154always writes those files with Windows-style EOLs.
155
156 If a file which belongs to an untranslated file system matches one of
157the file-name patterns in @code{file-name-buffer-file-type-alist}, the
158EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
159
160@node Windows Files
161@section File Names on MS-Windows
162@cindex file names on MS-Windows
163
164 MS-Windows and MS-DOS normally use a backslash, @samp{\}, to
165separate name units within a file name, instead of the slash used on
166other systems. Emacs on MS-DOS/MS-Windows permits use of either slash or
167backslash, and also knows about drive letters in file names.
168
169@cindex file-name completion, on MS-Windows
170 On MS-DOS/MS-Windows, file names are case-insensitive, so Emacs by
171default ignores letter-case in file names during completion.
172
173@vindex w32-get-true-file-attributes
174 If the variable @code{w32-get-true-file-attributes} is
175non-@code{nil} (the default), Emacs tries to determine the accurate
176link counts for files. This option is only useful on NTFS volumes,
177and it considerably slows down Dired and other features, so use it
178only on fast machines.
179
180@node ls in Lisp
181@section Emulation of @code{ls} on MS-Windows
182@cindex Dired, and MS-Windows/MS-DOS
183@cindex @code{ls} emulation
184
185 Dired normally uses the external program @code{ls} (or its close
186work-alike) to produce the directory listing displayed in Dired
187buffers (@pxref{Dired}). However, MS-Windows and MS-DOS systems don't
188come with such a program, although several ports of @sc{gnu} @code{ls}
189are available. Therefore, Emacs on those systems @emph{emulates}
190@code{ls} in Lisp, by using the @file{ls-lisp.el} package. While
191@file{ls-lisp.el} provides a reasonably full emulation of @code{ls},
192there are some options and features peculiar to that emulation;
193@iftex
194for more details, see the documentation of the variables whose names
195begin with @code{ls-lisp}.
196@end iftex
197@ifnottex
198they are described in this section.
199
200 The @code{ls} emulation supports many of the @code{ls} switches, but
201it doesn't support all of them. Here's the list of the switches it
202does support: @option{-A}, @option{-a}, @option{-B}, @option{-C},
203@option{-c}, @option{-i}, @option{-G}, @option{-g}, @option{-R},
204@option{-r}, @option{-S}, @option{-s}, @option{-t}, @option{-U},
205@option{-u}, and @option{-X}. The @option{-F} switch is partially
206supported (it appends the character that classifies the file, but does
207not prevent symlink following).
208
209@vindex ls-lisp-use-insert-directory-program
210 On MS-Windows and MS-DOS, @file{ls-lisp.el} is preloaded when Emacs
211is built, so the Lisp emulation of @code{ls} is always used on those
212platforms. If you have a ported @code{ls}, setting
213@code{ls-lisp-use-insert-directory-program} to a non-@code{nil} value
214will revert to using an external program named by the variable
215@code{insert-directory-program}.
216
217@vindex ls-lisp-ignore-case
218 By default, @file{ls-lisp.el} uses a case-sensitive sort order for
219the directory listing it produces; this is so the listing looks the
220same as on other platforms. If you wish that the files be sorted in
221case-insensitive order, set the variable @code{ls-lisp-ignore-case} to
222a non-@code{nil} value.
223
224@vindex ls-lisp-dirs-first
225 By default, files and subdirectories are sorted together, to emulate
226the behavior of @code{ls}. However, native MS-Windows/MS-DOS file
227managers list the directories before the files; if you want that
228behavior, customize the option @code{ls-lisp-dirs-first} to a
229non-@code{nil} value.
230
231@vindex ls-lisp-verbosity
232 The variable @code{ls-lisp-verbosity} controls the file attributes
233that @file{ls-lisp.el} displays. The value should be a list that
234contains one or more of the symbols @code{links}, @code{uid}, and
235@code{gid}. @code{links} means display the count of different file
236names that are associated with (a.k.a.@: @dfn{links to}) the file's
237data; this is only useful on NTFS volumes. @code{uid} means display
238the numerical identifier of the user who owns the file. @code{gid}
239means display the numerical identifier of the file owner's group. The
240default value is @code{(links uid gid)} i.e.@: all the 3 optional
241attributes are displayed.
242
243@vindex ls-lisp-emulation
244 The variable @code{ls-lisp-emulation} controls the flavour of the
245@code{ls} emulation by setting the defaults for the 3 options
246described above: @code{ls-lisp-ignore-case},
247@code{ls-lisp-dirs-first}, and @code{ls-lisp-verbosity}. The value of
248this option can be one of the following symbols:
249
250@table @code
251@item GNU
252@itemx nil
253Emulate @sc{gnu} systems; this is the default. This sets
254@code{ls-lisp-ignore-case} and @code{ls-lisp-dirs-first} to
255@code{nil}, and @code{ls-lisp-verbosity} to @code{(links uid gid)}.
256@item UNIX
257Emulate Unix systems. Like @code{GNU}, but sets
258@code{ls-lisp-verbosity} to @code{(links uid)}.
259@item MacOS
260Emulate MacOS. Sets @code{ls-lisp-ignore-case} to @code{t}, and
261@code{ls-lisp-dirs-first} and @code{ls-lisp-verbosity} to @code{nil}.
262@item MS-Windows
263Emulate MS-Windows. Sets @code{ls-lisp-ignore-case} and
264@code{ls-lisp-dirs-first} to @code{t}, and @code{ls-lisp-verbosity} to
265@code{(links)} on Windows NT/2K/XP/2K3 and to @code{nil} on Windows 9X.
266Note that the default emulation is @emph{not} @code{MS-Windows}, even
267on Windows, since many users of Emacs on those platforms prefer the
268@sc{gnu} defaults.
269@end table
270
271@noindent
272Any other value of @code{ls-lisp-emulation} means the same as
273@code{GNU}. Note that this option needs to be set @emph{before}
274@file{ls-lisp.el} is loaded, which means that on MS-Windows and MS-DOS
275you will have to set the value from your @file{.emacs} file and then
276restart Emacs, since @file{ls-lisp.el} is preloaded.
277
278@vindex ls-lisp-support-shell-wildcards
279 The variable @code{ls-lisp-support-shell-wildcards} controls how
280file-name patterns are supported: if it is non-@code{nil} (the
281default), they are treated as shell-style wildcards; otherwise they
282are treated as Emacs regular expressions.
283
284@vindex ls-lisp-format-time-list
285 The variable @code{ls-lisp-format-time-list} defines how to format
286the date and time of files. @emph{The value of this variable is
287ignored}, unless Emacs cannot determine the current locale. (However,
288if the value of @code{ls-lisp-use-localized-time-format} is
289non-@code{nil}, Emacs obeys @code{ls-lisp-format-time-list} even if
290the current locale is available; see below.)
291
292The value of @code{ls-lisp-format-time-list} is a list of 2 strings.
293The first string is used if the file was modified within the current
294year, while the second string is used for older files. In each of
295these two strings you can use @samp{%}-sequences to substitute parts
296of the time. For example:
297@lisp
298("%b %e %H:%M" "%b %e %Y")
299@end lisp
300
301@noindent
302Note that the strings substituted for these @samp{%}-sequences depend
303on the current locale. @xref{Time Parsing,,, elisp, The Emacs Lisp
304Reference Manual}, for more about format time specs.
305
306@vindex ls-lisp-use-localized-time-format
307 Normally, Emacs formats the file time stamps in either traditional
308or ISO-style time format. However, if the value of the variable
309@code{ls-lisp-use-localized-time-format} is non-@code{nil}, Emacs
310formats file time stamps according to what
311@code{ls-lisp-format-time-list} specifies. The @samp{%}-sequences in
312@code{ls-lisp-format-time-list} produce locale-dependent month and day
313names, which might cause misalignment of columns in Dired display.
314@end ifnottex
315
316@node Windows HOME
317@section HOME Directory on MS-Windows
318@cindex @code{HOME} directory on MS-Windows
319
320 The Windows equivalent of the @code{HOME} directory is the
321@dfn{user-specific application data directory}. The actual location
322depends on your Windows version and system configuration; typical values
323are @file{C:\Documents and Settings\@var{username}\Application Data} on
324Windows 2K/XP and later, and either @file{C:\WINDOWS\Application Data}
325or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the
326older Windows 9X/ME systems.
327
328@cindex init file @file{.emacs} on MS-Windows
329 The home directory is where your init file @file{.emacs} is stored.
330When Emacs starts, it first checks whether the environment variable
331@env{HOME} is set. If it is, it looks for the init file in the
332directory pointed by @env{HOME}. If @env{HOME} is not defined, Emacs
333checks for an existing @file{.emacs} file in @file{C:\}, the root
334directory of drive @file{C:}@footnote{
335The check in @file{C:\} is in preference to the application data
336directory for compatibility with older versions of Emacs, which didn't
337check the application data directory.
338}. If there's no such file in @file{C:\}, Emacs next uses the Windows
339system calls to find out the exact location of your application data
340directory. If that fails as well, Emacs falls back to @file{C:\}.
341
342 Whatever the final place is, Emacs sets the value of the @env{HOME}
343environment variable to point to it, and it will use that location for
344other files and directories it normally creates in the user's home
345directory.
346
347 You can always find out where Emacs thinks is your home directory's
348location by typing @kbd{C-x d ~/ @key{RET}}. This should present the
349list of files in the home directory, and show its full name on the
350first line. Likewise, to visit your init file, type @kbd{C-x C-f
351~/.emacs @key{RET}}.
352
353@cindex @file{_emacs} init file, MS-Windows
354 Because MS-DOS does not allow file names with leading dots, and
355because older Windows systems made it hard to create files with such
356names, the Windows port of Emacs supports an alternative name
357@file{_emacs} as a fallback, if such a file exists in the home
358directory, whereas @file{.emacs} does not.
359
360@node Windows Keyboard
361@section Keyboard Usage on MS-Windows
362@cindex keyboard, MS-Windows
363
364 This section describes the Windows-specific features related to
365keyboard input in Emacs.
366
367@cindex MS-Windows keyboard shortcuts
368 Many key combinations (known as ``keyboard shortcuts'') that have
369conventional uses in MS-Windows programs conflict with traditional
370Emacs key bindings. (These Emacs key bindings were established years
371before Microsoft was founded.) Examples of conflicts include
372@kbd{C-c}, @kbd{C-x}, @kbd{C-z}, @kbd{C-a}, and @kbd{W-@key{SPC}}.
373You can redefine some of them with meanings more like the MS-Windows
374meanings by enabling CUA Mode (@pxref{CUA Bindings}).
375
376@kindex F10 @r{(MS-Windows)}
377@cindex menu bar access using keyboard @r{(MS-Windows)}
378 The @key{F10} key on Windows activates the menu bar in a way that
379makes it possible to use the menus without a mouse. In this mode, the
380arrow keys traverse the menus, @key{RET} selects a highlighted menu
381item, and @key{ESC} closes the menu.
382
383@iftex
384@inforef{Windows Keyboard, , emacs}, for information about additional
385Windows-specific variables in this category.
386@end iftex
387@ifnottex
388@vindex w32-alt-is-meta
389@cindex @code{Alt} key (MS-Windows)
390 By default, the key labeled @key{Alt} is mapped as the @key{META}
391key. If you wish it to produce the @code{Alt} modifier instead, set
392the variable @code{w32-alt-is-meta} to a @code{nil} value.
393
394@vindex w32-capslock-is-shiftlock
395 By default, the @key{CapsLock} key only affects normal character
396keys (it converts lower-case characters to their upper-case
397variants). However, if you set the variable
398@code{w32-capslock-is-shiftlock} to a non-@code{nil} value, the
399@key{CapsLock} key will affect non-character keys as well, as if you
400pressed the @key{Shift} key while typing the non-character key.
401
402@vindex w32-enable-caps-lock
403 If the variable @code{w32-enable-caps-lock} is set to a @code{nil}
404value, the @key{CapsLock} key produces the symbol @code{capslock}
405instead of the shifted version of they keys. The default value is
406@code{t}.
407
408@vindex w32-enable-num-lock
409@cindex keypad keys (MS-Windows)
410 Similarly, if @code{w32-enable-num-lock} is @code{nil}, the
411@key{NumLock} key will produce the symbol @code{kp-numlock}. The
412default is @code{t}, which causes @key{NumLock} to work as expected:
413toggle the meaning of the keys on the numeric keypad.
414@end ifnottex
415
416@vindex w32-apps-modifier
417 The variable @code{w32-apps-modifier} controls the effect of the
418@key{Apps} key (usually located between the right @key{Alt} and the
419right @key{Ctrl} keys). Its value can be one of the symbols
420@code{hyper}, @code{super}, @code{meta}, @code{alt}, @code{control},
421or @code{shift} for the respective modifier, or @code{nil} to appear
422as the key @code{apps}. The default is @code{nil}.
423
424@vindex w32-lwindow-modifier
425@vindex w32-rwindow-modifier
426@vindex w32-scroll-lock-modifier
427 The variable @code{w32-lwindow-modifier} determines the effect of
428the left Windows key (usually labeled with @key{start} and the Windows
429logo). If its value is @code{nil} (the default), the key will produce
430the symbol @code{lwindow}. Setting it to one of the symbols
431@code{hyper}, @code{super}, @code{meta}, @code{alt}, @code{control},
432or @code{shift} will produce the respective modifier. A similar
433variable @code{w32-rwindow-modifier} controls the effect of the right
434Windows key, and @code{w32-scroll-lock-modifier} does the same for the
435@key{ScrLock} key. If these variables are set to @code{nil}, the
436right Windows key produces the symbol @code{rwindow} and @key{ScrLock}
437produces the symbol @code{scroll}.
438
439@vindex w32-pass-alt-to-system
440@cindex Windows system menu
441@cindex @code{Alt} key invokes menu (Windows)
442 Emacs compiled as a native Windows application normally turns off
443the Windows feature that tapping the @key{ALT} key invokes the Windows
444menu. The reason is that the @key{ALT} serves as @key{META} in Emacs.
445When using Emacs, users often press the @key{META} key temporarily and
446then change their minds; if this has the effect of bringing up the
447Windows menu, it alters the meaning of subsequent commands. Many
448users find this frustrating.
449
450 You can re-enable Windows' default handling of tapping the @key{ALT}
451key by setting @code{w32-pass-alt-to-system} to a non-@code{nil}
452value.
453
454@ifnottex
455@vindex w32-pass-lwindow-to-system
456@vindex w32-pass-rwindow-to-system
457 The variables @code{w32-pass-lwindow-to-system} and
458@code{w32-pass-rwindow-to-system} determine whether the respective
459keys are passed to Windows or swallowed by Emacs. If the value is
460@code{nil}, the respective key is silently swallowed by Emacs,
461otherwise it is passed to Windows. The default is @code{t} for both
462of these variables. Passing each of these keys to Windows produces
463its normal effect: for example, @kbd{@key{Lwindow}} opens the
464@code{Start} menu, etc.@footnote{
465Some combinations of the ``Windows'' keys with other keys are caught
466by Windows at low level in a way that Emacs currently cannot prevent.
467For example, @kbd{@key{Lwindow} r} always pops up the Windows
468@samp{Run} dialog. Customizing the value of
469@code{w32-phantom-key-code} might help in some cases, though.}
470
471@vindex w32-recognize-altgr
472@kindex AltGr @r{(MS-Windows)}
473@cindex AltGr key (MS-Windows)
474 The variable @code{w32-recognize-altgr} controls whether the
475@key{AltGr} key (if it exists on your keyboard), or its equivalent,
476the combination of the right @key{Alt} and left @key{Ctrl} keys
477pressed together, is recognized as the @key{AltGr} key. The default
478is @code{t}, which means these keys produce @code{AltGr}; setting it
479to @code{nil} causes @key{AltGr} or the equivalent key combination to
480be interpreted as the combination of @key{CTRL} and @key{META}
481modifiers.
482@end ifnottex
483
484@node Windows Mouse
485@section Mouse Usage on MS-Windows
486@cindex mouse, and MS-Windows
487
488 This section describes the Windows-specific variables related to
489mouse.
490
491@vindex w32-mouse-button-tolerance
492@cindex simulation of middle mouse button
493 The variable @code{w32-mouse-button-tolerance} specifies the
494time interval, in milliseconds, for faking middle mouse button press
495on 2-button mice. If both mouse buttons are depressed within this
496time interval, Emacs generates a middle mouse button click event
497instead of a double click on one of the buttons.
498
499@vindex w32-pass-extra-mouse-buttons-to-system
500 If the variable @code{w32-pass-extra-mouse-buttons-to-system} is
501non-@code{nil}, Emacs passes the fourth and fifth mouse buttons to
502Windows.
503
504@vindex w32-swap-mouse-buttons
505 The variable @code{w32-swap-mouse-buttons} controls which of the 3
506mouse buttons generates the @kbd{mouse-2} events. When it is
507@code{nil} (the default), the middle button generates @kbd{mouse-2}
508and the right button generates @kbd{mouse-3} events. If this variable
509is non-@code{nil}, the roles of these two buttons are reversed.
510
511@node Windows Processes
512@section Subprocesses on Windows 9X/ME and Windows NT/2K/XP
513@cindex subprocesses on MS-Windows
514
515@cindex DOS applications, running from Emacs
516 Emacs compiled as a native Windows application (as opposed to the DOS
517version) includes full support for asynchronous subprocesses.
518In the Windows version, synchronous and asynchronous subprocesses work
519fine on both
520Windows 9X/ME and Windows NT/2K/XP as long as you run only 32-bit Windows
521applications. However, when you run a DOS application in a subprocess,
522you may encounter problems or be unable to run the application at all;
523and if you run two DOS applications at the same time in two
524subprocesses, you may have to reboot your system.
525
526Since the standard command interpreter (and most command line utilities)
527on Windows 9X are DOS applications, these problems are significant when
528using that system. But there's nothing we can do about them; only
529Microsoft can fix them.
530
531If you run just one DOS application subprocess, the subprocess should
532work as expected as long as it is ``well-behaved'' and does not perform
533direct screen access or other unusual actions. If you have a CPU
534monitor application, your machine will appear to be 100% busy even when
535the DOS application is idle, but this is only an artifact of the way CPU
536monitors measure processor load.
537
538You must terminate the DOS application before you start any other DOS
539application in a different subprocess. Emacs is unable to interrupt or
540terminate a DOS subprocess. The only way you can terminate such a
541subprocess is by giving it a command that tells its program to exit.
542
543If you attempt to run two DOS applications at the same time in separate
544subprocesses, the second one that is started will be suspended until the
545first one finishes, even if either or both of them are asynchronous.
546
547@cindex kill DOS application
548If you can go to the first subprocess, and tell it to exit, the second
549subprocess should continue normally. However, if the second subprocess
550is synchronous, Emacs itself will be hung until the first subprocess
551finishes. If it will not finish without user input, then you have no
552choice but to reboot if you are running on Windows 9X. If you are
553running on Windows NT/2K/XP, you can use a process viewer application to kill
554the appropriate instance of NTVDM instead (this will terminate both DOS
555subprocesses).
556
557If you have to reboot Windows 9X in this situation, do not use the
558@code{Shutdown} command on the @code{Start} menu; that usually hangs the
559system. Instead, type @kbd{CTL-ALT-@key{DEL}} and then choose
560@code{Shutdown}. That usually works, although it may take a few minutes
561to do its job.
562
563@vindex w32-quote-process-args
564 The variable @code{w32-quote-process-args} controls how Emacs quotes
565the process arguments. Non-@code{nil} means quote with the @code{"}
566character. If the value is a character, use that character to escape
567any quote characters that appear; otherwise chose a suitable escape
568character based on the type of the program.
569
570@ifnottex
571@findex w32-shell-execute
572 The function @code{w32-shell-execute} can be useful for writing
573customized commands that run MS-Windows applications registered to
574handle a certain standard Windows operation for a specific type of
575document or file. This function is a wrapper around the Windows
576@code{ShellExecute} API. See the MS-Windows API documentation for
577more details.
578@end ifnottex
579
580@node Windows Printing
581@section Printing and MS-Windows
582
583 Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and
584@code{ps-print-buffer} (@pxref{PostScript}) work in MS-DOS and
585MS-Windows by sending the output to one of the printer ports, if a
586Posix-style @code{lpr} program is unavailable. The same Emacs
587variables control printing on all systems, but in some cases they have
588different default values on MS-DOS and MS-Windows.
589
590 Emacs on Windows automatically determines your default printer and
591sets the variable @var{printer-name} to that printer's name. But in
592some rare cases this can fail, or you may wish to use a different
593printer from within Emacs. The rest of this section explains how to
594tell Emacs which printer to use.
595
596@vindex printer-name@r{, (MS-DOS/MW-Windows)}
597 If you want to use your local printer, then set the Lisp variable
598@code{lpr-command} to @code{""} (its default value on Windows) and
599@code{printer-name} to the name of the printer port---for example,
600@code{"PRN"}, the usual local printer port or @code{"LPT2"}, or
601@code{"COM1"} for a serial printer. You can also set
602@code{printer-name} to a file name, in which case ``printed'' output
603is actually appended to that file. If you set @code{printer-name} to
604@code{"NUL"}, printed output is silently discarded (sent to the system
605null device).
606
607 You can also use a printer shared by another machine by setting
608@code{printer-name} to the UNC share name for that printer---for
609example, @code{"//joes_pc/hp4si"}. (It doesn't matter whether you use
610forward slashes or backslashes here.) To find out the names of shared
611printers, run the command @samp{net view} from the command prompt to
612obtain a list of servers, and @samp{net view @var{server-name}} to see
613the names of printers (and directories) shared by that server.
614Alternatively, click the @samp{Network Neighborhood} icon on your
615desktop, and look for machines which share their printers via the
616network.
617
618@cindex @samp{net use}, and printing on MS-Windows
619@cindex networked printers (MS-Windows)
620 If the printer doesn't appear in the output of @samp{net view}, or
621if setting @code{printer-name} to the UNC share name doesn't produce a
622hardcopy on that printer, you can use the @samp{net use} command to
623connect a local print port such as @code{"LPT2"} to the networked
624printer. For example, typing @kbd{net use LPT2: \\joes_pc\hp4si}@footnote{
625Note that the @samp{net use} command requires the UNC share name to be
626typed with the Windows-style backslashes, while the value of
627@code{printer-name} can be set with either forward- or backslashes.}
628causes Windows to @dfn{capture} the @code{LPT2} port and redirect the
629printed material to the printer connected to the machine @code{joes_pc}.
630After this command, setting @code{printer-name} to @code{"LPT2"}
631should produce the hardcopy on the networked printer.
632
633 With some varieties of Windows network software, you can instruct
634Windows to capture a specific printer port such as @code{"LPT2"}, and
635redirect it to a networked printer via the @w{@code{Control
636Panel->Printers}} applet instead of @samp{net use}.
637
638 If you set @code{printer-name} to a file name, it's best to use an
639absolute file name. Emacs changes the working directory according to
640the default directory of the current buffer, so if the file name in
641@code{printer-name} is relative, you will end up with several such
642files, each one in the directory of the buffer from which the printing
643was done.
644
645 If the value of @code{printer-name} is correct, but printing does
646not produce the hardcopy on your printer, it is possible that your
647printer does not support printing plain text (some cheap printers omit
648this functionality). In that case, try the PostScript print commands,
649described below.
650
651@findex print-buffer @r{(MS-DOS)}
652@findex print-region @r{(MS-DOS)}
653@vindex lpr-headers-switches @r{(MS-DOS)}
654 The commands @code{print-buffer} and @code{print-region} call the
655@code{pr} program, or use special switches to the @code{lpr} program, to
656produce headers on each printed page. MS-DOS and MS-Windows don't
657normally have these programs, so by default, the variable
658@code{lpr-headers-switches} is set so that the requests to print page
659headers are silently ignored. Thus, @code{print-buffer} and
660@code{print-region} produce the same output as @code{lpr-buffer} and
661@code{lpr-region}, respectively. If you do have a suitable @code{pr}
662program (for example, from GNU Coreutils), set
663@code{lpr-headers-switches} to @code{nil}; Emacs will then call
664@code{pr} to produce the page headers, and print the resulting output as
665specified by @code{printer-name}.
666
667@vindex print-region-function @r{(MS-DOS)}
668@cindex lpr usage under MS-DOS
669@vindex lpr-command @r{(MS-DOS)}
670@vindex lpr-switches @r{(MS-DOS)}
671 Finally, if you do have an @code{lpr} work-alike, you can set the
672variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
673@code{lpr} for printing, as on other systems. (If the name of the
674program isn't @code{lpr}, set @code{lpr-command} to specify where to
675find it.) The variable @code{lpr-switches} has its standard meaning
676when @code{lpr-command} is not @code{""}. If the variable
677@code{printer-name} has a string value, it is used as the value for the
678@code{-P} option to @code{lpr}, as on Unix.
679
680@findex ps-print-buffer @r{(MS-DOS)}
681@findex ps-spool-buffer @r{(MS-DOS)}
682@vindex ps-printer-name @r{(MS-DOS)}
683@vindex ps-lpr-command @r{(MS-DOS)}
684@vindex ps-lpr-switches @r{(MS-DOS)}
685 A parallel set of variables, @code{ps-lpr-command},
686@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
687Variables}), defines how PostScript files should be printed. These
688variables are used in the same way as the corresponding variables
689described above for non-PostScript printing. Thus, the value of
690@code{ps-printer-name} is used as the name of the device (or file) to
691which PostScript output is sent, just as @code{printer-name} is used
692for non-PostScript printing. (There are two distinct sets of
693variables in case you have two printers attached to two different
694ports, and only one of them is a PostScript printer.)
695
696 The default value of the variable @code{ps-lpr-command} is @code{""},
697which causes PostScript output to be sent to the printer port specified
698by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
699the name of a program which will accept PostScript files. Thus, if you
700have a non-PostScript printer, you can set this variable to the name of
701a PostScript interpreter program (such as Ghostscript). Any switches
702that need to be passed to the interpreter program are specified using
703@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
704string, it will be added to the list of switches as the value for the
705@code{-P} option. This is probably only useful if you are using
706@code{lpr}, so when using an interpreter typically you would set
707@code{ps-printer-name} to something other than a string so it is
708ignored.)
709
710 For example, to use Ghostscript for printing on the system's default
711printer, put this in your @file{.emacs} file:
712
713@example
714(setq ps-printer-name t)
715(setq ps-lpr-command "D:/gs6.01/bin/gswin32c.exe")
716(setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH"
717 "-sDEVICE=mswinpr2"
718 "-sPAPERSIZE=a4"))
719@end example
720
721@noindent
722(This assumes that Ghostscript is installed in the
723@file{D:/gs6.01} directory.)
724
725@node Windows Misc
726@section Miscellaneous Windows-specific features
727
728 This section describes miscellaneous Windows-specific features.
729
730@vindex w32-use-visible-system-caret
731@cindex screen reader software, MS-Windows
732 The variable @code{w32-use-visible-system-caret} is a flag that
733determines whether to make the system caret visible. The default is
734@code{nil}, which means Emacs draws its own cursor to indicate the
735position of point. A non-@code{nil} value means Emacs will indicate
736point location by the system caret; this facilitates use of screen
737reader software. When this variable is non-@code{nil}, other
738variables affecting the cursor display have no effect.
739
740@iftex
741@inforef{Windows Misc, , emacs}, for information about additional
742Windows-specific variables in this category.
743@end iftex
744
745@ifnottex
746@vindex w32-grab-focus-on-raise
747@cindex frame focus policy, MS-Windows
748 The variable @code{w32-grab-focus-on-raise}, if set to a
749non-@code{nil} value causes a frame to grab focus when it is raised.
750The default is @code{t}, which fits well with the Windows default
751click-to-focus policy.
752
753@vindex w32-list-proportional-fonts
754 The variable @code{w32-list-proportional-fonts} controls whether
755proportional fonts are included in the font selection dialog. If its
756value is non-@code{nil}, these fonts will be included. The default is
757@code{nil}.
758@end ifnottex
759
760@ifnottex
761@include msdog-xtra.texi
762@end ifnottex
763
764@ignore
765 arch-tag: f39d2590-5dcc-4318-88d9-0eb73ca10fa2
766@end ignore
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
new file mode 100644
index 00000000000..c71c820dc27
--- /dev/null
+++ b/doc/emacs/mule.texi
@@ -0,0 +1,1535 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004,
3@c 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node International, Major Modes, Frames, Top
6@chapter International Character Set Support
7@cindex MULE
8@cindex international scripts
9@cindex multibyte characters
10@cindex encoding of characters
11
12@cindex Celtic
13@cindex Chinese
14@cindex Cyrillic
15@cindex Czech
16@cindex Devanagari
17@cindex Hindi
18@cindex Marathi
19@cindex Ethiopic
20@cindex German
21@cindex Greek
22@cindex Hebrew
23@cindex IPA
24@cindex Japanese
25@cindex Korean
26@cindex Lao
27@cindex Latin
28@cindex Polish
29@cindex Romanian
30@cindex Slovak
31@cindex Slovenian
32@cindex Thai
33@cindex Tibetan
34@cindex Turkish
35@cindex Vietnamese
36@cindex Dutch
37@cindex Spanish
38 Emacs supports a wide variety of international character sets,
39including European and Vietnamese variants of the Latin alphabet, as
40well as Cyrillic, Devanagari (for Hindi and Marathi), Ethiopic, Greek,
41Han (for Chinese and Japanese), Hangul (for Korean), Hebrew, IPA,
42Kannada, Lao, Malayalam, Tamil, Thai, Tibetan, and Vietnamese scripts.
43Emacs also supports various encodings of these characters used by
44other internationalized software, such as word processors and mailers.
45
46 Emacs allows editing text with international characters by supporting
47all the related activities:
48
49@itemize @bullet
50@item
51You can visit files with non-@acronym{ASCII} characters, save non-@acronym{ASCII} text, and
52pass non-@acronym{ASCII} text between Emacs and programs it invokes (such as
53compilers, spell-checkers, and mailers). Setting your language
54environment (@pxref{Language Environments}) takes care of setting up the
55coding systems and other options for a specific language or culture.
56Alternatively, you can specify how Emacs should encode or decode text
57for each command; see @ref{Text Coding}.
58
59@item
60You can display non-@acronym{ASCII} characters encoded by the various
61scripts. This works by using appropriate fonts on graphics displays
62(@pxref{Defining Fontsets}), and by sending special codes to text-only
63displays (@pxref{Terminal Coding}). If some characters are displayed
64incorrectly, refer to @ref{Undisplayable Characters}, which describes
65possible problems and explains how to solve them.
66
67@item
68You can insert non-@acronym{ASCII} characters or search for them. To do that,
69you can specify an input method (@pxref{Select Input Method}) suitable
70for your language, or use the default input method set up when you set
71your language environment. If
72your keyboard can produce non-@acronym{ASCII} characters, you can select an
73appropriate keyboard coding system (@pxref{Terminal Coding}), and Emacs
74will accept those characters. Latin-1 characters can also be input by
75using the @kbd{C-x 8} prefix, see @ref{Unibyte Mode}.
76
77On X Window systems, your locale should be set to an appropriate value
78to make sure Emacs interprets keyboard input correctly; see
79@ref{Language Environments, locales}.
80@end itemize
81
82 The rest of this chapter describes these issues in detail.
83
84@menu
85* International Chars:: Basic concepts of multibyte characters.
86* Enabling Multibyte:: Controlling whether to use multibyte characters.
87* Language Environments:: Setting things up for the language you use.
88* Input Methods:: Entering text characters not on your keyboard.
89* Select Input Method:: Specifying your choice of input methods.
90* Multibyte Conversion:: How single-byte characters convert to multibyte.
91* Coding Systems:: Character set conversion when you read and
92 write files, and so on.
93* Recognize Coding:: How Emacs figures out which conversion to use.
94* Specify Coding:: Specifying a file's coding system explicitly.
95* Output Coding:: Choosing coding systems for output.
96* Text Coding:: Choosing conversion to use for file text.
97* Communication Coding:: Coding systems for interprocess communication.
98* File Name Coding:: Coding systems for file @emph{names}.
99* Terminal Coding:: Specifying coding systems for converting
100 terminal input and output.
101* Fontsets:: Fontsets are collections of fonts
102 that cover the whole spectrum of characters.
103* Defining Fontsets:: Defining a new fontset.
104* Undisplayable Characters:: When characters don't display.
105* Unibyte Mode:: You can pick one European character set
106 to use without multibyte characters.
107* Charsets:: How Emacs groups its internal character codes.
108@end menu
109
110@node International Chars
111@section Introduction to International Character Sets
112
113 The users of international character sets and scripts have
114established many more-or-less standard coding systems for storing
115files. Emacs internally uses a single multibyte character encoding,
116so that it can intermix characters from all these scripts in a single
117buffer or string. This encoding represents each non-@acronym{ASCII}
118character as a sequence of bytes in the range 0200 through 0377.
119Emacs translates between the multibyte character encoding and various
120other coding systems when reading and writing files, when exchanging
121data with subprocesses, and (in some cases) in the @kbd{C-q} command
122(@pxref{Multibyte Conversion}).
123
124@kindex C-h h
125@findex view-hello-file
126@cindex undisplayable characters
127@cindex @samp{?} in display
128 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
129@file{etc/HELLO}, which shows how to say ``hello'' in many languages.
130This illustrates various scripts. If some characters can't be
131displayed on your terminal, they appear as @samp{?} or as hollow boxes
132(@pxref{Undisplayable Characters}).
133
134 Keyboards, even in the countries where these character sets are used,
135generally don't have keys for all the characters in them. So Emacs
136supports various @dfn{input methods}, typically one for each script or
137language, to make it convenient to type them.
138
139@kindex C-x RET
140 The prefix key @kbd{C-x @key{RET}} is used for commands that pertain
141to multibyte characters, coding systems, and input methods.
142
143@node Enabling Multibyte
144@section Enabling Multibyte Characters
145
146 By default, Emacs starts in multibyte mode, because that allows you to
147use all the supported languages and scripts without limitations.
148
149@cindex turn multibyte support on or off
150 You can enable or disable multibyte character support, either for
151Emacs as a whole, or for a single buffer. When multibyte characters
152are disabled in a buffer, we call that @dfn{unibyte mode}. Then each
153byte in that buffer represents a character, even codes 0200 through
1540377.
155
156 The old features for supporting the European character sets, ISO
157Latin-1 and ISO Latin-2, work in unibyte mode as they did in Emacs 19
158and also work for the other ISO 8859 character sets. However, there
159is no need to turn off multibyte character support to use ISO Latin;
160the Emacs multibyte character set includes all the characters in these
161character sets, and Emacs can translate automatically to and from the
162ISO codes.
163
164 To edit a particular file in unibyte representation, visit it using
165@code{find-file-literally}. @xref{Visiting}. To convert a buffer in
166multibyte representation into a single-byte representation of the same
167characters, the easiest way is to save the contents in a file, kill the
168buffer, and find the file again with @code{find-file-literally}. You
169can also use @kbd{C-x @key{RET} c}
170(@code{universal-coding-system-argument}) and specify @samp{raw-text} as
171the coding system with which to find or save a file. @xref{Text
172Coding}. Finding a file as @samp{raw-text} doesn't disable format
173conversion, uncompression and auto mode selection as
174@code{find-file-literally} does.
175
176@vindex enable-multibyte-characters
177@vindex default-enable-multibyte-characters
178 To turn off multibyte character support by default, start Emacs with
179the @samp{--unibyte} option (@pxref{Initial Options}), or set the
180environment variable @env{EMACS_UNIBYTE}. You can also customize
181@code{enable-multibyte-characters} or, equivalently, directly set the
182variable @code{default-enable-multibyte-characters} to @code{nil} in
183your init file to have basically the same effect as @samp{--unibyte}.
184
185@findex toggle-enable-multibyte-characters
186 To convert a unibyte session to a multibyte session, set
187@code{default-enable-multibyte-characters} to @code{t}. Buffers which
188were created in the unibyte session before you turn on multibyte support
189will stay unibyte. You can turn on multibyte support in a specific
190buffer by invoking the command @code{toggle-enable-multibyte-characters}
191in that buffer.
192
193@cindex Lisp files, and multibyte operation
194@cindex multibyte operation, and Lisp files
195@cindex unibyte operation, and Lisp files
196@cindex init file, and non-@acronym{ASCII} characters
197@cindex environment variables, and non-@acronym{ASCII} characters
198 With @samp{--unibyte}, multibyte strings are not created during
199initialization from the values of environment variables,
200@file{/etc/passwd} entries etc.@: that contain non-@acronym{ASCII} 8-bit
201characters.
202
203 Emacs normally loads Lisp files as multibyte, regardless of whether
204you used @samp{--unibyte}. This includes the Emacs initialization file,
205@file{.emacs}, and the initialization files of Emacs packages such as
206Gnus. However, you can specify unibyte loading for a particular Lisp
207file, by putting @w{@samp{-*-unibyte: t;-*-}} in a comment on the first
208line (@pxref{File Variables}). Then that file is always loaded as
209unibyte text, even if you did not start Emacs with @samp{--unibyte}.
210The motivation for these conventions is that it is more reliable to
211always load any particular Lisp file in the same way. However, you can
212load a Lisp file as unibyte, on any one occasion, by typing @kbd{C-x
213@key{RET} c raw-text @key{RET}} immediately before loading it.
214
215 The mode line indicates whether multibyte character support is
216enabled in the current buffer. If it is, there are two or more
217characters (most often two dashes) near the beginning of the mode
218line, before the indication of the visited file's end-of-line
219convention (colon, backslash, etc.). When multibyte characters
220are not enabled, nothing precedes the colon except a single dash.
221@xref{Mode Line}, for more details about this.
222
223@node Language Environments
224@section Language Environments
225@cindex language environments
226
227 All supported character sets are supported in Emacs buffers whenever
228multibyte characters are enabled; there is no need to select a
229particular language in order to display its characters in an Emacs
230buffer. However, it is important to select a @dfn{language environment}
231in order to set various defaults. The language environment really
232represents a choice of preferred script (more or less) rather than a
233choice of language.
234
235 The language environment controls which coding systems to recognize
236when reading text (@pxref{Recognize Coding}). This applies to files,
237incoming mail, netnews, and any other text you read into Emacs. It may
238also specify the default coding system to use when you create a file.
239Each language environment also specifies a default input method.
240
241@findex set-language-environment
242@vindex current-language-environment
243 To select a language environment, you can customize the variable
244@code{current-language-environment} or use the command @kbd{M-x
245set-language-environment}. It makes no difference which buffer is
246current when you use this command, because the effects apply globally to
247the Emacs session. The supported language environments include:
248
249@cindex Euro sign
250@cindex UTF-8
251@quotation
252ASCII, Belarusian, Brazilian Portuguese, Bulgarian, Chinese-BIG5,
253Chinese-CNS, Chinese-EUC-TW, Chinese-GB, Croatian, Cyrillic-ALT,
254Cyrillic-ISO, Cyrillic-KOI8, Czech, Devanagari, Dutch, English,
255Esperanto, Ethiopic, French, Georgian, German, Greek, Hebrew, IPA,
256Italian, Japanese, Kannada, Korean, Lao, Latin-1, Latin-2, Latin-3,
257Latin-4, Latin-5, Latin-6, Latin-7, Latin-8 (Celtic), Latin-9 (updated
258Latin-1 with the Euro sign), Latvian, Lithuanian, Malayalam, Polish,
259Romanian, Russian, Slovak, Slovenian, Spanish, Swedish, Tajik, Tamil,
260Thai, Tibetan, Turkish, UTF-8 (for a setup which prefers Unicode
261characters and files encoded in UTF-8), Ukrainian, Vietnamese, Welsh,
262and Windows-1255 (for a setup which prefers Cyrillic characters and
263files encoded in Windows-1255).
264@tex
265\hbadness=10000\par % just avoid underfull hbox warning
266@end tex
267@end quotation
268
269@cindex fonts for various scripts
270@cindex Intlfonts package, installation
271 To display the script(s) used by your language environment on a
272graphical display, you need to have a suitable font. If some of the
273characters appear as empty boxes, you should install the GNU Intlfonts
274package, which includes fonts for most supported scripts.@footnote{If
275you run Emacs on X, you need to inform the X server about the location
276of the newly installed fonts with the following commands:
277
278@example
279 xset fp+ /usr/local/share/emacs/fonts
280 xset fp rehash
281@end example
282}
283@xref{Fontsets}, for more details about setting up your fonts.
284
285@findex set-locale-environment
286@vindex locale-language-names
287@vindex locale-charset-language-names
288@cindex locales
289 Some operating systems let you specify the character-set locale you
290are using by setting the locale environment variables @env{LC_ALL},
291@env{LC_CTYPE}, or @env{LANG}.@footnote{If more than one of these is
292set, the first one that is nonempty specifies your locale for this
293purpose.} During startup, Emacs looks up your character-set locale's
294name in the system locale alias table, matches its canonical name
295against entries in the value of the variables
296@code{locale-charset-language-names} and @code{locale-language-names},
297and selects the corresponding language environment if a match is found.
298(The former variable overrides the latter.) It also adjusts the display
299table and terminal coding system, the locale coding system, the
300preferred coding system as needed for the locale, and---last but not
301least---the way Emacs decodes non-@acronym{ASCII} characters sent by your keyboard.
302
303 If you modify the @env{LC_ALL}, @env{LC_CTYPE}, or @env{LANG}
304environment variables while running Emacs, you may want to invoke the
305@code{set-locale-environment} function afterwards to readjust the
306language environment from the new locale.
307
308@vindex locale-preferred-coding-systems
309 The @code{set-locale-environment} function normally uses the preferred
310coding system established by the language environment to decode system
311messages. But if your locale matches an entry in the variable
312@code{locale-preferred-coding-systems}, Emacs uses the corresponding
313coding system instead. For example, if the locale @samp{ja_JP.PCK}
314matches @code{japanese-shift-jis} in
315@code{locale-preferred-coding-systems}, Emacs uses that encoding even
316though it might normally use @code{japanese-iso-8bit}.
317
318 You can override the language environment chosen at startup with
319explicit use of the command @code{set-language-environment}, or with
320customization of @code{current-language-environment} in your init
321file.
322
323@kindex C-h L
324@findex describe-language-environment
325 To display information about the effects of a certain language
326environment @var{lang-env}, use the command @kbd{C-h L @var{lang-env}
327@key{RET}} (@code{describe-language-environment}). This tells you
328which languages this language environment is useful for, and lists the
329character sets, coding systems, and input methods that go with it. It
330also shows some sample text to illustrate scripts used in this
331language environment. If you give an empty input for @var{lang-env},
332this command describes the chosen language environment.
333
334@vindex set-language-environment-hook
335 You can customize any language environment with the normal hook
336@code{set-language-environment-hook}. The command
337@code{set-language-environment} runs that hook after setting up the new
338language environment. The hook functions can test for a specific
339language environment by checking the variable
340@code{current-language-environment}. This hook is where you should
341put non-default settings for specific language environment, such as
342coding systems for keyboard input and terminal output, the default
343input method, etc.
344
345@vindex exit-language-environment-hook
346 Before it starts to set up the new language environment,
347@code{set-language-environment} first runs the hook
348@code{exit-language-environment-hook}. This hook is useful for undoing
349customizations that were made with @code{set-language-environment-hook}.
350For instance, if you set up a special key binding in a specific language
351environment using @code{set-language-environment-hook}, you should set
352up @code{exit-language-environment-hook} to restore the normal binding
353for that key.
354
355@node Input Methods
356@section Input Methods
357
358@cindex input methods
359 An @dfn{input method} is a kind of character conversion designed
360specifically for interactive input. In Emacs, typically each language
361has its own input method; sometimes several languages which use the same
362characters can share one input method. A few languages support several
363input methods.
364
365 The simplest kind of input method works by mapping @acronym{ASCII} letters
366into another alphabet; this allows you to use one other alphabet
367instead of @acronym{ASCII}. The Greek and Russian input methods
368work this way.
369
370 A more powerful technique is composition: converting sequences of
371characters into one letter. Many European input methods use composition
372to produce a single non-@acronym{ASCII} letter from a sequence that consists of a
373letter followed by accent characters (or vice versa). For example, some
374methods convert the sequence @kbd{a'} into a single accented letter.
375These input methods have no special commands of their own; all they do
376is compose sequences of printing characters.
377
378 The input methods for syllabic scripts typically use mapping followed
379by composition. The input methods for Thai and Korean work this way.
380First, letters are mapped into symbols for particular sounds or tone
381marks; then, sequences of these which make up a whole syllable are
382mapped into one syllable sign.
383
384 Chinese and Japanese require more complex methods. In Chinese input
385methods, first you enter the phonetic spelling of a Chinese word (in
386input method @code{chinese-py}, among others), or a sequence of
387portions of the character (input methods @code{chinese-4corner} and
388@code{chinese-sw}, and others). One input sequence typically
389corresponds to many possible Chinese characters. You select the one
390you mean using keys such as @kbd{C-f}, @kbd{C-b}, @kbd{C-n},
391@kbd{C-p}, and digits, which have special meanings in this situation.
392
393 The possible characters are conceptually arranged in several rows,
394with each row holding up to 10 alternatives. Normally, Emacs displays
395just one row at a time, in the echo area; @code{(@var{i}/@var{j})}
396appears at the beginning, to indicate that this is the @var{i}th row
397out of a total of @var{j} rows. Type @kbd{C-n} or @kbd{C-p} to
398display the next row or the previous row.
399
400 Type @kbd{C-f} and @kbd{C-b} to move forward and backward among
401the alternatives in the current row. As you do this, Emacs highlights
402the current alternative with a special color; type @code{C-@key{SPC}}
403to select the current alternative and use it as input. The
404alternatives in the row are also numbered; the number appears before
405the alternative. Typing a digit @var{n} selects the @var{n}th
406alternative of the current row and uses it as input.
407
408 @key{TAB} in these Chinese input methods displays a buffer showing
409all the possible characters at once; then clicking @kbd{Mouse-2} on
410one of them selects that alternative. The keys @kbd{C-f}, @kbd{C-b},
411@kbd{C-n}, @kbd{C-p}, and digits continue to work as usual, but they
412do the highlighting in the buffer showing the possible characters,
413rather than in the echo area.
414
415 In Japanese input methods, first you input a whole word using
416phonetic spelling; then, after the word is in the buffer, Emacs
417converts it into one or more characters using a large dictionary. One
418phonetic spelling corresponds to a number of different Japanese words;
419to select one of them, use @kbd{C-n} and @kbd{C-p} to cycle through
420the alternatives.
421
422 Sometimes it is useful to cut off input method processing so that the
423characters you have just entered will not combine with subsequent
424characters. For example, in input method @code{latin-1-postfix}, the
425sequence @kbd{e '} combines to form an @samp{e} with an accent. What if
426you want to enter them as separate characters?
427
428 One way is to type the accent twice; this is a special feature for
429entering the separate letter and accent. For example, @kbd{e ' '} gives
430you the two characters @samp{e'}. Another way is to type another letter
431after the @kbd{e}---something that won't combine with that---and
432immediately delete it. For example, you could type @kbd{e e @key{DEL}
433'} to get separate @samp{e} and @samp{'}.
434
435 Another method, more general but not quite as easy to type, is to use
436@kbd{C-\ C-\} between two characters to stop them from combining. This
437is the command @kbd{C-\} (@code{toggle-input-method}) used twice.
438@ifnottex
439@xref{Select Input Method}.
440@end ifnottex
441
442@cindex incremental search, input method interference
443 @kbd{C-\ C-\} is especially useful inside an incremental search,
444because it stops waiting for more characters to combine, and starts
445searching for what you have already entered.
446
447 To find out how to input the character after point using the current
448input method, type @kbd{C-u C-x =}. @xref{Position Info}.
449
450@vindex input-method-verbose-flag
451@vindex input-method-highlight-flag
452 The variables @code{input-method-highlight-flag} and
453@code{input-method-verbose-flag} control how input methods explain
454what is happening. If @code{input-method-highlight-flag} is
455non-@code{nil}, the partial sequence is highlighted in the buffer (for
456most input methods---some disable this feature). If
457@code{input-method-verbose-flag} is non-@code{nil}, the list of
458possible characters to type next is displayed in the echo area (but
459not when you are in the minibuffer).
460
461@node Select Input Method
462@section Selecting an Input Method
463
464@table @kbd
465@item C-\
466Enable or disable use of the selected input method.
467
468@item C-x @key{RET} C-\ @var{method} @key{RET}
469Select a new input method for the current buffer.
470
471@item C-h I @var{method} @key{RET}
472@itemx C-h C-\ @var{method} @key{RET}
473@findex describe-input-method
474@kindex C-h I
475@kindex C-h C-\
476Describe the input method @var{method} (@code{describe-input-method}).
477By default, it describes the current input method (if any). This
478description should give you the full details of how to use any
479particular input method.
480
481@item M-x list-input-methods
482Display a list of all the supported input methods.
483@end table
484
485@findex set-input-method
486@vindex current-input-method
487@kindex C-x RET C-\
488 To choose an input method for the current buffer, use @kbd{C-x
489@key{RET} C-\} (@code{set-input-method}). This command reads the
490input method name from the minibuffer; the name normally starts with the
491language environment that it is meant to be used with. The variable
492@code{current-input-method} records which input method is selected.
493
494@findex toggle-input-method
495@kindex C-\
496 Input methods use various sequences of @acronym{ASCII} characters to
497stand for non-@acronym{ASCII} characters. Sometimes it is useful to
498turn off the input method temporarily. To do this, type @kbd{C-\}
499(@code{toggle-input-method}). To reenable the input method, type
500@kbd{C-\} again.
501
502 If you type @kbd{C-\} and you have not yet selected an input method,
503it prompts for you to specify one. This has the same effect as using
504@kbd{C-x @key{RET} C-\} to specify an input method.
505
506 When invoked with a numeric argument, as in @kbd{C-u C-\},
507@code{toggle-input-method} always prompts you for an input method,
508suggesting the most recently selected one as the default.
509
510@vindex default-input-method
511 Selecting a language environment specifies a default input method for
512use in various buffers. When you have a default input method, you can
513select it in the current buffer by typing @kbd{C-\}. The variable
514@code{default-input-method} specifies the default input method
515(@code{nil} means there is none).
516
517 In some language environments, which support several different input
518methods, you might want to use an input method different from the
519default chosen by @code{set-language-environment}. You can instruct
520Emacs to select a different default input method for a certain
521language environment, if you wish, by using
522@code{set-language-environment-hook} (@pxref{Language Environments,
523set-language-environment-hook}). For example:
524
525@lisp
526(defun my-chinese-setup ()
527 "Set up my private Chinese environment."
528 (if (equal current-language-environment "Chinese-GB")
529 (setq default-input-method "chinese-tonepy")))
530(add-hook 'set-language-environment-hook 'my-chinese-setup)
531@end lisp
532
533@noindent
534This sets the default input method to be @code{chinese-tonepy}
535whenever you choose a Chinese-GB language environment.
536
537@findex quail-set-keyboard-layout
538 Some input methods for alphabetic scripts work by (in effect)
539remapping the keyboard to emulate various keyboard layouts commonly used
540for those scripts. How to do this remapping properly depends on your
541actual keyboard layout. To specify which layout your keyboard has, use
542the command @kbd{M-x quail-set-keyboard-layout}.
543
544@findex quail-show-key
545 You can use the command @kbd{M-x quail-show-key} to show what key (or
546key sequence) to type in order to input the character following point,
547using the selected keyboard layout. The command @kbd{C-u C-x =} also
548shows that information in addition to the other information about the
549character.
550
551@findex list-input-methods
552 To see a list of all the supported input methods, type @kbd{M-x
553list-input-methods}. The list gives information about each input
554method, including the string that stands for it in the mode line.
555
556@node Multibyte Conversion
557@section Unibyte and Multibyte Non-@acronym{ASCII} characters
558
559 When multibyte characters are enabled, character codes 0240 (octal)
560through 0377 (octal) are not really legitimate in the buffer. The valid
561non-@acronym{ASCII} printing characters have codes that start from 0400.
562
563 If you type a self-inserting character in the range 0240 through
5640377, or if you use @kbd{C-q} to insert one, Emacs assumes you
565intended to use one of the ISO Latin-@var{n} character sets, and
566converts it to the Emacs code representing that Latin-@var{n}
567character. You select @emph{which} ISO Latin character set to use
568through your choice of language environment
569@iftex
570(see above).
571@end iftex
572@ifnottex
573(@pxref{Language Environments}).
574@end ifnottex
575If you do not specify a choice, the default is Latin-1.
576
577 If you insert a character in the range 0200 through 0237, which
578forms the @code{eight-bit-control} character set, it is inserted
579literally. You should normally avoid doing this since buffers
580containing such characters have to be written out in either the
581@code{emacs-mule} or @code{raw-text} coding system, which is usually
582not what you want.
583
584@node Coding Systems
585@section Coding Systems
586@cindex coding systems
587
588 Users of various languages have established many more-or-less standard
589coding systems for representing them. Emacs does not use these coding
590systems internally; instead, it converts from various coding systems to
591its own system when reading data, and converts the internal coding
592system to other coding systems when writing data. Conversion is
593possible in reading or writing files, in sending or receiving from the
594terminal, and in exchanging data with subprocesses.
595
596 Emacs assigns a name to each coding system. Most coding systems are
597used for one language, and the name of the coding system starts with the
598language name. Some coding systems are used for several languages;
599their names usually start with @samp{iso}. There are also special
600coding systems @code{no-conversion}, @code{raw-text} and
601@code{emacs-mule} which do not convert printing characters at all.
602
603@cindex international files from DOS/Windows systems
604 A special class of coding systems, collectively known as
605@dfn{codepages}, is designed to support text encoded by MS-Windows and
606MS-DOS software. The names of these coding systems are
607@code{cp@var{nnnn}}, where @var{nnnn} is a 3- or 4-digit number of the
608codepage. You can use these encodings just like any other coding
609system; for example, to visit a file encoded in codepage 850, type
610@kbd{C-x @key{RET} c cp850 @key{RET} C-x C-f @var{filename}
611@key{RET}}@footnote{
612In the MS-DOS port of Emacs, you need to create a @code{cp@var{nnn}}
613coding system with @kbd{M-x codepage-setup}, before you can use it.
614@iftex
615@xref{MS-DOS and MULE,,,emacs-extra,Specialized Emacs Features}.
616@end iftex
617@ifnottex
618@xref{MS-DOS and MULE}.
619@end ifnottex
620}.
621
622 In addition to converting various representations of non-@acronym{ASCII}
623characters, a coding system can perform end-of-line conversion. Emacs
624handles three different conventions for how to separate lines in a file:
625newline, carriage-return linefeed, and just carriage-return.
626
627@table @kbd
628@item C-h C @var{coding} @key{RET}
629Describe coding system @var{coding}.
630
631@item C-h C @key{RET}
632Describe the coding systems currently in use.
633
634@item M-x list-coding-systems
635Display a list of all the supported coding systems.
636@end table
637
638@kindex C-h C
639@findex describe-coding-system
640 The command @kbd{C-h C} (@code{describe-coding-system}) displays
641information about particular coding systems, including the end-of-line
642conversion specified by those coding systems. You can specify a coding
643system name as the argument; alternatively, with an empty argument, it
644describes the coding systems currently selected for various purposes,
645both in the current buffer and as the defaults, and the priority list
646for recognizing coding systems (@pxref{Recognize Coding}).
647
648@findex list-coding-systems
649 To display a list of all the supported coding systems, type @kbd{M-x
650list-coding-systems}. The list gives information about each coding
651system, including the letter that stands for it in the mode line
652(@pxref{Mode Line}).
653
654@cindex end-of-line conversion
655@cindex line endings
656@cindex MS-DOS end-of-line conversion
657@cindex Macintosh end-of-line conversion
658 Each of the coding systems that appear in this list---except for
659@code{no-conversion}, which means no conversion of any kind---specifies
660how and whether to convert printing characters, but leaves the choice of
661end-of-line conversion to be decided based on the contents of each file.
662For example, if the file appears to use the sequence carriage-return
663linefeed to separate lines, DOS end-of-line conversion will be used.
664
665 Each of the listed coding systems has three variants which specify
666exactly what to do for end-of-line conversion:
667
668@table @code
669@item @dots{}-unix
670Don't do any end-of-line conversion; assume the file uses
671newline to separate lines. (This is the convention normally used
672on Unix and GNU systems.)
673
674@item @dots{}-dos
675Assume the file uses carriage-return linefeed to separate lines, and do
676the appropriate conversion. (This is the convention normally used on
677Microsoft systems.@footnote{It is also specified for MIME @samp{text/*}
678bodies and in other network transport contexts. It is different
679from the SGML reference syntax record-start/record-end format which
680Emacs doesn't support directly.})
681
682@item @dots{}-mac
683Assume the file uses carriage-return to separate lines, and do the
684appropriate conversion. (This is the convention normally used on the
685Macintosh system.)
686@end table
687
688 These variant coding systems are omitted from the
689@code{list-coding-systems} display for brevity, since they are entirely
690predictable. For example, the coding system @code{iso-latin-1} has
691variants @code{iso-latin-1-unix}, @code{iso-latin-1-dos} and
692@code{iso-latin-1-mac}.
693
694@cindex @code{undecided}, coding system
695 The coding systems @code{unix}, @code{dos}, and @code{mac} are
696aliases for @code{undecided-unix}, @code{undecided-dos}, and
697@code{undecided-mac}, respectively. These coding systems specify only
698the end-of-line conversion, and leave the character code conversion to
699be deduced from the text itself.
700
701 The coding system @code{raw-text} is good for a file which is mainly
702@acronym{ASCII} text, but may contain byte values above 127 which are
703not meant to encode non-@acronym{ASCII} characters. With
704@code{raw-text}, Emacs copies those byte values unchanged, and sets
705@code{enable-multibyte-characters} to @code{nil} in the current buffer
706so that they will be interpreted properly. @code{raw-text} handles
707end-of-line conversion in the usual way, based on the data
708encountered, and has the usual three variants to specify the kind of
709end-of-line conversion to use.
710
711 In contrast, the coding system @code{no-conversion} specifies no
712character code conversion at all---none for non-@acronym{ASCII} byte values and
713none for end of line. This is useful for reading or writing binary
714files, tar files, and other files that must be examined verbatim. It,
715too, sets @code{enable-multibyte-characters} to @code{nil}.
716
717 The easiest way to edit a file with no conversion of any kind is with
718the @kbd{M-x find-file-literally} command. This uses
719@code{no-conversion}, and also suppresses other Emacs features that
720might convert the file contents before you see them. @xref{Visiting}.
721
722 The coding system @code{emacs-mule} means that the file contains
723non-@acronym{ASCII} characters stored with the internal Emacs encoding. It
724handles end-of-line conversion based on the data encountered, and has
725the usual three variants to specify the kind of end-of-line conversion.
726
727@findex unify-8859-on-decoding-mode
728@anchor{Character Translation}
729 The @dfn{character translation} feature can modify the effect of
730various coding systems, by changing the internal Emacs codes that
731decoding produces. For instance, the command
732@code{unify-8859-on-decoding-mode} enables a mode that ``unifies'' the
733Latin alphabets when decoding text. This works by converting all
734non-@acronym{ASCII} Latin-@var{n} characters to either Latin-1 or
735Unicode characters. This way it is easier to use various
736Latin-@var{n} alphabets together. (In a future Emacs version we hope
737to move towards full Unicode support and complete unification of
738character sets.)
739
740@vindex enable-character-translation
741 If you set the variable @code{enable-character-translation} to
742@code{nil}, that disables all character translation (including
743@code{unify-8859-on-decoding-mode}).
744
745@node Recognize Coding
746@section Recognizing Coding Systems
747
748 Emacs tries to recognize which coding system to use for a given text
749as an integral part of reading that text. (This applies to files
750being read, output from subprocesses, text from X selections, etc.)
751Emacs can select the right coding system automatically most of the
752time---once you have specified your preferences.
753
754 Some coding systems can be recognized or distinguished by which byte
755sequences appear in the data. However, there are coding systems that
756cannot be distinguished, not even potentially. For example, there is no
757way to distinguish between Latin-1 and Latin-2; they use the same byte
758values with different meanings.
759
760 Emacs handles this situation by means of a priority list of coding
761systems. Whenever Emacs reads a file, if you do not specify the coding
762system to use, Emacs checks the data against each coding system,
763starting with the first in priority and working down the list, until it
764finds a coding system that fits the data. Then it converts the file
765contents assuming that they are represented in this coding system.
766
767 The priority list of coding systems depends on the selected language
768environment (@pxref{Language Environments}). For example, if you use
769French, you probably want Emacs to prefer Latin-1 to Latin-2; if you use
770Czech, you probably want Latin-2 to be preferred. This is one of the
771reasons to specify a language environment.
772
773@findex prefer-coding-system
774 However, you can alter the coding system priority list in detail
775with the command @kbd{M-x prefer-coding-system}. This command reads
776the name of a coding system from the minibuffer, and adds it to the
777front of the priority list, so that it is preferred to all others. If
778you use this command several times, each use adds one element to the
779front of the priority list.
780
781 If you use a coding system that specifies the end-of-line conversion
782type, such as @code{iso-8859-1-dos}, what this means is that Emacs
783should attempt to recognize @code{iso-8859-1} with priority, and should
784use DOS end-of-line conversion when it does recognize @code{iso-8859-1}.
785
786@vindex file-coding-system-alist
787 Sometimes a file name indicates which coding system to use for the
788file. The variable @code{file-coding-system-alist} specifies this
789correspondence. There is a special function
790@code{modify-coding-system-alist} for adding elements to this list. For
791example, to read and write all @samp{.txt} files using the coding system
792@code{chinese-iso-8bit}, you can execute this Lisp expression:
793
794@smallexample
795(modify-coding-system-alist 'file "\\.txt\\'" 'chinese-iso-8bit)
796@end smallexample
797
798@noindent
799The first argument should be @code{file}, the second argument should be
800a regular expression that determines which files this applies to, and
801the third argument says which coding system to use for these files.
802
803@vindex inhibit-eol-conversion
804@cindex DOS-style end-of-line display
805 Emacs recognizes which kind of end-of-line conversion to use based on
806the contents of the file: if it sees only carriage-returns, or only
807carriage-return linefeed sequences, then it chooses the end-of-line
808conversion accordingly. You can inhibit the automatic use of
809end-of-line conversion by setting the variable @code{inhibit-eol-conversion}
810to non-@code{nil}. If you do that, DOS-style files will be displayed
811with the @samp{^M} characters visible in the buffer; some people
812prefer this to the more subtle @samp{(DOS)} end-of-line type
813indication near the left edge of the mode line (@pxref{Mode Line,
814eol-mnemonic}).
815
816@vindex inhibit-iso-escape-detection
817@cindex escape sequences in files
818 By default, the automatic detection of coding system is sensitive to
819escape sequences. If Emacs sees a sequence of characters that begin
820with an escape character, and the sequence is valid as an ISO-2022
821code, that tells Emacs to use one of the ISO-2022 encodings to decode
822the file.
823
824 However, there may be cases that you want to read escape sequences
825in a file as is. In such a case, you can set the variable
826@code{inhibit-iso-escape-detection} to non-@code{nil}. Then the code
827detection ignores any escape sequences, and never uses an ISO-2022
828encoding. The result is that all escape sequences become visible in
829the buffer.
830
831 The default value of @code{inhibit-iso-escape-detection} is
832@code{nil}. We recommend that you not change it permanently, only for
833one specific operation. That's because many Emacs Lisp source files
834in the Emacs distribution contain non-@acronym{ASCII} characters encoded in the
835coding system @code{iso-2022-7bit}, and they won't be
836decoded correctly when you visit those files if you suppress the
837escape sequence detection.
838
839@vindex auto-coding-alist
840@vindex auto-coding-regexp-alist
841@vindex auto-coding-functions
842 The variables @code{auto-coding-alist},
843@code{auto-coding-regexp-alist} and @code{auto-coding-functions} are
844the strongest way to specify the coding system for certain patterns of
845file names, or for files containing certain patterns; these variables
846even override @samp{-*-coding:-*-} tags in the file itself. Emacs
847uses @code{auto-coding-alist} for tar and archive files, to prevent it
848from being confused by a @samp{-*-coding:-*-} tag in a member of the
849archive and thinking it applies to the archive file as a whole.
850Likewise, Emacs uses @code{auto-coding-regexp-alist} to ensure that
851RMAIL files, whose names in general don't match any particular
852pattern, are decoded correctly. One of the builtin
853@code{auto-coding-functions} detects the encoding for XML files.
854
855@vindex rmail-decode-mime-charset
856 When you get new mail in Rmail, each message is translated
857automatically from the coding system it is written in, as if it were a
858separate file. This uses the priority list of coding systems that you
859have specified. If a MIME message specifies a character set, Rmail
860obeys that specification, unless @code{rmail-decode-mime-charset} is
861@code{nil}.
862
863@vindex rmail-file-coding-system
864 For reading and saving Rmail files themselves, Emacs uses the coding
865system specified by the variable @code{rmail-file-coding-system}. The
866default value is @code{nil}, which means that Rmail files are not
867translated (they are read and written in the Emacs internal character
868code).
869
870@node Specify Coding
871@section Specifying a File's Coding System
872
873 If Emacs recognizes the encoding of a file incorrectly, you can
874reread the file using the correct coding system by typing @kbd{C-x
875@key{RET} r @var{coding-system} @key{RET}}. To see what coding system
876Emacs actually used to decode the file, look at the coding system
877mnemonic letter near the left edge of the mode line (@pxref{Mode
878Line}), or type @kbd{C-h C @key{RET}}.
879
880@vindex coding
881 You can specify the coding system for a particular file in the file
882itself, using the @w{@samp{-*-@dots{}-*-}} construct at the beginning,
883or a local variables list at the end (@pxref{File Variables}). You do
884this by defining a value for the ``variable'' named @code{coding}.
885Emacs does not really have a variable @code{coding}; instead of
886setting a variable, this uses the specified coding system for the
887file. For example, @samp{-*-mode: C; coding: latin-1;-*-} specifies
888use of the Latin-1 coding system, as well as C mode. When you specify
889the coding explicitly in the file, that overrides
890@code{file-coding-system-alist}.
891
892 If you add the character @samp{!} at the end of the coding system
893name in @code{coding}, it disables any character translation
894(@pxref{Character Translation}) while decoding the file. This is
895useful when you need to make sure that the character codes in the
896Emacs buffer will not vary due to changes in user settings; for
897instance, for the sake of strings in Emacs Lisp source files.
898
899@node Output Coding
900@section Choosing Coding Systems for Output
901
902@vindex buffer-file-coding-system
903 Once Emacs has chosen a coding system for a buffer, it stores that
904coding system in @code{buffer-file-coding-system}. That makes it the
905default for operations that write from this buffer into a file, such
906as @code{save-buffer} and @code{write-region}. You can specify a
907different coding system for further file output from the buffer using
908@code{set-buffer-file-coding-system} (@pxref{Text Coding}).
909
910 You can insert any character Emacs supports into any Emacs buffer,
911but most coding systems can only handle a subset of these characters.
912Therefore, you can insert characters that cannot be encoded with the
913coding system that will be used to save the buffer. For example, you
914could start with an @acronym{ASCII} file and insert a few Latin-1
915characters into it, or you could edit a text file in Polish encoded in
916@code{iso-8859-2} and add some Russian words to it. When you save
917that buffer, Emacs cannot use the current value of
918@code{buffer-file-coding-system}, because the characters you added
919cannot be encoded by that coding system.
920
921 When that happens, Emacs tries the most-preferred coding system (set
922by @kbd{M-x prefer-coding-system} or @kbd{M-x
923set-language-environment}), and if that coding system can safely
924encode all of the characters in the buffer, Emacs uses it, and stores
925its value in @code{buffer-file-coding-system}. Otherwise, Emacs
926displays a list of coding systems suitable for encoding the buffer's
927contents, and asks you to choose one of those coding systems.
928
929 If you insert the unsuitable characters in a mail message, Emacs
930behaves a bit differently. It additionally checks whether the
931most-preferred coding system is recommended for use in MIME messages;
932if not, Emacs tells you that the most-preferred coding system is not
933recommended and prompts you for another coding system. This is so you
934won't inadvertently send a message encoded in a way that your
935recipient's mail software will have difficulty decoding. (You can
936still use an unsuitable coding system if you type its name in response
937to the question.)
938
939@vindex sendmail-coding-system
940 When you send a message with Mail mode (@pxref{Sending Mail}), Emacs has
941four different ways to determine the coding system to use for encoding
942the message text. It tries the buffer's own value of
943@code{buffer-file-coding-system}, if that is non-@code{nil}. Otherwise,
944it uses the value of @code{sendmail-coding-system}, if that is
945non-@code{nil}. The third way is to use the default coding system for
946new files, which is controlled by your choice of language environment,
947if that is non-@code{nil}. If all of these three values are @code{nil},
948Emacs encodes outgoing mail using the Latin-1 coding system.
949
950@node Text Coding
951@section Specifying a Coding System for File Text
952
953 In cases where Emacs does not automatically choose the right coding
954system for a file's contents, you can use these commands to specify
955one:
956
957@table @kbd
958@item C-x @key{RET} f @var{coding} @key{RET}
959Use coding system @var{coding} for saving or revisiting the visited
960file in the current buffer.
961
962@item C-x @key{RET} c @var{coding} @key{RET}
963Specify coding system @var{coding} for the immediately following
964command.
965
966@item C-x @key{RET} r @var{coding} @key{RET}
967Revisit the current file using the coding system @var{coding}.
968
969@item M-x recode-region @key{RET} @var{right} @key{RET} @var{wrong} @key{RET}
970Convert a region that was decoded using coding system @var{wrong},
971decoding it using coding system @var{right} instead.
972@end table
973
974@kindex C-x RET f
975@findex set-buffer-file-coding-system
976 The command @kbd{C-x @key{RET} f}
977(@code{set-buffer-file-coding-system}) sets the file coding system for
978the current buffer---in other words, it says which coding system to
979use when saving or reverting the visited file. You specify which
980coding system using the minibuffer. If you specify a coding system
981that cannot handle all of the characters in the buffer, Emacs warns
982you about the troublesome characters when you actually save the
983buffer.
984
985@cindex specify end-of-line conversion
986 You can also use this command to specify the end-of-line conversion
987(@pxref{Coding Systems, end-of-line conversion}) for encoding the
988current buffer. For example, @kbd{C-x @key{RET} f dos @key{RET}} will
989cause Emacs to save the current buffer's text with DOS-style CRLF line
990endings.
991
992@kindex C-x RET c
993@findex universal-coding-system-argument
994 Another way to specify the coding system for a file is when you visit
995the file. First use the command @kbd{C-x @key{RET} c}
996(@code{universal-coding-system-argument}); this command uses the
997minibuffer to read a coding system name. After you exit the minibuffer,
998the specified coding system is used for @emph{the immediately following
999command}.
1000
1001 So if the immediately following command is @kbd{C-x C-f}, for example,
1002it reads the file using that coding system (and records the coding
1003system for when you later save the file). Or if the immediately following
1004command is @kbd{C-x C-w}, it writes the file using that coding system.
1005When you specify the coding system for saving in this way, instead
1006of with @kbd{C-x @key{RET} f}, there is no warning if the buffer
1007contains characters that the coding system cannot handle.
1008
1009 Other file commands affected by a specified coding system include
1010@kbd{C-x i} and @kbd{C-x C-v}, as well as the other-window variants
1011of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that
1012start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). If the
1013immediately following command does not use the coding system, then
1014@kbd{C-x @key{RET} c} ultimately has no effect.
1015
1016 An easy way to visit a file with no conversion is with the @kbd{M-x
1017find-file-literally} command. @xref{Visiting}.
1018
1019@vindex default-buffer-file-coding-system
1020 The variable @code{default-buffer-file-coding-system} specifies the
1021choice of coding system to use when you create a new file. It applies
1022when you find a new file, and when you create a buffer and then save it
1023in a file. Selecting a language environment typically sets this
1024variable to a good choice of default coding system for that language
1025environment.
1026
1027@kindex C-x RET r
1028@findex revert-buffer-with-coding-system
1029 If you visit a file with a wrong coding system, you can correct this
1030with @kbd{C-x @key{RET} r} (@code{revert-buffer-with-coding-system}).
1031This visits the current file again, using a coding system you specify.
1032
1033@findex recode-region
1034 If a piece of text has already been inserted into a buffer using the
1035wrong coding system, you can redo the decoding of it using @kbd{M-x
1036recode-region}. This prompts you for the proper coding system, then
1037for the wrong coding system that was actually used, and does the
1038conversion. It first encodes the region using the wrong coding system,
1039then decodes it again using the proper coding system.
1040
1041@node Communication Coding
1042@section Coding Systems for Interprocess Communication
1043
1044 This section explains how to specify coding systems for use
1045in communication with other processes.
1046
1047@table @kbd
1048@item C-x @key{RET} x @var{coding} @key{RET}
1049Use coding system @var{coding} for transferring selections to and from
1050other window-based applications.
1051
1052@item C-x @key{RET} X @var{coding} @key{RET}
1053Use coding system @var{coding} for transferring @emph{one}
1054selection---the next one---to or from another window-based application.
1055
1056@item C-x @key{RET} p @var{input-coding} @key{RET} @var{output-coding} @key{RET}
1057Use coding systems @var{input-coding} and @var{output-coding} for
1058subprocess input and output in the current buffer.
1059
1060@item C-x @key{RET} c @var{coding} @key{RET}
1061Specify coding system @var{coding} for the immediately following
1062command.
1063@end table
1064
1065@kindex C-x RET x
1066@kindex C-x RET X
1067@findex set-selection-coding-system
1068@findex set-next-selection-coding-system
1069 The command @kbd{C-x @key{RET} x} (@code{set-selection-coding-system})
1070specifies the coding system for sending selected text to other windowing
1071applications, and for receiving the text of selections made in other
1072applications. This command applies to all subsequent selections, until
1073you override it by using the command again. The command @kbd{C-x
1074@key{RET} X} (@code{set-next-selection-coding-system}) specifies the
1075coding system for the next selection made in Emacs or read by Emacs.
1076
1077@kindex C-x RET p
1078@findex set-buffer-process-coding-system
1079 The command @kbd{C-x @key{RET} p} (@code{set-buffer-process-coding-system})
1080specifies the coding system for input and output to a subprocess. This
1081command applies to the current buffer; normally, each subprocess has its
1082own buffer, and thus you can use this command to specify translation to
1083and from a particular subprocess by giving the command in the
1084corresponding buffer.
1085
1086 You can also use @kbd{C-x @key{RET} c} just before the command that
1087runs or starts a subprocess, to specify the coding system to use for
1088communication with that subprocess.
1089
1090 The default for translation of process input and output depends on the
1091current language environment.
1092
1093@vindex locale-coding-system
1094@cindex decoding non-@acronym{ASCII} keyboard input on X
1095 The variable @code{locale-coding-system} specifies a coding system
1096to use when encoding and decoding system strings such as system error
1097messages and @code{format-time-string} formats and time stamps. That
1098coding system is also used for decoding non-@acronym{ASCII} keyboard input on X
1099Window systems. You should choose a coding system that is compatible
1100with the underlying system's text representation, which is normally
1101specified by one of the environment variables @env{LC_ALL},
1102@env{LC_CTYPE}, and @env{LANG}. (The first one, in the order
1103specified above, whose value is nonempty is the one that determines
1104the text representation.)
1105
1106@node File Name Coding
1107@section Coding Systems for File Names
1108
1109@table @kbd
1110@item C-x @key{RET} F @var{coding} @key{RET}
1111Use coding system @var{coding} for encoding and decoding file
1112@emph{names}.
1113@end table
1114
1115@vindex file-name-coding-system
1116@cindex file names with non-@acronym{ASCII} characters
1117 The variable @code{file-name-coding-system} specifies a coding
1118system to use for encoding file names. It has no effect on reading
1119and writing the @emph{contents} of files.
1120
1121@findex set-file-name-coding-system
1122@kindex C-x @key{RET} F
1123 If you set the variable to a coding system name (as a Lisp symbol or
1124a string), Emacs encodes file names using that coding system for all
1125file operations. This makes it possible to use non-@acronym{ASCII}
1126characters in file names---or, at least, those non-@acronym{ASCII}
1127characters which the specified coding system can encode. Use @kbd{C-x
1128@key{RET} F} (@code{set-file-name-coding-system}) to specify this
1129interactively.
1130
1131 If @code{file-name-coding-system} is @code{nil}, Emacs uses a
1132default coding system determined by the selected language environment.
1133In the default language environment, any non-@acronym{ASCII}
1134characters in file names are not encoded specially; they appear in the
1135file system using the internal Emacs representation.
1136
1137 @strong{Warning:} if you change @code{file-name-coding-system} (or the
1138language environment) in the middle of an Emacs session, problems can
1139result if you have already visited files whose names were encoded using
1140the earlier coding system and cannot be encoded (or are encoded
1141differently) under the new coding system. If you try to save one of
1142these buffers under the visited file name, saving may use the wrong file
1143name, or it may get an error. If such a problem happens, use @kbd{C-x
1144C-w} to specify a new file name for that buffer.
1145
1146@findex recode-file-name
1147 If a mistake occurs when encoding a file name, use the command
1148@kbd{M-x recode-file-name} to change the file name's coding
1149system. This prompts for an existing file name, its old coding
1150system, and the coding system to which you wish to convert.
1151
1152@node Terminal Coding
1153@section Coding Systems for Terminal I/O
1154
1155@table @kbd
1156@item C-x @key{RET} k @var{coding} @key{RET}
1157Use coding system @var{coding} for keyboard input.
1158
1159@item C-x @key{RET} t @var{coding} @key{RET}
1160Use coding system @var{coding} for terminal output.
1161@end table
1162
1163@kindex C-x RET t
1164@findex set-terminal-coding-system
1165 The command @kbd{C-x @key{RET} t} (@code{set-terminal-coding-system})
1166specifies the coding system for terminal output. If you specify a
1167character code for terminal output, all characters output to the
1168terminal are translated into that coding system.
1169
1170 This feature is useful for certain character-only terminals built to
1171support specific languages or character sets---for example, European
1172terminals that support one of the ISO Latin character sets. You need to
1173specify the terminal coding system when using multibyte text, so that
1174Emacs knows which characters the terminal can actually handle.
1175
1176 By default, output to the terminal is not translated at all, unless
1177Emacs can deduce the proper coding system from your terminal type or
1178your locale specification (@pxref{Language Environments}).
1179
1180@kindex C-x RET k
1181@findex set-keyboard-coding-system
1182@vindex keyboard-coding-system
1183 The command @kbd{C-x @key{RET} k} (@code{set-keyboard-coding-system})
1184or the variable @code{keyboard-coding-system} specifies the coding
1185system for keyboard input. Character-code translation of keyboard
1186input is useful for terminals with keys that send non-@acronym{ASCII}
1187graphic characters---for example, some terminals designed for ISO
1188Latin-1 or subsets of it.
1189
1190 By default, keyboard input is translated based on your system locale
1191setting. If your terminal does not really support the encoding
1192implied by your locale (for example, if you find it inserts a
1193non-@acronym{ASCII} character if you type @kbd{M-i}), you will need to set
1194@code{keyboard-coding-system} to @code{nil} to turn off encoding.
1195You can do this by putting
1196
1197@lisp
1198(set-keyboard-coding-system nil)
1199@end lisp
1200
1201@noindent
1202in your @file{~/.emacs} file.
1203
1204 There is a similarity between using a coding system translation for
1205keyboard input, and using an input method: both define sequences of
1206keyboard input that translate into single characters. However, input
1207methods are designed to be convenient for interactive use by humans, and
1208the sequences that are translated are typically sequences of @acronym{ASCII}
1209printing characters. Coding systems typically translate sequences of
1210non-graphic characters.
1211
1212@node Fontsets
1213@section Fontsets
1214@cindex fontsets
1215
1216 A font typically defines shapes for a single alphabet or script.
1217Therefore, displaying the entire range of scripts that Emacs supports
1218requires a collection of many fonts. In Emacs, such a collection is
1219called a @dfn{fontset}. A fontset is defined by a list of fonts, each
1220assigned to handle a range of character codes.
1221
1222 Each fontset has a name, like a font. However, while fonts are
1223stored in the system and the available font names are defined by the
1224system, fontsets are defined within Emacs itself. Once you have
1225defined a fontset, you can use it within Emacs by specifying its name,
1226anywhere that you could use a single font. Of course, Emacs fontsets
1227can use only the fonts that the system supports; if certain characters
1228appear on the screen as hollow boxes, this means that the fontset in
1229use for them has no font for those characters.@footnote{The Emacs
1230installation instructions have information on additional font
1231support.}
1232
1233 Emacs creates two fontsets automatically: the @dfn{standard fontset}
1234and the @dfn{startup fontset}. The standard fontset is most likely to
1235have fonts for a wide variety of non-@acronym{ASCII} characters;
1236however, this is not the default for Emacs to use. (By default, Emacs
1237tries to find a font that has bold and italic variants.) You can
1238specify use of the standard fontset with the @samp{-fn} option. For
1239example,
1240
1241@example
1242emacs -fn fontset-standard
1243@end example
1244
1245@noindent
1246You can also specify a fontset with the @samp{Font} resource (@pxref{X
1247Resources}).
1248
1249 A fontset does not necessarily specify a font for every character
1250code. If a fontset specifies no font for a certain character, or if it
1251specifies a font that does not exist on your system, then it cannot
1252display that character properly. It will display that character as an
1253empty box instead.
1254
1255@node Defining Fontsets
1256@section Defining fontsets
1257
1258@vindex standard-fontset-spec
1259@cindex standard fontset
1260 Emacs creates a standard fontset automatically according to the value
1261of @code{standard-fontset-spec}. This fontset's name is
1262
1263@example
1264-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard
1265@end example
1266
1267@noindent
1268or just @samp{fontset-standard} for short.
1269
1270 Bold, italic, and bold-italic variants of the standard fontset are
1271created automatically. Their names have @samp{bold} instead of
1272@samp{medium}, or @samp{i} instead of @samp{r}, or both.
1273
1274@cindex startup fontset
1275 If you specify a default @acronym{ASCII} font with the @samp{Font} resource or
1276the @samp{-fn} argument, Emacs generates a fontset from it
1277automatically. This is the @dfn{startup fontset} and its name is
1278@code{fontset-startup}. It does this by replacing the @var{foundry},
1279@var{family}, @var{add_style}, and @var{average_width} fields of the
1280font name with @samp{*}, replacing @var{charset_registry} field with
1281@samp{fontset}, and replacing @var{charset_encoding} field with
1282@samp{startup}, then using the resulting string to specify a fontset.
1283
1284 For instance, if you start Emacs this way,
1285
1286@example
1287emacs -fn "*courier-medium-r-normal--14-140-*-iso8859-1"
1288@end example
1289
1290@noindent
1291Emacs generates the following fontset and uses it for the initial X
1292window frame:
1293
1294@example
1295-*-*-medium-r-normal-*-14-140-*-*-*-*-fontset-startup
1296@end example
1297
1298 With the X resource @samp{Emacs.Font}, you can specify a fontset name
1299just like an actual font name. But be careful not to specify a fontset
1300name in a wildcard resource like @samp{Emacs*Font}---that wildcard
1301specification matches various other resources, such as for menus, and
1302menus cannot handle fontsets.
1303
1304 You can specify additional fontsets using X resources named
1305@samp{Fontset-@var{n}}, where @var{n} is an integer starting from 0.
1306The resource value should have this form:
1307
1308@smallexample
1309@var{fontpattern}, @r{[}@var{charset}:@var{font}@r{]@dots{}}
1310@end smallexample
1311
1312@noindent
1313@var{fontpattern} should have the form of a standard X font name, except
1314for the last two fields. They should have the form
1315@samp{fontset-@var{alias}}.
1316
1317 The fontset has two names, one long and one short. The long name is
1318@var{fontpattern}. The short name is @samp{fontset-@var{alias}}. You
1319can refer to the fontset by either name.
1320
1321 The construct @samp{@var{charset}:@var{font}} specifies which font to
1322use (in this fontset) for one particular character set. Here,
1323@var{charset} is the name of a character set, and @var{font} is the
1324font to use for that character set. You can use this construct any
1325number of times in defining one fontset.
1326
1327 For the other character sets, Emacs chooses a font based on
1328@var{fontpattern}. It replaces @samp{fontset-@var{alias}} with values
1329that describe the character set. For the @acronym{ASCII} character font,
1330@samp{fontset-@var{alias}} is replaced with @samp{ISO8859-1}.
1331
1332 In addition, when several consecutive fields are wildcards, Emacs
1333collapses them into a single wildcard. This is to prevent use of
1334auto-scaled fonts. Fonts made by scaling larger fonts are not usable
1335for editing, and scaling a smaller font is not useful because it is
1336better to use the smaller font in its own size, which is what Emacs
1337does.
1338
1339 Thus if @var{fontpattern} is this,
1340
1341@example
1342-*-fixed-medium-r-normal-*-24-*-*-*-*-*-fontset-24
1343@end example
1344
1345@noindent
1346the font specification for @acronym{ASCII} characters would be this:
1347
1348@example
1349-*-fixed-medium-r-normal-*-24-*-ISO8859-1
1350@end example
1351
1352@noindent
1353and the font specification for Chinese GB2312 characters would be this:
1354
1355@example
1356-*-fixed-medium-r-normal-*-24-*-gb2312*-*
1357@end example
1358
1359 You may not have any Chinese font matching the above font
1360specification. Most X distributions include only Chinese fonts that
1361have @samp{song ti} or @samp{fangsong ti} in @var{family} field. In
1362such a case, @samp{Fontset-@var{n}} can be specified as below:
1363
1364@smallexample
1365Emacs.Fontset-0: -*-fixed-medium-r-normal-*-24-*-*-*-*-*-fontset-24,\
1366 chinese-gb2312:-*-*-medium-r-normal-*-24-*-gb2312*-*
1367@end smallexample
1368
1369@noindent
1370Then, the font specifications for all but Chinese GB2312 characters have
1371@samp{fixed} in the @var{family} field, and the font specification for
1372Chinese GB2312 characters has a wild card @samp{*} in the @var{family}
1373field.
1374
1375@findex create-fontset-from-fontset-spec
1376 The function that processes the fontset resource value to create the
1377fontset is called @code{create-fontset-from-fontset-spec}. You can also
1378call this function explicitly to create a fontset.
1379
1380 @xref{Font X}, for more information about font naming in X.
1381
1382@node Undisplayable Characters
1383@section Undisplayable Characters
1384
1385 There may be a some non-@acronym{ASCII} characters that your terminal cannot
1386display. Most text-only terminals support just a single character
1387set (use the variable @code{default-terminal-coding-system}
1388(@pxref{Terminal Coding}) to tell Emacs which one); characters which
1389can't be encoded in that coding system are displayed as @samp{?} by
1390default.
1391
1392 Graphical displays can display a broader range of characters, but
1393you may not have fonts installed for all of them; characters that have
1394no font appear as a hollow box.
1395
1396 If you use Latin-1 characters but your terminal can't display
1397Latin-1, you can arrange to display mnemonic @acronym{ASCII} sequences
1398instead, e.g.@: @samp{"o} for o-umlaut. Load the library
1399@file{iso-ascii} to do this.
1400
1401@vindex latin1-display
1402 If your terminal can display Latin-1, you can display characters
1403from other European character sets using a mixture of equivalent
1404Latin-1 characters and @acronym{ASCII} mnemonics. Customize the variable
1405@code{latin1-display} to enable this. The mnemonic @acronym{ASCII}
1406sequences mostly correspond to those of the prefix input methods.
1407
1408@node Unibyte Mode
1409@section Unibyte Editing Mode
1410
1411@cindex European character sets
1412@cindex accented characters
1413@cindex ISO Latin character sets
1414@cindex Unibyte operation
1415 The ISO 8859 Latin-@var{n} character sets define character codes in
1416the range 0240 to 0377 octal (160 to 255 decimal) to handle the
1417accented letters and punctuation needed by various European languages
1418(and some non-European ones). If you disable multibyte characters,
1419Emacs can still handle @emph{one} of these character codes at a time.
1420To specify @emph{which} of these codes to use, invoke @kbd{M-x
1421set-language-environment} and specify a suitable language environment
1422such as @samp{Latin-@var{n}}.
1423
1424 For more information about unibyte operation, see @ref{Enabling
1425Multibyte}. Note particularly that you probably want to ensure that
1426your initialization files are read as unibyte if they contain
1427non-@acronym{ASCII} characters.
1428
1429@vindex unibyte-display-via-language-environment
1430 Emacs can also display those characters, provided the terminal or font
1431in use supports them. This works automatically. Alternatively, on a
1432graphical display, Emacs can also display single-byte characters
1433through fontsets, in effect by displaying the equivalent multibyte
1434characters according to the current language environment. To request
1435this, set the variable @code{unibyte-display-via-language-environment}
1436to a non-@code{nil} value.
1437
1438@cindex @code{iso-ascii} library
1439 If your terminal does not support display of the Latin-1 character
1440set, Emacs can display these characters as @acronym{ASCII} sequences which at
1441least give you a clear idea of what the characters are. To do this,
1442load the library @code{iso-ascii}. Similar libraries for other
1443Latin-@var{n} character sets could be implemented, but we don't have
1444them yet.
1445
1446@findex standard-display-8bit
1447@cindex 8-bit display
1448 Normally non-ISO-8859 characters (decimal codes between 128 and 159
1449inclusive) are displayed as octal escapes. You can change this for
1450non-standard ``extended'' versions of ISO-8859 character sets by using the
1451function @code{standard-display-8bit} in the @code{disp-table} library.
1452
1453 There are two ways to input single-byte non-@acronym{ASCII}
1454characters:
1455
1456@itemize @bullet
1457@cindex 8-bit input
1458@item
1459You can use an input method for the selected language environment.
1460@xref{Input Methods}. When you use an input method in a unibyte buffer,
1461the non-@acronym{ASCII} character you specify with it is converted to unibyte.
1462
1463@item
1464If your keyboard can generate character codes 128 (decimal) and up,
1465representing non-@acronym{ASCII} characters, you can type those character codes
1466directly.
1467
1468On a graphical display, you should not need to do anything special to use
1469these keys; they should simply work. On a text-only terminal, you
1470should use the command @code{M-x set-keyboard-coding-system} or the
1471variable @code{keyboard-coding-system} to specify which coding system
1472your keyboard uses (@pxref{Terminal Coding}). Enabling this feature
1473will probably require you to use @kbd{ESC} to type Meta characters;
1474however, on a console terminal or in @code{xterm}, you can arrange for
1475Meta to be converted to @kbd{ESC} and still be able type 8-bit
1476characters present directly on the keyboard or using @kbd{Compose} or
1477@kbd{AltGr} keys. @xref{User Input}.
1478
1479@kindex C-x 8
1480@cindex @code{iso-transl} library
1481@cindex compose character
1482@cindex dead character
1483@item
1484For Latin-1 only, you can use the key @kbd{C-x 8} as a ``compose
1485character'' prefix for entry of non-@acronym{ASCII} Latin-1 printing
1486characters. @kbd{C-x 8} is good for insertion (in the minibuffer as
1487well as other buffers), for searching, and in any other context where
1488a key sequence is allowed.
1489
1490@kbd{C-x 8} works by loading the @code{iso-transl} library. Once that
1491library is loaded, the @key{ALT} modifier key, if the keyboard has
1492one, serves the same purpose as @kbd{C-x 8}: use @key{ALT} together
1493with an accent character to modify the following letter. In addition,
1494if the keyboard has keys for the Latin-1 ``dead accent characters,''
1495they too are defined to compose with the following character, once
1496@code{iso-transl} is loaded.
1497
1498Use @kbd{C-x 8 C-h} to list all the available @kbd{C-x 8} translations.
1499@end itemize
1500
1501@node Charsets
1502@section Charsets
1503@cindex charsets
1504
1505 Emacs groups all supported characters into disjoint @dfn{charsets}.
1506Each character code belongs to one and only one charset. For
1507historical reasons, Emacs typically divides an 8-bit character code
1508for an extended version of @acronym{ASCII} into two charsets:
1509@acronym{ASCII}, which covers the codes 0 through 127, plus another
1510charset which covers the ``right-hand part'' (the codes 128 and up).
1511For instance, the characters of Latin-1 include the Emacs charset
1512@code{ascii} plus the Emacs charset @code{latin-iso8859-1}.
1513
1514 Emacs characters belonging to different charsets may look the same,
1515but they are still different characters. For example, the letter
1516@samp{o} with acute accent in charset @code{latin-iso8859-1}, used for
1517Latin-1, is different from the letter @samp{o} with acute accent in
1518charset @code{latin-iso8859-2}, used for Latin-2.
1519
1520@findex list-charset-chars
1521@cindex characters in a certain charset
1522@findex describe-character-set
1523 There are two commands for obtaining information about Emacs
1524charsets. The command @kbd{M-x list-charset-chars} prompts for a name
1525of a character set, and displays all the characters in that character
1526set. The command @kbd{M-x describe-character-set} prompts for a
1527charset name and displays information about that charset, including
1528its internal representation within Emacs.
1529
1530 To find out which charset a character in the buffer belongs to,
1531put point before it and type @kbd{C-u C-x =}.
1532
1533@ignore
1534 arch-tag: 310ba60d-31ef-4ce7-91f1-f282dd57b6b3
1535@end ignore
diff --git a/doc/emacs/picture-xtra.texi b/doc/emacs/picture-xtra.texi
new file mode 100644
index 00000000000..ad3b9f27cc5
--- /dev/null
+++ b/doc/emacs/picture-xtra.texi
@@ -0,0 +1,291 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Picture Mode
8@chapter Editing Pictures
9@cindex pictures
10@cindex making pictures out of text characters
11@findex edit-picture
12
13 To edit a picture made out of text characters (for example, a picture
14of the division of a register into fields, as a comment in a program),
15use the command @kbd{M-x edit-picture} to enter Picture mode.
16
17 In Picture mode, editing is based on the @dfn{quarter-plane} model of
18text, according to which the text characters lie studded on an area that
19stretches infinitely far to the right and downward. The concept of the end
20of a line does not exist in this model; the most you can say is where the
21last nonblank character on the line is found.
22
23 Of course, Emacs really always considers text as a sequence of
24characters, and lines really do have ends. But Picture mode replaces
25the most frequently-used commands with variants that simulate the
26quarter-plane model of text. They do this by inserting spaces or by
27converting tabs to spaces.
28
29 Most of the basic editing commands of Emacs are redefined by Picture mode
30to do essentially the same thing but in a quarter-plane way. In addition,
31Picture mode defines various keys starting with the @kbd{C-c} prefix to
32run special picture editing commands.
33
34 One of these keys, @kbd{C-c C-c}, is particularly important. Often a
35picture is part of a larger file that is usually edited in some other
36major mode. @kbd{M-x edit-picture} records the name of the previous
37major mode so you can use the @kbd{C-c C-c} command
38(@code{picture-mode-exit}) later to go back to that mode. @kbd{C-c C-c}
39also deletes spaces from the ends of lines, unless given a numeric
40argument.
41
42 The special commands of Picture mode all work in other modes (provided
43the @file{picture} library is loaded), but are not bound to keys except
44in Picture mode. The descriptions below talk of moving ``one column''
45and so on, but all the picture mode commands handle numeric arguments as
46their normal equivalents do.
47
48@vindex picture-mode-hook
49 Turning on Picture mode runs the hook @code{picture-mode-hook}.
50Additional extensions to Picture mode can be found in
51@file{artist.el}.
52
53@menu
54* Basic Picture:: Basic concepts and simple commands of Picture Mode.
55* Insert in Picture:: Controlling direction of cursor motion
56 after "self-inserting" characters.
57* Tabs in Picture:: Various features for tab stops and indentation.
58* Rectangles in Picture:: Clearing and superimposing rectangles.
59@end menu
60
61@node Basic Picture
62@section Basic Editing in Picture Mode
63
64@findex picture-forward-column
65@findex picture-backward-column
66@findex picture-move-down
67@findex picture-move-up
68@cindex editing in Picture mode
69
70 Most keys do the same thing in Picture mode that they usually do, but
71do it in a quarter-plane style. For example, @kbd{C-f} is rebound to
72run @code{picture-forward-column}, a command which moves point one
73column to the right, inserting a space if necessary so that the actual
74end of the line makes no difference. @kbd{C-b} is rebound to run
75@code{picture-backward-column}, which always moves point left one
76column, converting a tab to multiple spaces if necessary. @kbd{C-n} and
77@kbd{C-p} are rebound to run @code{picture-move-down} and
78@code{picture-move-up}, which can either insert spaces or convert tabs
79as necessary to make sure that point stays in exactly the same column.
80@kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last
81nonblank character on the line. There is no need to change @kbd{C-a},
82as the choice of screen model does not affect beginnings of
83lines.
84
85@findex picture-newline
86 Insertion of text is adapted to the quarter-plane screen model
87through the use of Overwrite mode
88@iftex
89(@pxref{Minor Modes,,, emacs, the Emacs Manual}.)
90@end iftex
91@ifnottex
92(@pxref{Minor Modes}.)
93@end ifnottex
94Self-inserting characters replace existing text, column by column,
95rather than pushing existing text to the right. @key{RET} runs
96@code{picture-newline}, which just moves to the beginning of the
97following line so that new text will replace that line.
98
99@findex picture-backward-clear-column
100@findex picture-clear-column
101@findex picture-clear-line
102 In Picture mode, the commands that normally delete or kill text,
103instead erase text (replacing it with spaces). @key{DEL}
104(@code{picture-backward-clear-column}) replaces the preceding
105character with a space rather than removing it; this moves point
106backwards. @kbd{C-d} (@code{picture-clear-column}) replaces the next
107character or characters with spaces, but does not move point. (If you
108want to clear characters to spaces and move forward over them, use
109@key{SPC}.) @kbd{C-k} (@code{picture-clear-line}) really kills the
110contents of lines, but does not delete the newlines from the buffer.
111
112@findex picture-open-line
113 To do actual insertion, you must use special commands. @kbd{C-o}
114(@code{picture-open-line}) creates a blank line after the current
115line; it never splits a line. @kbd{C-M-o} (@code{split-line}) makes
116sense in Picture mode, so it is not changed. @kbd{C-j}
117(@code{picture-duplicate-line}) inserts another line with the same
118contents below the current line.
119
120@kindex C-c C-d @r{(Picture mode)}
121 To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d}
122(which is defined as @code{delete-char}, as @kbd{C-d} is in other
123modes), or one of the picture rectangle commands (@pxref{Rectangles in
124Picture}).
125
126@node Insert in Picture
127@section Controlling Motion after Insert
128
129@findex picture-movement-up
130@findex picture-movement-down
131@findex picture-movement-left
132@findex picture-movement-right
133@findex picture-movement-nw
134@findex picture-movement-ne
135@findex picture-movement-sw
136@findex picture-movement-se
137@kindex C-c < @r{(Picture mode)}
138@kindex C-c > @r{(Picture mode)}
139@kindex C-c ^ @r{(Picture mode)}
140@kindex C-c . @r{(Picture mode)}
141@kindex C-c ` @r{(Picture mode)}
142@kindex C-c ' @r{(Picture mode)}
143@kindex C-c / @r{(Picture mode)}
144@kindex C-c \ @r{(Picture mode)}
145 Since ``self-inserting'' characters in Picture mode overwrite and move
146point, there is no essential restriction on how point should be moved.
147Normally point moves right, but you can specify any of the eight
148orthogonal or diagonal directions for motion after a ``self-inserting''
149character. This is useful for drawing lines in the buffer.
150
151@table @kbd
152@item C-c <
153@itemx C-c @key{LEFT}
154Move left after insertion (@code{picture-movement-left}).
155@item C-c >
156@itemx C-c @key{RIGHT}
157Move right after insertion (@code{picture-movement-right}).
158@item C-c ^
159@itemx C-c @key{UP}
160Move up after insertion (@code{picture-movement-up}).
161@item C-c .
162@itemx C-c @key{DOWN}
163Move down after insertion (@code{picture-movement-down}).
164@item C-c `
165@itemx C-c @key{HOME}
166Move up and left (``northwest'') after insertion (@code{picture-movement-nw}).
167@item C-c '
168@itemx C-c @key{PAGEUP}
169Move up and right (``northeast'') after insertion
170(@code{picture-movement-ne}).
171@item C-c /
172@itemx C-c @key{END}
173Move down and left (``southwest'') after insertion
174@*(@code{picture-movement-sw}).
175@item C-c \
176@itemx C-c @key{PAGEDOWN}
177Move down and right (``southeast'') after insertion
178@*(@code{picture-movement-se}).
179@end table
180
181@kindex C-c C-f @r{(Picture mode)}
182@kindex C-c C-b @r{(Picture mode)}
183@findex picture-motion
184@findex picture-motion-reverse
185 Two motion commands move based on the current Picture insertion
186direction. The command @kbd{C-c C-f} (@code{picture-motion}) moves in the
187same direction as motion after ``insertion'' currently does, while @kbd{C-c
188C-b} (@code{picture-motion-reverse}) moves in the opposite direction.
189
190@node Tabs in Picture
191@section Picture Mode Tabs
192
193@kindex M-TAB @r{(Picture mode)}
194@findex picture-tab-search
195@vindex picture-tab-chars
196 Two kinds of tab-like action are provided in Picture mode. Use
197@kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing.
198With no argument, it moves to a point underneath the next
199``interesting'' character that follows whitespace in the previous
200nonblank line. ``Next'' here means ``appearing at a horizontal position
201greater than the one point starts out at.'' With an argument, as in
202@kbd{C-u M-@key{TAB}}, this command moves to the next such interesting
203character in the current line. @kbd{M-@key{TAB}} does not change the
204text; it only moves point. ``Interesting'' characters are defined by
205the variable @code{picture-tab-chars}, which should define a set of
206characters. The syntax for this variable is like the syntax used inside
207of @samp{[@dots{}]} in a regular expression---but without the @samp{[}
208and the @samp{]}. Its default value is @code{"!-~"}.
209
210@findex picture-tab
211 @key{TAB} itself runs @code{picture-tab}, which operates based on the
212current tab stop settings; it is the Picture mode equivalent of
213@code{tab-to-tab-stop}. Normally it just moves point, but with a numeric
214argument it clears the text that it moves over.
215
216@kindex C-c TAB @r{(Picture mode)}
217@findex picture-set-tab-stops
218 The context-based and tab-stop-based forms of tabbing are brought
219together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}).
220This command sets the tab stops to the positions which @kbd{M-@key{TAB}}
221would consider significant in the current line. The use of this command,
222together with @key{TAB}, can get the effect of context-based tabbing. But
223@kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient.
224
225 It may be convenient to prevent use of actual tab characters in
226pictures. For example, this prevents @kbd{C-x @key{TAB}} from messing
227up the picture. You can do this by setting the variable
228@code{indent-tabs-mode} to @code{nil}.
229
230@node Rectangles in Picture
231@section Picture Mode Rectangle Commands
232@cindex rectangles and Picture mode
233@cindex Picture mode and rectangles
234
235 Picture mode defines commands for working on rectangular pieces of
236the text in ways that fit with the quarter-plane model. The standard
237rectangle commands may also be useful.
238@iftex
239@xref{Rectangles,,, emacs, the Emacs Manual}.
240@end iftex
241@ifnottex
242@xref{Rectangles}.
243@end ifnottex
244
245@table @kbd
246@item C-c C-k
247Clear out the region-rectangle with spaces
248(@code{picture-clear-rectangle}). With argument, delete the text.
249@item C-c C-w @var{r}
250Similar, but save rectangle contents in register @var{r} first
251(@code{picture-clear-rectangle-to-register}).
252@item C-c C-y
253Copy last killed rectangle into the buffer by overwriting, with upper
254left corner at point (@code{picture-yank-rectangle}). With argument,
255insert instead.
256@item C-c C-x @var{r}
257Similar, but use the rectangle in register @var{r}
258(@code{picture-yank-rectangle-from-register}).
259@end table
260
261@kindex C-c C-k @r{(Picture mode)}
262@kindex C-c C-w @r{(Picture mode)}
263@findex picture-clear-rectangle
264@findex picture-clear-rectangle-to-register
265 The picture rectangle commands @kbd{C-c C-k}
266(@code{picture-clear-rectangle}) and @kbd{C-c C-w}
267(@code{picture-clear-rectangle-to-register}) differ from the standard
268rectangle commands in that they normally clear the rectangle instead of
269deleting it; this is analogous with the way @kbd{C-d} is changed in Picture
270mode.
271
272 However, deletion of rectangles can be useful in Picture mode, so
273these commands delete the rectangle if given a numeric argument.
274@kbd{C-c C-k} either with or without a numeric argument saves the
275rectangle for @kbd{C-c C-y}.
276
277@kindex C-c C-y @r{(Picture mode)}
278@kindex C-c C-x @r{(Picture mode)}
279@findex picture-yank-rectangle
280@findex picture-yank-rectangle-from-register
281 The Picture mode commands for yanking rectangles differ from the
282standard ones in that they overwrite instead of inserting. This is
283the same way that Picture mode insertion of other text differs from
284other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts
285(by overwriting) the rectangle that was most recently killed, while
286@kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does
287likewise for the rectangle found in a specified register.
288
289@ignore
290 arch-tag: 10e423ad-d896-42f2-a7e8-7018adeaf8c2
291@end ignore
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
new file mode 100644
index 00000000000..2472d7daabe
--- /dev/null
+++ b/doc/emacs/programs.texi
@@ -0,0 +1,1773 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
3@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Programs, Building, Text, Top
6@chapter Editing Programs
7@cindex Lisp editing
8@cindex C editing
9@cindex program editing
10
11 Emacs provides many features to facilitate editing programs. Some
12of these features can
13
14@itemize @bullet
15@item
16Find or move over top-level definitions (@pxref{Defuns}).
17@item
18Apply the usual indentation conventions of the language
19(@pxref{Program Indent}).
20@item
21Balance parentheses (@pxref{Parentheses}).
22@item
23Insert, kill or align comments (@pxref{Comments}).
24@item
25Highlight program syntax (@pxref{Font Lock}).
26@end itemize
27
28 This chapter describes these features and many more.
29
30@menu
31* Program Modes:: Major modes for editing programs.
32* Defuns:: Commands to operate on major top-level parts
33 of a program.
34* Program Indent:: Adjusting indentation to show the nesting.
35* Parentheses:: Commands that operate on parentheses.
36* Comments:: Inserting, killing, and aligning comments.
37* Documentation:: Getting documentation of functions you plan to call.
38* Hideshow:: Displaying blocks selectively.
39* Symbol Completion:: Completion on symbol names of your program or language.
40* Glasses:: Making identifiersLikeThis more readable.
41* Misc for Programs:: Other Emacs features useful for editing programs.
42* C Modes:: Special commands of C, C++, Objective-C,
43 Java, and Pike modes.
44* Asm Mode:: Asm mode and its special features.
45@ifnottex
46* Fortran:: Fortran mode and its special features.
47@end ifnottex
48@end menu
49
50@node Program Modes
51@section Major Modes for Programming Languages
52@cindex modes for programming languages
53
54 Emacs has specialized major modes for various programming languages.
55@xref{Major Modes}. A programming language major mode typically
56specifies the syntax of expressions, the customary rules for
57indentation, how to do syntax highlighting for the language, and how
58to find the beginning of a function definition. It often customizes
59or provides facilities for compiling and debugging programs as well.
60
61 Ideally, Emacs should provide a major mode for each programming
62language that you might want to edit; if it doesn't have a mode for
63your favorite language, you can contribute one. But often the mode
64for one language can serve for other syntactically similar languages.
65The major mode for language @var{l} is called @code{@var{l}-mode},
66and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
67@xref{Choosing Modes}.
68
69@cindex Perl mode
70@cindex Icon mode
71@cindex Makefile mode
72@cindex Tcl mode
73@cindex CPerl mode
74@cindex DSSSL mode
75@cindex Octave mode
76@cindex Metafont mode
77@cindex Modula2 mode
78@cindex Prolog mode
79@cindex Python mode
80@cindex Simula mode
81@cindex VHDL mode
82@cindex M4 mode
83@cindex Shell-script mode
84@cindex Delphi mode
85@cindex PostScript mode
86@cindex Conf mode
87@cindex DNS mode
88 The existing programming language major modes include Lisp, Scheme (a
89variant of Lisp) and the Scheme-based DSSSL expression language, Ada,
90ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed
91format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s
92companion for font creation), Modula2, Objective-C, Octave, Pascal,
93Perl, Pike, PostScript, Prolog, Python, Simula, Tcl, and VHDL. An
94alternative mode for Perl is called CPerl mode. Modes are available for
95the scripting languages of the common GNU and Unix shells, VMS DCL, and
96MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for
97editing makefiles, DNS master files, and various sorts of configuration
98files.
99
100@kindex DEL @r{(programming modes)}
101@findex c-electric-backspace
102 In most programming languages, indentation should vary from line to
103line to illustrate the structure of the program. So the major modes
104for programming languages arrange for @key{TAB} to update the
105indentation of the current line. They also rebind @key{DEL} to treat
106a tab as if it were the equivalent number of spaces; this lets you
107delete one column of indentation without worrying whether the
108whitespace consists of spaces or tabs. Use @kbd{C-b C-d} to delete a
109tab character before point, in these modes.
110
111 Separate manuals are available for the modes for Ada (@pxref{Top, , Ada
112Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK
113(@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes
114(@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). For Fortran
115mode, see
116@iftex
117@ref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
118@end iftex
119@ifnottex
120@ref{Fortran}.
121@end ifnottex
122
123
124@cindex mode hook
125@vindex c-mode-hook
126@vindex lisp-mode-hook
127@vindex emacs-lisp-mode-hook
128@vindex lisp-interaction-mode-hook
129@vindex scheme-mode-hook
130 Turning on a major mode runs a normal hook called the @dfn{mode
131hook}, which is the value of a Lisp variable. Each major mode has a
132mode hook, and the hook's name is always made from the mode command's
133name by adding @samp{-hook}. For example, turning on C mode runs the
134hook @code{c-mode-hook}, while turning on Lisp mode runs the hook
135@code{lisp-mode-hook}. The purpose of the mode hook is to give you a
136place to set up customizations for that major mode. @xref{Hooks}.
137
138@node Defuns
139@section Top-Level Definitions, or Defuns
140
141 In Emacs, a major definition at the top level in the buffer,
142something like a function, is called a @dfn{defun}. The name comes
143from Lisp, but in Emacs we use it for all languages.
144
145@menu
146* Left Margin Paren:: An open-paren or similar opening delimiter
147 starts a defun if it is at the left margin.
148* Moving by Defuns:: Commands to move over or mark a major definition.
149* Imenu:: Making buffer indexes as menus.
150* Which Function:: Which Function mode shows which function you are in.
151@end menu
152
153@node Left Margin Paren
154@subsection Left Margin Convention
155
156@cindex open-parenthesis in leftmost column
157@cindex ( in leftmost column
158 Emacs assumes by default that any opening delimiter found at the
159left margin is the start of a top-level definition, or defun.
160Therefore, @strong{don't put an opening delimiter at the left margin
161unless it should have that significance}. For instance, never put an
162open-parenthesis at the left margin in a Lisp file unless it is the
163start of a top-level list.
164
165 If you don't follow this convention, not only will you have trouble
166when you explicitly use the commands for motion by defuns; other
167features that use them will also give you trouble. This includes
168the indentation commands (@pxref{Program Indent}) and Font Lock
169mode (@pxref{Font Lock}).
170
171 The most likely problem case is when you want an opening delimiter
172at the start of a line inside a string. To avoid trouble, put an
173escape character (@samp{\}, in C and Emacs Lisp, @samp{/} in some
174other Lisp dialects) before the opening delimiter. This will not
175affect the contents of the string, but will prevent that opening
176delimiter from starting a defun. Here's an example:
177
178@example
179 (insert "Foo:
180\(bar)
181")
182@end example
183
184 To help you catch violations of this convention, Font Lock mode
185highlights confusing opening delimiters (those that ought to be
186quoted) in bold red.
187
188If you need to override this convention, you can so by setting this
189user option:
190
191@defvar open-paren-in-column-0-is-defun-start
192If this user option is set to @code{t} (the default), opening
193parentheses or braces at column zero always start defuns. When it's
194@code{nil}, defuns are found by searching for parens or braces at the
195outermost level.
196@end defvar
197
198 Usually, you shouldn't need to set
199@code{open-paren-in-column-0-is-defun-start} to @code{nil}. However,
200if your buffer contains parentheses or braces in column zero which
201don't start defuns and this confuses Emacs, it sometimes helps to set
202the option to @code{nil}. Be aware, though, that this will make
203scrolling and display in large buffers quite sluggish, and that
204parentheses and braces must be correctly matched throughout the buffer
205for it to work properly.
206
207 In the earliest days, the original Emacs found defuns by moving
208upward a level of parentheses or braces until there were no more
209levels to go up. This always required scanning all the way back to
210the beginning of the buffer, even for a small function. To speed up
211the operation, we changed Emacs to assume that any opening delimiter
212at the left margin is the start of a defun. This heuristic is nearly
213always right, and avoids the need to scan back to the beginning of the
214buffer. However, now that modern computers are so powerful, this
215scanning is rarely slow enough to annoy, so we've provided a way to
216disable the heuristic.
217
218@node Moving by Defuns
219@subsection Moving by Defuns
220@cindex defuns
221
222 These commands move point or set up the region based on top-level
223major definitions, also called @dfn{defuns}.
224
225@table @kbd
226@item C-M-a
227Move to beginning of current or preceding defun
228(@code{beginning-of-defun}).
229@item C-M-e
230Move to end of current or following defun (@code{end-of-defun}).
231@item C-M-h
232Put region around whole current or following defun (@code{mark-defun}).
233@end table
234
235@cindex move to beginning or end of function
236@cindex function, move to beginning or end
237@kindex C-M-a
238@kindex C-M-e
239@kindex C-M-h
240@findex beginning-of-defun
241@findex end-of-defun
242@findex mark-defun
243 The commands to move to the beginning and end of the current defun
244are @kbd{C-M-a} (@code{beginning-of-defun}) and @kbd{C-M-e}
245(@code{end-of-defun}). If you repeat one of these commands, or use a
246positive numeric argument, each repetition moves to the next defun in
247the direction of motion.
248
249 @kbd{C-M-a} with a negative argument @minus{}@var{n} moves forward
250@var{n} times to the next beginning of a defun. This is not exactly
251the same place that @kbd{C-M-e} with argument @var{n} would move to;
252the end of this defun is not usually exactly the same place as the
253beginning of the following defun. (Whitespace, comments, and perhaps
254declarations can separate them.) Likewise, @kbd{C-M-e} with a
255negative argument moves back to an end of a defun, which is not quite
256the same as @kbd{C-M-a} with a positive argument.
257
258@kindex C-M-h @r{(C mode)}
259@findex c-mark-function
260 To operate on the current defun, use @kbd{C-M-h} (@code{mark-defun})
261which puts point at the beginning and mark at the end of the current
262defun. This is the easiest way to get ready to kill the defun in
263order to move it to a different place in the file. If you use the
264command while point is between defuns, it uses the following defun.
265Successive uses of @kbd{C-M-h}, or using it in Transient Mark mode
266when the mark is active, extends the end of the region to include one
267more defun each time.
268
269 In C mode, @kbd{C-M-h} runs the function @code{c-mark-function},
270which is almost the same as @code{mark-defun}; the difference is that
271it backs up over the argument declarations, function name and returned
272data type so that the entire C function is inside the region. This is
273an example of how major modes adjust the standard key bindings so that
274they do their standard jobs in a way better fitting a particular
275language. Other major modes may replace any or all of these key
276bindings for that purpose.
277
278@node Imenu
279@subsection Imenu
280@cindex index of buffer definitions
281@cindex buffer definitions index
282@cindex tags
283
284 The Imenu facility offers a way to find the major definitions in
285a file by name. It is also useful in text formatter major modes,
286where it treats each chapter, section, etc., as a definition.
287(@xref{Tags}, for a more powerful feature that handles multiple files
288together.)
289
290@findex imenu
291 If you type @kbd{M-x imenu}, it reads the name of a definition using
292the minibuffer, then moves point to that definition. You can use
293completion to specify the name; the command always displays the whole
294list of valid names.
295
296@findex imenu-add-menubar-index
297 Alternatively, you can bind the command @code{imenu} to a mouse
298click. Then it displays mouse menus for you to select a definition
299name. You can also add the buffer's index to the menu bar by calling
300@code{imenu-add-menubar-index}. If you want to have this menu bar
301item available for all buffers in a certain major mode, you can do
302this by adding @code{imenu-add-menubar-index} to its mode hook. But
303if you have done that, you will have to wait a little while each time
304you visit a file in that mode, while Emacs finds all the definitions
305in that buffer.
306
307@vindex imenu-auto-rescan
308 When you change the contents of a buffer, if you add or delete
309definitions, you can update the buffer's index based on the
310new contents by invoking the @samp{*Rescan*} item in the menu.
311Rescanning happens automatically if you set @code{imenu-auto-rescan} to
312a non-@code{nil} value. There is no need to rescan because of small
313changes in the text.
314
315@vindex imenu-sort-function
316 You can customize the way the menus are sorted by setting the
317variable @code{imenu-sort-function}. By default, names are ordered as
318they occur in the buffer; if you want alphabetic sorting, use the
319symbol @code{imenu--sort-by-name} as the value. You can also
320define your own comparison function by writing Lisp code.
321
322 Imenu provides the information to guide Which Function mode
323@ifnottex
324(@pxref{Which Function}).
325@end ifnottex
326@iftex
327(see below).
328@end iftex
329The Speedbar can also use it (@pxref{Speedbar}).
330
331@node Which Function
332@subsection Which Function Mode
333@cindex current function name in mode line
334
335 Which Function mode is a minor mode that displays the current
336function name in the mode line, updating it as you move around in a
337buffer.
338
339@findex which-function-mode
340@vindex which-func-modes
341 To either enable or disable Which Function mode, use the command
342@kbd{M-x which-function-mode}. This command is global; it applies to
343all buffers, both existing ones and those yet to be created. However,
344it takes effect only in certain major modes, those listed in the value
345of @code{which-func-modes}. If the value is @code{t}, then Which
346Function mode applies to all major modes that know how to support
347it---in other words, all the major modes that support Imenu.
348
349@node Program Indent
350@section Indentation for Programs
351@cindex indentation for programs
352
353 The best way to keep a program properly indented is to use Emacs to
354reindent it as you change it. Emacs has commands to indent properly
355either a single line, a specified number of lines, or all of the lines
356inside a single parenthetical grouping.
357
358@menu
359* Basic Indent:: Indenting a single line.
360* Multi-line Indent:: Commands to reindent many lines at once.
361* Lisp Indent:: Specifying how each Lisp function should be indented.
362* C Indent:: Extra features for indenting C and related modes.
363* Custom C Indent:: Controlling indentation style for C and related modes.
364@end menu
365
366@cindex pretty-printer
367 Emacs also provides a Lisp pretty-printer in the library @code{pp}.
368This program reformats a Lisp object with indentation chosen to look nice.
369
370@node Basic Indent
371@subsection Basic Program Indentation Commands
372
373 The basic indentation commands indent a single line according to the
374usual conventions of the language you are editing.
375
376@need 1000
377@table @kbd
378@item @key{TAB}
379Adjust indentation of current line.
380@item C-j
381Insert a newline, then adjust indentation of following line
382(@code{newline-and-indent}).
383@end table
384
385@kindex TAB @r{(programming modes)}
386@findex c-indent-command
387@findex indent-line-function
388@findex indent-for-tab-command
389 The basic indentation command is @key{TAB}, which gives the current line
390the correct indentation as determined from the previous lines. The
391function that @key{TAB} runs depends on the major mode; it is
392@code{lisp-indent-line}
393in Lisp mode, @code{c-indent-command} in C mode, etc. These functions
394understand the syntax and conventions of different languages, but they all do
395conceptually the same job: @key{TAB} in any programming-language major mode
396inserts or deletes whitespace at the beginning of the current line,
397independent of where point is in the line. If point was inside the
398whitespace at the beginning of the line, @key{TAB} puts it at the end of
399that whitespace; otherwise, @key{TAB} keeps point fixed with respect to
400the characters around it.
401
402 Use @kbd{C-q @key{TAB}} to insert a tab character at point.
403
404@kindex C-j
405@findex newline-and-indent
406 When entering lines of new code, use @kbd{C-j}
407(@code{newline-and-indent}), which inserts a newline and then adjusts
408indentation after it. (It also deletes any trailing whitespace which
409remains before the new newline.) Thus, @kbd{C-j} at the end of a line
410creates a blank line with appropriate indentation. In programming
411language modes, it is equivalent to @key{RET} @key{TAB}.
412
413 @key{TAB} indents a line that starts within a parenthetical grouping
414under the preceding line within the grouping, or the text after the
415parenthesis. Therefore, if you manually give one of these lines a
416nonstandard indentation, the lines below will tend to follow it. This
417behavior is convenient in cases where you have overridden the standard
418result of @key{TAB} because you find it unaesthetic for a particular
419line.
420
421 In some modes, an open-parenthesis, open-brace or other opening
422delimiter at the left margin is assumed by Emacs (including the
423indentation routines) to be the start of a function. This speeds up
424indentation commands. If you will be editing text which contains
425opening delimiters in column zero that aren't the beginning of a
426functions, even inside strings or comments, you must set
427@code{open-paren-in-column-0-is-defun-start}. @xref{Left Margin
428Paren}, for more information on this.
429
430 Normally, lines are indented with tabs and spaces. If you want Emacs
431to use spaces only, set @code{indent-tabs-mode} (@pxref{Just Spaces}).
432
433@node Multi-line Indent
434@subsection Indenting Several Lines
435
436 When you wish to reindent several lines of code which have been
437altered or moved to a different level in the parenthesis structure,
438you have several commands available.
439
440@table @kbd
441@item C-M-q
442Reindent all the lines within one parenthetical grouping (@code{indent-pp-sexp}).
443@item C-M-\
444Reindent all lines in the region (@code{indent-region}).
445@item C-u @key{TAB}
446Shift an entire parenthetical grouping rigidly sideways so that its
447first line is properly indented.
448@item M-x indent-code-rigidly
449Shift all the lines in the region rigidly sideways, but do not alter
450lines that start inside comments and strings.
451@end table
452
453@kindex C-M-q
454@findex indent-pp-sexp
455 You can reindent the contents of a single parenthetical grouping by
456positioning point before the beginning of it and typing @kbd{C-M-q}
457(@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode; also
458bound to other suitable commands in other modes). The indentation of
459the line where the grouping starts is not changed; therefore this
460changes only the relative indentation within the grouping, not its
461overall indentation. To correct that as well, type @key{TAB} first.
462
463 Another way to specify the range to be reindented is with the
464region. The command @kbd{C-M-\} (@code{indent-region}) applies
465@key{TAB} to every line whose first character is between point and
466mark.
467
468@kindex C-u TAB
469 If you like the relative indentation within a grouping, but not the
470indentation of its first line, you can type @kbd{C-u @key{TAB}} to
471reindent the whole grouping as a rigid unit. (This works in Lisp
472modes and C and related modes.) @key{TAB} with a numeric argument
473reindents the current line as usual, then reindents by the same amount
474all the lines in the parenthetical grouping starting on the current
475line. It is clever, though, and does not alter lines that start
476inside strings. Neither does it alter C preprocessor lines when in C
477mode, but it does reindent any continuation lines that may be attached
478to them.
479
480@findex indent-code-rigidly
481 You can also perform this operation on the region, using the command
482@kbd{M-x indent-code-rigidly}. It rigidly shifts all the lines in the
483region sideways, like @code{indent-rigidly} does (@pxref{Indentation
484Commands}). It doesn't alter the indentation of lines that start
485inside a string, unless the region also starts inside that string.
486The prefix arg specifies the number of columns to indent.
487
488@node Lisp Indent
489@subsection Customizing Lisp Indentation
490@cindex customizing Lisp indentation
491
492 The indentation pattern for a Lisp expression can depend on the function
493called by the expression. For each Lisp function, you can choose among
494several predefined patterns of indentation, or define an arbitrary one with
495a Lisp program.
496
497 The standard pattern of indentation is as follows: the second line of the
498expression is indented under the first argument, if that is on the same
499line as the beginning of the expression; otherwise, the second line is
500indented underneath the function name. Each following line is indented
501under the previous line whose nesting depth is the same.
502
503@vindex lisp-indent-offset
504 If the variable @code{lisp-indent-offset} is non-@code{nil}, it overrides
505the usual indentation pattern for the second line of an expression, so that
506such lines are always indented @code{lisp-indent-offset} more columns than
507the containing list.
508
509@vindex lisp-body-indent
510 Certain functions override the standard pattern. Functions whose
511names start with @code{def} treat the second lines as the start of
512a @dfn{body}, by indenting the second line @code{lisp-body-indent}
513additional columns beyond the open-parenthesis that starts the
514expression.
515
516@cindex @code{lisp-indent-function} property
517 You can override the standard pattern in various ways for individual
518functions, according to the @code{lisp-indent-function} property of
519the function name. Normally you would use this for macro definitions
520and specify it using the @code{declare} construct (@pxref{Defining
521Macros,,, elisp, the Emacs Lisp Reference Manual}).
522
523@node C Indent
524@subsection Commands for C Indentation
525
526 Here are special features for indentation in C mode and related modes:
527
528@table @code
529@item C-c C-q
530@kindex C-c C-q @r{(C mode)}
531@findex c-indent-defun
532Reindent the current top-level function definition or aggregate type
533declaration (@code{c-indent-defun}).
534
535@item C-M-q
536@kindex C-M-q @r{(C mode)}
537@findex c-indent-exp
538Reindent each line in the balanced expression that follows point
539(@code{c-indent-exp}). A prefix argument inhibits warning messages
540about invalid syntax.
541
542@item @key{TAB}
543@findex c-indent-command
544Reindent the current line, and/or in some cases insert a tab character
545(@code{c-indent-command}).
546
547@vindex c-tab-always-indent
548If @code{c-tab-always-indent} is @code{t}, this command always reindents
549the current line and does nothing else. This is the default.
550
551If that variable is @code{nil}, this command reindents the current line
552only if point is at the left margin or in the line's indentation;
553otherwise, it inserts a tab (or the equivalent number of spaces,
554if @code{indent-tabs-mode} is @code{nil}).
555
556Any other value (not @code{nil} or @code{t}) means always reindent the
557line, and also insert a tab if within a comment or a string.
558@end table
559
560 To reindent the whole current buffer, type @kbd{C-x h C-M-\}. This
561first selects the whole buffer as the region, then reindents that
562region.
563
564 To reindent the current block, use @kbd{C-M-u C-M-q}. This moves
565to the front of the block and then reindents it all.
566
567@node Custom C Indent
568@subsection Customizing C Indentation
569@cindex style (for indentation)
570
571 C mode and related modes use a flexible mechanism for customizing
572indentation. C mode indents a source line in two steps: first it
573classifies the line syntactically according to its contents and
574context; second, it determines the indentation offset associated by
575your selected @dfn{style} with the syntactic construct and adds this
576onto the indentation of the @dfn{anchor statement}.
577
578@table @kbd
579@item C-c . @key{RET} @var{style} @key{RET}
580Select a predefined style @var{style} (@code{c-set-style}).
581@end table
582
583 A @dfn{style} is a named collection of customizations that can be
584used in C mode and the related modes. @ref{Styles,,, ccmode, The CC
585Mode Manual}, for a complete description. Emacs comes with several
586predefined styles, including @code{gnu}, @code{k&r}, @code{bsd},
587@code{stroustrup}, @code{linux}, @code{python}, @code{java},
588@code{whitesmith}, @code{ellemtel}, and @code{awk}. Some of these
589styles are primarily intended for one language, but any of them can be
590used with any of the languages supported by these modes. To find out
591what a style looks like, select it and reindent some code, e.g., by
592typing @key{C-M-q} at the start of a function definition.
593
594@kindex C-c . @r{(C mode)}
595@findex c-set-style
596 To choose a style for the current buffer, use the command @w{@kbd{C-c
597.}}. Specify a style name as an argument (case is not significant).
598This command affects the current buffer only, and it affects only
599future invocations of the indentation commands; it does not reindent
600the code already in the buffer. To reindent the whole buffer in the
601new style, you can type @kbd{C-x h C-M-\}.
602
603@vindex c-default-style
604 You can also set the variable @code{c-default-style} to specify the
605default style for various major modes. Its value should be either the
606style's name (a string) or an alist, in which each element specifies
607one major mode and which indentation style to use for it. For
608example,
609
610@example
611(setq c-default-style
612 '((java-mode . "java") (awk-mode . "awk") (other . "gnu")))
613@end example
614
615@noindent
616specifies explicit choices for Java and AWK modes, and the default
617@samp{gnu} style for the other C-like modes. (These settings are
618actually the defaults.) This variable takes effect when you select
619one of the C-like major modes; thus, if you specify a new default
620style for Java mode, you can make it take effect in an existing Java
621mode buffer by typing @kbd{M-x java-mode} there.
622
623 The @code{gnu} style specifies the formatting recommended by the GNU
624Project for C; it is the default, so as to encourage use of our
625recommended style.
626
627 @xref{Indentation Engine Basics,,, ccmode, the CC Mode Manual}, and
628@ref{Customizing Indentation,,, ccmode, the CC Mode Manual}, for more
629information on customizing indentation for C and related modes,
630including how to override parts of an existing style and how to define
631your own styles.
632
633@node Parentheses
634@section Commands for Editing with Parentheses
635
636@findex check-parens
637@cindex unbalanced parentheses and quotes
638 This section describes the commands and features that take advantage
639of the parenthesis structure in a program, or help you keep it
640balanced.
641
642 When talking about these facilities, the term ``parenthesis'' also
643includes braces, brackets, or whatever delimiters are defined to match
644in pairs. The major mode controls which delimiters are significant,
645through the syntax table (@pxref{Syntax}). In Lisp, only parentheses
646count; in C, these commands apply to braces and brackets too.
647
648 You can use @kbd{M-x check-parens} to find any unbalanced
649parentheses and unbalanced string quotes in the buffer.
650
651@menu
652* Expressions:: Expressions with balanced parentheses.
653* Moving by Parens:: Commands for moving up, down and across
654 in the structure of parentheses.
655* Matching:: Insertion of a close-delimiter flashes matching open.
656@end menu
657
658@node Expressions
659@subsection Expressions with Balanced Parentheses
660
661@cindex sexp
662@cindex expression
663@cindex balanced expression
664 These commands deal with balanced expressions, also called
665@dfn{sexps}@footnote{The word ``sexp'' is used to refer to an
666expression in Lisp.}.
667
668@table @kbd
669@item C-M-f
670Move forward over a balanced expression (@code{forward-sexp}).
671@item C-M-b
672Move backward over a balanced expression (@code{backward-sexp}).
673@item C-M-k
674Kill balanced expression forward (@code{kill-sexp}).
675@item C-M-t
676Transpose expressions (@code{transpose-sexps}).
677@item C-M-@@
678@itemx C-M-@key{SPC}
679Put mark after following expression (@code{mark-sexp}).
680@end table
681
682 Each programming language major mode customizes the definition of
683balanced expressions to suit that language. Balanced expressions
684typically include symbols, numbers, and string constants, as well as
685any pair of matching delimiters and their contents. Some languages
686have obscure forms of expression syntax that nobody has bothered to
687implement in Emacs.
688
689@cindex Control-Meta
690 By convention, the keys for these commands are all Control-Meta
691characters. They usually act on expressions just as the corresponding
692Meta characters act on words. For instance, the command @kbd{C-M-b}
693moves backward over a balanced expression, just as @kbd{M-b} moves
694back over a word.
695
696@kindex C-M-f
697@kindex C-M-b
698@findex forward-sexp
699@findex backward-sexp
700 To move forward over a balanced expression, use @kbd{C-M-f}
701(@code{forward-sexp}). If the first significant character after point
702is an opening delimiter (@samp{(} in Lisp; @samp{(}, @samp{[} or
703@samp{@{} in C), @kbd{C-M-f} moves past the matching closing
704delimiter. If the character begins a symbol, string, or number,
705@kbd{C-M-f} moves over that.
706
707 The command @kbd{C-M-b} (@code{backward-sexp}) moves backward over a
708balanced expression. The detailed rules are like those above for
709@kbd{C-M-f}, but with directions reversed. If there are prefix
710characters (single-quote, backquote and comma, in Lisp) preceding the
711expression, @kbd{C-M-b} moves back over them as well. The balanced
712expression commands move across comments as if they were whitespace,
713in most modes.
714
715 @kbd{C-M-f} or @kbd{C-M-b} with an argument repeats that operation the
716specified number of times; with a negative argument, it moves in the
717opposite direction.
718
719@cindex killing expressions
720@kindex C-M-k
721@findex kill-sexp
722 Killing a whole balanced expression can be done with @kbd{C-M-k}
723(@code{kill-sexp}). @kbd{C-M-k} kills the characters that @kbd{C-M-f}
724would move over.
725
726@cindex transposition of expressions
727@kindex C-M-t
728@findex transpose-sexps
729 A somewhat random-sounding command which is nevertheless handy is
730@kbd{C-M-t} (@code{transpose-sexps}), which drags the previous
731balanced expression across the next one. An argument serves as a
732repeat count, moving the previous expression over that many following
733ones. A negative argument drags the previous balanced expression
734backwards across those before it (thus canceling out the effect of
735@kbd{C-M-t} with a positive argument). An argument of zero, rather
736than doing nothing, transposes the balanced expressions ending at or
737after point and the mark.
738
739@kindex C-M-@@
740@kindex C-M-@key{SPC}
741@findex mark-sexp
742 To set the region around the next balanced expression in the buffer,
743use @kbd{C-M-@@} (@code{mark-sexp}), which sets mark at the same place
744that @kbd{C-M-f} would move to. @kbd{C-M-@@} takes arguments like
745@kbd{C-M-f}. In particular, a negative argument is useful for putting
746the mark at the beginning of the previous balanced expression. The
747alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}. When you
748repeat this command, or use it in Transient Mark mode when the mark is
749active, it extends the end of the region by one sexp each time.
750
751 In languages that use infix operators, such as C, it is not possible
752to recognize all balanced expressions as such because there can be
753multiple possibilities at a given position. For example, C mode does
754not treat @samp{foo + bar} as a single expression, even though it
755@emph{is} one C expression; instead, it recognizes @samp{foo} as one
756expression and @samp{bar} as another, with the @samp{+} as punctuation
757between them. Both @samp{foo + bar} and @samp{foo} are legitimate
758choices for ``the expression following point'' when point is at the
759@samp{f}, so the expression commands must perforce choose one or the
760other to operate on. Note that @samp{(foo + bar)} is recognized as a
761single expression in C mode, because of the parentheses.
762
763@node Moving by Parens
764@subsection Moving in the Parenthesis Structure
765
766@cindex parenthetical groupings
767@cindex parentheses, moving across
768@cindex matching parenthesis and braces, moving to
769@cindex braces, moving across
770@cindex list commands
771 The Emacs commands for handling parenthetical groupings see nothing
772except parentheses (or whatever characters must balance in the
773language you are working with), and the escape characters that might
774be used to quote those. They are mainly intended for editing
775programs, but can be useful for editing any text that has parentheses.
776They are sometimes called ``list'' commands because in Lisp these
777groupings are lists.
778
779@table @kbd
780@item C-M-n
781Move forward over a parenthetical group (@code{forward-list}).
782@item C-M-p
783Move backward over a parenthetical group (@code{backward-list}).
784@item C-M-u
785Move up in parenthesis structure (@code{backward-up-list}).
786@item C-M-d
787Move down in parenthesis structure (@code{down-list}).
788@end table
789
790@kindex C-M-n
791@kindex C-M-p
792@findex forward-list
793@findex backward-list
794 The ``list'' commands @kbd{C-M-n} (@code{forward-list}) and
795@kbd{C-M-p} (@code{backward-list}) move over one (or @var{n})
796parenthetical groupings, skipping blithely over any amount of text
797that doesn't include meaningful parentheses (symbols, strings, etc.).
798
799@kindex C-M-u
800@findex backward-up-list
801 @kbd{C-M-n} and @kbd{C-M-p} try to stay at the same level in the
802parenthesis structure. To move @emph{up} one (or @var{n}) levels, use
803@kbd{C-M-u} (@code{backward-up-list}). @kbd{C-M-u} moves backward up
804past one unmatched opening delimiter. A positive argument serves as a
805repeat count; a negative argument reverses the direction of motion, so
806that the command moves forward and up one or more levels.
807
808@kindex C-M-d
809@findex down-list
810 To move @emph{down} in the parenthesis structure, use @kbd{C-M-d}
811(@code{down-list}). In Lisp mode, where @samp{(} is the only opening
812delimiter, this is nearly the same as searching for a @samp{(}. An
813argument specifies the number of levels to go down.
814
815@node Matching
816@subsection Automatic Display Of Matching Parentheses
817@cindex matching parentheses
818@cindex parentheses, displaying matches
819
820 The Emacs parenthesis-matching feature is designed to show
821automatically how parentheses (and other matching delimiters) match in
822the text. Whenever you type a self-inserting character that is a
823closing delimiter, the cursor moves momentarily to the location of the
824matching opening delimiter, provided that is on the screen. If it is
825not on the screen, Emacs displays some of the text near it in the echo
826area. Either way, you can tell which grouping you are closing off.
827
828 If the opening delimiter and closing delimiter are mismatched---such
829as in @samp{[x)}---a warning message is displayed in the echo area.
830
831@vindex blink-matching-paren
832@vindex blink-matching-paren-distance
833@vindex blink-matching-delay
834 Three variables control parenthesis match display:
835
836 @code{blink-matching-paren} turns the feature on or off: @code{nil}
837disables it, but the default is @code{t} to enable match display.
838
839 @code{blink-matching-delay} says how many seconds to leave the
840cursor on the matching opening delimiter, before bringing it back to
841the real location of point; the default is 1, but on some systems it
842is useful to specify a fraction of a second.
843
844 @code{blink-matching-paren-distance} specifies how many characters
845back to search to find the matching opening delimiter. If the match
846is not found in that distance, scanning stops, and nothing is displayed.
847This is to prevent the scan for the matching delimiter from wasting
848lots of time when there is no match. The default is 25600.
849
850@cindex Show Paren mode
851@cindex highlighting matching parentheses
852@findex show-paren-mode
853 Show Paren mode provides a more powerful kind of automatic matching.
854Whenever point is after a closing delimiter, that delimiter and its
855matching opening delimiter are both highlighted; otherwise, if point
856is before an opening delimiter, the matching closing delimiter is
857highlighted. (There is no need to highlight the opening delimiter in
858that case, because the cursor appears on top of that character.) Use
859the command @kbd{M-x show-paren-mode} to enable or disable this mode.
860
861 Show Paren mode uses the faces @code{show-paren-match} and
862@code{show-paren-mismatch} to highlight parentheses; you can customize
863them to control how highlighting looks. @xref{Face Customization}.
864
865@node Comments
866@section Manipulating Comments
867@cindex comments
868
869 Because comments are such an important part of programming, Emacs
870provides special commands for editing and inserting comments. It can
871also do spell checking on comments with Flyspell Prog mode
872(@pxref{Spelling}).
873
874@menu
875* Comment Commands:: Inserting, killing, and aligning comments.
876* Multi-Line Comments:: Commands for adding and editing multi-line comments.
877* Options for Comments::Customizing the comment features.
878@end menu
879
880@node Comment Commands
881@subsection Comment Commands
882@cindex indentation for comments
883@cindex alignment for comments
884
885 The comment commands in this table insert, kill and align comments.
886They are described in this section and following sections.
887
888@table @asis
889@item @kbd{M-;}
890Insert or realign comment on current line; alternatively, comment or
891uncomment the region (@code{comment-dwim}).
892@item @kbd{C-u M-;}
893Kill comment on current line (@code{comment-kill}).
894@item @kbd{C-x ;}
895Set comment column (@code{comment-set-column}).
896@item @kbd{C-M-j}
897@itemx @kbd{M-j}
898Like @key{RET} followed by inserting and aligning a comment
899(@code{comment-indent-new-line}). @xref{Multi-Line Comments}.
900@item @kbd{M-x comment-region}
901@itemx @kbd{C-c C-c} (in C-like modes)
902Add or remove comment delimiters on all the lines in the region.
903@end table
904
905@kindex M-;
906@findex comment-dwim
907 The command to create or align a comment is @kbd{M-;}
908(@code{comment-dwim}). The word ``dwim'' is an acronym for ``Do What
909I Mean''; it indicates that this command can be used for many
910different jobs relating to comments, depending on the situation where
911you use it.
912
913 If there is no comment already on the line, @kbd{M-;} inserts a new
914comment, aligned at a specific column called the @dfn{comment column}.
915The new comment begins with the string Emacs thinks comments should
916start with (the value of @code{comment-start}; see below). Point is
917after that string, so you can insert the text of the comment right
918away. If the major mode has specified a string to terminate comments,
919@kbd{M-;} inserts that after point, to keep the syntax valid.
920
921 If the text of the line extends past the comment column, this
922command aligns the comment start string to a suitable boundary
923(usually, at least one space is inserted).
924
925 You can also use @kbd{M-;} to align an existing comment. If a line
926already contains the comment-start string, @kbd{M-;} realigns it to
927the conventional alignment and moves point after it. (Exception:
928comments starting in column 0 are not moved.) Even when an existing
929comment is properly aligned, @kbd{M-;} is still useful for moving
930directly to the start of the text inside the comment.
931
932@findex comment-kill
933@kindex C-u M-;
934 @kbd{C-u M-;} kills any comment on the current line, along with the
935whitespace before it. To reinsert the comment on another line, move
936to the end of that line, do @kbd{C-y}, and then do @kbd{M-;} to
937realign it.
938
939 Note that @kbd{C-u M-;} is not a distinct key; it is @kbd{M-;}
940(@code{comment-dwim}) with a prefix argument. That command is
941programmed so that when it receives a prefix argument it calls
942@code{comment-kill}. However, @code{comment-kill} is a valid command
943in its own right, and you can bind it directly to a key if you wish.
944
945 @kbd{M-;} does two other jobs when used with an active region in
946Transient Mark mode (@pxref{Transient Mark}). Then it either adds or
947removes comment delimiters on each line of the region. (If every line
948is a comment, it removes comment delimiters from each; otherwise, it
949adds comment delimiters to each.) If you are not using Transient Mark
950mode, then you should use the commands @code{comment-region} and
951@code{uncomment-region} to do these jobs (@pxref{Multi-Line Comments}),
952or else enable Transient Mark mode momentarily (@pxref{Momentary Mark}).
953A prefix argument used in these circumstances specifies how many
954comment delimiters to add or how many to delete.
955
956 Some major modes have special rules for aligning certain kinds of
957comments in certain contexts. For example, in Lisp code, comments which
958start with two semicolons are indented as if they were lines of code,
959instead of at the comment column. Comments which start with three
960semicolons are supposed to start at the left margin and are often used
961for sectioning purposes. Emacs understands
962these conventions by indenting a double-semicolon comment using @key{TAB},
963and by not changing the indentation of a triple-semicolon comment at all.
964
965@example
966;; This function is just an example.
967;;; Here either two or three semicolons are appropriate.
968(defun foo (x)
969;;; And now, the first part of the function:
970 ;; The following line adds one.
971 (1+ x)) ; This line adds one.
972@end example
973
974 For C-like modes, you can configure the exact effect of @kbd{M-;}
975more flexibly than for most buffers by setting the variables
976@code{c-indent-comment-alist} and
977@code{c-indent-comments-syntactically-p}. For example, on a line
978ending in a closing brace, @kbd{M-;} puts the comment one space after
979the brace rather than at @code{comment-column}. For full details see
980@ref{Comment Commands,,, ccmode, The CC Mode Manual}.
981
982@node Multi-Line Comments
983@subsection Multiple Lines of Comments
984
985@kindex C-M-j
986@kindex M-j
987@cindex blank lines in programs
988@findex comment-indent-new-line
989
990 If you are typing a comment and wish to continue it on another line,
991you can use the command @kbd{C-M-j} or @kbd{M-j}
992(@code{comment-indent-new-line}). If @code{comment-multi-line}
993(@pxref{Options for Comments}) is non-@code{nil}, it moves to a new
994line within the comment. Otherwise it closes the comment and starts a
995new comment on a new line. When Auto Fill mode is on, going past the
996fill column while typing a comment causes the comment to be continued
997in just this fashion.
998
999@kindex C-c C-c (C mode)
1000@findex comment-region
1001 To turn existing lines into comment lines, use the @kbd{M-x
1002comment-region} command (or type @kbd{C-c C-c} in C-like modes). It
1003adds comment delimiters to the lines that start in the region, thus
1004commenting them out. With a negative argument, it does the
1005opposite---it deletes comment delimiters from the lines in the region.
1006
1007 With a positive argument, @code{comment-region} duplicates the last
1008character of the comment start sequence it adds; the argument
1009specifies how many copies of the character to insert. Thus, in Lisp
1010mode, @kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line.
1011Duplicating the comment delimiter is a way of calling attention to the
1012comment. It can also affect how the comment is aligned or indented.
1013In Lisp, for proper indentation, you should use an argument of two or
1014three, if between defuns; if within a defun, it must be three.
1015
1016 You can configure C Mode such that when you type a @samp{/} at the
1017start of a line in a multi-line block comment, this closes the
1018comment. Enable the @code{comment-close-slash} clean-up for this.
1019@xref{Clean-ups,,, ccmode, The CC Mode Manual}.
1020
1021@node Options for Comments
1022@subsection Options Controlling Comments
1023
1024@vindex comment-column
1025@kindex C-x ;
1026@findex comment-set-column
1027 The @dfn{comment column}, the column at which Emacs tries to place
1028comments, is stored in the variable @code{comment-column}. You can
1029set it to a number explicitly. Alternatively, the command @kbd{C-x ;}
1030(@code{comment-set-column}) sets the comment column to the column
1031point is at. @kbd{C-u C-x ;} sets the comment column to match the
1032last comment before point in the buffer, and then does a @kbd{M-;} to
1033align the current line's comment under the previous one.
1034
1035 The variable @code{comment-column} is per-buffer: setting the variable
1036in the normal fashion affects only the current buffer, but there is a
1037default value which you can change with @code{setq-default}.
1038@xref{Locals}. Many major modes initialize this variable for the
1039current buffer.
1040
1041@vindex comment-start-skip
1042 The comment commands recognize comments based on the regular
1043expression that is the value of the variable @code{comment-start-skip}.
1044Make sure this regexp does not match the null string. It may match more
1045than the comment starting delimiter in the strictest sense of the word;
1046for example, in C mode the value of the variable is
1047@c This stops M-q from breaking the line inside that @code.
1048@code{@w{"/\\*+ *\\|//+ *"}}, which matches extra stars and spaces
1049after the @samp{/*} itself, and accepts C++ style comments also.
1050(Note that @samp{\\} is needed in Lisp syntax to include a @samp{\} in
1051the string, which is needed to deny the first star its special meaning
1052in regexp syntax. @xref{Regexp Backslash}.)
1053
1054@vindex comment-start
1055@vindex comment-end
1056 When a comment command makes a new comment, it inserts the value of
1057@code{comment-start} to begin it. The value of @code{comment-end} is
1058inserted after point, so that it will follow the text that you will
1059insert into the comment. When @code{comment-end} is non-empty, it
1060should start with a space. For example, in C mode,
1061@code{comment-start} has the value @w{@code{"/* "}} and
1062@code{comment-end} has the value @w{@code{" */"}}.
1063
1064@vindex comment-padding
1065 The variable @code{comment-padding} specifies how many spaces
1066@code{comment-region} should insert on each line between the comment
1067delimiter and the line's original text. The default is 1, to insert
1068one space. @code{nil} means 0. Alternatively, @code{comment-padding}
1069can hold the actual string to insert.
1070
1071@vindex comment-multi-line
1072 The variable @code{comment-multi-line} controls how @kbd{C-M-j}
1073(@code{indent-new-comment-line}) behaves when used inside a comment.
1074Specifically, when @code{comment-multi-line} is @code{nil}, the
1075command inserts a comment terminator, begins a new line, and finally
1076inserts a comment starter. Otherwise it does not insert the
1077terminator and starter, so it effectively continues the current
1078comment across multiple lines. In languages that allow multi-line
1079comments, the choice of value for this variable is a matter of taste.
1080The default for this variable depends on the major mode.
1081
1082@vindex comment-indent-function
1083 The variable @code{comment-indent-function} should contain a function
1084that will be called to compute the alignment for a newly inserted
1085comment or for aligning an existing comment. It is set differently by
1086various major modes. The function is called with no arguments, but with
1087point at the beginning of the comment, or at the end of a line if a new
1088comment is to be inserted. It should return the column in which the
1089comment ought to start. For example, in Lisp mode, the indent hook
1090function bases its decision on how many semicolons begin an existing
1091comment, and on the code in the preceding lines.
1092
1093@node Documentation
1094@section Documentation Lookup
1095
1096 Emacs provides several features you can use to look up the
1097documentation of functions, variables and commands that you plan to
1098use in your program.
1099
1100@menu
1101* Info Lookup:: Looking up library functions and commands
1102 in Info files.
1103* Man Page:: Looking up man pages of library functions and commands.
1104* Lisp Doc:: Looking up Emacs Lisp functions, etc.
1105@end menu
1106
1107@node Info Lookup
1108@subsection Info Documentation Lookup
1109
1110@findex info-lookup-symbol
1111@findex info-lookup-file
1112@kindex C-h S
1113 For many major modes, that apply to languages that have
1114documentation in Info, you can use @kbd{C-h S}
1115(@code{info-lookup-symbol}) to view the Info documentation for a
1116symbol used in the program. You specify the symbol with the
1117minibuffer; the default is the symbol appearing in the buffer at
1118point. For example, in C mode this looks for the symbol in the C
1119Library Manual. The command only works if the appropriate manual's
1120Info files are installed.
1121
1122 The major mode determines where to look for documentation for the
1123symbol---which Info files to look in, and which indices to search.
1124You can also use @kbd{M-x info-lookup-file} to look for documentation
1125for a file name.
1126
1127 If you use @kbd{C-h S} in a major mode that does not support it,
1128it asks you to specify the ``symbol help mode.'' You should enter
1129a command such as @code{c-mode} that would select a major
1130mode which @kbd{C-h S} does support.
1131
1132@node Man Page
1133@subsection Man Page Lookup
1134
1135@cindex manual page
1136 On Unix, the main form of on-line documentation was the @dfn{manual
1137page} or @dfn{man page}. In the GNU operating system, we aim to
1138replace man pages with better-organized manuals that you can browse
1139with Info (@pxref{Misc Help}). This process is not finished, so it is
1140still useful to read manual pages.
1141
1142@findex manual-entry
1143 You can read the man page for an operating system command, library
1144function, or system call, with the @kbd{M-x man} command. It
1145runs the @code{man} program to format the man page; if the system
1146permits, it runs @code{man} asynchronously, so that you can keep on
1147editing while the page is being formatted. (On MS-DOS and MS-Windows
11483, you cannot edit while Emacs waits for @code{man} to finish.) The
1149result goes in a buffer named @samp{*Man @var{topic}*}. These buffers
1150use a special major mode, Man mode, that facilitates scrolling and
1151jumping to other manual pages. For details, type @kbd{C-h m} while in
1152a man page buffer.
1153
1154@cindex sections of manual pages
1155 Each man page belongs to one of ten or more @dfn{sections}, each
1156named by a digit or by a digit and a letter. Sometimes there are
1157multiple man pages with the same name in different sections. To read
1158a man page from a specific section, type
1159@samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}}
1160when @kbd{M-x manual-entry} prompts for the topic. For example, to
1161read the man page for the C library function @code{chmod} (as opposed
1162to a command of the same name), type @kbd{M-x manual-entry @key{RET}
1163chmod(2) @key{RET}}. (@code{chmod} is a system call, so it is in
1164section @samp{2}.)
1165
1166@vindex Man-switches
1167 If you do not specify a section, the results depend on how the
1168@code{man} program works on your system. Some of them display only
1169the first man page they find. Others display all man pages that have
1170the specified name, so you can move between them with the @kbd{M-n}
1171and @kbd{M-p} keys@footnote{On some systems, the @code{man} program
1172accepts a @samp{-a} command-line option which tells it to display all
1173the man pages for the specified topic. If you want this behavior, you
1174can add this option to the value of the variable @code{Man-switches}.}.
1175The mode line shows how many manual pages are present in the Man buffer.
1176
1177@vindex Man-fontify-manpage-flag
1178 By default, Emacs highlights the text in man pages. For a long man
1179page, highlighting can take substantial time. You can turn off
1180highlighting of man pages by setting the variable
1181@code{Man-fontify-manpage-flag} to @code{nil}.
1182
1183@findex Man-fontify-manpage
1184 If you insert the text of a man page into an Emacs buffer in some
1185other fashion, you can use the command @kbd{M-x Man-fontify-manpage} to
1186perform the same conversions that @kbd{M-x manual-entry} does.
1187
1188@findex woman
1189@cindex manual pages, on MS-DOS/MS-Windows
1190 An alternative way of reading manual pages is the @kbd{M-x woman}
1191command@footnote{The name of the command, @code{woman}, is an acronym
1192for ``w/o (without) man,'' since it doesn't use the @code{man}
1193program.}. Unlike @kbd{M-x man}, it does not run any external
1194programs to format and display the man pages; instead it does the job
1195in Emacs Lisp, so it works on systems such as MS-Windows, where the
1196@code{man} program (and other programs it uses) are not generally
1197available.
1198
1199 @kbd{M-x woman} prompts for a name of a manual page, and provides
1200completion based on the list of manual pages that are installed on
1201your machine; the list of available manual pages is computed
1202automatically the first time you invoke @code{woman}. The word at
1203point in the current buffer is used to suggest the default for the
1204name the manual page.
1205
1206 With a numeric argument, @kbd{M-x woman} recomputes the list of the
1207manual pages used for completion. This is useful if you add or delete
1208manual pages.
1209
1210 If you type a name of a manual page and @kbd{M-x woman} finds that
1211several manual pages by the same name exist in different sections, it
1212pops up a window with possible candidates asking you to choose one of
1213them.
1214
1215 For more information about setting up and using @kbd{M-x woman}, see
1216@ref{Top, WoMan, Browse UN*X Manual Pages WithOut Man, woman, The WoMan
1217Manual}.
1218
1219@node Lisp Doc
1220@subsection Emacs Lisp Documentation Lookup
1221
1222 As you edit Lisp code to be run in Emacs, you can use the commands
1223@kbd{C-h f} (@code{describe-function}) and @kbd{C-h v}
1224(@code{describe-variable}) to view documentation of functions and
1225variables that you want to use. These commands use the minibuffer to
1226read the name of a function or variable to document, and display the
1227documentation in a window. Their default arguments are based on the
1228code in the neighborhood of point. For @kbd{C-h f}, the default is
1229the function called in the innermost list containing point. @kbd{C-h
1230v} uses the symbol name around or adjacent to point as its default.
1231
1232@cindex Eldoc mode
1233@findex eldoc-mode
1234 A more automatic but less powerful method is Eldoc mode. This minor
1235mode constantly displays in the echo area the argument list for the
1236function being called at point. (In other words, it finds the
1237function call that point is contained in, and displays the argument
1238list of that function.) If point is over a documented variable, it
1239shows the first line of the variable's docstring. Eldoc mode applies
1240in Emacs Lisp and Lisp Interaction modes, and perhaps a few others
1241that provide special support for looking up doc strings. Use the
1242command @kbd{M-x eldoc-mode} to enable or disable this feature.
1243
1244@node Hideshow
1245@section Hideshow minor mode
1246
1247@findex hs-minor-mode
1248 Hideshow minor mode provides selective display of portions of a
1249program, known as @dfn{blocks}. You can use @kbd{M-x hs-minor-mode}
1250to enable or disable this mode, or add @code{hs-minor-mode} to the
1251mode hook for certain major modes in order to enable it automatically
1252for those modes.
1253
1254 Just what constitutes a block depends on the major mode. In C mode
1255or C++ mode, they are delimited by braces, while in Lisp mode and
1256similar modes they are delimited by parentheses. Multi-line comments
1257also count as blocks.
1258
1259@findex hs-hide-all
1260@findex hs-hide-block
1261@findex hs-show-all
1262@findex hs-show-block
1263@findex hs-show-region
1264@findex hs-hide-level
1265@findex hs-minor-mode
1266@kindex C-c @@ C-h
1267@kindex C-c @@ C-s
1268@kindex C-c @@ C-M-h
1269@kindex C-c @@ C-M-s
1270@kindex C-c @@ C-r
1271@kindex C-c @@ C-l
1272@kindex S-Mouse-2
1273@table @kbd
1274@item C-c @@ C-h
1275Hide the current block (@code{hs-hide-block}).
1276@item C-c @@ C-s
1277Show the current block (@code{hs-show-block}).
1278@item C-c @@ C-c
1279Either hide or show the current block (@code{hs-toggle-hiding}).
1280@item S-Mouse-2
1281Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}).
1282@item C-c @@ C-M-h
1283Hide all top-level blocks (@code{hs-hide-all}).
1284@item C-c @@ C-M-s
1285Show everything in the buffer (@code{hs-show-all}).
1286@item C-c @@ C-l
1287Hide all blocks @var{n} levels below this block
1288(@code{hs-hide-level}).
1289@end table
1290
1291@vindex hs-hide-comments-when-hiding-all
1292@vindex hs-isearch-open
1293@vindex hs-special-modes-alist
1294 These variables exist for customizing Hideshow mode.
1295
1296@table @code
1297@item hs-hide-comments-when-hiding-all
1298Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too.
1299
1300@item hs-isearch-open
1301Specifies what kind of hidden blocks incremental search should make
1302visible. The value should be one of these four symbols:
1303
1304@table @code
1305@item code
1306Open only code blocks.
1307@item comment
1308Open only comments.
1309@item t
1310Open both code blocks and comments.
1311@item nil
1312Open neither code blocks nor comments.
1313@end table
1314
1315@item hs-special-modes-alist
1316A list of elements, each specifying how to initialize Hideshow
1317variables for one major mode. See the variable's documentation string
1318for more information.
1319@end table
1320
1321@node Symbol Completion
1322@section Completion for Symbol Names
1323@cindex completion (symbol names)
1324
1325 In Emacs, completion is something you normally do in the minibuffer.
1326But one kind of completion is available in all buffers: completion for
1327symbol names.
1328
1329@kindex M-TAB
1330 The character @kbd{M-@key{TAB}} runs a command to complete the
1331partial symbol before point against the set of meaningful symbol
1332names. This command inserts at point any additional characters that
1333it can determine from the partial name.
1334
1335 If your window manager defines @kbd{M-@key{TAB}} to switch windows,
1336you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead.
1337However, most window managers let you customize these shortcuts, and
1338we recommend that you change any that get in the way of use of Emacs.
1339
1340 If the partial name in the buffer has multiple possible completions
1341that differ in the very next character, so that it is impossible to
1342complete even one more character, @kbd{M-@key{TAB}} displays a list of
1343all possible completions in another window.
1344
1345@cindex tags-based completion
1346@cindex Info index completion
1347@findex complete-symbol
1348 In most programming language major modes, @kbd{M-@key{TAB}} runs the
1349command @code{complete-symbol}, which provides two kinds of completion.
1350Normally it does completion based on a tags table (@pxref{Tags}); with a
1351numeric argument (regardless of the value), it does completion based on
1352the names listed in the Info file indexes for your language. Thus, to
1353complete the name of a symbol defined in your own program, use
1354@kbd{M-@key{TAB}} with no argument; to complete the name of a standard
1355library function, use @kbd{C-u M-@key{TAB}}. Of course, Info-based
1356completion works only if there is an Info file for the standard library
1357functions of your language, and only if it is installed at your site.
1358
1359@cindex Lisp symbol completion
1360@cindex completion (Lisp symbols)
1361@findex lisp-complete-symbol
1362 In Emacs-Lisp mode, the name space for completion normally consists of
1363nontrivial symbols present in Emacs---those that have function
1364definitions, values or properties. However, if there is an
1365open-parenthesis immediately before the beginning of the partial symbol,
1366only symbols with function definitions are considered as completions.
1367The command which implements this is @code{lisp-complete-symbol}.
1368
1369 In Text mode and related modes, @kbd{M-@key{TAB}} completes words
1370based on the spell-checker's dictionary. @xref{Spelling}.
1371
1372@node Glasses
1373@section Glasses minor mode
1374@cindex Glasses mode
1375@cindex identifiers, making long ones readable
1376@cindex StudlyCaps, making them readable
1377@findex glasses-mode
1378
1379 Glasses minor mode makes @samp{unreadableIdentifiersLikeThis}
1380readable by altering the way they display. It knows two different
1381ways to do this: by displaying underscores between a lower-case letter
1382and the following capital letter, and by emboldening the capital
1383letters. It does not alter the buffer text, only the way they
1384display, so you can use it even on read-only buffers. You can use the
1385command @kbd{M-x glasses-mode} to enable or disable the mode in the
1386current buffer; you can also add @code{glasses-mode} to the mode hook
1387of the programming language major modes in which you normally want
1388to use Glasses mode.
1389
1390@node Misc for Programs
1391@section Other Features Useful for Editing Programs
1392
1393 A number of Emacs commands that aren't designed specifically for
1394editing programs are useful for that nonetheless.
1395
1396 The Emacs commands that operate on words, sentences and paragraphs
1397are useful for editing code. Most symbols names contain words
1398(@pxref{Words}); sentences can be found in strings and comments
1399(@pxref{Sentences}). Paragraphs in the strict sense can be found in
1400program code (in long comments), but the paragraph commands are useful
1401in other places too, because programming language major modes define
1402paragraphs to begin and end at blank lines (@pxref{Paragraphs}).
1403Judicious use of blank lines to make the program clearer will also
1404provide useful chunks of text for the paragraph commands to work on.
1405Auto Fill mode, if enabled in a programming language major mode,
1406indents the new lines which it creates.
1407
1408 The selective display feature is useful for looking at the overall
1409structure of a function (@pxref{Selective Display}). This feature
1410hides the lines that are indented more than a specified amount.
1411Programming modes often support Outline minor mode (@pxref{Outline
1412Mode}). The Foldout package provides folding-editor features
1413(@pxref{Foldout}).
1414
1415 The ``automatic typing'' features may be useful for writing programs.
1416@xref{Top,,Autotyping, autotype, Autotyping}.
1417
1418@node C Modes
1419@section C and Related Modes
1420@cindex C mode
1421@cindex Java mode
1422@cindex Pike mode
1423@cindex IDL mode
1424@cindex CORBA IDL mode
1425@cindex Objective C mode
1426@cindex C++ mode
1427@cindex AWK mode
1428@cindex mode, Java
1429@cindex mode, C
1430@cindex mode, C++
1431@cindex mode, Objective C
1432@cindex mode, CORBA IDL
1433@cindex mode, Pike
1434@cindex mode, AWK
1435
1436 This section gives a brief description of the special features
1437available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes.
1438(These are called ``C mode and related modes.'') @xref{Top, , CC Mode,
1439ccmode, CC Mode}, for a more extensive description of these modes
1440and their special features.
1441
1442@menu
1443* Motion in C:: Commands to move by C statements, etc.
1444* Electric C:: Colon and other chars can automatically reindent.
1445* Hungry Delete:: A more powerful DEL command.
1446* Other C Commands:: Filling comments, viewing expansion of macros,
1447 and other neat features.
1448@end menu
1449
1450@node Motion in C
1451@subsection C Mode Motion Commands
1452
1453 This section describes commands for moving point, in C mode and
1454related modes.
1455
1456@table @code
1457@item M-x c-beginning-of-defun
1458@itemx M-x c-end-of-defun
1459@findex c-beginning-of-defun
1460@findex c-end-of-defun
1461Move point to the beginning or end of the current function or
1462top-level definition. These are found by searching for the least
1463enclosing braces. (By contrast, @code{beginning-of-defun} and
1464@code{end-of-defun} search for braces in column zero.) If you are
1465editing code where the opening brace of a function isn't placed in
1466column zero, you may wish to bind @code{C-M-a} and @code{C-M-e} to
1467these commands. @xref{Moving by Defuns}.
1468
1469@item C-c C-u
1470@kindex C-c C-u @r{(C mode)}
1471@findex c-up-conditional
1472Move point back to the containing preprocessor conditional, leaving the
1473mark behind. A prefix argument acts as a repeat count. With a negative
1474argument, move point forward to the end of the containing
1475preprocessor conditional.
1476
1477@samp{#elif} is equivalent to @samp{#else} followed by @samp{#if}, so
1478the function will stop at a @samp{#elif} when going backward, but not
1479when going forward.
1480
1481@item C-c C-p
1482@kindex C-c C-p @r{(C mode)}
1483@findex c-backward-conditional
1484Move point back over a preprocessor conditional, leaving the mark
1485behind. A prefix argument acts as a repeat count. With a negative
1486argument, move forward.
1487
1488@item C-c C-n
1489@kindex C-c C-n @r{(C mode)}
1490@findex c-forward-conditional
1491Move point forward across a preprocessor conditional, leaving the mark
1492behind. A prefix argument acts as a repeat count. With a negative
1493argument, move backward.
1494
1495@item M-a
1496@kindex M-a (C mode)
1497@findex c-beginning-of-statement
1498Move point to the beginning of the innermost C statement
1499(@code{c-beginning-of-statement}). If point is already at the beginning
1500of a statement, move to the beginning of the preceding statement. With
1501prefix argument @var{n}, move back @var{n} @minus{} 1 statements.
1502
1503In comments or in strings which span more than one line, this command
1504moves by sentences instead of statements.
1505
1506@item M-e
1507@kindex M-e (C mode)
1508@findex c-end-of-statement
1509Move point to the end of the innermost C statement or sentence; like
1510@kbd{M-a} except that it moves in the other direction
1511(@code{c-end-of-statement}).
1512@end table
1513
1514@node Electric C
1515@subsection Electric C Characters
1516
1517 In C mode and related modes, certain printing characters are
1518@dfn{electric}---in addition to inserting themselves, they also
1519reindent the current line, and optionally also insert newlines. The
1520``electric'' characters are @kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#},
1521@kbd{;}, @kbd{,}, @kbd{<}, @kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and
1522@kbd{)}.
1523
1524 You might find electric indentation inconvenient if you are editing
1525chaotically indented code. If you are new to CC Mode, you might find
1526it disconcerting. You can toggle electric action with the command
1527@kbd{C-c C-l}; when it is enabled, @samp{/l} appears in the mode line
1528after the mode name:
1529
1530@table @kbd
1531@item C-c C-l
1532@kindex C-c C-l @r{(C mode)}
1533@findex c-toggle-electric-state
1534Toggle electric action (@code{c-toggle-electric-state}). With a
1535prefix argument, this command enables electric action if the argument
1536is positive, disables it if it is negative.
1537@end table
1538
1539 Electric characters insert newlines only when, in addition to the
1540electric state, the @dfn{auto-newline} feature is enabled (indicated
1541by @samp{/la} in the mode line after the mode name). You can turn
1542this feature on or off with the command @kbd{C-c C-a}:
1543
1544@table @kbd
1545@item C-c C-a
1546@kindex C-c C-a @r{(C mode)}
1547@findex c-toggle-auto-newline
1548Toggle the auto-newline feature (@code{c-toggle-auto-newline}). With a
1549prefix argument, this command turns the auto-newline feature on if the
1550argument is positive, and off if it is negative.
1551@end table
1552
1553 Usually the CC Mode style configures the exact circumstances in
1554which Emacs inserts auto-newlines. You can also configure this
1555directly. @xref{Custom Auto-newlines,,, ccmode, The CC Mode Manual}.
1556
1557@node Hungry Delete
1558@subsection Hungry Delete Feature in C
1559@cindex hungry deletion (C Mode)
1560
1561 If you want to delete an entire block of whitespace at point, you
1562can use @dfn{hungry deletion}. This deletes all the contiguous
1563whitespace either before point or after point in a single operation.
1564@dfn{Whitespace} here includes tabs and newlines, but not comments or
1565preprocessor commands.
1566
1567@table @kbd
1568@item C-c C-@key{DEL}
1569@itemx C-c @key{DEL}
1570@findex c-hungry-delete-backwards
1571@kindex C-c C-@key{DEL} (C Mode)
1572@kindex C-c @key{DEL} (C Mode)
1573@code{c-hungry-delete-backwards}---Delete the entire block of whitespace
1574preceding point.
1575
1576@item C-c C-d
1577@itemx C-c C-@key{DELETE}
1578@itemx C-c @key{DELETE}
1579@findex c-hungry-delete-forward
1580@kindex C-c C-d (C Mode)
1581@kindex C-c C-@key{DELETE} (C Mode)
1582@kindex C-c @key{DELETE} (C Mode)
1583@code{c-hungry-delete-forward}---Delete the entire block of whitespace
1584following point.
1585@end table
1586
1587 As an alternative to the above commands, you can enable @dfn{hungry
1588delete mode}. When this feature is enabled (indicated by @samp{/h} in
1589the mode line after the mode name), a single @key{DEL} deletes all
1590preceding whitespace, not just one space, and a single @kbd{C-c C-d}
1591(but @emph{not} plain @key{DELETE}) deletes all following whitespace.
1592
1593@table @kbd
1594@item M-x c-toggle-hungry-state
1595@findex c-toggle-hungry-state
1596Toggle the hungry-delete feature
1597(@code{c-toggle-hungry-state})@footnote{This command had the binding
1598@kbd{C-c C-d} in earlier versions of Emacs. @kbd{C-c C-d} is now
1599bound to @code{c-hungry-delete-forward}.}. With a prefix argument,
1600this command turns the hungry-delete feature on if the argument is
1601positive, and off if it is negative.
1602@end table
1603
1604@vindex c-hungry-delete-key
1605 The variable @code{c-hungry-delete-key} controls whether the
1606hungry-delete feature is enabled.
1607
1608@node Other C Commands
1609@subsection Other Commands for C Mode
1610
1611@table @kbd
1612@item C-c C-w
1613@itemx M-x c-subword-mode
1614@findex c-subword-mode
1615Enable (or disable) @dfn{subword mode}. In subword mode, Emacs's word
1616commands recognize upper case letters in
1617@samp{StudlyCapsIdentifiers} as word boundaries. This is indicated by
1618the flag @samp{/w} on the mode line after the mode name
1619(e.g. @samp{C/law}). You can even use @kbd{M-x c-subword-mode} in
1620non-CC Mode buffers.
1621
1622In the GNU project, we recommend using underscores to separate words
1623within an identifier in C or C++, rather than using case distinctions.
1624
1625@item M-x c-context-line-break
1626@findex c-context-line-break
1627This command inserts a line break and indents the new line in a manner
1628appropriate to the context. In normal code, it does the work of
1629@kbd{C-j} (@code{newline-and-indent}), in a C preprocessor line it
1630additionally inserts a @samp{\} at the line break, and within comments
1631it's like @kbd{M-j} (@code{c-indent-new-comment-line}).
1632
1633@code{c-context-line-break} isn't bound to a key by default, but it
1634needs a binding to be useful. The following code will bind it to
1635@kbd{C-j}. We use @code{c-initialization-hook} here to make sure
1636the keymap is loaded before we try to change it.
1637
1638@smallexample
1639(defun my-bind-clb ()
1640 (define-key c-mode-base-map "\C-j" 'c-context-line-break))
1641(add-hook 'c-initialization-hook 'my-bind-clb)
1642@end smallexample
1643
1644@item C-M-h
1645Put mark at the end of a function definition, and put point at the
1646beginning (@code{c-mark-function}).
1647
1648@item M-q
1649@kindex M-q @r{(C mode)}
1650@findex c-fill-paragraph
1651Fill a paragraph, handling C and C++ comments (@code{c-fill-paragraph}).
1652If any part of the current line is a comment or within a comment, this
1653command fills the comment or the paragraph of it that point is in,
1654preserving the comment indentation and comment delimiters.
1655
1656@item C-c C-e
1657@cindex macro expansion in C
1658@cindex expansion of C macros
1659@findex c-macro-expand
1660@kindex C-c C-e @r{(C mode)}
1661Run the C preprocessor on the text in the region, and show the result,
1662which includes the expansion of all the macro calls
1663(@code{c-macro-expand}). The buffer text before the region is also
1664included in preprocessing, for the sake of macros defined there, but the
1665output from this part isn't shown.
1666
1667When you are debugging C code that uses macros, sometimes it is hard to
1668figure out precisely how the macros expand. With this command, you
1669don't have to figure it out; you can see the expansions.
1670
1671@item C-c C-\
1672@findex c-backslash-region
1673@kindex C-c C-\ @r{(C mode)}
1674Insert or align @samp{\} characters at the ends of the lines of the
1675region (@code{c-backslash-region}). This is useful after writing or
1676editing a C macro definition.
1677
1678If a line already ends in @samp{\}, this command adjusts the amount of
1679whitespace before it. Otherwise, it inserts a new @samp{\}. However,
1680the last line in the region is treated specially; no @samp{\} is
1681inserted on that line, and any @samp{\} there is deleted.
1682
1683@item M-x cpp-highlight-buffer
1684@cindex preprocessor highlighting
1685@findex cpp-highlight-buffer
1686Highlight parts of the text according to its preprocessor conditionals.
1687This command displays another buffer named @samp{*CPP Edit*}, which
1688serves as a graphic menu for selecting how to display particular kinds
1689of conditionals and their contents. After changing various settings,
1690click on @samp{[A]pply these settings} (or go to that buffer and type
1691@kbd{a}) to rehighlight the C mode buffer accordingly.
1692
1693@item C-c C-s
1694@findex c-show-syntactic-information
1695@kindex C-c C-s @r{(C mode)}
1696Display the syntactic information about the current source line
1697(@code{c-show-syntactic-information}). This information directs how
1698the line is indented.
1699
1700@item M-x cwarn-mode
1701@itemx M-x global-cwarn-mode
1702@findex cwarn-mode
1703@findex global-cwarn-mode
1704@vindex global-cwarn-mode
1705@cindex CWarn mode
1706@cindex suspicious constructions in C, C++
1707CWarn minor mode highlights certain suspicious C and C++ constructions:
1708
1709@itemize @bullet{}
1710@item
1711Assignments inside expressions.
1712@item
1713Semicolon following immediately after @samp{if}, @samp{for}, and @samp{while}
1714(except after a @samp{do @dots{} while} statement);
1715@item
1716C++ functions with reference parameters.
1717@end itemize
1718
1719@noindent
1720You can enable the mode for one buffer with the command @kbd{M-x
1721cwarn-mode}, or for all suitable buffers with the command @kbd{M-x
1722global-cwarn-mode} or by customizing the variable
1723@code{global-cwarn-mode}. You must also enable Font Lock mode to make
1724it work.
1725
1726@item M-x hide-ifdef-mode
1727@findex hide-ifdef-mode
1728@cindex Hide-ifdef mode
1729Hide-ifdef minor mode hides selected code within @samp{#if} and
1730@samp{#ifdef} preprocessor blocks. See the documentation string of
1731@code{hide-ifdef-mode} for more information.
1732
1733@item M-x ff-find-related-file
1734@cindex related files
1735@findex ff-find-related-file
1736@vindex ff-related-file-alist
1737Find a file ``related'' in a special way to the file visited by the
1738current buffer. Typically this will be the header file corresponding
1739to a C/C++ source file, or vice versa. The variable
1740@code{ff-related-file-alist} specifies how to compute related file
1741names.
1742@end table
1743
1744@node Asm Mode
1745@section Asm Mode
1746
1747@cindex Asm mode
1748@cindex assembler mode
1749Asm mode is a major mode for editing files of assembler code. It
1750defines these commands:
1751
1752@table @kbd
1753@item @key{TAB}
1754@code{tab-to-tab-stop}.
1755@item C-j
1756Insert a newline and then indent using @code{tab-to-tab-stop}.
1757@item :
1758Insert a colon and then remove the indentation from before the label
1759preceding colon. Then do @code{tab-to-tab-stop}.
1760@item ;
1761Insert or align a comment.
1762@end table
1763
1764 The variable @code{asm-comment-char} specifies which character
1765starts comments in assembler syntax.
1766
1767@ifnottex
1768@include fortran-xtra.texi
1769@end ifnottex
1770
1771@ignore
1772 arch-tag: c7ee7409-40a4-45c7-bfb7-ae7f2c74d0c0
1773@end ignore
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi
new file mode 100644
index 00000000000..475a3b7b1b5
--- /dev/null
+++ b/doc/emacs/regs.texi
@@ -0,0 +1,330 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Registers, Display, CUA Bindings, Top
6@chapter Registers
7@cindex registers
8
9 Emacs @dfn{registers} are compartments where you can save text,
10rectangles, positions, and other things for later use. Once you save
11text or a rectangle in a register, you can copy it into the buffer
12once, or many times; you can move point to a position saved in a
13register once, or many times.
14
15@findex view-register
16 Each register has a name, which consists of a single character. A
17register can store a number, a piece of text, a rectangle, a position,
18a window configuration, or a file name, but only one thing at any
19given time. Whatever you store in a register remains there until you
20store something else in that register. To see what a register @var{r}
21contains, use @kbd{M-x view-register}.
22
23@table @kbd
24@item M-x view-register @key{RET} @var{r}
25Display a description of what register @var{r} contains.
26@end table
27
28 @dfn{Bookmarks} record files and positions in them, so you can
29return to those positions when you look at the file again.
30Bookmarks are similar enough in spirit to registers that they
31seem to belong in this chapter.
32
33@menu
34* Position: RegPos. Saving positions in registers.
35* Text: RegText. Saving text in registers.
36* Rectangle: RegRect. Saving rectangles in registers.
37* Configurations: RegConfig. Saving window configurations in registers.
38* Numbers: RegNumbers. Numbers in registers.
39* Files: RegFiles. File names in registers.
40* Bookmarks:: Bookmarks are like registers, but persistent.
41@end menu
42
43@node RegPos
44@section Saving Positions in Registers
45@cindex saving position in a register
46
47 Saving a position records a place in a buffer so that you can move
48back there later. Moving to a saved position switches to that buffer
49and moves point to that place in it.
50
51@table @kbd
52@item C-x r @key{SPC} @var{r}
53Save position of point in register @var{r} (@code{point-to-register}).
54@item C-x r j @var{r}
55Jump to the position saved in register @var{r} (@code{jump-to-register}).
56@end table
57
58@kindex C-x r SPC
59@findex point-to-register
60 To save the current position of point in a register, choose a name
61@var{r} and type @kbd{C-x r @key{SPC} @var{r}}. The register @var{r}
62retains the position thus saved until you store something else in that
63register.
64
65@kindex C-x r j
66@findex jump-to-register
67 The command @kbd{C-x r j @var{r}} moves point to the position recorded
68in register @var{r}. The register is not affected; it continues to
69hold the same position. You can jump to the saved position any number
70of times.
71
72 If you use @kbd{C-x r j} to go to a saved position, but the buffer it
73was saved from has been killed, @kbd{C-x r j} tries to create the buffer
74again by visiting the same file. Of course, this works only for buffers
75that were visiting files.
76
77@node RegText
78@section Saving Text in Registers
79@cindex saving text in a register
80
81 When you want to insert a copy of the same piece of text several
82times, it may be inconvenient to yank it from the kill ring, since each
83subsequent kill moves that entry further down the ring. An alternative
84is to store the text in a register and later retrieve it.
85
86@table @kbd
87@item C-x r s @var{r}
88Copy region into register @var{r} (@code{copy-to-register}).
89@item C-x r i @var{r}
90Insert text from register @var{r} (@code{insert-register}).
91@item M-x append-to-register @key{RET} @var{r}
92Append region to text in register @var{r}.
93@item M-x prepend-to-register @key{RET} @var{r}
94Prepend region to text in register @var{r}.
95@end table
96
97@kindex C-x r s
98@kindex C-x r i
99@findex copy-to-register
100@findex insert-register
101 @kbd{C-x r s @var{r}} stores a copy of the text of the region into
102the register named @var{r}. @kbd{C-u C-x r s @var{r}}, the same
103command with a numeric argument, deletes the text from the buffer as
104well; you can think of this as ``moving'' the region text into the register.
105
106@findex append-to-register
107@findex prepend-to-register
108 @kbd{M-x append-to-register @key{RET} @var{r}} appends the copy of
109the text in the region to the text already stored in the register
110named @var{r}. If invoked with a numeric argument, it deletes the
111region after appending it to the register. The command
112@code{prepend-to-register} is similar, except that it @emph{prepends}
113the region text to the text in the register, rather than
114@emph{appending} it.
115
116 @kbd{C-x r i @var{r}} inserts in the buffer the text from register
117@var{r}. Normally it leaves point before the text and places the mark
118after, but with a numeric argument (@kbd{C-u}) it puts point after the
119text and the mark before.
120
121@node RegRect
122@section Saving Rectangles in Registers
123@cindex saving rectangle in a register
124
125 A register can contain a rectangle instead of linear text. The
126rectangle is represented as a list of strings. @xref{Rectangles}, for
127basic information on how to specify a rectangle in the buffer.
128
129@table @kbd
130@findex copy-rectangle-to-register
131@kindex C-x r r
132@item C-x r r @var{r}
133Copy the region-rectangle into register @var{r}
134(@code{copy-rectangle-to-register}). With numeric argument, delete it as
135well.
136@item C-x r i @var{r}
137Insert the rectangle stored in register @var{r} (if it contains a
138rectangle) (@code{insert-register}).
139@end table
140
141 The @kbd{C-x r i @var{r}} command inserts a text string if the
142register contains one, and inserts a rectangle if the register contains
143one.
144
145 See also the command @code{sort-columns}, which you can think of
146as sorting a rectangle. @xref{Sorting}.
147
148@node RegConfig
149@section Saving Window Configurations in Registers
150@cindex saving window configuration in a register
151
152@findex window-configuration-to-register
153@findex frame-configuration-to-register
154@kindex C-x r w
155@kindex C-x r f
156 You can save the window configuration of the selected frame in a
157register, or even the configuration of all windows in all frames, and
158restore the configuration later.
159
160@table @kbd
161@item C-x r w @var{r}
162Save the state of the selected frame's windows in register @var{r}
163(@code{window-configuration-to-register}).
164@item C-x r f @var{r}
165Save the state of all frames, including all their windows, in register
166@var{r} (@code{frame-configuration-to-register}).
167@end table
168
169 Use @kbd{C-x r j @var{r}} to restore a window or frame configuration.
170This is the same command used to restore a cursor position. When you
171restore a frame configuration, any existing frames not included in the
172configuration become invisible. If you wish to delete these frames
173instead, use @kbd{C-u C-x r j @var{r}}.
174
175@node RegNumbers
176@section Keeping Numbers in Registers
177@cindex saving number in a register
178
179 There are commands to store a number in a register, to insert
180the number in the buffer in decimal, and to increment it. These commands
181can be useful in keyboard macros (@pxref{Keyboard Macros}).
182
183@table @kbd
184@item C-u @var{number} C-x r n @var{r}
185@kindex C-x r n
186@findex number-to-register
187Store @var{number} into register @var{r} (@code{number-to-register}).
188@item C-u @var{number} C-x r + @var{r}
189@kindex C-x r +
190@findex increment-register
191Increment the number in register @var{r} by @var{number}
192(@code{increment-register}).
193@item C-x r i @var{r}
194Insert the number from register @var{r} into the buffer.
195@end table
196
197 @kbd{C-x r i} is the same command used to insert any other sort of
198register contents into the buffer. @kbd{C-x r +} with no numeric
199argument increments the register value by 1; @kbd{C-x r n} with no
200numeric argument stores zero in the register.
201
202@node RegFiles
203@section Keeping File Names in Registers
204@cindex saving file name in a register
205
206 If you visit certain file names frequently, you can visit them more
207conveniently if you put their names in registers. Here's the Lisp code
208used to put a file name in a register:
209
210@smallexample
211(set-register ?@var{r} '(file . @var{name}))
212@end smallexample
213
214@need 3000
215@noindent
216For example,
217
218@smallexample
219(set-register ?z '(file . "/gd/gnu/emacs/19.0/src/ChangeLog"))
220@end smallexample
221
222@noindent
223puts the file name shown in register @samp{z}.
224
225 To visit the file whose name is in register @var{r}, type @kbd{C-x r j
226@var{r}}. (This is the same command used to jump to a position or
227restore a frame configuration.)
228
229@node Bookmarks
230@section Bookmarks
231@cindex bookmarks
232
233 @dfn{Bookmarks} are somewhat like registers in that they record
234positions you can jump to. Unlike registers, they have long names, and
235they persist automatically from one Emacs session to the next. The
236prototypical use of bookmarks is to record ``where you were reading'' in
237various files.
238
239@table @kbd
240@item C-x r m @key{RET}
241Set the bookmark for the visited file, at point.
242
243@item C-x r m @var{bookmark} @key{RET}
244@findex bookmark-set
245Set the bookmark named @var{bookmark} at point (@code{bookmark-set}).
246
247@item C-x r b @var{bookmark} @key{RET}
248@findex bookmark-jump
249Jump to the bookmark named @var{bookmark} (@code{bookmark-jump}).
250
251@item C-x r l
252@findex list-bookmarks
253List all bookmarks (@code{list-bookmarks}).
254
255@item M-x bookmark-save
256@findex bookmark-save
257Save all the current bookmark values in the default bookmark file.
258@end table
259
260@kindex C-x r m
261@findex bookmark-set
262@kindex C-x r b
263@findex bookmark-jump
264 The prototypical use for bookmarks is to record one current position
265in each of several files. So the command @kbd{C-x r m}, which sets a
266bookmark, uses the visited file name as the default for the bookmark
267name. If you name each bookmark after the file it points to, then you
268can conveniently revisit any of those files with @kbd{C-x r b}, and move
269to the position of the bookmark at the same time.
270
271@kindex C-x r l
272 To display a list of all your bookmarks in a separate buffer, type
273@kbd{C-x r l} (@code{list-bookmarks}). If you switch to that buffer,
274you can use it to edit your bookmark definitions or annotate the
275bookmarks. Type @kbd{C-h m} in the bookmark buffer for more
276information about its special editing commands.
277
278 When you kill Emacs, Emacs offers to save your bookmark values in your
279default bookmark file, @file{~/.emacs.bmk}, if you have changed any
280bookmark values. You can also save the bookmarks at any time with the
281@kbd{M-x bookmark-save} command. The bookmark commands load your
282default bookmark file automatically. This saving and loading is how
283bookmarks persist from one Emacs session to the next.
284
285@vindex bookmark-save-flag
286 If you set the variable @code{bookmark-save-flag} to 1, then each
287command that sets a bookmark will also save your bookmarks; this way,
288you don't lose any bookmark values even if Emacs crashes. (The value,
289if a number, says how many bookmark modifications should go by between
290saving.)
291
292@vindex bookmark-search-size
293 Bookmark position values are saved with surrounding context, so that
294@code{bookmark-jump} can find the proper position even if the file is
295modified slightly. The variable @code{bookmark-search-size} says how
296many characters of context to record on each side of the bookmark's
297position.
298
299 Here are some additional commands for working with bookmarks:
300
301@table @kbd
302@item M-x bookmark-load @key{RET} @var{filename} @key{RET}
303@findex bookmark-load
304Load a file named @var{filename} that contains a list of bookmark
305values. You can use this command, as well as @code{bookmark-write}, to
306work with other files of bookmark values in addition to your default
307bookmark file.
308
309@item M-x bookmark-write @key{RET} @var{filename} @key{RET}
310@findex bookmark-write
311Save all the current bookmark values in the file @var{filename}.
312
313@item M-x bookmark-delete @key{RET} @var{bookmark} @key{RET}
314@findex bookmark-delete
315Delete the bookmark named @var{bookmark}.
316
317@item M-x bookmark-insert-location @key{RET} @var{bookmark} @key{RET}
318@findex bookmark-insert-location
319Insert in the buffer the name of the file that bookmark @var{bookmark}
320points to.
321
322@item M-x bookmark-insert @key{RET} @var{bookmark} @key{RET}
323@findex bookmark-insert
324Insert in the buffer the @emph{contents} of the file that bookmark
325@var{bookmark} points to.
326@end table
327
328@ignore
329 arch-tag: b00af991-ebc3-4b3a-8e82-a3ac81ff2e64
330@end ignore
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
new file mode 100644
index 00000000000..7c36a31ff18
--- /dev/null
+++ b/doc/emacs/rmail.texi
@@ -0,0 +1,1430 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Rmail, Dired, Sending Mail, Top
6@chapter Reading Mail with Rmail
7@cindex Rmail
8@cindex reading mail
9@findex rmail
10@findex rmail-mode
11@vindex rmail-mode-hook
12
13 Rmail is an Emacs subsystem for reading and disposing of mail that
14you receive. Rmail stores mail messages in files called Rmail files
15which use a special format. Reading the message in an Rmail file is
16done in a special major mode, Rmail mode, which redefines most letters
17to run commands for managing mail.
18@menu
19* Basic: Rmail Basics. Basic concepts of Rmail, and simple use.
20* Scroll: Rmail Scrolling. Scrolling through a message.
21* Motion: Rmail Motion. Moving to another message.
22* Deletion: Rmail Deletion. Deleting and expunging messages.
23* Inbox: Rmail Inbox. How mail gets into the Rmail file.
24* Files: Rmail Files. Using multiple Rmail files.
25* Output: Rmail Output. Copying message out to files.
26* Labels: Rmail Labels. Classifying messages by labeling them.
27* Attrs: Rmail Attributes. Certain standard labels, called attributes.
28* Reply: Rmail Reply. Sending replies to messages you are viewing.
29* Summary: Rmail Summary. Summaries show brief info on many messages.
30* Sort: Rmail Sorting. Sorting messages in Rmail.
31* Display: Rmail Display. How Rmail displays a message; customization.
32* Coding: Rmail Coding. How Rmail handles decoding character sets.
33* Editing: Rmail Editing. Editing message text and headers in Rmail.
34* Digest: Rmail Digest. Extracting the messages from a digest message.
35* Out of Rmail:: Converting an Rmail file to mailbox format.
36* Rot13: Rmail Rot13. Reading messages encoded in the rot13 code.
37* Movemail:: More details of fetching new mail.
38* Remote Mailboxes:: Retrieving Mail from Remote Mailboxes.
39* Other Mailbox Formats:: Retrieving Mail from Local Mailboxes in
40 Various Formats
41@end menu
42
43@node Rmail Basics
44@section Basic Concepts of Rmail
45
46@cindex primary Rmail file
47@vindex rmail-file-name
48 Using Rmail in the simplest fashion, you have one Rmail file
49@file{~/RMAIL} in which all of your mail is saved. It is called your
50@dfn{primary Rmail file}. The command @kbd{M-x rmail} reads your primary
51Rmail file, merges new mail in from your inboxes, displays the first
52message you haven't read yet, and lets you begin reading. The variable
53@code{rmail-file-name} specifies the name of the primary Rmail file.
54
55 Rmail uses narrowing to hide all but one message in the Rmail file.
56The message that is shown is called the @dfn{current message}. Rmail
57mode's special commands can do such things as delete the current
58message, copy it into another file, send a reply, or move to another
59message. You can also create multiple Rmail files and use Rmail to move
60messages between them.
61
62@cindex message number
63 Within the Rmail file, messages are normally arranged sequentially in
64order of receipt; you can specify other ways to sort them. Messages are
65identified by consecutive integers which are their @dfn{message numbers}.
66The number of the current message is displayed in Rmail's mode line,
67followed by the total number of messages in the file. You can move to
68a message by specifying its message number with the @kbd{j} key
69(@pxref{Rmail Motion}).
70
71@kindex s @r{(Rmail)}
72@findex rmail-expunge-and-save
73 Following the usual conventions of Emacs, changes in an Rmail file
74become permanent only when you save the file. You can save it with
75@kbd{s} (@code{rmail-expunge-and-save}), which also expunges deleted
76messages from the file first (@pxref{Rmail Deletion}). To save the
77file without expunging, use @kbd{C-x C-s}. Rmail also saves the Rmail
78file after merging new mail from an inbox file (@pxref{Rmail Inbox}).
79
80@kindex q @r{(Rmail)}
81@findex rmail-quit
82@kindex b @r{(Rmail)}
83@findex rmail-bury
84 You can exit Rmail with @kbd{q} (@code{rmail-quit}); this expunges
85and saves the Rmail file, then buries the Rmail buffer as well as its
86summary buffer, if present (@pxref{Rmail Summary}). But there is no
87need to ``exit'' formally. If you switch from Rmail to editing in
88other buffers, and never switch back, you have exited. Just make sure
89to save the Rmail file eventually (like any other file you have
90changed). @kbd{C-x s} is a suitable way to do this (@pxref{Save
91Commands}). The Rmail command @kbd{b}, @code{rmail-bury}, buries the
92Rmail buffer and its summary buffer without expunging and saving the
93Rmail file.
94
95@node Rmail Scrolling
96@section Scrolling Within a Message
97
98 When Rmail displays a message that does not fit on the screen, you
99must scroll through it to read the rest. You could do this with
100@kbd{C-v}, @kbd{M-v} and @kbd{M-<}, but in Rmail scrolling is so
101frequent that it deserves to be easier.
102
103@table @kbd
104@item @key{SPC}
105Scroll forward (@code{scroll-up}).
106@item @key{DEL}
107Scroll backward (@code{scroll-down}).
108@item .
109Scroll to start of message (@code{rmail-beginning-of-message}).
110@item /
111Scroll to end of message (@code{rmail-end-of-message}).
112@end table
113
114@kindex SPC @r{(Rmail)}
115@kindex DEL @r{(Rmail)}
116 Since the most common thing to do while reading a message is to scroll
117through it by screenfuls, Rmail makes @key{SPC} and @key{DEL} synonyms of
118@kbd{C-v} (@code{scroll-up}) and @kbd{M-v} (@code{scroll-down})
119
120@kindex . @r{(Rmail)}
121@kindex / @r{(Rmail)}
122@findex rmail-beginning-of-message
123@findex rmail-end-of-message
124 The command @kbd{.} (@code{rmail-beginning-of-message}) scrolls back to the
125beginning of the selected message. This is not quite the same as @kbd{M-<}:
126for one thing, it does not set the mark; for another, it resets the buffer
127boundaries to the current message if you have changed them. Similarly,
128the command @kbd{/} (@code{rmail-end-of-message}) scrolls forward to the end
129of the selected message.
130
131@node Rmail Motion
132@section Moving Among Messages
133
134 The most basic thing to do with a message is to read it. The way to
135do this in Rmail is to make the message current. The usual practice is
136to move sequentially through the file, since this is the order of
137receipt of messages. When you enter Rmail, you are positioned at the
138first message that you have not yet made current (that is, the first one
139that has the @samp{unseen} attribute; @pxref{Rmail Attributes}). Move
140forward to see the other new messages; move backward to re-examine old
141messages.
142
143@table @kbd
144@item n
145Move to the next nondeleted message, skipping any intervening deleted
146messages (@code{rmail-next-undeleted-message}).
147@item p
148Move to the previous nondeleted message
149(@code{rmail-previous-undeleted-message}).
150@item M-n
151Move to the next message, including deleted messages
152(@code{rmail-next-message}).
153@item M-p
154Move to the previous message, including deleted messages
155(@code{rmail-previous-message}).
156@item j
157Move to the first message. With argument @var{n}, move to
158message number @var{n} (@code{rmail-show-message}).
159@item >
160Move to the last message (@code{rmail-last-message}).
161@item <
162Move to the first message (@code{rmail-first-message}).
163
164@item M-s @var{regexp} @key{RET}
165Move to the next message containing a match for @var{regexp}
166(@code{rmail-search}).
167
168@item - M-s @var{regexp} @key{RET}
169Move to the previous message containing a match for @var{regexp}.
170@end table
171
172@kindex n @r{(Rmail)}
173@kindex p @r{(Rmail)}
174@kindex M-n @r{(Rmail)}
175@kindex M-p @r{(Rmail)}
176@findex rmail-next-undeleted-message
177@findex rmail-previous-undeleted-message
178@findex rmail-next-message
179@findex rmail-previous-message
180 @kbd{n} and @kbd{p} are the usual way of moving among messages in
181Rmail. They move through the messages sequentially, but skip over
182deleted messages, which is usually what you want to do. Their command
183definitions are named @code{rmail-next-undeleted-message} and
184@code{rmail-previous-undeleted-message}. If you do not want to skip
185deleted messages---for example, if you want to move to a message to
186undelete it---use the variants @kbd{M-n} and @kbd{M-p}
187(@code{rmail-next-message} and @code{rmail-previous-message}). A
188numeric argument to any of these commands serves as a repeat
189count.
190
191 In Rmail, you can specify a numeric argument by typing just the
192digits. You don't need to type @kbd{C-u} first.
193
194@kindex M-s @r{(Rmail)}
195@findex rmail-search
196@cindex searching in Rmail
197 The @kbd{M-s} (@code{rmail-search}) command is Rmail's version of
198search. The usual incremental search command @kbd{C-s} works in Rmail,
199but it searches only within the current message. The purpose of
200@kbd{M-s} is to search for another message. It reads a regular
201expression (@pxref{Regexps}) nonincrementally, then searches starting at
202the beginning of the following message for a match. It then selects
203that message. If @var{regexp} is empty, @kbd{M-s} reuses the regexp
204used the previous time.
205
206 To search backward in the file for another message, give @kbd{M-s} a
207negative argument. In Rmail you can do this with @kbd{- M-s}.
208
209 It is also possible to search for a message based on labels.
210@xref{Rmail Labels}.
211
212@kindex j @r{(Rmail)}
213@kindex > @r{(Rmail)}
214@kindex < @r{(Rmail)}
215@findex rmail-show-message
216@findex rmail-last-message
217@findex rmail-first-message
218 To move to a message specified by absolute message number, use @kbd{j}
219(@code{rmail-show-message}) with the message number as argument. With
220no argument, @kbd{j} selects the first message. @kbd{<}
221(@code{rmail-first-message}) also selects the first message. @kbd{>}
222(@code{rmail-last-message}) selects the last message.
223
224@node Rmail Deletion
225@section Deleting Messages
226
227@cindex deletion (Rmail)
228 When you no longer need to keep a message, you can @dfn{delete} it. This
229flags it as ignorable, and some Rmail commands pretend it is no longer
230present; but it still has its place in the Rmail file, and still has its
231message number.
232
233@cindex expunging (Rmail)
234 @dfn{Expunging} the Rmail file actually removes the deleted messages.
235The remaining messages are renumbered consecutively. Expunging is the only
236action that changes the message number of any message, except for
237undigestifying (@pxref{Rmail Digest}).
238
239@table @kbd
240@item d
241Delete the current message, and move to the next nondeleted message
242(@code{rmail-delete-forward}).
243@item C-d
244Delete the current message, and move to the previous nondeleted
245message (@code{rmail-delete-backward}).
246@item u
247Undelete the current message, or move back to a deleted message and
248undelete it (@code{rmail-undelete-previous-message}).
249@item x
250Expunge the Rmail file (@code{rmail-expunge}).
251@end table
252
253@kindex d @r{(Rmail)}
254@kindex C-d @r{(Rmail)}
255@findex rmail-delete-forward
256@findex rmail-delete-backward
257 There are two Rmail commands for deleting messages. Both delete the
258current message and select another message. @kbd{d}
259(@code{rmail-delete-forward}) moves to the following message, skipping
260messages already deleted, while @kbd{C-d} (@code{rmail-delete-backward})
261moves to the previous nondeleted message. If there is no nondeleted
262message to move to in the specified direction, the message that was just
263deleted remains current. @kbd{d} with a numeric argument is
264equivalent to @kbd{C-d}.
265
266@vindex rmail-delete-message-hook
267 Whenever Rmail deletes a message, it runs the hook
268@code{rmail-delete-message-hook}. When the hook functions are invoked,
269the message has been marked deleted, but it is still the current message
270in the Rmail buffer.
271
272@cindex undeletion (Rmail)
273@kindex x @r{(Rmail)}
274@findex rmail-expunge
275@kindex u @r{(Rmail)}
276@findex rmail-undelete-previous-message
277 To make all the deleted messages finally vanish from the Rmail file,
278type @kbd{x} (@code{rmail-expunge}). Until you do this, you can still
279@dfn{undelete} the deleted messages. The undeletion command, @kbd{u}
280(@code{rmail-undelete-previous-message}), is designed to cancel the
281effect of a @kbd{d} command in most cases. It undeletes the current
282message if the current message is deleted. Otherwise it moves backward
283to previous messages until a deleted message is found, and undeletes
284that message.
285
286 You can usually undo a @kbd{d} with a @kbd{u} because the @kbd{u}
287moves back to and undeletes the message that the @kbd{d} deleted. But
288this does not work when the @kbd{d} skips a few already-deleted messages
289that follow the message being deleted; then the @kbd{u} command
290undeletes the last of the messages that were skipped. There is no clean
291way to avoid this problem. However, by repeating the @kbd{u} command,
292you can eventually get back to the message that you intend to
293undelete. You can also select a particular deleted message with
294the @kbd{M-p} command, then type @kbd{u} to undelete it.
295
296 A deleted message has the @samp{deleted} attribute, and as a result
297@samp{deleted} appears in the mode line when the current message is
298deleted. In fact, deleting or undeleting a message is nothing more than
299adding or removing this attribute. @xref{Rmail Attributes}.
300
301@node Rmail Inbox
302@section Rmail Files and Inboxes
303@cindex inbox file
304
305 When you receive mail locally, the operating system places incoming
306mail for you in a file that we call your @dfn{inbox}. When you start
307up Rmail, it runs a C program called @code{movemail} to copy the new
308messages from your local inbox into your primary Rmail file, which
309also contains other messages saved from previous Rmail sessions. It
310is in this file that you actually read the mail with Rmail. This
311operation is called @dfn{getting new mail}. You can get new mail at
312any time in Rmail by typing @kbd{g}.
313
314@vindex rmail-primary-inbox-list
315@cindex @env{MAIL} environment variable
316 The variable @code{rmail-primary-inbox-list} contains a list of the
317files which are inboxes for your primary Rmail file. If you don't set
318this variable explicitly, it is initialized from the @env{MAIL}
319environment variable, or, as a last resort, set to @code{nil}, which
320means to use the default inbox. The default inbox file depends on
321your operating system; often it is @file{/var/mail/@var{username}},
322@file{/usr/spool/mail/@var{username}}, or
323@file{/usr/mail/@var{username}}.
324
325 You can specify the inbox file(s) for any Rmail file with the
326command @code{set-rmail-inbox-list}; see @ref{Rmail Files}.
327
328 There are two reasons for having separate Rmail files and inboxes.
329
330@enumerate
331@item
332The inbox file format varies between operating systems and according to
333the other mail software in use. Only one part of Rmail needs to know
334about the alternatives, and it need only understand how to convert all
335of them to Rmail's own format.
336
337@item
338It is very cumbersome to access an inbox file without danger of losing
339mail, because it is necessary to interlock with mail delivery.
340Moreover, different operating systems use different interlocking
341techniques. The strategy of moving mail out of the inbox once and for
342all into a separate Rmail file avoids the need for interlocking in all
343the rest of Rmail, since only Rmail operates on the Rmail file.
344@end enumerate
345
346 Rmail was written to use Babyl format as its internal format. Since
347then, we have recognized that the usual inbox format on Unix and GNU
348systems is adequate for the job, and we plan to change Rmail to use that
349as its internal format. However, the Rmail file will still be separate
350from the inbox file, even when their format is the same.
351
352@vindex rmail-preserve-inbox
353 When getting new mail, Rmail first copies the new mail from the
354inbox file to the Rmail file; then it saves the Rmail file; then it
355clears out the inbox file. This way, a system crash may cause
356duplication of mail between the inbox and the Rmail file, but cannot
357lose mail. If @code{rmail-preserve-inbox} is non-@code{nil}, then
358Rmail does not clear out the inbox file when it gets new mail. You
359may wish to set this, for example, on a portable computer you use to
360check your mail via POP while traveling, so that your mail will remain
361on the server and you can save it later on your workstation.
362
363 In some cases, Rmail copies the new mail from the inbox file
364indirectly. First it runs the @code{movemail} program to move the mail
365from the inbox to an intermediate file called
366@file{~/.newmail-@var{inboxname}}. Then Rmail merges the new mail from
367that file, saves the Rmail file, and only then deletes the intermediate
368file. If there is a crash at the wrong time, this file continues to
369exist, and Rmail will use it again the next time it gets new mail from
370that inbox.
371
372 If Rmail is unable to convert the data in
373@file{~/.newmail-@var{inboxname}} into Babyl format, it renames the file
374to @file{~/RMAILOSE.@var{n}} (@var{n} is an integer chosen to make the
375name unique) so that Rmail will not have trouble with the data again.
376You should look at the file, find whatever message confuses Rmail
377(probably one that includes the control-underscore character, octal code
378037), and delete it. Then you can use @kbd{1 g} to get new mail from
379the corrected file.
380
381@node Rmail Files
382@section Multiple Rmail Files
383
384 Rmail operates by default on your @dfn{primary Rmail file}, which is named
385@file{~/RMAIL} and receives your incoming mail from your system inbox file.
386But you can also have other Rmail files and edit them with Rmail. These
387files can receive mail through their own inboxes, or you can move messages
388into them with explicit Rmail commands (@pxref{Rmail Output}).
389
390@table @kbd
391@item i @var{file} @key{RET}
392Read @var{file} into Emacs and run Rmail on it (@code{rmail-input}).
393
394@item M-x set-rmail-inbox-list @key{RET} @var{files} @key{RET}
395Specify inbox file names for current Rmail file to get mail from.
396
397@item g
398Merge new mail from current Rmail file's inboxes
399(@code{rmail-get-new-mail}).
400
401@item C-u g @var{file} @key{RET}
402Merge new mail from inbox file @var{file}.
403@end table
404
405@kindex i @r{(Rmail)}
406@findex rmail-input
407 To run Rmail on a file other than your primary Rmail file, you can use
408the @kbd{i} (@code{rmail-input}) command in Rmail. This visits the file
409in Rmail mode. You can use @kbd{M-x rmail-input} even when not in
410Rmail, but it is easier to type @kbd{C-u M-x rmail}, which does the
411same thing.
412
413 The file you read with @kbd{i} should normally be a valid Rmail file.
414If it is not, Rmail tries to decompose it into a stream of messages in
415various known formats. If it succeeds, it converts the whole file to an
416Rmail file. If you specify a file name that doesn't exist, @kbd{i}
417initializes a new buffer for creating a new Rmail file.
418
419@vindex rmail-secondary-file-directory
420@vindex rmail-secondary-file-regexp
421 You can also select an Rmail file from a menu. In the Classify menu,
422choose the Input Rmail File item; then choose the Rmail file you want.
423The variables @code{rmail-secondary-file-directory} and
424@code{rmail-secondary-file-regexp} specify which files to offer in the
425menu: the first variable says which directory to find them in; the
426second says which files in that directory to offer (all those that
427match the regular expression). These variables also apply to choosing
428a file for output (@pxref{Rmail Output}).
429
430@findex set-rmail-inbox-list
431 Each Rmail file can contain a list of inbox file names; you can specify
432this list with @kbd{M-x set-rmail-inbox-list @key{RET} @var{files}
433@key{RET}}. The argument can contain any number of file names, separated
434by commas. It can also be empty, which specifies that this file should
435have no inboxes. Once you specify a list of inboxes in an Rmail file,
436the Rmail file remembers it permanently until you specify a different list.
437
438 As a special exception, if your primary Rmail file does not specify any
439inbox files, it uses your standard system inbox.
440
441@kindex g @r{(Rmail)}
442@findex rmail-get-new-mail
443 The @kbd{g} command (@code{rmail-get-new-mail}) merges mail into the
444current Rmail file from its inboxes. If the Rmail file has no
445inboxes, @kbd{g} does nothing. The command @kbd{M-x rmail} also
446merges new mail into your primary Rmail file.
447
448 To merge mail from a file that is not the usual inbox, give the
449@kbd{g} key a numeric argument, as in @kbd{C-u g}. Then it reads a file
450name and merges mail from that file. The inbox file is not deleted or
451changed in any way when @kbd{g} with an argument is used. This is,
452therefore, a general way of merging one file of messages into another.
453
454@node Rmail Output
455@section Copying Messages Out to Files
456
457 These commands copy messages from an Rmail file into another file.
458
459@table @kbd
460@item o @var{file} @key{RET}
461Append a copy of the current message to the file @var{file}, using Rmail
462file format by default (@code{rmail-output-to-rmail-file}).
463
464@item C-o @var{file} @key{RET}
465Append a copy of the current message to the file @var{file}, using
466system inbox file format by default (@code{rmail-output}).
467
468@item w @var{file} @key{RET}
469Output just the message body to the file @var{file}, taking the default
470file name from the message @samp{Subject} header.
471@end table
472
473@kindex o @r{(Rmail)}
474@findex rmail-output-to-rmail-file
475@kindex C-o @r{(Rmail)}
476@findex rmail-output
477 The commands @kbd{o} and @kbd{C-o} copy the current message into a
478specified file. This file may be an Rmail file or it may be in system
479inbox format; the output commands ascertain the file's format and write
480the copied message in that format.
481
482 The @kbd{o} and @kbd{C-o} commands differ in two ways: each has its
483own separate default file name, and each specifies a choice of format to
484use when the file does not already exist. The @kbd{o} command uses
485Rmail format when it creates a new file, while @kbd{C-o} uses system
486inbox format for a new file. The default file name for @kbd{o} is the
487file name used last with @kbd{o}, and the default file name for
488@kbd{C-o} is the file name used last with @kbd{C-o}.
489
490 If the output file is an Rmail file currently visited in an Emacs buffer,
491the output commands copy the message into that buffer. It is up to you
492to save the buffer eventually in its file.
493
494@kindex w @r{(Rmail)}
495@findex rmail-output-body-to-file
496 Sometimes you may receive a message whose body holds the contents of a
497file. You can save the body to a file (excluding the message header)
498with the @kbd{w} command (@code{rmail-output-body-to-file}). Often
499these messages contain the intended file name in the @samp{Subject}
500field, so the @kbd{w} command uses the @samp{Subject} field as the
501default for the output file name. However, the file name is read using
502the minibuffer, so you can specify a different name if you wish.
503
504 You can also output a message to an Rmail file chosen with a menu.
505In the Classify menu, choose the Output Rmail File menu item; then
506choose the Rmail file you want. This outputs the current message to
507that file, like the @kbd{o} command. The variables
508@code{rmail-secondary-file-directory} and
509@code{rmail-secondary-file-regexp} specify which files to offer in the
510menu: the first variable says which directory to find them in; the
511second says which files in that directory to offer (all those that
512match the regular expression).
513
514@vindex rmail-delete-after-output
515 Copying a message with @kbd{o} or @kbd{C-o} gives the original copy
516of the message the @samp{filed} attribute, so that @samp{filed}
517appears in the mode line when such a message is current. @kbd{w}
518gives it the @samp{stored} attribute. If you like to keep just a
519single copy of every mail message, set the variable
520@code{rmail-delete-after-output} to @code{t}; then the @kbd{o},
521@kbd{C-o} and @kbd{w} commands delete the original message after
522copying it. (You can undelete the original afterward if you wish.)
523
524 Copying messages into files in system inbox format uses the header
525fields that are displayed in Rmail at the time. Thus, if you use the
526@kbd{t} command to view the entire header and then copy the message, the
527entire header is copied. @xref{Rmail Display}.
528
529@vindex rmail-output-file-alist
530 The variable @code{rmail-output-file-alist} lets you specify
531intelligent defaults for the output file, based on the contents of the
532current message. The value should be a list whose elements have this
533form:
534
535@example
536(@var{regexp} . @var{name-exp})
537@end example
538
539@noindent
540If there's a match for @var{regexp} in the current message, then the
541default file name for output is @var{name-exp}. If multiple elements
542match the message, the first matching element decides the default file
543name. The subexpression @var{name-exp} may be a string constant giving
544the file name to use, or more generally it may be any Lisp expression
545that returns a file name as a string. @code{rmail-output-file-alist}
546applies to both @kbd{o} and @kbd{C-o}.
547
548@node Rmail Labels
549@section Labels
550@cindex label (Rmail)
551@cindex attribute (Rmail)
552
553 Each message can have various @dfn{labels} assigned to it as a means
554of classification. Each label has a name; different names are different
555labels. Any given label is either present or absent on a particular
556message. A few label names have standard meanings and are given to
557messages automatically by Rmail when appropriate; these special labels
558are called @dfn{attributes}.
559@ifnottex
560(@xref{Rmail Attributes}.)
561@end ifnottex
562All other labels are assigned only by users.
563
564@table @kbd
565@item a @var{label} @key{RET}
566Assign the label @var{label} to the current message (@code{rmail-add-label}).
567@item k @var{label} @key{RET}
568Remove the label @var{label} from the current message (@code{rmail-kill-label}).
569@item C-M-n @var{labels} @key{RET}
570Move to the next message that has one of the labels @var{labels}
571(@code{rmail-next-labeled-message}).
572@item C-M-p @var{labels} @key{RET}
573Move to the previous message that has one of the labels @var{labels}
574(@code{rmail-previous-labeled-message}).
575@item l @var{labels} @key{RET}
576@itemx C-M-l @var{labels} @key{RET}
577Make a summary of all messages containing any of the labels @var{labels}
578(@code{rmail-summary-by-labels}).
579@end table
580
581@kindex a @r{(Rmail)}
582@kindex k @r{(Rmail)}
583@findex rmail-add-label
584@findex rmail-kill-label
585 The @kbd{a} (@code{rmail-add-label}) and @kbd{k}
586(@code{rmail-kill-label}) commands allow you to assign or remove any
587label on the current message. If the @var{label} argument is empty, it
588means to assign or remove the same label most recently assigned or
589removed.
590
591 Once you have given messages labels to classify them as you wish, there
592are two ways to use the labels: in moving and in summaries.
593
594@kindex C-M-n @r{(Rmail)}
595@kindex C-M-p @r{(Rmail)}
596@findex rmail-next-labeled-message
597@findex rmail-previous-labeled-message
598 The command @kbd{C-M-n @var{labels} @key{RET}}
599(@code{rmail-next-labeled-message}) moves to the next message that has
600one of the labels @var{labels}. The argument @var{labels} specifies one
601or more label names, separated by commas. @kbd{C-M-p}
602(@code{rmail-previous-labeled-message}) is similar, but moves backwards
603to previous messages. A numeric argument to either command serves as a
604repeat count.
605
606 The command @kbd{C-M-l @var{labels} @key{RET}}
607(@code{rmail-summary-by-labels}) displays a summary containing only the
608messages that have at least one of a specified set of labels. The
609argument @var{labels} is one or more label names, separated by commas.
610@xref{Rmail Summary}, for information on summaries.
611
612 If the @var{labels} argument to @kbd{C-M-n}, @kbd{C-M-p} or
613@kbd{C-M-l} is empty, it means to use the last set of labels specified
614for any of these commands.
615
616@node Rmail Attributes
617@section Rmail Attributes
618
619 Some labels such as @samp{deleted} and @samp{filed} have built-in
620meanings, and Rmail assigns them to messages automatically at
621appropriate times; these labels are called @dfn{attributes}. Here is
622a list of Rmail attributes:
623
624@table @samp
625@item unseen
626Means the message has never been current. Assigned to messages when
627they come from an inbox file, and removed when a message is made
628current. When you start Rmail, it initially shows the first message
629that has this attribute.
630@item deleted
631Means the message is deleted. Assigned by deletion commands and
632removed by undeletion commands (@pxref{Rmail Deletion}).
633@item filed
634Means the message has been copied to some other file. Assigned by the
635@kbd{o} and @kbd{C-o} file output commands (@pxref{Rmail Output}).
636@item stored
637Assigned by the @kbd{w} file output command (@pxref{Rmail Output}).
638@item answered
639Means you have mailed an answer to the message. Assigned by the @kbd{r}
640command (@code{rmail-reply}). @xref{Rmail Reply}.
641@item forwarded
642Means you have forwarded the message. Assigned by the @kbd{f} command
643(@code{rmail-forward}). @xref{Rmail Reply}.
644@item edited
645Means you have edited the text of the message within Rmail.
646@xref{Rmail Editing}.
647@item resent
648Means you have resent the message. Assigned by the command @kbd{M-x
649rmail-resend}. @xref{Rmail Reply}.
650@end table
651
652 All other labels are assigned or removed only by users, and have no
653standard meaning.
654
655@node Rmail Reply
656@section Sending Replies
657
658 Rmail has several commands that use Mail mode to send outgoing mail.
659@xref{Sending Mail}, for information on using Mail mode, including
660certain features meant to work with Rmail. What this section documents
661are the special commands of Rmail for entering Mail mode. Note that the
662usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and @kbd{C-x 5
663m}---also work normally in Rmail mode.
664
665@table @kbd
666@item m
667Send a message (@code{rmail-mail}).
668@item c
669Continue editing the already started outgoing message (@code{rmail-continue}).
670@item r
671Send a reply to the current Rmail message (@code{rmail-reply}).
672@item f
673Forward the current message to other users (@code{rmail-forward}).
674@item C-u f
675Resend the current message to other users (@code{rmail-resend}).
676@item M-m
677Try sending a bounced message a second time (@code{rmail-retry-failure}).
678@end table
679
680@kindex r @r{(Rmail)}
681@findex rmail-reply
682@cindex reply to a message
683 The most common reason to send a message while in Rmail is to reply
684to the message you are reading. To do this, type @kbd{r}
685(@code{rmail-reply}). This displays the @samp{*mail*} buffer in
686another window, much like @kbd{C-x 4 m}, but preinitializes the
687@samp{Subject}, @samp{To}, @samp{CC}, @samp{In-reply-to} and
688@samp{References} header fields based on the message you are replying
689to. The @samp{To} field starts out as the address of the person who
690sent the message you received, and the @samp{CC} field starts out with
691all the other recipients of that message.
692
693@vindex rmail-dont-reply-to-names
694 You can exclude certain recipients from being placed automatically in
695the @samp{CC}, using the variable @code{rmail-dont-reply-to-names}. Its
696value should be a regular expression (as a string); any recipient that
697the regular expression matches, is excluded from the @samp{CC} field.
698The default value matches your own name, and any name starting with
699@samp{info-}. (Those names are excluded because there is a convention
700of using them for large mailing lists to broadcast announcements.)
701
702 To omit the @samp{CC} field completely for a particular reply, enter
703the reply command with a numeric argument: @kbd{C-u r} or @kbd{1 r}.
704This means to reply only to the sender of the original message.
705
706 Once the @samp{*mail*} buffer has been initialized, editing and
707sending the mail goes as usual (@pxref{Sending Mail}). You can edit the
708presupplied header fields if they are not what you want. You can also
709use the commands of Mail mode (@pxref{Mail Mode}), including @kbd{C-c
710C-y} which yanks in the message that you are replying to. You can
711also switch to the Rmail buffer, select a different message there, switch
712back, and yank the new current message.
713
714@kindex M-m @r{(Rmail)}
715@findex rmail-retry-failure
716@cindex retrying a failed message
717@vindex rmail-retry-ignored-headers
718 Sometimes a message does not reach its destination. Mailers usually
719send the failed message back to you, enclosed in a @dfn{failure
720message}. The Rmail command @kbd{M-m} (@code{rmail-retry-failure})
721prepares to send the same message a second time: it sets up a
722@samp{*mail*} buffer with the same text and header fields as before. If
723you type @kbd{C-c C-c} right away, you send the message again exactly
724the same as the first time. Alternatively, you can edit the text or
725headers and then send it. The variable
726@code{rmail-retry-ignored-headers}, in the same format as
727@code{rmail-ignored-headers} (@pxref{Rmail Display}), controls which
728headers are stripped from the failed message when retrying it.
729
730@kindex f @r{(Rmail)}
731@findex rmail-forward
732@cindex forwarding a message
733 Another frequent reason to send mail in Rmail is to @dfn{forward} the
734current message to other users. @kbd{f} (@code{rmail-forward}) makes
735this easy by preinitializing the @samp{*mail*} buffer with the current
736message as the text, and a subject designating a forwarded message. All
737you have to do is fill in the recipients and send. When you forward a
738message, recipients get a message which is ``from'' you, and which has
739the original message in its contents.
740
741@findex unforward-rmail-message
742 Forwarding a message encloses it between two delimiter lines. It also
743modifies every line that starts with a dash, by inserting @w{@samp{- }}
744at the start of the line. When you receive a forwarded message, if it
745contains something besides ordinary text---for example, program source
746code---you might find it useful to undo that transformation. You can do
747this by selecting the forwarded message and typing @kbd{M-x
748unforward-rmail-message}. This command extracts the original forwarded
749message, deleting the inserted @w{@samp{- }} strings, and inserts it
750into the Rmail file as a separate message immediately following the
751current one.
752
753@findex rmail-resend
754 @dfn{Resending} is an alternative similar to forwarding; the
755difference is that resending sends a message that is ``from'' the
756original sender, just as it reached you---with a few added header fields
757@samp{Resent-From} and @samp{Resent-To} to indicate that it came via
758you. To resend a message in Rmail, use @kbd{C-u f}. (@kbd{f} runs
759@code{rmail-forward}, which is programmed to invoke @code{rmail-resend}
760if you provide a numeric argument.)
761
762@kindex m @r{(Rmail)}
763@findex rmail-mail
764 The @kbd{m} (@code{rmail-mail}) command is used to start editing an
765outgoing message that is not a reply. It leaves the header fields empty.
766Its only difference from @kbd{C-x 4 m} is that it makes the Rmail buffer
767accessible for @kbd{C-c C-y}, just as @kbd{r} does. Thus, @kbd{m} can be
768used to reply to or forward a message; it can do anything @kbd{r} or @kbd{f}
769can do.
770
771@kindex c @r{(Rmail)}
772@findex rmail-continue
773 The @kbd{c} (@code{rmail-continue}) command resumes editing the
774@samp{*mail*} buffer, to finish editing an outgoing message you were
775already composing, or to alter a message you have sent.
776
777@vindex rmail-mail-new-frame
778 If you set the variable @code{rmail-mail-new-frame} to a
779non-@code{nil} value, then all the Rmail commands to start sending a
780message create a new frame to edit it in. This frame is deleted when
781you send the message, or when you use the @samp{Cancel} item in the
782@samp{Mail} menu.
783
784 All the Rmail commands to send a message use the mail-composition
785method that you have chosen (@pxref{Mail Methods}).
786
787@node Rmail Summary
788@section Summaries
789@cindex summary (Rmail)
790
791 A @dfn{summary} is a buffer containing one line per message to give
792you an overview of the mail in an Rmail file. Each line shows the
793message number and date, the sender, the line count, the labels, and
794the subject. Moving point in the summary buffer selects messages as
795you move to their summary lines. Almost all Rmail commands are valid
796in the summary buffer also; when used there, they apply to the message
797described by the current line of the summary.
798
799 A summary buffer applies to a single Rmail file only; if you are
800editing multiple Rmail files, each one can have its own summary buffer.
801The summary buffer name is made by appending @samp{-summary} to the
802Rmail buffer's name. Normally only one summary buffer is displayed at a
803time.
804
805@menu
806* Rmail Make Summary:: Making various sorts of summaries.
807* Rmail Summary Edit:: Manipulating messages from the summary.
808@end menu
809
810@node Rmail Make Summary
811@subsection Making Summaries
812
813 Here are the commands to create a summary for the current Rmail file.
814Once the Rmail file has a summary buffer, changes in the Rmail file
815(such as deleting or expunging messages, and getting new mail)
816automatically update the summary.
817
818@table @kbd
819@item h
820@itemx C-M-h
821Summarize all messages (@code{rmail-summary}).
822@item l @var{labels} @key{RET}
823@itemx C-M-l @var{labels} @key{RET}
824Summarize messages that have one or more of the specified labels
825(@code{rmail-summary-by-labels}).
826@item C-M-r @var{rcpts} @key{RET}
827Summarize messages that have one or more of the specified recipients
828(@code{rmail-summary-by-recipients}).
829@item C-M-t @var{topic} @key{RET}
830Summarize messages that have a match for the specified regexp
831@var{topic} in their subjects (@code{rmail-summary-by-topic}).
832@item C-M-s @var{regexp}
833Summarize messages whose headers and the subject line match the
834specified regular expression @var{regexp}
835(@code{rmail-summary-by-regexp}).
836@end table
837
838@kindex h @r{(Rmail)}
839@findex rmail-summary
840 The @kbd{h} or @kbd{C-M-h} (@code{rmail-summary}) command fills the summary buffer
841for the current Rmail file with a summary of all the messages in the file.
842It then displays and selects the summary buffer in another window.
843
844@kindex l @r{(Rmail)}
845@kindex C-M-l @r{(Rmail)}
846@findex rmail-summary-by-labels
847 @kbd{C-M-l @var{labels} @key{RET}} (@code{rmail-summary-by-labels}) makes
848a partial summary mentioning only the messages that have one or more of the
849labels @var{labels}. @var{labels} should contain label names separated by
850commas.
851
852@kindex C-M-r @r{(Rmail)}
853@findex rmail-summary-by-recipients
854 @kbd{C-M-r @var{rcpts} @key{RET}} (@code{rmail-summary-by-recipients})
855makes a partial summary mentioning only the messages that have one or more
856of the recipients @var{rcpts}. @var{rcpts} should contain mailing
857addresses separated by commas.
858
859@kindex C-M-t @r{(Rmail)}
860@findex rmail-summary-by-topic
861 @kbd{C-M-t @var{topic} @key{RET}} (@code{rmail-summary-by-topic})
862makes a partial summary mentioning only the messages whose subjects have
863a match for the regular expression @var{topic}.
864
865@kindex C-M-s @r{(Rmail)}
866@findex rmail-summary-by-regexp
867 @kbd{C-M-s @var{regexp} @key{RET}} (@code{rmail-summary-by-regexp})
868makes a partial summary which mentions only the messages whose headers
869(including the date and the subject lines) match the regular
870expression @var{regexp}.
871
872 Note that there is only one summary buffer for any Rmail file;
873making any kind of summary discards any previous summary.
874
875@vindex rmail-summary-window-size
876@vindex rmail-summary-line-count-flag
877 The variable @code{rmail-summary-window-size} says how many lines to
878use for the summary window. The variable
879@code{rmail-summary-line-count-flag} controls whether the summary line
880for a message should include the line count of the message.
881
882@node Rmail Summary Edit
883@subsection Editing in Summaries
884
885 You can use the Rmail summary buffer to do almost anything you can do
886in the Rmail buffer itself. In fact, once you have a summary buffer,
887there's no need to switch back to the Rmail buffer.
888
889 You can select and display various messages in the Rmail buffer, from
890the summary buffer, just by moving point in the summary buffer to
891different lines. It doesn't matter what Emacs command you use to move
892point; whichever line point is on at the end of the command, that
893message is selected in the Rmail buffer.
894
895 Almost all Rmail commands work in the summary buffer as well as in the
896Rmail buffer. Thus, @kbd{d} in the summary buffer deletes the current
897message, @kbd{u} undeletes, and @kbd{x} expunges. (However, in the
898summary buffer, a numeric argument to @kbd{d}, @kbd{C-d} and @kbd{u}
899serves as a repeat count. A negative argument reverses the meaning of
900@kbd{d} and @kbd{C-d}.) @kbd{o} and @kbd{C-o} output the current
901message to a file; @kbd{r} starts a reply to it. You can scroll the
902current message while remaining in the summary buffer using @key{SPC}
903and @key{DEL}.
904
905 The Rmail commands to move between messages also work in the summary
906buffer, but with a twist: they move through the set of messages included
907in the summary. They also ensure the Rmail buffer appears on the screen
908(unlike cursor motion commands, which update the contents of the Rmail
909buffer but don't display it in a window unless it already appears).
910Here is a list of these commands:
911
912@table @kbd
913@item n
914Move to next line, skipping lines saying `deleted', and select its
915message.
916@item p
917Move to previous line, skipping lines saying `deleted', and select
918its message.
919@item M-n
920Move to next line and select its message.
921@item M-p
922Move to previous line and select its message.
923@item >
924Move to the last line, and select its message.
925@item <
926Move to the first line, and select its message.
927@item j
928@itemx @key{RET}
929Select the message on the current line (ensuring that the RMAIL buffer
930appears on the screen). With argument @var{n}, select message number
931@var{n} and move to its line in the summary buffer; this signals an
932error if the message is not listed in the summary buffer.
933@item M-s @var{pattern} @key{RET}
934Search through messages for @var{pattern} starting with the current
935message; select the message found, and move point in the summary buffer
936to that message's line.
937@end table
938
939@vindex rmail-redisplay-summary
940 Deletion, undeletion, and getting new mail, and even selection of a
941different message all update the summary buffer when you do them in the
942Rmail buffer. If the variable @code{rmail-redisplay-summary} is
943non-@code{nil}, these actions also bring the summary buffer back onto
944the screen.
945
946@kindex Q @r{(Rmail summary)}
947@findex rmail-summary-wipe
948@kindex q @r{(Rmail summary)}
949@findex rmail-summary-quit
950 When you are finished using the summary, type @kbd{Q}
951(@code{rmail-summary-wipe}) to delete the summary buffer's window. You
952can also exit Rmail while in the summary: @kbd{q}
953(@code{rmail-summary-quit}) deletes the summary window, then exits from
954Rmail by saving the Rmail file and switching to another buffer.
955
956@node Rmail Sorting
957@section Sorting the Rmail File
958
959@table @kbd
960@item M-x rmail-sort-by-date
961Sort messages of current Rmail file by date.
962
963@item M-x rmail-sort-by-subject
964Sort messages of current Rmail file by subject.
965
966@item M-x rmail-sort-by-author
967Sort messages of current Rmail file by author's name.
968
969@item M-x rmail-sort-by-recipient
970Sort messages of current Rmail file by recipient's names.
971
972@item M-x rmail-sort-by-correspondent
973Sort messages of current Rmail file by the name of the other
974correspondent.
975
976@item M-x rmail-sort-by-lines
977Sort messages of current Rmail file by size (number of lines).
978
979@item M-x rmail-sort-by-keywords @key{RET} @var{labels} @key{RET}
980Sort messages of current Rmail file by labels. The argument
981@var{labels} should be a comma-separated list of labels. The order of
982these labels specifies the order of messages; messages with the first
983label come first, messages with the second label come second, and so on.
984Messages which have none of these labels come last.
985@end table
986
987 The Rmail sort commands perform a @emph{stable sort}: if there is no
988reason to prefer either one of two messages, their order remains
989unchanged. You can use this to sort by more than one criterion. For
990example, if you use @code{rmail-sort-by-date} and then
991@code{rmail-sort-by-author}, messages from the same author appear in
992order by date.
993
994 With a numeric argument, all these commands reverse the order of
995comparison. This means they sort messages from newest to oldest, from
996biggest to smallest, or in reverse alphabetical order.
997
998@node Rmail Display
999@section Display of Messages
1000
1001 Rmail reformats the header of each message before displaying it for
1002the first time. Reformatting hides uninteresting header fields to
1003reduce clutter. You can use the @kbd{t} command to show the entire
1004header or to repeat the header reformatting operation.
1005
1006@table @kbd
1007@item t
1008Toggle display of complete header (@code{rmail-toggle-header}).
1009@end table
1010
1011@vindex rmail-ignored-headers
1012@vindex rmail-nonignored-headers
1013 Reformatting the header involves deleting most header fields, on the
1014grounds that they are not interesting. The variable
1015@code{rmail-ignored-headers} holds a regular expression that specifies
1016which header fields to hide in this way---if it matches the beginning
1017of a header field, that whole field is hidden. However, the variable
1018@code{rmail-nonignored-headers} provides a further override: a header
1019matching that regular expression is shown even if it matches
1020@code{rmail-ignored-headers} too.
1021
1022@kindex t @r{(Rmail)}
1023@findex rmail-toggle-header
1024 Rmail saves the complete original header before reformatting; to see
1025it, use the @kbd{t} command (@code{rmail-toggle-header}). This
1026discards the reformatted headers of the current message and displays
1027it with the original header. Repeating @kbd{t} reformats the message
1028again, which shows only the interesting headers according to the
1029current values of those variable. Selecting the message again also
1030reformats it if necessary.
1031
1032 One consequence of this is that if you edit the reformatted header
1033(using @kbd{e}; @pxref{Rmail Editing}), subsequent use of @kbd{t} will
1034discard your edits. On the other hand, if you use @kbd{e} after
1035@kbd{t}, to edit the original (unreformatted) header, those changes are
1036permanent.
1037
1038 When the @kbd{t} command has a prefix argument, a positive argument
1039means to show the reformatted header, and a zero or negative argument
1040means to show the full header.
1041
1042@vindex rmail-highlighted-headers
1043 When the terminal supports multiple fonts or colors, Rmail
1044highlights certain header fields that are especially interesting---by
1045default, the @samp{From} and @samp{Subject} fields. The variable
1046@code{rmail-highlighted-headers} holds a regular expression that
1047specifies the header fields to highlight; if it matches the beginning
1048of a header field, that whole field is highlighted.
1049
1050 If you specify unusual colors for your text foreground and
1051background, the colors used for highlighting may not go well with
1052them. If so, specify different colors by setting the variable
1053@code{rmail-highlight-face} to a suitable face. To turn off
1054highlighting entirely in Rmail, set @code{rmail-highlighted-headers}
1055to @code{nil}.
1056
1057 You can highlight and activate URLs in incoming messages by adding
1058the function @code{goto-address} to the hook
1059@code{rmail-show-message-hook}. Then you can browse these URLs by
1060clicking on them with @kbd{Mouse-2} (or @kbd{Mouse-1} quickly) or by
1061moving to one and typing @kbd{C-c @key{RET}}. @xref{Goto-address,
1062Activating URLs, Activating URLs}.
1063
1064@node Rmail Coding
1065@section Rmail and Coding Systems
1066
1067@cindex decoding mail messages (Rmail)
1068 Rmail automatically decodes messages which contain non-@acronym{ASCII}
1069characters, just as Emacs does with files you visit and with subprocess
1070output. Rmail uses the standard @samp{charset=@var{charset}} header in
1071the message, if any, to determine how the message was encoded by the
1072sender. It maps @var{charset} into the corresponding Emacs coding
1073system (@pxref{Coding Systems}), and uses that coding system to decode
1074message text. If the message header doesn't have the @samp{charset}
1075specification, or if @var{charset} is not recognized,
1076Rmail chooses the coding system with the usual Emacs heuristics and
1077defaults (@pxref{Recognize Coding}).
1078
1079@cindex fixing incorrectly decoded mail messages
1080 Occasionally, a message is decoded incorrectly, either because Emacs
1081guessed the wrong coding system in the absence of the @samp{charset}
1082specification, or because the specification was inaccurate. For
1083example, a misconfigured mailer could send a message with a
1084@samp{charset=iso-8859-1} header when the message is actually encoded
1085in @code{koi8-r}. When you see the message text garbled, or some of
1086its characters displayed as empty boxes, this may have happened.
1087
1088@findex rmail-redecode-body
1089 You can correct the problem by decoding the message again using the
1090right coding system, if you can figure out or guess which one is
1091right. To do this, invoke the @kbd{M-x rmail-redecode-body} command.
1092It reads the name of a coding system, encodes the message body using
1093whichever coding system was used to decode it before, then redecodes
1094it using the coding system you specified. If you specified the right
1095coding system, the result should be readable.
1096
1097 Decoding and encoding using the wrong coding system is lossless for
1098most encodings, in particular with 8-bit encodings such as iso-8859 or
1099koi8. So, if the initial attempt to redecode the message didn't
1100result in a legible text, you can try other coding systems until you
1101succeed.
1102
1103 With some coding systems, notably those from the iso-2022 family,
1104information can be lost in decoding, so that encoding the message
1105again won't bring back the original incoming text. In such a case,
1106@code{rmail-redecode-body} cannot work. However, the problems that
1107call for use of @code{rmail-redecode-body} rarely occur with those
1108coding systems. So in practice the command works when you need it.
1109
1110@node Rmail Editing
1111@section Editing Within a Message
1112
1113 Most of the usual Emacs commands are available in Rmail mode, though a
1114few, such as @kbd{C-M-n} and @kbd{C-M-h}, are redefined by Rmail for
1115other purposes. However, the Rmail buffer is normally read only, and
1116most of the letters are redefined as Rmail commands. If you want to
1117edit the text of a message, you must use the Rmail command @kbd{e}.
1118
1119@table @kbd
1120@item e
1121Edit the current message as ordinary text.
1122@end table
1123
1124@kindex e @r{(Rmail)}
1125@findex rmail-edit-current-message
1126 The @kbd{e} command (@code{rmail-edit-current-message}) switches from
1127Rmail mode into Rmail Edit mode, another major mode which is nearly the
1128same as Text mode. The mode line indicates this change.
1129
1130 In Rmail Edit mode, letters insert themselves as usual and the Rmail
1131commands are not available. When you are finished editing the message and
1132are ready to go back to Rmail, type @kbd{C-c C-c}, which switches back to
1133Rmail mode. Alternatively, you can return to Rmail mode but cancel all the
1134editing that you have done, by typing @kbd{C-c C-]}.
1135
1136@vindex rmail-edit-mode-hook
1137 Entering Rmail Edit mode runs the hook @code{text-mode-hook}; then it
1138runs the hook @code{rmail-edit-mode-hook} (@pxref{Hooks}). It adds the
1139attribute @samp{edited} to the message. It also displays the full
1140headers of the message, so that you can edit the headers as well as the
1141body of the message, and your changes in the headers will be
1142permanent.
1143
1144@node Rmail Digest
1145@section Digest Messages
1146@cindex digest message
1147@cindex undigestify
1148
1149 A @dfn{digest message} is a message which exists to contain and carry
1150several other messages. Digests are used on some moderated mailing
1151lists; all the messages that arrive for the list during a period of time
1152such as one day are put inside a single digest which is then sent to the
1153subscribers. Transmitting the single digest uses much less computer
1154time than transmitting the individual messages even though the total
1155size is the same, because the per-message overhead in network mail
1156transmission is considerable.
1157
1158@findex undigestify-rmail-message
1159 When you receive a digest message, the most convenient way to read it is
1160to @dfn{undigestify} it: to turn it back into many individual messages.
1161Then you can read and delete the individual messages as it suits you.
1162To do this, select the digest message and type the command @kbd{M-x
1163undigestify-rmail-message}. This extracts the submessages as separate
1164Rmail messages, and inserts them following the digest. The digest
1165message itself is flagged as deleted.
1166
1167@node Out of Rmail
1168@section Converting an Rmail File to Inbox Format
1169@cindex Babyl format to Inbox format
1170@cindex converting Rmail file to mailbox format
1171
1172@findex unrmail
1173 The command @kbd{M-x unrmail} converts a file in Rmail format to inbox
1174format (also known as the system mailbox, or mbox, format), so that
1175you can use it with other mail-editing tools. You must specify two
1176arguments, the name of the Rmail file and the name to use for the
1177converted file. @kbd{M-x unrmail} does not alter the Rmail file itself.
1178
1179@pindex b2m
1180 @kbd{M-x unrmail} is useful if you can run Emacs on the machine
1181where the Rmail file resides, or can access the Rmail file remotely
1182(@pxref{Remote Files}) from a machine where Emacs is installed. If
1183accessing Rmail files from Emacs is impossible, you can use the
1184@command{b2m} program instead. @command{b2m} is part of the Emacs
1185distribution, it is installed into the same directory where all the
1186other auxiliary programs (@command{etags} etc.) are installed, and its
1187source is available in the Emacs source distribution, so that you
1188could copy the source to the target machine and compile it there.
1189
1190 To convert a file @file{@var{babyl-file}} into @file{@var{mbox-file}},
1191invoke @command{b2m} like this:
1192
1193@example
1194 b2m < @var{babyl-file} > @var{mbox-file}
1195@end example
1196
1197@node Rmail Rot13
1198@section Reading Rot13 Messages
1199@cindex rot13 code
1200
1201 Mailing list messages that might offend some readers are sometimes
1202encoded in a simple code called @dfn{rot13}---so named because it
1203rotates the alphabet by 13 letters. This code is not for secrecy, as it
1204provides none; rather, it enables those who might be offended to avoid
1205seeing the real text of the message.
1206
1207@findex rot13-other-window
1208 To view a buffer which uses the rot13 code, use the command @kbd{M-x
1209rot13-other-window}. This displays the current buffer in another window
1210which applies the code when displaying the text.
1211
1212@node Movemail
1213@section @code{movemail} program
1214@cindex @code{movemail} program
1215
1216 When invoked for the first time, Rmail attempts to locate the
1217@code{movemail} program and determine its version. There are two
1218versions of @code{movemail} program: the native one, shipped with GNU
1219Emacs (the ``emacs version'') and the one included in GNU mailutils
1220(the ``mailutils version,'' @pxref{movemail,,,mailutils,GNU
1221mailutils}). They support the same command line syntax and the same
1222basic subset of options. However, the Mailutils version offers
1223additional features.
1224
1225 The Emacs version of @code{movemail} is able to retrieve mail from
1226usual UNIX mailbox formats and from remote mailboxes using the POP3
1227protocol.
1228
1229 The Mailutils version is able to handle a wide set of mailbox
1230formats, such as plain UNIX mailboxes, @code{maildir} and @code{MH}
1231mailboxes, etc. It is able to retrieve remote mail using POP3 or
1232IMAP4 protocol, and can retrieve mail from them using a TLS encrypted
1233channel. It also accepts mailbox argument in the @acronym{URL} form.
1234The detailed description of mailbox @acronym{URL}s can be found in
1235@ref{URL,,,mailutils,Mailbox URL Formats}. In short, a @acronym{URL}
1236is:
1237
1238@smallexample
1239@var{proto}://[@var{user}[:@var{password}]@@]@var{host-or-file-name}
1240@end smallexample
1241
1242@noindent
1243where square brackets denote optional elements.
1244
1245@table @var
1246@item proto
1247Specifies the @dfn{mailbox protocol}, or @dfn{format} to
1248use. The exact semantics of the rest of @acronym{URL} elements depends
1249on the actual value of @var{proto} (see below).
1250
1251@item user
1252User name to access the remote mailbox.
1253
1254@item password
1255User password to access the remote mailbox.
1256
1257@item host-or-file-name
1258Hostname of the remote server for remote mailboxes or file name of a
1259local mailbox.
1260@end table
1261
1262@noindent
1263@var{Proto} can be one of:
1264
1265@table @code
1266@item mbox
1267Usual UNIX mailbox format. In this case, neither @var{user} nor
1268@var{pass} are used, and @var{host-or-file-name} denotes the file name of
1269the mailbox file, e.g., @code{mbox://var/spool/mail/smith}.
1270
1271@item mh
1272A local mailbox in the @acronym{MH} format. @var{User} and
1273@var{pass} are not used. @var{Host-or-file-name} denotes the name of
1274@acronym{MH} folder, e.g., @code{mh://Mail/inbox}.
1275
1276@item maildir
1277A local mailbox in the @acronym{maildir} format. @var{User} and
1278@var{pass} are not used, and @var{host-or-file-name} denotes the name of
1279@code{maildir} mailbox, e.g., @code{maildir://mail/inbox}.
1280
1281@item file
1282Any local mailbox format. Its actual format is detected automatically
1283by @code{movemail}.
1284
1285@item pop
1286A remote mailbox to be accessed via POP3 protocol. @var{User}
1287specifies the remote user name to use, @var{pass} may be used to
1288specify the user password, @var{host-or-file-name} is the name or IP
1289address of the remote mail server to connect to; e.g.,
1290@code{pop://smith:guessme@@remote.server.net}.
1291
1292@item imap
1293A remote mailbox to be accessed via IMAP4 protocol. @var{User}
1294specifies the remote user name to use, @var{pass} may be used to
1295specify the user password, @var{host-or-file-name} is the name or IP
1296address of the remote mail server to connect to;
1297e.g., @code{imap://smith:guessme@@remote.server.net}.
1298@end table
1299
1300 Alternatively, you can specify the file name of the mailbox to use.
1301This is equivalent to specifying the @samp{file} protocol:
1302
1303@smallexample
1304/var/spool/mail/@var{user} @equiv{} file://var/spool/mail/@var{user}
1305@end smallexample
1306
1307@vindex rmail-movemail-program
1308@vindex rmail-movemail-search-path
1309 The variable @code{rmail-movemail-program} controls which version of
1310@code{movemail} to use. If that is a string, it specifies the
1311absolute file name of the @code{movemail} executable. If it is
1312@code{nil}, Rmail searches for @code{movemail} in the directories
1313listed in @code{rmail-movemail-search-path} and @code{exec-path}, then
1314in @code{exec-directory}.
1315
1316@node Remote Mailboxes
1317@section Retrieving Mail from Remote Mailboxes
1318@pindex movemail
1319
1320 Some sites use a method called POP for accessing users' inbox data
1321instead of storing the data in inbox files. The @code{Emacs
1322movemail} can work with POP if you compile it with the macro
1323@code{MAIL_USE_POP} defined. (You can achieve that by specifying
1324@samp{--with-pop} when you run @code{configure} during the
1325installation of Emacs.)
1326
1327The Mailutils @code{movemail} by default supports POP, unless it was
1328configured with @samp{--disable-pop} option.
1329
1330Both versions of @code{movemail} only work with POP3, not with older
1331versions of POP.
1332
1333@cindex @env{MAILHOST} environment variable
1334@cindex POP mailboxes
1335 No matter which flavor of @code{movemail} you use, you can specify
1336POP inbox by using POP @dfn{URL} (@pxref{Movemail}). A POP
1337@acronym{URL} is a ``file name'' of the form
1338@samp{pop://@var{username}@@@var{hostname}}, where
1339@var{hostname} is the host name or IP address of the remote mail
1340server and @var{username} is the user name on that server.
1341Additionally, you may specify the password in the mailbox @acronym{URL}:
1342@samp{pop://@var{username}:@var{password}@@@var{hostname}}. In this
1343case, @var{password} takes preference over the one set by
1344@code{rmail-remote-password}. This is especially useful if you have
1345several remote mailboxes with different passwords.
1346
1347 For backward compatibility, Rmail also supports two alternative ways
1348of specifying remote POP mailboxes. First, specifying an inbox name
1349in the form @samp{po:@var{username}:@var{hostname}} is equivalent to
1350@samp{pop://@var{username}@@@var{hostname}}. Alternatively, you may
1351set a ``file name'' of @samp{po:@var{username}} in the inbox list of
1352an Rmail file. @code{movemail} will handle such a name by opening a
1353connection to the POP server. In this case, the @env{MAILHOST}
1354environment variable specifies the machine on which to look for the
1355POP server.
1356
1357@cindex IMAP mailboxes
1358 Another method for accessing remote mailboxes is IMAP. This method is
1359supported only by the Mailutils @code{movemail}. To specify an IMAP
1360mailbox in the inbox list, use the following mailbox @acronym{URL}:
1361@samp{imap://@var{username}[:@var{password}]@@@var{hostname}}. The
1362@var{password} part is optional, as described above.
1363
1364@vindex rmail-remote-password
1365@vindex rmail-remote-password-required
1366@vindex rmail-pop-password
1367@vindex rmail-pop-password-required
1368 Accessing a remote mailbox may require a password. Rmail uses the
1369following algorithm to retrieve it:
1370
1371@enumerate
1372@item
1373If the @var{password} is present in mailbox URL (see above), it is
1374used.
1375@item
1376If the variable @code{rmail-remote-password} is non-@code{nil}, its
1377value is used.
1378@item
1379Otherwise, if @code{rmail-remote-password-required} is non-@code{nil},
1380then Rmail will ask you for the password to use.
1381@item
1382Otherwise, Rmail assumes no password is required.
1383@end enumerate
1384
1385 For compatibility with previous versions, the variables
1386@code{rmail-pop-password} and @code{rmail-pop-password-required} may
1387be used instead of @code{rmail-remote-password} and
1388@code{rmail-remote-password-required}.
1389
1390@vindex rmail-movemail-flags
1391 If you need to pass additional command-line flags to @code{movemail},
1392set the variable @code{rmail-movemail-flags} a list of the flags you
1393wish to use. Do not use this variable to pass the @samp{-p} flag to
1394preserve your inbox contents; use @code{rmail-preserve-inbox} instead.
1395
1396@cindex Kerberos POP authentication
1397 The @code{movemail} program installed at your site may support
1398Kerberos authentication. If it is
1399supported, it is used by default whenever you attempt to retrieve
1400POP mail when @code{rmail-pop-password} and
1401@code{rmail-pop-password-required} are unset.
1402
1403@cindex reverse order in POP inboxes
1404 Some POP servers store messages in reverse order. If your server does
1405this, and you would rather read your mail in the order in which it was
1406received, you can tell @code{movemail} to reverse the order of
1407downloaded messages by adding the @samp{-r} flag to
1408@code{rmail-movemail-flags}.
1409
1410@cindex TLS encryption (Rmail)
1411 Mailutils @code{movemail} supports TLS encryption. If you wish to
1412use it, add the @samp{--tls} flag to @code{rmail-movemail-flags}.
1413
1414@node Other Mailbox Formats
1415@section Retrieving Mail from Local Mailboxes in Various Formats
1416
1417 If your incoming mail is stored on a local machine in a format other
1418than UNIX mailbox, you will need the Mailutils @code{movemail} to
1419retrieve it. @xref{Movemail}, for the detailed description of
1420@code{movemail} versions. For example, to access mail from a inbox in
1421@code{maildir} format located in @file{/var/spool/mail/in}, you would
1422include the following in the Rmail inbox list:
1423
1424@smallexample
1425maildir://var/spool/mail/in
1426@end smallexample
1427
1428@ignore
1429 arch-tag: 034965f6-38df-47a2-a9f1-b8bc8ab37e23
1430@end ignore
diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi
new file mode 100644
index 00000000000..90ec645a26f
--- /dev/null
+++ b/doc/emacs/screen.texi
@@ -0,0 +1,359 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Screen, User Input, Acknowledgments, Top
6@chapter The Organization of the Screen
7@cindex screen
8@cindex parts of the screen
9
10 On a text-only terminal, the Emacs display occupies the whole
11screen. On a graphical display, such as on GNU/Linux using the X
12Window System, Emacs creates its own windows to use. We use the term
13@dfn{frame} to mean the entire text-only screen or an entire
14system-level window used by Emacs. Emacs uses both kinds of frames,
15in the same way, to display your editing. Emacs normally starts out
16with just one frame, but you can create additional frames if you wish.
17@xref{Frames}.
18
19 When you start Emacs, the main central area of the frame, all except
20for the top and bottom and sides, displays the text you are editing.
21This area is called @dfn{the window}. At the top there is normally a
22@dfn{menu bar} where you can access a series of menus; then there may
23be a @dfn{tool bar}, a row of icons that perform editing commands if
24you click on them. Below this, the window begins, often with a
25@dfn{scroll bar} on one side. Below the window comes the last line of
26the frame, a special @dfn{echo area} or @dfn{minibuffer window}, where
27prompts appear and you enter information when Emacs asks for it. See
28following sections for more information about these special lines.
29
30 You can subdivide the window horizontally or vertically to make
31multiple text windows, each of which can independently display some
32file or text (@pxref{Windows}). In this manual, the word ``window''
33refers to the initial large window if not subdivided, or any one of
34the multiple windows you have subdivided it into.
35
36 At any time, one window is the @dfn{selected window}. On graphical
37displays, the selected window normally shows a more prominent cursor
38(usually solid and blinking) while other windows show a weaker cursor
39(such as a hollow box). Text terminals have just one cursor, so it
40always appears in the selected window.
41
42 Most Emacs commands implicitly apply to the text in the selected
43window; the text in unselected windows is mostly visible for
44reference. However, mouse commands generally operate on whatever
45window you click them in, whether selected or not. If you use
46multiple frames on a graphical display, then giving the input focus to
47a particular frame selects a window in that frame.
48
49 Each window's last line is a @dfn{mode line}, which describes what
50is going on in that window. It appears in different color and/or a ``3D''
51box if the terminal supports them; its contents normally begin with
52@w{@samp{--:-- @ *scratch*}} when Emacs starts. The mode line
53displays status information such as what buffer is being displayed
54above it in the window, what major and minor modes are in use, and
55whether the buffer contains unsaved changes.
56
57@menu
58* Point:: The place in the text where editing commands operate.
59* Echo Area:: Short messages appear at the bottom of the screen.
60* Mode Line:: Interpreting the mode line.
61* Menu Bar:: How to use the menu bar.
62@end menu
63
64@node Point
65@section Point
66@cindex point
67@cindex cursor
68
69 Within Emacs, the active cursor shows the location at which
70editing commands will take effect. This location is called @dfn{point}.
71Many Emacs commands move point through the text, so that you can edit at
72different places in it. You can also place point by clicking mouse
73button 1 (normally the left button).
74
75 While the cursor appears to be @emph{on} a character, you should
76think of point as @emph{between} two characters; it points @emph{before}
77the character that appears under the cursor. For example, if your text
78looks like @samp{frob} with the cursor over the @samp{b}, then point is
79between the @samp{o} and the @samp{b}. If you insert the character
80@samp{!} at that position, the result is @samp{fro!b}, with point
81between the @samp{!} and the @samp{b}. Thus, the cursor remains over
82the @samp{b}, as before.
83
84 Sometimes people speak of ``the cursor'' when they mean ``point,'' or
85speak of commands that move point as ``cursor motion'' commands.
86
87 If you are editing several files in Emacs, each in its own buffer,
88each buffer has its own point location. A buffer that is not
89currently displayed remembers its point location in case you display
90it again later. When Emacs displays multiple windows, each window has
91its own point location. If the same buffer appears in more than one
92window, each window has its own point position in that buffer, and (when
93possible) its own cursor.
94
95 A text-only terminal has just one cursor, in the selected window.
96The other windows do not show a cursor, even though they do have their
97own position of point. When Emacs updates the screen on a text-only
98terminal, it has to put the cursor temporarily at the place the output
99goes. This doesn't mean point is there, though. Once display
100updating finishes, Emacs puts the cursor where point is.
101
102 On graphical displays, Emacs shows a cursor in each window; the
103selected window's cursor is solid and blinking, and the other cursors
104are just hollow. Thus, the most prominent cursor always shows you the
105selected window, on all kinds of terminals.
106
107 @xref{Cursor Display}, for customizable variables that control display
108of the cursor or cursors.
109
110 The term ``point'' comes from the character @samp{.}, which was the
111command in TECO (the language in which the original Emacs was written)
112for accessing the value now called ``point.''
113
114@node Echo Area
115@section The Echo Area
116@cindex echo area
117
118 The line at the bottom of the frame (below the mode line) is the
119@dfn{echo area}. It is used to display small amounts of text for
120various purposes.
121
122 @dfn{Echoing} means displaying the characters that you type. At the
123command line, the operating system normally echoes all your input.
124Emacs handles echoing differently.
125
126 Single-character commands do not echo in Emacs, and multi-character
127commands echo only if you pause while typing them. As soon as you pause
128for more than a second in the middle of a command, Emacs echoes all the
129characters of the command so far. This is to @dfn{prompt} you for the
130rest of the command. Once echoing has started, the rest of the command
131echoes immediately as you type it. This behavior is designed to give
132confident users fast response, while giving hesitant users maximum
133feedback. You can change this behavior by setting a variable
134(@pxref{Display Custom}).
135
136@cindex error message in the echo area
137 If a command cannot do its job, it may display an @dfn{error
138message} in the echo area. Error messages are accompanied by beeping
139or by flashing the screen. The error also discards any input you have
140typed ahead.
141
142 Some commands display informative messages in the echo area. These
143messages look much like error messages, but they are not announced
144with a beep and do not throw away input. Sometimes the message tells
145you what the command has done, when this is not obvious from looking
146at the text being edited. Sometimes the sole purpose of a command is
147to show you a message giving you specific information---for example,
148@kbd{C-x =} (hold down @key{CTRL} and type @kbd{x}, then let go of
149@key{CTRL} and type @kbd{=}) displays a message describing the
150character position of point in the text and its current column in the
151window. Commands that take a long time often display messages ending
152in @samp{...} while they are working, and add @samp{done} at the end
153when they are finished. They may also indicate progress with
154percentages.
155
156@cindex @samp{*Messages*} buffer
157@cindex saved echo area messages
158@cindex messages saved from echo area
159 Echo-area informative messages are saved in an editor buffer named
160@samp{*Messages*}. (We have not explained buffers yet; see
161@ref{Buffers}, for more information about them.) If you miss a message
162that appears briefly on the screen, you can switch to the
163@samp{*Messages*} buffer to see it again. (Successive progress messages
164are often collapsed into one in that buffer.)
165
166@vindex message-log-max
167 The size of @samp{*Messages*} is limited to a certain number of
168lines. The variable @code{message-log-max} specifies how many lines.
169Once the buffer has that many lines, adding lines at the end deletes lines
170from the beginning, to keep the size constant. @xref{Variables}, for
171how to set variables such as @code{message-log-max}.
172
173 The echo area is also used to display the @dfn{minibuffer}, a window
174where you can input arguments to commands, such as the name of a file
175to be edited. When the minibuffer is in use, the echo area begins
176with a prompt string that usually ends with a colon; also, the cursor
177appears in that line because it is the selected window. You can
178always get out of the minibuffer by typing @kbd{C-g}.
179@xref{Minibuffer}.
180
181@node Mode Line
182@section The Mode Line
183@cindex mode line
184@cindex top level
185@c
186
187 Each text window's last line is a @dfn{mode line}, which describes
188what is going on in that window. The mode line starts and ends with
189dashes. When there is only one text window, the mode line appears
190right above the echo area; it is the next-to-last line in the frame.
191On a text-only terminal, the mode line is in inverse video if the
192terminal supports that; on a graphics display, the mode line has a 3D
193box appearance to help it stand out. The mode line of the selected
194window is highlighted if possible; see @ref{Optional Mode Line}, for
195more information.
196
197 Normally, the mode line looks like this:
198
199@example
200-@var{cs}:@var{ch}@var{R}-@var{fr} @var{buf} @var{pos} @var{line} (@var{major} @var{minor})------
201@end example
202
203@noindent
204This gives information about the window and the buffer it displays: the
205buffer's name, what major and minor modes are in use, whether the
206buffer's text has been changed, and how far down the buffer you are
207currently looking.
208
209 @var{ch} contains two stars @samp{**} if the text in the buffer has
210been edited (the buffer is ``modified''), or @samp{--} if the buffer has
211not been edited. For a read-only buffer, it is @samp{%*} if the buffer
212is modified, and @samp{%%} otherwise.
213
214 @var{R} is @samp{@@} if the default-directory for the current buffer
215is on a remote machine, or a hyphen otherwise.
216
217 @var{fr} gives the selected frame name (@pxref{Frames}). It appears
218only on text-only terminals. The initial frame's name is @samp{F1}.
219
220 @var{buf} is the name of the window's @dfn{buffer}. Usually this is
221the same as the name of a file you are editing. @xref{Buffers}.
222
223 The buffer displayed in the selected window (the window with the
224cursor) is the @dfn{current buffer}, where editing happens. When a
225command's effect applies to ``the buffer,'' we mean it does those
226things to the current buffer.
227
228 @var{pos} tells you whether there is additional text above the top of
229the window, or below the bottom. If your buffer is small and it is all
230visible in the window, @var{pos} is @samp{All}. Otherwise, it is
231@samp{Top} if you are looking at the beginning of the buffer, @samp{Bot}
232if you are looking at the end of the buffer, or @samp{@var{nn}%}, where
233@var{nn} is the percentage of the buffer above the top of the window.
234With Size Indication mode, you can display the size of the buffer as
235well. @xref{Optional Mode Line}.
236
237 @var{line} is @samp{L} followed by the current line number of point.
238This is present when Line Number mode is enabled (it normally is).
239You can display the current column number too, by turning on Column
240Number mode. It is not enabled by default because it is somewhat
241slower. @xref{Optional Mode Line}.
242
243 @var{major} is the name of the @dfn{major mode} in effect in the
244buffer. A buffer can only be in one major mode at a time. The major
245modes available include Fundamental mode (the least specialized), Text
246mode, Lisp mode, C mode, Texinfo mode, and many others. @xref{Major
247Modes}, for details of how the modes differ and how to select
248them.
249
250 Some major modes display additional information after the major mode
251name. For example, Rmail buffers display the current message number and
252the total number of messages. Compilation buffers and Shell buffers
253display the status of the subprocess.
254
255 @var{minor} is a list of some of the @dfn{minor modes} that are
256turned on at the moment in the window's chosen buffer. For example,
257@samp{Fill} means that Auto Fill mode is on. @samp{Abbrev} means that
258Word Abbrev mode is on. @samp{Ovwrt} means that Overwrite mode is on.
259@xref{Minor Modes}, for more information.
260
261 @samp{Narrow} means that the buffer being displayed has editing
262restricted to only a portion of its text. (This is not really a minor
263mode, but is like one.) @xref{Narrowing}. @samp{Def} means that a
264keyboard macro is being defined. @xref{Keyboard Macros}.
265
266 In addition, if Emacs is inside a recursive editing level, square
267brackets (@samp{[@dots{}]}) appear around the parentheses that
268surround the modes. If Emacs is in one recursive editing level within
269another, double square brackets appear, and so on. Since recursive
270editing levels affect Emacs globally, not just one buffer, the square
271brackets appear in every window's mode line or not in any of them.
272@xref{Recursive Edit}.@refill
273
274 @var{cs} states the coding system used for the file you are editing.
275A dash indicates the default state of affairs: no code conversion,
276except for end-of-line translation if the file contents call for that.
277@samp{=} means no conversion whatsoever. Nontrivial code conversions
278are represented by various letters---for example, @samp{1} refers to ISO
279Latin-1. @xref{Coding Systems}, for more information.
280
281 On a text-only terminal, @var{cs} includes two additional characters
282which describe the coding system for keyboard input and the coding
283system for terminal output. They come right before the coding system
284used for the file you are editing.
285
286 If you are using an input method, a string of the form
287@samp{@var{i}>} is added to the beginning of @var{cs}; @var{i}
288identifies the input method. (Some input methods show @samp{+} or
289@samp{@@} instead of @samp{>}.) @xref{Input Methods}.
290
291 When multibyte characters are not enabled, @var{cs} does not appear at
292all. @xref{Enabling Multibyte}.
293
294@cindex end-of-line conversion, mode-line indication
295 The colon after @var{cs} changes to another string in some cases.
296Emacs uses newline characters to separate lines in the buffer. Some
297files use different conventions for separating lines: either
298carriage-return linefeed (the MS-DOS convention) or just
299carriage-return (the Macintosh convention). If the buffer's file uses
300carriage-return linefeed, the colon changes to either a backslash
301(@samp{\}) or @samp{(DOS)}, depending on the operating system. If the
302file uses just carriage-return, the colon indicator changes to either
303a forward slash (@samp{/}) or @samp{(Mac)}. On some systems, Emacs
304displays @samp{(Unix)} instead of the colon for files that use newline
305as the line separator.
306
307 @xref{Optional Mode Line}, to add other handy information to the
308mode line, such as the size of the buffer, the current column number
309of point, and whether new mail for you has arrived.
310
311 The mode line is mouse-sensitive; when you move the mouse across
312various parts of it, Emacs displays help text to say what a click in
313that place will do. @xref{Mode Line Mouse}.
314
315@node Menu Bar
316@section The Menu Bar
317@cindex menu bar
318
319 Each Emacs frame normally has a @dfn{menu bar} at the top which you
320can use to perform common operations. There's no need to list them
321here, as you can more easily see them yourself.
322
323@kindex M-`
324@kindex F10
325@findex tmm-menubar
326@findex menu-bar-open
327 On a graphical display, you can use the mouse to choose a command
328from the menu bar. A right-arrow at the end of the menu item means it
329leads to a subsidiary menu; @samp{...} at the end means that the
330command invoked will read arguments (further input from you) before it
331actually does anything.
332
333 You can also invoke the first menu bar item by pressing @key{F10} (to run
334the command @code{menu-bar-open}). You can then navigate the menus with
335the arrow keys. You select an item by pressing @key{RET} and cancel menu
336navigation with @key{ESC}.
337
338 To view the full command name and documentation for a menu item, type
339@kbd{C-h k}, and then select the menu bar with the mouse in the usual
340way (@pxref{Key Help}).
341
342 On text-only terminals with no mouse, you can use the menu bar by
343typing @kbd{M-`} or @key{F10} (these run the command
344@code{tmm-menubar}). This lets you select a menu item with the
345keyboard. A provisional choice appears in the echo area. You can use
346the up and down arrow keys to move through the menu to different
347items, and then you can type @key{RET} to select the item.
348
349 Each menu item also has an assigned letter or digit which designates
350that item; it is usually the initial of some word in the item's name.
351This letter or digit is separated from the item name by @samp{=>}. You
352can type the item's letter or digit to select the item.
353
354 Some of the commands in the menu bar have ordinary key bindings as
355well; one such binding is shown in parentheses after the item itself.
356
357@ignore
358 arch-tag: 104ba40e-d972-4866-a542-a98be94bdf2f
359@end ignore
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
new file mode 100644
index 00000000000..1a8a6372ba2
--- /dev/null
+++ b/doc/emacs/search.texi
@@ -0,0 +1,1361 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Search, Fixit, Display, Top
6@chapter Searching and Replacement
7@cindex searching
8@cindex finding strings within text
9
10 Like other editors, Emacs has commands for searching for occurrences of
11a string. The principal search command is unusual in that it is
12@dfn{incremental}; it begins to search before you have finished typing the
13search string. There are also nonincremental search commands more like
14those of other editors.
15
16 Besides the usual @code{replace-string} command that finds all
17occurrences of one string and replaces them with another, Emacs has a
18more flexible replacement command called @code{query-replace}, which
19asks interactively which occurrences to replace. There are also
20commands to find and operate on all matches for a pattern.
21
22 You can also search multiple files under control of a tags
23table (@pxref{Tags Search}) or through the Dired @kbd{A} command
24(@pxref{Operating on Files}), or ask the @code{grep} program to do it
25(@pxref{Grep Searching}).
26
27
28@menu
29* Incremental Search:: Search happens as you type the string.
30* Nonincremental Search:: Specify entire string and then search.
31* Word Search:: Search for sequence of words.
32* Regexp Search:: Search for match for a regexp.
33* Regexps:: Syntax of regular expressions.
34* Regexp Backslash:: Regular expression constructs starting with `\'.
35* Regexp Example:: A complex regular expression explained.
36* Search Case:: To ignore case while searching, or not.
37* Replace:: Search, and replace some or all matches.
38* Other Repeating Search:: Operating on all matches for some regexp.
39@end menu
40
41@node Incremental Search
42@section Incremental Search
43@cindex incremental search
44@cindex isearch
45
46 An incremental search begins searching as soon as you type the first
47character of the search string. As you type in the search string, Emacs
48shows you where the string (as you have typed it so far) would be
49found. When you have typed enough characters to identify the place you
50want, you can stop. Depending on what you plan to do next, you may or
51may not need to terminate the search explicitly with @key{RET}.
52
53@table @kbd
54@item C-s
55Incremental search forward (@code{isearch-forward}).
56@item C-r
57Incremental search backward (@code{isearch-backward}).
58@end table
59
60@menu
61* Basic Isearch:: Basic incremental search commands.
62* Repeat Isearch:: Searching for the same string again.
63* Error in Isearch:: When your string is not found.
64* Special Isearch:: Special input in incremental search.
65* Non-ASCII Isearch:: How to search for non-ASCII characters.
66* Isearch Yank:: Commands that grab text into the search string
67 or else edit the search string.
68* Highlight Isearch:: Isearch highlights the other possible matches.
69* Isearch Scroll:: Scrolling during an incremental search.
70* Slow Isearch:: Incremental search features for slow terminals.
71@end menu
72
73@node Basic Isearch
74@subsection Basics of Incremental Search
75
76@kindex C-s
77@findex isearch-forward
78 @kbd{C-s} starts a forward incremental search. It reads characters
79from the keyboard, and moves point past the next occurrence of those
80characters. If you type @kbd{C-s} and then @kbd{F}, that puts the
81cursor after the first @samp{F} (the first following the starting point, since
82this is a forward search). Then if you type an @kbd{O}, you will see
83the cursor move to just after the first @samp{FO} (the @samp{F} in that
84@samp{FO} may or may not be the first @samp{F}). After another
85@kbd{O}, the cursor moves to just after the first @samp{FOO} after the place
86where you started the search. At each step, the buffer text that
87matches the search string is highlighted, if the terminal can do that;
88the current search string is always displayed in the echo area.
89
90 If you make a mistake in typing the search string, you can cancel
91characters with @key{DEL}. Each @key{DEL} cancels the last character of
92search string. This does not happen until Emacs is ready to read another
93input character; first it must either find, or fail to find, the character
94you want to erase. If you do not want to wait for this to happen, use
95@kbd{C-g} as described below.
96
97 When you are satisfied with the place you have reached, you can type
98@key{RET}, which stops searching, leaving the cursor where the search
99brought it. Also, any command not specially meaningful in searches
100stops the searching and is then executed. Thus, typing @kbd{C-a}
101would exit the search and then move to the beginning of the line.
102@key{RET} is necessary only if the next command you want to type is a
103printing character, @key{DEL}, @key{RET}, or another character that is
104special within searches (@kbd{C-q}, @kbd{C-w}, @kbd{C-r}, @kbd{C-s},
105@kbd{C-y}, @kbd{M-y}, @kbd{M-r}, @kbd{M-c}, @kbd{M-e}, and some other
106meta-characters).
107
108 When you exit the incremental search, it sets the mark where point
109@emph{was} before the search. That is convenient for moving back
110there. In Transient Mark mode, incremental search sets the mark
111without activating it, and does so only if the mark is not already
112active.
113
114@node Repeat Isearch
115@subsection Repeating Incremental Search
116
117 Sometimes you search for @samp{FOO} and find one, but not the one you
118expected to find. There was a second @samp{FOO} that you forgot
119about, before the one you were aiming for. In this event, type
120another @kbd{C-s} to move to the next occurrence of the search string.
121You can repeat this any number of times. If you overshoot, you can
122cancel some @kbd{C-s} characters with @key{DEL}.
123
124 After you exit a search, you can search for the same string again by
125typing just @kbd{C-s C-s}: the first @kbd{C-s} is the key that invokes
126incremental search, and the second @kbd{C-s} means ``search again.''
127
128 If a search is failing and you ask to repeat it by typing another
129@kbd{C-s}, it starts again from the beginning of the buffer.
130Repeating a failing reverse search with @kbd{C-r} starts again from
131the end. This is called @dfn{wrapping around}, and @samp{Wrapped}
132appears in the search prompt once this has happened. If you keep on
133going past the original starting point of the search, it changes to
134@samp{Overwrapped}, which means that you are revisiting matches that
135you have already seen.
136
137 To reuse earlier search strings, use the @dfn{search ring}. The
138commands @kbd{M-p} and @kbd{M-n} move through the ring to pick a search
139string to reuse. These commands leave the selected search ring element
140in the minibuffer, where you can edit it. To edit the current search
141string in the minibuffer without replacing it with items from the
142search ring, type @kbd{M-e}. Type @kbd{C-s} or @kbd{C-r}
143to terminate editing the string and search for it.
144
145 You can change to searching backwards with @kbd{C-r}. For instance,
146if you are searching forward but you realize you were looking for
147something above the starting point, you can do this. Repeated
148@kbd{C-r} keeps looking for more occurrences backwards. A @kbd{C-s}
149starts going forwards again. @kbd{C-r} in a search can be canceled
150with @key{DEL}.
151
152@kindex C-r
153@findex isearch-backward
154 If you know initially that you want to search backwards, you can use
155@kbd{C-r} instead of @kbd{C-s} to start the search, because @kbd{C-r}
156as a key runs a command (@code{isearch-backward}) to search backward.
157A backward search finds matches that end before the starting point,
158just as a forward search finds matches that begin after it.
159
160@node Error in Isearch
161@subsection Errors in Incremental Search
162
163 If your string is not found at all, the echo area says @samp{Failing
164I-Search}. The cursor is after the place where Emacs found as much of your
165string as it could. Thus, if you search for @samp{FOOT}, and there is no
166@samp{FOOT}, you might see the cursor after the @samp{FOO} in @samp{FOOL}.
167At this point there are several things you can do. If your string was
168mistyped, you can rub some of it out and correct it. If you like the place
169you have found, you can type @key{RET} or some other Emacs command to
170remain there. Or you can type @kbd{C-g}, which
171removes from the search string the characters that could not be found (the
172@samp{T} in @samp{FOOT}), leaving those that were found (the @samp{FOO} in
173@samp{FOOT}). A second @kbd{C-g} at that point cancels the search
174entirely, returning point to where it was when the search started.
175
176@cindex quitting (in search)
177 The @kbd{C-g} ``quit'' character does special things during searches;
178just what it does depends on the status of the search. If the search has
179found what you specified and is waiting for input, @kbd{C-g} cancels the
180entire search. The cursor moves back to where you started the search. If
181@kbd{C-g} is typed when there are characters in the search string that have
182not been found---because Emacs is still searching for them, or because it
183has failed to find them---then the search string characters which have not
184been found are discarded from the search string. With them gone, the
185search is now successful and waiting for more input, so a second @kbd{C-g}
186will cancel the entire search.
187
188@node Special Isearch
189@subsection Special Input for Incremental Search
190
191 An upper-case letter in the search string makes the search
192case-sensitive. If you delete the upper-case character from the search
193string, it ceases to have this effect. @xref{Search Case}.
194
195 To search for a newline, type @kbd{C-j}. To search for another
196control character, such as control-S or carriage return, you must quote
197it by typing @kbd{C-q} first. This function of @kbd{C-q} is analogous
198to its use for insertion (@pxref{Inserting Text}): it causes the
199following character to be treated the way any ``ordinary'' character is
200treated in the same context. You can also specify a character by its
201octal code: enter @kbd{C-q} followed by a sequence of octal digits.
202
203 @kbd{M-%} typed in incremental search invokes @code{query-replace}
204or @code{query-replace-regexp} (depending on search mode) with the
205current search string used as the string to replace. @xref{Query
206Replace}.
207
208 Entering @key{RET} when the search string is empty launches
209nonincremental search (@pxref{Nonincremental Search}).
210
211@vindex isearch-mode-map
212 To customize the special characters that incremental search understands,
213alter their bindings in the keymap @code{isearch-mode-map}. For a list
214of bindings, look at the documentation of @code{isearch-mode} with
215@kbd{C-h f isearch-mode @key{RET}}.
216
217@node Non-ASCII Isearch
218@subsection Isearch for Non-@acronym{ASCII} Characters
219@cindex searching for non-@acronym{ASCII} characters
220@cindex input method, during incremental search
221
222 To enter non-@acronym{ASCII} characters in an incremental search,
223you can use @kbd{C-q} (see the previous section), but it is easier to
224use an input method (@pxref{Input Methods}). If an input method is
225enabled in the current buffer when you start the search, you can use
226it in the search string also. Emacs indicates that by including the
227input method mnemonic in its prompt, like this:
228
229@example
230I-search [@var{im}]:
231@end example
232
233@noindent
234@findex isearch-toggle-input-method
235@findex isearch-toggle-specified-input-method
236where @var{im} is the mnemonic of the active input method.
237
238 You can toggle (enable or disable) the input method while you type
239the search string with @kbd{C-\} (@code{isearch-toggle-input-method}).
240You can turn on a certain (non-default) input method with @kbd{C-^}
241(@code{isearch-toggle-specified-input-method}), which prompts for the
242name of the input method. The input method you enable during
243incremental search remains enabled in the current buffer afterwards.
244
245@node Isearch Yank
246@subsection Isearch Yanking
247
248 The characters @kbd{C-w} and @kbd{C-y} can be used in incremental
249search to grab text from the buffer into the search string. This
250makes it convenient to search for another occurrence of text at point.
251@kbd{C-w} copies the character or word after point as part of the
252search string, advancing point over it. (The decision, whether to
253copy a character or a word, is heuristic.) Another @kbd{C-s} to
254repeat the search will then search for a string including that
255character or word.
256
257 @kbd{C-y} is similar to @kbd{C-w} but copies all the rest of the
258current line into the search string. If point is already at the end
259of a line, it grabs the entire next line. Both @kbd{C-y} and
260@kbd{C-w} convert the text they copy to lower case if the search is
261currently not case-sensitive; this is so the search remains
262case-insensitive.
263
264 @kbd{C-M-w} and @kbd{C-M-y} modify the search string by only one
265character at a time: @kbd{C-M-w} deletes the last character from the
266search string and @kbd{C-M-y} copies the character after point to the
267end of the search string. An alternative method to add the character
268after point into the search string is to enter the minibuffer by
269@kbd{M-e} and to type @kbd{C-f} at the end of the search string in the
270minibuffer.
271
272 The character @kbd{M-y} copies text from the kill ring into the search
273string. It uses the same text that @kbd{C-y} as a command would yank.
274@kbd{Mouse-2} in the echo area does the same.
275@xref{Yanking}.
276
277@node Highlight Isearch
278@subsection Lazy Search Highlighting
279@cindex lazy search highlighting
280@vindex isearch-lazy-highlight
281
282 When you pause for a little while during incremental search, it
283highlights all other possible matches for the search string. This
284makes it easier to anticipate where you can get to by typing @kbd{C-s}
285or @kbd{C-r} to repeat the search. The short delay before highlighting
286other matches helps indicate which match is the current one.
287If you don't like this feature, you can turn it off by setting
288@code{isearch-lazy-highlight} to @code{nil}.
289
290@cindex faces for highlighting search matches
291 You can control how this highlighting looks by customizing the faces
292@code{isearch} (used for the current match) and @code{lazy-highlight}
293(for all the other matches).
294
295@node Isearch Scroll
296@subsection Scrolling During Incremental Search
297
298 You can enable the use of vertical scrolling during incremental
299search (without exiting the search) by setting the customizable
300variable @code{isearch-allow-scroll} to a non-@code{nil} value. This
301applies to using the vertical scroll-bar and to certain keyboard
302commands such as @kbd{@key{PRIOR}} (@code{scroll-down}),
303@kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter}).
304You must run these commands via their key sequences to stay in the
305search---typing @kbd{M-x} will terminate the search. You can give
306prefix arguments to these commands in the usual way.
307
308 This feature won't let you scroll the current match out of visibility,
309however.
310
311 The feature also affects some other commands, such as @kbd{C-x 2}
312(@code{split-window-vertically}) and @kbd{C-x ^}
313(@code{enlarge-window}) which don't exactly scroll but do affect where
314the text appears on the screen. In general, it applies to any command
315whose name has a non-@code{nil} @code{isearch-scroll} property. So you
316can control which commands are affected by changing these properties.
317
318 For example, to make @kbd{C-h l} usable within an incremental search
319in all future Emacs sessions, use @kbd{C-h c} to find what command it
320runs. (You type @kbd{C-h c C-h l}; it says @code{view-lossage}.)
321Then you can put the following line in your @file{.emacs} file
322(@pxref{Init File}):
323
324@example
325(put 'view-lossage 'isearch-scroll t)
326@end example
327
328@noindent
329This feature can be applied to any command that doesn't permanently
330change point, the buffer contents, the match data, the current buffer,
331or the selected window and frame. The command must not itself attempt
332an incremental search.
333
334@node Slow Isearch
335@subsection Slow Terminal Incremental Search
336
337 Incremental search on a slow terminal uses a modified style of display
338that is designed to take less time. Instead of redisplaying the buffer at
339each place the search gets to, it creates a new single-line window and uses
340that to display the line that the search has found. The single-line window
341comes into play as soon as point moves outside of the text that is already
342on the screen.
343
344 When you terminate the search, the single-line window is removed.
345Emacs then redisplays the window in which the search was done, to show
346its new position of point.
347
348@vindex search-slow-speed
349 The slow terminal style of display is used when the terminal baud rate is
350less than or equal to the value of the variable @code{search-slow-speed},
351initially 1200. See also the discussion of the variable @code{baud-rate}
352(@pxref{baud-rate,, Customization of Display}).
353
354@vindex search-slow-window-lines
355 The number of lines to use in slow terminal search display is controlled
356by the variable @code{search-slow-window-lines}. Its normal value is 1.
357
358@node Nonincremental Search
359@section Nonincremental Search
360@cindex nonincremental search
361
362 Emacs also has conventional nonincremental search commands, which require
363you to type the entire search string before searching begins.
364
365@table @kbd
366@item C-s @key{RET} @var{string} @key{RET}
367Search for @var{string}.
368@item C-r @key{RET} @var{string} @key{RET}
369Search backward for @var{string}.
370@end table
371
372 To do a nonincremental search, first type @kbd{C-s @key{RET}}. This
373enters the minibuffer to read the search string; terminate the string
374with @key{RET}, and then the search takes place. If the string is not
375found, the search command signals an error.
376
377 When you type @kbd{C-s @key{RET}}, the @kbd{C-s} invokes incremental
378search as usual. That command is specially programmed to invoke
379nonincremental search, @code{search-forward}, if the string you
380specify is empty. (Such an empty argument would otherwise be
381useless.) But it does not call @code{search-forward} right away. First
382it checks the next input character to see if is @kbd{C-w},
383which specifies a word search.
384@ifnottex
385@xref{Word Search}.
386@end ifnottex
387@kbd{C-r @key{RET}} does likewise, for a reverse incremental search.
388
389@findex search-forward
390@findex search-backward
391 Forward and backward nonincremental searches are implemented by the
392commands @code{search-forward} and @code{search-backward}. These
393commands may be bound to keys in the usual manner. The feature that you
394can get to them via the incremental search commands exists for
395historical reasons, and to avoid the need to find separate key sequences
396for them.
397
398@node Word Search
399@section Word Search
400@cindex word search
401
402 Word search searches for a sequence of words without regard to how the
403words are separated. More precisely, you type a string of many words,
404using single spaces to separate them, and the string can be found even
405if there are multiple spaces, newlines, or other punctuation characters
406between these words.
407
408 Word search is useful for editing a printed document made with a text
409formatter. If you edit while looking at the printed, formatted version,
410you can't tell where the line breaks are in the source file. With word
411search, you can search without having to know them.
412
413@table @kbd
414@item C-s @key{RET} C-w @var{words} @key{RET}
415Search for @var{words}, ignoring details of punctuation.
416@item C-r @key{RET} C-w @var{words} @key{RET}
417Search backward for @var{words}, ignoring details of punctuation.
418@end table
419
420 Word search as a special case of nonincremental search is invoked
421with @kbd{C-s @key{RET} C-w}. This is followed by the search string,
422which must always be terminated with @key{RET}. Being nonincremental,
423this search does not start until the argument is terminated. It works
424by constructing a regular expression and searching for that; see
425@ref{Regexp Search}.
426
427 Use @kbd{C-r @key{RET} C-w} to do backward word search.
428
429 You can also invoke word search with @kbd{C-s M-e C-w} or @kbd{C-r
430M-e C-w} followed by the search string and terminated with @key{RET},
431@kbd{C-s} or @kbd{C-r}. This puts word search into incremental mode
432where you can use all keys available for incremental search. However,
433when you type more words in incremental word search, it will fail
434until you type complete words.
435
436@findex word-search-forward
437@findex word-search-backward
438 Forward and backward word searches are implemented by the commands
439@code{word-search-forward} and @code{word-search-backward}. These
440commands may be bound to keys in the usual manner. They are available
441via the incremental search commands both for historical reasons and
442to avoid the need to find separate key sequences for them.
443
444@node Regexp Search
445@section Regular Expression Search
446@cindex regular expression
447@cindex regexp
448
449 A @dfn{regular expression} (@dfn{regexp}, for short) is a pattern
450that denotes a class of alternative strings to match, possibly
451infinitely many. GNU Emacs provides both incremental and
452nonincremental ways to search for a match for a regexp. The syntax of
453regular expressions is explained in the following section.
454
455@kindex C-M-s
456@findex isearch-forward-regexp
457@kindex C-M-r
458@findex isearch-backward-regexp
459 Incremental search for a regexp is done by typing @kbd{C-M-s}
460(@code{isearch-forward-regexp}), by invoking @kbd{C-s} with a
461prefix argument (whose value does not matter), or by typing @kbd{M-r}
462within a forward incremental search. This command reads a
463search string incrementally just like @kbd{C-s}, but it treats the
464search string as a regexp rather than looking for an exact match
465against the text in the buffer. Each time you add text to the search
466string, you make the regexp longer, and the new regexp is searched
467for. To search backward for a regexp, use @kbd{C-M-r}
468(@code{isearch-backward-regexp}), @kbd{C-r} with a prefix argument,
469or @kbd{M-r} within a backward incremental search.
470
471 All of the control characters that do special things within an
472ordinary incremental search have the same function in incremental regexp
473search. Typing @kbd{C-s} or @kbd{C-r} immediately after starting the
474search retrieves the last incremental search regexp used; that is to
475say, incremental regexp and non-regexp searches have independent
476defaults. They also have separate search rings that you can access with
477@kbd{M-p} and @kbd{M-n}.
478
479@vindex search-whitespace-regexp
480 If you type @key{SPC} in incremental regexp search, it matches any
481sequence of whitespace characters, including newlines. If you want to
482match just a space, type @kbd{C-q @key{SPC}}. You can control what a
483bare space matches by setting the variable
484@code{search-whitespace-regexp} to the desired regexp.
485
486 In some cases, adding characters to the regexp in an incremental regexp
487search can make the cursor move back and start again. For example, if
488you have searched for @samp{foo} and you add @samp{\|bar}, the cursor
489backs up in case the first @samp{bar} precedes the first @samp{foo}.
490
491 Forward and backward regexp search are not symmetrical, because
492regexp matching in Emacs always operates forward, starting with the
493beginning of the regexp. Thus, forward regexp search scans forward,
494trying a forward match at each possible starting position. Backward
495regexp search scans backward, trying a forward match at each possible
496starting position. These search methods are not mirror images.
497
498@findex re-search-forward
499@findex re-search-backward
500 Nonincremental search for a regexp is done by the functions
501@code{re-search-forward} and @code{re-search-backward}. You can invoke
502these with @kbd{M-x}, or bind them to keys, or invoke them by way of
503incremental regexp search with @kbd{C-M-s @key{RET}} and @kbd{C-M-r
504@key{RET}}.
505
506 If you use the incremental regexp search commands with a prefix
507argument, they perform ordinary string search, like
508@code{isearch-forward} and @code{isearch-backward}. @xref{Incremental
509Search}.
510
511@node Regexps
512@section Syntax of Regular Expressions
513@cindex syntax of regexps
514
515 This manual describes regular expression features that users
516typically want to use. There are additional features that are
517mainly used in Lisp programs; see @ref{Regular Expressions,,,
518elisp, The Emacs Lisp Reference Manual}.
519
520 Regular expressions have a syntax in which a few characters are
521special constructs and the rest are @dfn{ordinary}. An ordinary
522character is a simple regular expression which matches that same
523character and nothing else. The special characters are @samp{$},
524@samp{^}, @samp{.}, @samp{*}, @samp{+}, @samp{?}, @samp{[}, and
525@samp{\}. The character @samp{]} is special if it ends a character
526alternative (see later). The character @samp{-} is special inside a
527character alternative. Any other character appearing in a regular
528expression is ordinary, unless a @samp{\} precedes it. (When you use
529regular expressions in a Lisp program, each @samp{\} must be doubled,
530see the example near the end of this section.)
531
532 For example, @samp{f} is not a special character, so it is ordinary, and
533therefore @samp{f} is a regular expression that matches the string
534@samp{f} and no other string. (It does @emph{not} match the string
535@samp{ff}.) Likewise, @samp{o} is a regular expression that matches
536only @samp{o}. (When case distinctions are being ignored, these regexps
537also match @samp{F} and @samp{O}, but we consider this a generalization
538of ``the same string,'' rather than an exception.)
539
540 Any two regular expressions @var{a} and @var{b} can be concatenated. The
541result is a regular expression which matches a string if @var{a} matches
542some amount of the beginning of that string and @var{b} matches the rest of
543the string.@refill
544
545 As a simple example, we can concatenate the regular expressions @samp{f}
546and @samp{o} to get the regular expression @samp{fo}, which matches only
547the string @samp{fo}. Still trivial. To do something nontrivial, you
548need to use one of the special characters. Here is a list of them.
549
550@table @asis
551@item @kbd{.}@: @r{(Period)}
552is a special character that matches any single character except a newline.
553Using concatenation, we can make regular expressions like @samp{a.b}, which
554matches any three-character string that begins with @samp{a} and ends with
555@samp{b}.@refill
556
557@item @kbd{*}
558is not a construct by itself; it is a postfix operator that means to
559match the preceding regular expression repetitively as many times as
560possible. Thus, @samp{o*} matches any number of @samp{o}s (including no
561@samp{o}s).
562
563@samp{*} always applies to the @emph{smallest} possible preceding
564expression. Thus, @samp{fo*} has a repeating @samp{o}, not a repeating
565@samp{fo}. It matches @samp{f}, @samp{fo}, @samp{foo}, and so on.
566
567The matcher processes a @samp{*} construct by matching, immediately,
568as many repetitions as can be found. Then it continues with the rest
569of the pattern. If that fails, backtracking occurs, discarding some
570of the matches of the @samp{*}-modified construct in case that makes
571it possible to match the rest of the pattern. For example, in matching
572@samp{ca*ar} against the string @samp{caaar}, the @samp{a*} first
573tries to match all three @samp{a}s; but the rest of the pattern is
574@samp{ar} and there is only @samp{r} left to match, so this try fails.
575The next alternative is for @samp{a*} to match only two @samp{a}s.
576With this choice, the rest of the regexp matches successfully.@refill
577
578@item @kbd{+}
579is a postfix operator, similar to @samp{*} except that it must match
580the preceding expression at least once. So, for example, @samp{ca+r}
581matches the strings @samp{car} and @samp{caaaar} but not the string
582@samp{cr}, whereas @samp{ca*r} matches all three strings.
583
584@item @kbd{?}
585is a postfix operator, similar to @samp{*} except that it can match the
586preceding expression either once or not at all. For example,
587@samp{ca?r} matches @samp{car} or @samp{cr}; nothing else.
588
589@item @kbd{*?}, @kbd{+?}, @kbd{??}
590@cindex non-greedy regexp matching
591are non-greedy variants of the operators above. The normal operators
592@samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as
593much as they can, as long as the overall regexp can still match. With
594a following @samp{?}, they are non-greedy: they will match as little
595as possible.
596
597Thus, both @samp{ab*} and @samp{ab*?} can match the string @samp{a}
598and the string @samp{abbbb}; but if you try to match them both against
599the text @samp{abbb}, @samp{ab*} will match it all (the longest valid
600match), while @samp{ab*?} will match just @samp{a} (the shortest
601valid match).
602
603Non-greedy operators match the shortest possible string starting at a
604given starting point; in a forward search, though, the earliest
605possible starting point for match is always the one chosen. Thus, if
606you search for @samp{a.*?$} against the text @samp{abbab} followed by
607a newline, it matches the whole string. Since it @emph{can} match
608starting at the first @samp{a}, it does.
609
610@item @kbd{\@{@var{n}\@}}
611is a postfix operator that specifies repetition @var{n} times---that
612is, the preceding regular expression must match exactly @var{n} times
613in a row. For example, @samp{x\@{4\@}} matches the string @samp{xxxx}
614and nothing else.
615
616@item @kbd{\@{@var{n},@var{m}\@}}
617is a postfix operator that specifies repetition between @var{n} and
618@var{m} times---that is, the preceding regular expression must match
619at least @var{n} times, but no more than @var{m} times. If @var{m} is
620omitted, then there is no upper limit, but the preceding regular
621expression must match at least @var{n} times.@* @samp{\@{0,1\@}} is
622equivalent to @samp{?}. @* @samp{\@{0,\@}} is equivalent to
623@samp{*}. @* @samp{\@{1,\@}} is equivalent to @samp{+}.
624
625@item @kbd{[ @dots{} ]}
626is a @dfn{character set}, which begins with @samp{[} and is terminated
627by @samp{]}. In the simplest case, the characters between the two
628brackets are what this set can match.
629
630Thus, @samp{[ad]} matches either one @samp{a} or one @samp{d}, and
631@samp{[ad]*} matches any string composed of just @samp{a}s and @samp{d}s
632(including the empty string), from which it follows that @samp{c[ad]*r}
633matches @samp{cr}, @samp{car}, @samp{cdr}, @samp{caddaar}, etc.
634
635You can also include character ranges in a character set, by writing the
636starting and ending characters with a @samp{-} between them. Thus,
637@samp{[a-z]} matches any lower-case @acronym{ASCII} letter. Ranges may be
638intermixed freely with individual characters, as in @samp{[a-z$%.]},
639which matches any lower-case @acronym{ASCII} letter or @samp{$}, @samp{%} or
640period.
641
642Note that the usual regexp special characters are not special inside a
643character set. A completely different set of special characters exists
644inside character sets: @samp{]}, @samp{-} and @samp{^}.
645
646To include a @samp{]} in a character set, you must make it the first
647character. For example, @samp{[]a]} matches @samp{]} or @samp{a}. To
648include a @samp{-}, write @samp{-} as the first or last character of the
649set, or put it after a range. Thus, @samp{[]-]} matches both @samp{]}
650and @samp{-}.
651
652To include @samp{^} in a set, put it anywhere but at the beginning of
653the set. (At the beginning, it complements the set---see below.)
654
655When you use a range in case-insensitive search, you should write both
656ends of the range in upper case, or both in lower case, or both should
657be non-letters. The behavior of a mixed-case range such as @samp{A-z}
658is somewhat ill-defined, and it may change in future Emacs versions.
659
660@item @kbd{[^ @dots{} ]}
661@samp{[^} begins a @dfn{complemented character set}, which matches any
662character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches
663all characters @emph{except} @acronym{ASCII} letters and digits.
664
665@samp{^} is not special in a character set unless it is the first
666character. The character following the @samp{^} is treated as if it
667were first (in other words, @samp{-} and @samp{]} are not special there).
668
669A complemented character set can match a newline, unless newline is
670mentioned as one of the characters not to match. This is in contrast to
671the handling of regexps in programs such as @code{grep}.
672
673@item @kbd{^}
674is a special character that matches the empty string, but only at the
675beginning of a line in the text being matched. Otherwise it fails to
676match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at
677the beginning of a line.
678
679For historical compatibility reasons, @samp{^} can be used with this
680meaning only at the beginning of the regular expression, or after
681@samp{\(} or @samp{\|}.
682
683@item @kbd{$}
684is similar to @samp{^} but matches only at the end of a line. Thus,
685@samp{x+$} matches a string of one @samp{x} or more at the end of a line.
686
687For historical compatibility reasons, @samp{$} can be used with this
688meaning only at the end of the regular expression, or before @samp{\)}
689or @samp{\|}.
690
691@item @kbd{\}
692has two functions: it quotes the special characters (including
693@samp{\}), and it introduces additional special constructs.
694
695Because @samp{\} quotes special characters, @samp{\$} is a regular
696expression that matches only @samp{$}, and @samp{\[} is a regular
697expression that matches only @samp{[}, and so on.
698
699See the following section for the special constructs that begin
700with @samp{\}.
701@end table
702
703 Note: for historical compatibility, special characters are treated as
704ordinary ones if they are in contexts where their special meanings make no
705sense. For example, @samp{*foo} treats @samp{*} as ordinary since there is
706no preceding expression on which the @samp{*} can act. It is poor practice
707to depend on this behavior; it is better to quote the special character anyway,
708regardless of where it appears.
709
710As a @samp{\} is not special inside a character alternative, it can
711never remove the special meaning of @samp{-} or @samp{]}. So you
712should not quote these characters when they have no special meaning
713either. This would not clarify anything, since backslashes can
714legitimately precede these characters where they @emph{have} special
715meaning, as in @samp{[^\]} (@code{"[^\\]"} for Lisp string syntax),
716which matches any single character except a backslash.
717
718@node Regexp Backslash
719@section Backslash in Regular Expressions
720
721 For the most part, @samp{\} followed by any character matches only
722that character. However, there are several exceptions: two-character
723sequences starting with @samp{\} that have special meanings. The
724second character in the sequence is always an ordinary character when
725used on its own. Here is a table of @samp{\} constructs.
726
727@table @kbd
728@item \|
729specifies an alternative. Two regular expressions @var{a} and @var{b}
730with @samp{\|} in between form an expression that matches some text if
731either @var{a} matches it or @var{b} matches it. It works by trying to
732match @var{a}, and if that fails, by trying to match @var{b}.
733
734Thus, @samp{foo\|bar} matches either @samp{foo} or @samp{bar}
735but no other string.@refill
736
737@samp{\|} applies to the largest possible surrounding expressions. Only a
738surrounding @samp{\( @dots{} \)} grouping can limit the grouping power of
739@samp{\|}.@refill
740
741Full backtracking capability exists to handle multiple uses of @samp{\|}.
742
743@item \( @dots{} \)
744is a grouping construct that serves three purposes:
745
746@enumerate
747@item
748To enclose a set of @samp{\|} alternatives for other operations.
749Thus, @samp{\(foo\|bar\)x} matches either @samp{foox} or @samp{barx}.
750
751@item
752To enclose a complicated expression for the postfix operators @samp{*},
753@samp{+} and @samp{?} to operate on. Thus, @samp{ba\(na\)*} matches
754@samp{bananana}, etc., with any (zero or more) number of @samp{na}
755strings.@refill
756
757@item
758To record a matched substring for future reference.
759@end enumerate
760
761This last application is not a consequence of the idea of a
762parenthetical grouping; it is a separate feature that is assigned as a
763second meaning to the same @samp{\( @dots{} \)} construct. In practice
764there is usually no conflict between the two meanings; when there is
765a conflict, you can use a ``shy'' group.
766
767@item \(?: @dots{} \)
768@cindex shy group, in regexp
769specifies a ``shy'' group that does not record the matched substring;
770you can't refer back to it with @samp{\@var{d}}. This is useful
771in mechanically combining regular expressions, so that you
772can add groups for syntactic purposes without interfering with
773the numbering of the groups that are meant to be referred to.
774
775@item \@var{d}
776@cindex back reference, in regexp
777matches the same text that matched the @var{d}th occurrence of a
778@samp{\( @dots{} \)} construct. This is called a @dfn{back
779reference}.
780
781After the end of a @samp{\( @dots{} \)} construct, the matcher remembers
782the beginning and end of the text matched by that construct. Then,
783later on in the regular expression, you can use @samp{\} followed by the
784digit @var{d} to mean ``match the same text matched the @var{d}th time
785by the @samp{\( @dots{} \)} construct.''
786
787The strings matching the first nine @samp{\( @dots{} \)} constructs
788appearing in a regular expression are assigned numbers 1 through 9 in
789the order that the open-parentheses appear in the regular expression.
790So you can use @samp{\1} through @samp{\9} to refer to the text matched
791by the corresponding @samp{\( @dots{} \)} constructs.
792
793For example, @samp{\(.*\)\1} matches any newline-free string that is
794composed of two identical halves. The @samp{\(.*\)} matches the first
795half, which may be anything, but the @samp{\1} that follows must match
796the same exact text.
797
798If a particular @samp{\( @dots{} \)} construct matches more than once
799(which can easily happen if it is followed by @samp{*}), only the last
800match is recorded.
801
802@item \`
803matches the empty string, but only at the beginning of the string or
804buffer (or its accessible portion) being matched against.
805
806@item \'
807matches the empty string, but only at the end of the string or buffer
808(or its accessible portion) being matched against.
809
810@item \=
811matches the empty string, but only at point.
812
813@item \b
814matches the empty string, but only at the beginning or
815end of a word. Thus, @samp{\bfoo\b} matches any occurrence of
816@samp{foo} as a separate word. @samp{\bballs?\b} matches
817@samp{ball} or @samp{balls} as a separate word.@refill
818
819@samp{\b} matches at the beginning or end of the buffer
820regardless of what text appears next to it.
821
822@item \B
823matches the empty string, but @emph{not} at the beginning or
824end of a word.
825
826@item \<
827matches the empty string, but only at the beginning of a word.
828@samp{\<} matches at the beginning of the buffer only if a
829word-constituent character follows.
830
831@item \>
832matches the empty string, but only at the end of a word. @samp{\>}
833matches at the end of the buffer only if the contents end with a
834word-constituent character.
835
836@item \w
837matches any word-constituent character. The syntax table
838determines which characters these are. @xref{Syntax}.
839
840@item \W
841matches any character that is not a word-constituent.
842
843@item \_<
844matches the empty string, but only at the beginning of a symbol.
845A symbol is a sequence of one or more symbol-constituent characters.
846A symbol-constituent character is a character whose syntax is either
847@samp{w} or @samp{_}. @samp{\_<} matches at the beginning of the
848buffer only if a symbol-constituent character follows.
849
850@item \_>
851matches the empty string, but only at the end of a symbol. @samp{\_>}
852matches at the end of the buffer only if the contents end with a
853symbol-constituent character.
854
855@item \s@var{c}
856matches any character whose syntax is @var{c}. Here @var{c} is a
857character that designates a particular syntax class: thus, @samp{w}
858for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.}
859for ordinary punctuation, etc. @xref{Syntax}.
860
861@item \S@var{c}
862matches any character whose syntax is not @var{c}.
863
864@cindex categories of characters
865@cindex characters which belong to a specific language
866@findex describe-categories
867@item \c@var{c}
868matches any character that belongs to the category @var{c}. For
869example, @samp{\cc} matches Chinese characters, @samp{\cg} matches
870Greek characters, etc. For the description of the known categories,
871type @kbd{M-x describe-categories @key{RET}}.
872
873@item \C@var{c}
874matches any character that does @emph{not} belong to category
875@var{c}.
876@end table
877
878 The constructs that pertain to words and syntax are controlled by the
879setting of the syntax table (@pxref{Syntax}).
880
881@node Regexp Example
882@section Regular Expression Example
883
884 Here is a complicated regexp---a simplified version of the regexp
885that Emacs uses, by default, to recognize the end of a sentence
886together with any whitespace that follows. We show its Lisp syntax to
887distinguish the spaces from the tab characters. In Lisp syntax, the
888string constant begins and ends with a double-quote. @samp{\"} stands
889for a double-quote as part of the regexp, @samp{\\} for a backslash as
890part of the regexp, @samp{\t} for a tab, and @samp{\n} for a newline.
891
892@example
893"[.?!][]\"')]*\\($\\| $\\|\t\\| \\)[ \t\n]*"
894@end example
895
896@noindent
897This contains four parts in succession: a character set matching
898period, @samp{?}, or @samp{!}; a character set matching
899close-brackets, quotes, or parentheses, repeated zero or more times; a
900set of alternatives within backslash-parentheses that matches either
901end-of-line, a space at the end of a line, a tab, or two spaces; and a
902character set matching whitespace characters, repeated any number of
903times.
904
905 To enter the same regexp in incremental search, you would type
906@key{TAB} to enter a tab, and @kbd{C-j} to enter a newline. You would
907also type single backslashes as themselves, instead of doubling them
908for Lisp syntax. In commands that use ordinary minibuffer input to
909read a regexp, you would quote the @kbd{C-j} by preceding it with a
910@kbd{C-q} to prevent @kbd{C-j} from exiting the minibuffer.
911
912@node Search Case
913@section Searching and Case
914
915 Incremental searches in Emacs normally ignore the case of the text
916they are searching through, if you specify the text in lower case.
917Thus, if you specify searching for @samp{foo}, then @samp{Foo} and
918@samp{foo} are also considered a match. Regexps, and in particular
919character sets, are included: @samp{[ab]} would match @samp{a} or
920@samp{A} or @samp{b} or @samp{B}.@refill
921
922 An upper-case letter anywhere in the incremental search string makes
923the search case-sensitive. Thus, searching for @samp{Foo} does not find
924@samp{foo} or @samp{FOO}. This applies to regular expression search as
925well as to string search. The effect ceases if you delete the
926upper-case letter from the search string.
927
928 Typing @kbd{M-c} within an incremental search toggles the case
929sensitivity of that search. The effect does not extend beyond the
930current incremental search to the next one, but it does override the
931effect of including an upper-case letter in the current search.
932
933@vindex case-fold-search
934@vindex default-case-fold-search
935 If you set the variable @code{case-fold-search} to @code{nil}, then
936all letters must match exactly, including case. This is a per-buffer
937variable; altering the variable affects only the current buffer, but
938there is a default value in @code{default-case-fold-search} that you
939can also set. @xref{Locals}. This variable applies to nonincremental
940searches also, including those performed by the replace commands
941(@pxref{Replace}) and the minibuffer history matching commands
942(@pxref{Minibuffer History}).
943
944 Several related variables control case-sensitivity of searching and
945matching for specific commands or activities. For instance,
946@code{tags-case-fold-search} controls case sensitivity for
947@code{find-tag}. To find these variables, do @kbd{M-x
948apropos-variable @key{RET} case-fold-search @key{RET}}.
949
950@node Replace
951@section Replacement Commands
952@cindex replacement
953@cindex search-and-replace commands
954@cindex string substitution
955@cindex global substitution
956
957 Global search-and-replace operations are not needed often in Emacs,
958but they are available. In addition to the simple @kbd{M-x
959replace-string} command which replaces all occurrences,
960there is @kbd{M-%} (@code{query-replace}), which presents each occurrence
961of the pattern and asks you whether to replace it.
962
963 The replace commands normally operate on the text from point to the
964end of the buffer; however, in Transient Mark mode (@pxref{Transient
965Mark}), when the mark is active, they operate on the region. The
966basic replace commands replace one string (or regexp) with one
967replacement string. It is possible to perform several replacements in
968parallel using the command @code{expand-region-abbrevs}
969(@pxref{Expanding Abbrevs}).
970
971@menu
972* Unconditional Replace:: Replacing all matches for a string.
973* Regexp Replace:: Replacing all matches for a regexp.
974* Replacement and Case:: How replacements preserve case of letters.
975* Query Replace:: How to use querying.
976@end menu
977
978@node Unconditional Replace, Regexp Replace, Replace, Replace
979@subsection Unconditional Replacement
980@findex replace-string
981
982@table @kbd
983@item M-x replace-string @key{RET} @var{string} @key{RET} @var{newstring} @key{RET}
984Replace every occurrence of @var{string} with @var{newstring}.
985@end table
986
987 To replace every instance of @samp{foo} after point with @samp{bar},
988use the command @kbd{M-x replace-string} with the two arguments
989@samp{foo} and @samp{bar}. Replacement happens only in the text after
990point, so if you want to cover the whole buffer you must go to the
991beginning first. All occurrences up to the end of the buffer are
992replaced; to limit replacement to part of the buffer, narrow to that
993part of the buffer before doing the replacement (@pxref{Narrowing}).
994In Transient Mark mode, when the region is active, replacement is
995limited to the region (@pxref{Transient Mark}).
996
997 When @code{replace-string} exits, it leaves point at the last
998occurrence replaced. It sets the mark to the prior position of point
999(where the @code{replace-string} command was issued); use @kbd{C-u
1000C-@key{SPC}} to move back there.
1001
1002 A numeric argument restricts replacement to matches that are surrounded
1003by word boundaries. The argument's value doesn't matter.
1004
1005 @xref{Replacement and Case}, for details about case-sensitivity in
1006replace commands.
1007
1008 What if you want to exchange @samp{x} and @samp{y}: replace every @samp{x} with a @samp{y} and vice versa? You can do it this way:
1009
1010@example
1011M-x replace-string @key{RET} x @key{RET} @@TEMP@@ @key{RET}
1012M-< M-x replace-string @key{RET} y @key{RET} x @key{RET}
1013M-< M-x replace-string @key{RET} @@TEMP@@ @key{RET} y @key{RET}
1014@end example
1015
1016@noindent
1017This works provided the string @samp{@@TEMP@@} does not appear
1018in your text.
1019
1020@node Regexp Replace, Replacement and Case, Unconditional Replace, Replace
1021@subsection Regexp Replacement
1022@findex replace-regexp
1023
1024 The @kbd{M-x replace-string} command replaces exact matches for a
1025single string. The similar command @kbd{M-x replace-regexp} replaces
1026any match for a specified pattern.
1027
1028@table @kbd
1029@item M-x replace-regexp @key{RET} @var{regexp} @key{RET} @var{newstring} @key{RET}
1030Replace every match for @var{regexp} with @var{newstring}.
1031@end table
1032
1033@cindex back reference, in regexp replacement
1034 In @code{replace-regexp}, the @var{newstring} need not be constant:
1035it can refer to all or part of what is matched by the @var{regexp}.
1036@samp{\&} in @var{newstring} stands for the entire match being
1037replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a
1038digit, stands for whatever matched the @var{d}th parenthesized
1039grouping in @var{regexp}. (This is called a ``back reference.'')
1040@samp{\#} refers to the count of replacements already made in this
1041command, as a decimal number. In the first replacement, @samp{\#}
1042stands for @samp{0}; in the second, for @samp{1}; and so on. For
1043example,
1044
1045@example
1046M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET}
1047@end example
1048
1049@noindent
1050replaces (for example) @samp{cadr} with @samp{cadr-safe} and @samp{cddr}
1051with @samp{cddr-safe}.
1052
1053@example
1054M-x replace-regexp @key{RET} \(c[ad]+r\)-safe @key{RET} \1 @key{RET}
1055@end example
1056
1057@noindent
1058performs the inverse transformation. To include a @samp{\} in the
1059text to replace with, you must enter @samp{\\}.
1060
1061 If you want to enter part of the replacement string by hand each
1062time, use @samp{\?} in the replacement string. Each replacement will
1063ask you to edit the replacement string in the minibuffer, putting
1064point where the @samp{\?} was.
1065
1066 The remainder of this subsection is intended for specialized tasks
1067and requires knowledge of Lisp. Most readers can skip it.
1068
1069 You can use Lisp expressions to calculate parts of the
1070replacement string. To do this, write @samp{\,} followed by the
1071expression in the replacement string. Each replacement calculates the
1072value of the expression and converts it to text without quoting (if
1073it's a string, this means using the string's contents), and uses it in
1074the replacement string in place of the expression itself. If the
1075expression is a symbol, one space in the replacement string after the
1076symbol name goes with the symbol name, so the value replaces them
1077both.
1078
1079 Inside such an expression, you can use some special sequences.
1080@samp{\&} and @samp{\@var{n}} refer here, as usual, to the entire
1081match as a string, and to a submatch as a string. @var{n} may be
1082multiple digits, and the value of @samp{\@var{n}} is @code{nil} if
1083subexpression @var{n} did not match. You can also use @samp{\#&} and
1084@samp{\#@var{n}} to refer to those matches as numbers (this is valid
1085when the match or submatch has the form of a numeral). @samp{\#} here
1086too stands for the number of already-completed replacements.
1087
1088 Repeating our example to exchange @samp{x} and @samp{y}, we can thus
1089do it also this way:
1090
1091@example
1092M-x replace-regexp @key{RET} \(x\)\|y @key{RET}
1093\,(if \1 "y" "x") @key{RET}
1094@end example
1095
1096 For computing replacement strings for @samp{\,}, the @code{format}
1097function is often useful (@pxref{Formatting Strings,,, elisp, The Emacs
1098Lisp Reference Manual}). For example, to add consecutively numbered
1099strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are
1100already occupied), you can use
1101
1102@example
1103M-x replace-regexp @key{RET} ^.\@{0,72\@}$ @key{RET}
1104\,(format "%-72sABC%05d" \& \#) @key{RET}
1105@end example
1106
1107@node Replacement and Case, Query Replace, Regexp Replace, Replace
1108@subsection Replace Commands and Case
1109
1110 If the first argument of a replace command is all lower case, the
1111command ignores case while searching for occurrences to
1112replace---provided @code{case-fold-search} is non-@code{nil}. If
1113@code{case-fold-search} is set to @code{nil}, case is always significant
1114in all searches.
1115
1116@vindex case-replace
1117 In addition, when the @var{newstring} argument is all or partly lower
1118case, replacement commands try to preserve the case pattern of each
1119occurrence. Thus, the command
1120
1121@example
1122M-x replace-string @key{RET} foo @key{RET} bar @key{RET}
1123@end example
1124
1125@noindent
1126replaces a lower case @samp{foo} with a lower case @samp{bar}, an
1127all-caps @samp{FOO} with @samp{BAR}, and a capitalized @samp{Foo} with
1128@samp{Bar}. (These three alternatives---lower case, all caps, and
1129capitalized, are the only ones that @code{replace-string} can
1130distinguish.)
1131
1132 If upper-case letters are used in the replacement string, they remain
1133upper case every time that text is inserted. If upper-case letters are
1134used in the first argument, the second argument is always substituted
1135exactly as given, with no case conversion. Likewise, if either
1136@code{case-replace} or @code{case-fold-search} is set to @code{nil},
1137replacement is done without case conversion.
1138
1139@node Query Replace,, Replacement and Case, Replace
1140@subsection Query Replace
1141@cindex query replace
1142
1143@table @kbd
1144@item M-% @var{string} @key{RET} @var{newstring} @key{RET}
1145@itemx M-x query-replace @key{RET} @var{string} @key{RET} @var{newstring} @key{RET}
1146Replace some occurrences of @var{string} with @var{newstring}.
1147@item C-M-% @var{regexp} @key{RET} @var{newstring} @key{RET}
1148@itemx M-x query-replace-regexp @key{RET} @var{regexp} @key{RET} @var{newstring} @key{RET}
1149Replace some matches for @var{regexp} with @var{newstring}.
1150@end table
1151
1152@kindex M-%
1153@findex query-replace
1154 If you want to change only some of the occurrences of @samp{foo} to
1155@samp{bar}, not all of them, then you cannot use an ordinary
1156@code{replace-string}. Instead, use @kbd{M-%} (@code{query-replace}).
1157This command finds occurrences of @samp{foo} one by one, displays each
1158occurrence and asks you whether to replace it. Aside from querying,
1159@code{query-replace} works just like @code{replace-string}. It
1160preserves case, like @code{replace-string}, provided
1161@code{case-replace} is non-@code{nil}, as it normally is
1162(@pxref{Replacement and Case}). A numeric argument means consider
1163only occurrences that are bounded by word-delimiter characters.
1164
1165@kindex C-M-%
1166@findex query-replace-regexp
1167 @kbd{C-M-%} performs regexp search and replace (@code{query-replace-regexp}).
1168It works like @code{replace-regexp} except that it queries
1169like @code{query-replace}.
1170
1171@cindex faces for highlighting query replace
1172 These commands highlight the current match using the face
1173@code{query-replace}. They highlight other matches using
1174@code{lazy-highlight} just like incremental search (@pxref{Incremental
1175Search}).
1176
1177 The characters you can type when you are shown a match for the string
1178or regexp are:
1179
1180@ignore @c Not worth it.
1181@kindex SPC @r{(query-replace)}
1182@kindex DEL @r{(query-replace)}
1183@kindex , @r{(query-replace)}
1184@kindex RET @r{(query-replace)}
1185@kindex . @r{(query-replace)}
1186@kindex ! @r{(query-replace)}
1187@kindex ^ @r{(query-replace)}
1188@kindex C-r @r{(query-replace)}
1189@kindex C-w @r{(query-replace)}
1190@kindex C-l @r{(query-replace)}
1191@end ignore
1192
1193@c WideCommands
1194@table @kbd
1195@item @key{SPC}
1196to replace the occurrence with @var{newstring}.
1197
1198@item @key{DEL}
1199to skip to the next occurrence without replacing this one.
1200
1201@item , @r{(Comma)}
1202to replace this occurrence and display the result. You are then asked
1203for another input character to say what to do next. Since the
1204replacement has already been made, @key{DEL} and @key{SPC} are
1205equivalent in this situation; both move to the next occurrence.
1206
1207You can type @kbd{C-r} at this point (see below) to alter the replaced
1208text. You can also type @kbd{C-x u} to undo the replacement; this exits
1209the @code{query-replace}, so if you want to do further replacement you
1210must use @kbd{C-x @key{ESC} @key{ESC} @key{RET}} to restart
1211(@pxref{Repetition}).
1212
1213@item @key{RET}
1214to exit without doing any more replacements.
1215
1216@item .@: @r{(Period)}
1217to replace this occurrence and then exit without searching for more
1218occurrences.
1219
1220@item !
1221to replace all remaining occurrences without asking again.
1222
1223@item ^
1224to go back to the position of the previous occurrence (or what used to
1225be an occurrence), in case you changed it by mistake or want to
1226reexamine it.
1227
1228@item C-r
1229to enter a recursive editing level, in case the occurrence needs to be
1230edited rather than just replaced with @var{newstring}. When you are
1231done, exit the recursive editing level with @kbd{C-M-c} to proceed to
1232the next occurrence. @xref{Recursive Edit}.
1233
1234@item C-w
1235to delete the occurrence, and then enter a recursive editing level as in
1236@kbd{C-r}. Use the recursive edit to insert text to replace the deleted
1237occurrence of @var{string}. When done, exit the recursive editing level
1238with @kbd{C-M-c} to proceed to the next occurrence.
1239
1240@item e
1241to edit the replacement string in the minibuffer. When you exit the
1242minibuffer by typing @key{RET}, the minibuffer contents replace the
1243current occurrence of the pattern. They also become the new
1244replacement string for any further occurrences.
1245
1246@item C-l
1247to redisplay the screen. Then you must type another character to
1248specify what to do with this occurrence.
1249
1250@item C-h
1251to display a message summarizing these options. Then you must type
1252another character to specify what to do with this occurrence.
1253@end table
1254
1255 Some other characters are aliases for the ones listed above: @kbd{y},
1256@kbd{n} and @kbd{q} are equivalent to @key{SPC}, @key{DEL} and
1257@key{RET}.
1258
1259 Aside from this, any other character exits the @code{query-replace},
1260and is then reread as part of a key sequence. Thus, if you type
1261@kbd{C-k}, it exits the @code{query-replace} and then kills to end of
1262line.
1263
1264 To restart a @code{query-replace} once it is exited, use @kbd{C-x
1265@key{ESC} @key{ESC}}, which repeats the @code{query-replace} because it
1266used the minibuffer to read its arguments. @xref{Repetition, C-x ESC
1267ESC}.
1268
1269 @xref{Operating on Files}, for the Dired @kbd{Q} command which
1270performs query replace on selected files. See also @ref{Transforming
1271File Names}, for Dired commands to rename, copy, or link files by
1272replacing regexp matches in file names.
1273
1274@node Other Repeating Search
1275@section Other Search-and-Loop Commands
1276
1277 Here are some other commands that find matches for a regular
1278expression. They all ignore case in matching, if the pattern contains
1279no upper-case letters and @code{case-fold-search} is non-@code{nil}.
1280Aside from @code{occur} and its variants, all operate on the text from
1281point to the end of the buffer, or on the active region in Transient
1282Mark mode.
1283
1284@findex list-matching-lines
1285@findex occur
1286@findex multi-occur
1287@findex multi-occur-in-matching-buffers
1288@findex how-many
1289@findex delete-non-matching-lines
1290@findex delete-matching-lines
1291@findex flush-lines
1292@findex keep-lines
1293
1294@table @kbd
1295@item M-x occur @key{RET} @var{regexp} @key{RET}
1296Display a list showing each line in the buffer that contains a match
1297for @var{regexp}. To limit the search to part of the buffer, narrow
1298to that part (@pxref{Narrowing}). A numeric argument @var{n}
1299specifies that @var{n} lines of context are to be displayed before and
1300after each matching line. Currently, @code{occur} can not correctly
1301handle multiline matches.
1302
1303@kindex RET @r{(Occur mode)}
1304@kindex o @r{(Occur mode)}
1305@kindex C-o @r{(Occur mode)}
1306The buffer @samp{*Occur*} containing the output serves as a menu for
1307finding the occurrences in their original context. Click
1308@kbd{Mouse-2} on an occurrence listed in @samp{*Occur*}, or position
1309point there and type @key{RET}; this switches to the buffer that was
1310searched and moves point to the original of the chosen occurrence.
1311@kbd{o} and @kbd{C-o} display the match in another window; @kbd{C-o}
1312does not select it.
1313
1314After using @kbd{M-x occur}, you can use @code{next-error} to visit
1315the occurrences found, one by one. @ref{Compilation Mode}.
1316
1317@item M-x list-matching-lines
1318Synonym for @kbd{M-x occur}.
1319
1320@item M-x multi-occur @key{RET} @var{buffers} @key{RET} @var{regexp} @key{RET}
1321This function is just like @code{occur}, except it is able to search
1322through multiple buffers. It asks you to specify the buffer names one by one.
1323
1324@item M-x multi-occur-in-matching-buffers @key{RET} @var{bufregexp} @key{RET} @var{regexp} @key{RET}
1325This function is similar to @code{multi-occur}, except the buffers to
1326search are specified by a regular expression that matches visited
1327file names. With a prefix argument, it uses the regular expression to match
1328buffer names instead.
1329
1330@item M-x how-many @key{RET} @var{regexp} @key{RET}
1331Print the number of matches for @var{regexp} that exist in the buffer
1332after point. In Transient Mark mode, if the region is active, the
1333command operates on the region instead.
1334
1335@item M-x flush-lines @key{RET} @var{regexp} @key{RET}
1336This command deletes each line that contains a match for @var{regexp},
1337operating on the text after point; it deletes the current line
1338if it contains a match starting after point. In Transient Mark mode,
1339if the region is active, the command operates on the region instead;
1340it deletes a line partially contained in the region if it contains a
1341match entirely contained in the region.
1342
1343If a match is split across lines, @code{flush-lines} deletes all those
1344lines. It deletes the lines before starting to look for the next
1345match; hence, it ignores a match starting on the same line at which
1346another match ended.
1347
1348@item M-x keep-lines @key{RET} @var{regexp} @key{RET}
1349This command deletes each line that @emph{does not} contain a match for
1350@var{regexp}, operating on the text after point; if point is not at the
1351beginning of a line, it always keeps the current line. In Transient
1352Mark mode, if the region is active, the command operates on the region
1353instead; it never deletes lines that are only partially contained in
1354the region (a newline that ends a line counts as part of that line).
1355
1356If a match is split across lines, this command keeps all those lines.
1357@end table
1358
1359@ignore
1360 arch-tag: fd9d8e77-66af-491c-b212-d80999613e3e
1361@end ignore
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi
new file mode 100644
index 00000000000..5d6a7c83f3e
--- /dev/null
+++ b/doc/emacs/sending.texi
@@ -0,0 +1,724 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Sending Mail
6@chapter Sending Mail
7@cindex sending mail
8@cindex mail
9@cindex message
10
11 To send a message in Emacs, you start by typing a command (@kbd{C-x m})
12to select and initialize the @samp{*mail*} buffer. Then you edit the text
13and headers of the message in this buffer, and type another command
14(@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message.
15
16@table @kbd
17@item C-x m
18Begin composing a message to send (@code{compose-mail}).
19@item C-x 4 m
20Likewise, but display the message in another window
21(@code{compose-mail-other-window}).
22@item C-x 5 m
23Likewise, but make a new frame (@code{compose-mail-other-frame}).
24@item C-c C-s
25In Mail mode, send the message (@code{mail-send}).
26@item C-c C-c
27Send the message and bury the mail buffer (@code{mail-send-and-exit}).
28@end table
29
30@kindex C-x m
31@findex compose-mail
32@kindex C-x 4 m
33@findex compose-mail-other-window
34@kindex C-x 5 m
35@findex compose-mail-other-frame
36 The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named
37@samp{*mail*} and initializes it with the skeleton of an outgoing
38message. @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the
39@samp{*mail*} buffer in a different window, leaving the previous current
40buffer visible. @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates
41a new frame to select the @samp{*mail*} buffer.
42
43 Because the mail-composition buffer is an ordinary Emacs buffer, you can
44switch to other buffers while in the middle of composing mail, and switch
45back later (or never). If you use the @kbd{C-x m} command again when you
46have been composing another message but have not sent it, you are asked to
47confirm before the old message is erased. If you answer @kbd{n}, the
48@samp{*mail*} buffer remains selected with its old contents, so you can
49finish the old message and send it. @kbd{C-u C-x m} is another way to do
50this. Sending the message marks the @samp{*mail*} buffer ``unmodified,''
51which avoids the need for confirmation when @kbd{C-x m} is next used.
52
53 If you are composing a message in the @samp{*mail*} buffer and want to
54send another message before finishing the first, rename the
55@samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc
56Buffer}). Then you can use @kbd{C-x m} or its variants described above
57to make a new @samp{*mail*} buffer. Once you've done that, you can work
58with each mail buffer independently.
59
60@vindex mail-default-directory
61 The variable @code{mail-default-directory} controls the default
62directory for mail buffers, and also says where to put their auto-save
63files.
64
65@ignore
66@c Commented out because it is not user-oriented;
67@c it doesn't say how to do some job. -- rms.
68@cindex directory servers
69@cindex LDAP
70@cindex PH/QI
71@cindex names and addresses
72There is an interface to directory servers using various protocols such
73as LDAP or the CCSO white pages directory system (PH/QI), described in a
74separate manual. It may be useful for looking up names and addresses.
75@xref{Top,,EUDC, eudc, EUDC Manual}.
76@end ignore
77
78@menu
79* Format: Mail Format. Format of the mail being composed.
80* Headers: Mail Headers. Details of permitted mail header fields.
81* Aliases: Mail Aliases. Abbreviating and grouping mail addresses.
82* Mode: Mail Mode. Special commands for editing mail being composed.
83* Amuse: Mail Amusements. Distracting the NSA; adding fortune messages.
84* Methods: Mail Methods. Using alternative mail-composition methods.
85@end menu
86
87@node Mail Format
88@section The Format of the Mail Buffer
89
90 In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header
91fields} which say who sent it, when, to whom, why, and so on. Some
92header fields, such as @samp{Date} and @samp{Sender}, are created
93automatically when you send the message. Others, such as the recipient
94names, must be specified by you in order to send the message properly.
95
96 In the mail buffer, you can insert and edit header fields using
97ordinary editing commands. Mail mode provides a commands to help you
98edit some header fields, and some are preinitialized in the buffer
99automatically when appropriate.
100
101 The line in the buffer that says
102
103@example
104--text follows this line--
105@end example
106
107@noindent
108is a special delimiter that separates the headers you have specified from
109the text. Whatever follows this line is the text of the message; the
110headers precede it. The delimiter line itself does not appear in the
111message actually sent. The text used for the delimiter line is controlled
112by the variable @code{mail-header-separator}.
113
114 Here is an example of what the headers and text in the mail buffer
115might look like.
116
117@example
118To: gnu@@gnu.org
119CC: lungfish@@spam.org, byob@@spam.org
120Subject: The Emacs Manual
121--Text follows this line--
122Please ignore this message.
123@end example
124
125@node Mail Headers
126@section Mail Header Fields
127@cindex headers (of mail message)
128
129 A header field in the mail buffer starts with a field name at the
130beginning of a line, terminated by a colon. Upper and lower case are
131equivalent in field names (and in mailing addresses also). After the
132colon and optional whitespace comes the contents of the field.
133
134 You can use any name you like for a header field, but normally people
135use only standard field names with accepted meanings. Here is a table
136of fields commonly used in outgoing messages.
137
138@table @samp
139@item To
140This field contains the mailing addresses to which the message is
141addressed. If you list more than one address, use commas, not spaces,
142to separate them.
143
144@item Subject
145The contents of the @samp{Subject} field should be a piece of text
146that says what the message is about. The reason @samp{Subject} fields
147are useful is that most mail-reading programs can provide a summary of
148messages, listing the subject of each message but not its text.
149
150@item CC
151This field contains additional mailing addresses to send the message to,
152like @samp{To} except that these readers should not regard the message
153as directed at them.
154
155@item BCC
156This field contains additional mailing addresses to send the message to,
157which should not appear in the header of the message actually sent.
158Copies sent this way are called @dfn{blind carbon copies}.
159
160@vindex mail-self-blind
161@cindex copy of every outgoing message
162To send a blind carbon copy of every outgoing message to yourself, set
163the variable @code{mail-self-blind} to @code{t}. To send a blind carbon
164copy of every message to some other @var{address}, set the variable
165@code{mail-default-headers} to @code{"Bcc: @var{address}\n"}.
166
167@item FCC
168This field contains the name of one file and directs Emacs to append a
169copy of the message to that file when you send the message. If the file
170is in Rmail format, Emacs writes the message in Rmail format; otherwise,
171Emacs writes the message in system mail file format. To specify
172more than one file, use several @samp{FCC} fields, with one file
173name in each field.
174
175@vindex mail-archive-file-name
176To put a fixed file name in the @samp{FCC} field each time you start
177editing an outgoing message, set the variable
178@code{mail-archive-file-name} to that file name. Unless you remove the
179@samp{FCC} field before sending, the message will be written into that
180file when it is sent.
181
182@item From
183Use the @samp{From} field to say who you are, when the account you are
184using to send the mail is not your own. The contents of the @samp{From}
185field should be a valid mailing address, since replies will normally go
186there. If you don't specify the @samp{From} field yourself, Emacs uses
187the value of @code{user-mail-address} as the default.
188
189@item Reply-to
190Use this field to direct replies to a different address. Most
191mail-reading programs (including Rmail) automatically send replies to
192the @samp{Reply-to} address in preference to the @samp{From} address.
193By adding a @samp{Reply-to} field to your header, you can work around
194any problems your @samp{From} address may cause for replies.
195
196@cindex @env{REPLYTO} environment variable
197@vindex mail-default-reply-to
198To put a fixed @samp{Reply-to} address into every outgoing message, set
199the variable @code{mail-default-reply-to} to that address (as a string).
200Then @code{mail} initializes the message with a @samp{Reply-to} field as
201specified. You can delete or alter that header field before you send
202the message, if you wish. When Emacs starts up, if the environment
203variable @env{REPLYTO} is set, @code{mail-default-reply-to} is
204initialized from that environment variable.
205
206@item In-reply-to
207This field contains a piece of text describing the message you are
208replying to. Some mail systems can use this information to correlate
209related pieces of mail. Normally this field is filled in by Rmail
210when you reply to a message in Rmail, and you never need to
211think about it (@pxref{Rmail}).
212
213@item References
214This field lists the message IDs of related previous messages. Rmail
215sets up this field automatically when you reply to a message.
216@end table
217
218 The @samp{To}, @samp{CC}, and @samp{BCC} header fields can appear
219any number of times, and each such header field can contain multiple
220addresses, separated by commas. This way, you can specify any number
221of places to send the message. These fields can also have
222continuation lines: one or more lines starting with whitespace,
223following the starting line of the field, are considered part of the
224field. Here's an example of a @samp{To} field with a continuation
225line:
226
227@example
228@group
229To: foo@@here.net, this@@there.net,
230 me@@gnu.cambridge.mass.usa.earth.spiral3281
231@end group
232@end example
233
234@vindex mail-from-style
235 When you send the message, if you didn't write a @samp{From} field
236yourself, Emacs puts in one for you. The variable
237@code{mail-from-style} controls the format:
238
239@table @code
240@item nil
241Use just the email address, as in @samp{king@@grassland.com}.
242@item parens
243Use both email address and full name, as in:@*
244@samp{king@@grassland.com (Elvis Parsley)}.
245@item angles
246Use both email address and full name, as in:@*
247@samp{Elvis Parsley <king@@grassland.com>}.
248@item system-default
249Allow the system to insert the @samp{From} field.
250@end table
251
252@vindex mail-default-headers
253 You can direct Emacs to insert certain default headers into the
254outgoing message by setting the variable @code{mail-default-headers}
255to a string. Then @code{C-x m} inserts this string into the message
256headers. If the default header fields are not appropriate for a
257particular message, edit them as appropriate before sending the
258message.
259
260@node Mail Aliases
261@section Mail Aliases
262@cindex mail aliases
263@cindex @file{.mailrc} file
264@cindex mailrc file
265
266 You can define @dfn{mail aliases} in a file named @file{~/.mailrc}.
267These are short mnemonic names which stand for mail addresses or groups of
268mail addresses. Like many other mail programs, Emacs expands aliases
269when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and
270@samp{Reply-to} fields, plus their @samp{Resent-} variants.
271
272 To define an alias in @file{~/.mailrc}, write a line in the following
273format:
274
275@example
276alias @var{shortaddress} @var{fulladdresses}
277@end example
278
279@noindent
280Here @var{fulladdresses} stands for one or more mail addresses for
281@var{shortaddress} to expand into. Separate multiple addresses with
282spaces; if an address contains a space, quote the whole address with a
283pair of double-quotes.
284
285For instance, to make @code{maingnu} stand for
286@code{gnu@@gnu.org} plus a local address of your own, put in
287this line:@refill
288
289@example
290alias maingnu gnu@@gnu.org local-gnu
291@end example
292
293@noindent
294Addresses specified in this way should use doublequotes around an
295entire address when the address contains spaces. But you need not
296include doublequotes around parts of the address, such as the person's
297full name. Emacs puts them in if they are needed. For example,
298
299@example
300alias chief-torturer "George W. Bush <bush@@whitehouse.gov>"
301@end example
302
303@noindent
304is correct in @samp{.mailrc}. Emacs will insert the address as
305@samp{"George W. Bush" <bush@@whitehouse.gov>}.
306
307 Emacs also recognizes ``include'' commands in @samp{.mailrc} files.
308They look like this:
309
310@example
311source @var{filename}
312@end example
313
314@noindent
315The file @file{~/.mailrc} is used primarily by other mail-reading
316programs; it can contain various other commands. Emacs ignores
317everything in it except for alias definitions and include commands.
318
319@findex define-mail-alias
320 Another way to define a mail alias, within Emacs alone, is with the
321@code{define-mail-alias} command. It prompts for the alias and then the
322full address. You can use it to define aliases in your @file{.emacs}
323file, like this:
324
325@example
326(define-mail-alias "maingnu" "gnu@@gnu.org")
327@end example
328
329@vindex mail-aliases
330 @code{define-mail-alias} records aliases by adding them to a
331variable named @code{mail-aliases}. If you are comfortable with
332manipulating Lisp lists, you can set @code{mail-aliases} directly. The
333initial value of @code{mail-aliases} is @code{t}, which means that
334Emacs should read @file{.mailrc} to get the proper value.
335
336@vindex mail-personal-alias-file
337 You can specify a different file name to use instead of
338@file{~/.mailrc} by setting the variable
339@code{mail-personal-alias-file}.
340
341@findex expand-mail-aliases
342 Normally, Emacs expands aliases when you send the message. You do not
343need to expand mail aliases before sending the message, but you can
344expand them if you want to see where the mail will actually go. To do
345this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail
346aliases currently present in the mail headers that hold addresses.
347
348 If you like, you can have mail aliases expand as abbrevs, as soon as
349you type them in (@pxref{Abbrevs}). To enable this feature, execute the
350following:
351
352@example
353(add-hook 'mail-mode-hook 'mail-abbrevs-setup)
354@end example
355
356@noindent
357@findex define-mail-abbrev
358@vindex mail-abbrevs
359This can go in your @file{.emacs} file. @xref{Hooks}. If you use this
360feature, you must use @code{define-mail-abbrev} instead of
361@code{define-mail-alias}; the latter does not work with this package.
362Note that the mail abbreviation package uses the variable
363@code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias
364names are converted to lower case.
365
366@kindex C-c C-a @r{(Mail mode)}
367@findex mail-interactive-insert-alias
368 The mail abbreviation package also provides the @kbd{C-c C-a}
369(@code{mail-interactive-insert-alias}) command, which reads an alias
370name (with completion) and inserts its definition at point. This is
371useful when editing the message text itself or a header field such as
372@samp{Subject} in which Emacs does not normally expand aliases.
373
374 Note that abbrevs expand only if you insert a word-separator character
375afterward. However, you can rebind @kbd{C-n} and @kbd{M->} to cause
376expansion as well. Here's how to do that:
377
378@smallexample
379(add-hook 'mail-mode-hook
380 (lambda ()
381 (define-key
382 mail-mode-map [remap next-line] 'mail-abbrev-next-line)
383 (define-key
384 mail-mode-map [remap end-of-buffer] 'mail-abbrev-end-of-buffer)))
385@end smallexample
386
387@node Mail Mode
388@section Mail Mode
389@cindex Mail mode
390@cindex mode, Mail
391
392 The major mode used in the mail buffer is Mail mode, which is much
393like Text mode except that various special commands are provided on the
394@kbd{C-c} prefix. These commands all have to do specifically with
395editing or sending the message. In addition, Mail mode defines the
396character @samp{%} as a word separator; this is helpful for using the
397word commands to edit mail addresses.
398
399 Mail mode is normally used in buffers set up automatically by the
400@code{mail} command and related commands. However, you can also switch
401to Mail mode in a file-visiting buffer. This is a useful thing to do if
402you have saved the text of a draft message in a file.
403
404@menu
405* Mail Sending:: Commands to send the message.
406* Header Editing:: Commands to move to header fields and edit them.
407* Citing Mail:: Copying all or part of a message you are replying to.
408* Mail Mode Misc:: Spell checking, signatures, etc.
409@end menu
410
411@node Mail Sending
412@subsection Mail Sending
413
414 Mail mode has two commands for sending the message you have been
415editing:
416
417@table @kbd
418@item C-c C-s
419Send the message, and leave the mail buffer selected (@code{mail-send}).
420@item C-c C-c
421Send the message, and select some other buffer (@code{mail-send-and-exit}).
422@end table
423
424@kindex C-c C-s @r{(Mail mode)}
425@kindex C-c C-c @r{(Mail mode)}
426@findex mail-send
427@findex mail-send-and-exit
428 @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail
429buffer unmodified, but leaves that buffer selected so that you can
430modify the message (perhaps with new recipients) and send it again.
431@kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the
432window or switches to another buffer. It puts the mail buffer at the
433lowest priority for reselection by default, since you are finished with
434using it. This is the usual way to send the message.
435
436 In a file-visiting buffer, sending the message does not clear the
437modified flag, because only saving the file should do that. Also, you
438don't get a warning if you try to send the same message twice.
439
440@c This is indexed in mule.texi, node "Recognize Coding".
441@c @vindex sendmail-coding-system
442 When you send a message that contains non-@acronym{ASCII} characters, they need
443to be encoded with a coding system (@pxref{Coding Systems}). Usually
444the coding system is specified automatically by your chosen language
445environment (@pxref{Language Environments}). You can explicitly specify
446the coding system for outgoing mail by setting the variable
447@code{sendmail-coding-system} (@pxref{Recognize Coding}).
448
449 If the coding system thus determined does not handle the characters in
450a particular message, Emacs asks you to select the coding system to use,
451showing a list of possible coding systems.
452
453@cindex SMTP
454@cindex Feedmail
455@cindex Sendmail
456@vindex send-mail-function
457 The variable @code{send-mail-function} controls how the default mail
458user agent sends mail. It should be set to a function. The default
459is @code{sendmail-send-it}, which delivers mail using the Sendmail
460installation on the local host. To send mail through a SMTP server,
461set it to @code{smtpmail-send-it} and set up the Emacs SMTP library
462(@pxref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}). A
463third option is @code{feedmail-send-it}, see the commentary section of
464the @file{feedmail.el} package for more information.
465
466@node Header Editing
467@subsection Mail Header Editing
468
469 Mail mode provides special commands to move to particular header
470fields and to complete addresses in headers.
471
472@table @kbd
473@item C-c C-f C-t
474Move to the @samp{To} header field, creating one if there is none
475(@code{mail-to}).
476@item C-c C-f C-s
477Move to the @samp{Subject} header field, creating one if there is
478none (@code{mail-subject}).
479@item C-c C-f C-c
480Move to the @samp{CC} header field, creating one if there is none
481(@code{mail-cc}).
482@item C-c C-f C-b
483Move to the @samp{BCC} header field, creating one if there is none
484(@code{mail-bcc}).
485@item C-c C-f C-f
486Move to the @samp{FCC} header field, creating one if there is none
487(@code{mail-fcc}).
488@item M-@key{TAB}
489Complete a mailing address (@code{mail-complete}).
490@end table
491
492@kindex C-c C-f C-t @r{(Mail mode)}
493@findex mail-to
494@kindex C-c C-f C-s @r{(Mail mode)}
495@findex mail-subject
496@kindex C-c C-f C-c @r{(Mail mode)}
497@findex mail-cc
498@kindex C-c C-f C-b @r{(Mail mode)}
499@findex mail-bcc
500@kindex C-c C-f C-f @r{(Mail mode)}
501@findex mail-fcc
502 There are five commands to move point to particular header fields, all
503based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). They
504are listed in the table above. If the field in question does not exist,
505these commands create one. We provide special motion commands for these
506particular fields because they are the fields users most often want to
507edit.
508
509@findex mail-complete
510@kindex M-TAB @r{(Mail mode)}
511 While editing a header field that contains mailing addresses, such
512as @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing
513address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It
514inserts the full name corresponding to the address, if it can
515determine the full name. The variable @code{mail-complete-style}
516controls whether to insert the full name, and what style to use, as in
517@code{mail-from-style} (@pxref{Mail Headers}). (If your window
518manager defines @kbd{M-@key{TAB}} to switch windows, you can type
519@kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.)
520
521 For completion purposes, the valid mailing addresses are taken to be
522the local users' names plus your personal mail aliases. You can
523specify additional sources of valid addresses; see the customization
524group @samp{mailalias} to see the variables for customizing this
525feature (@pxref{Customization Groups}).
526
527 If you type @kbd{M-@key{TAB}} in the body of the message,
528@code{mail-complete} invokes @code{ispell-complete-word}, as in Text
529mode.
530
531@node Citing Mail
532@subsection Citing Mail
533@cindex citing mail
534
535 Mail mode also has commands for yanking or @dfn{citing} all or part of
536a message that you are replying to. These commands are active only when
537you started sending a message using an Rmail command.
538
539@table @kbd
540@item C-c C-y
541Yank the selected message from Rmail (@code{mail-yank-original}).
542@item C-c C-r
543Yank the region from the Rmail buffer (@code{mail-yank-region}).
544@item C-c C-q
545Fill each paragraph cited from another message
546(@code{mail-fill-yanked-message}).
547@end table
548
549@kindex C-c C-y @r{(Mail mode)}
550@findex mail-yank-original
551 When mail sending is invoked from the Rmail mail reader using an Rmail
552command, @kbd{C-c C-y} can be used inside the mail buffer to insert
553the text of the message you are replying to. Normally it indents each line
554of that message three spaces and eliminates most header fields. A numeric
555argument specifies the number of spaces to indent. An argument of just
556@kbd{C-u} says not to indent at all and not to eliminate anything.
557@kbd{C-c C-y} always uses the current message from the Rmail buffer,
558so you can insert several old messages by selecting one in Rmail,
559switching to @samp{*mail*} and yanking it, then switching back to
560Rmail to select another.
561
562@vindex mail-yank-prefix
563 You can specify the text for @kbd{C-c C-y} to insert at the beginning
564of each line: set @code{mail-yank-prefix} to the desired string. (A
565value of @code{nil} means to use indentation; this is the default.)
566However, @kbd{C-u C-c C-y} never adds anything at the beginning of the
567inserted lines, regardless of the value of @code{mail-yank-prefix}.
568
569@kindex C-c C-r @r{(Mail mode)}
570@findex mail-yank-region
571 To yank just a part of an incoming message, set the region in Rmail to
572the part you want; then go to the @samp{*Mail*} message and type
573@kbd{C-c C-r} (@code{mail-yank-region}). Each line that is copied is
574indented or prefixed according to @code{mail-yank-prefix}.
575
576@kindex C-c C-q @r{(Mail mode)}
577@findex mail-fill-yanked-message
578 After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q}
579(@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked
580old message or messages. One use of @kbd{C-c C-q} fills all such
581paragraphs, each one individually. To fill a single paragraph of the
582quoted message, use @kbd{M-q}. If filling does not automatically
583handle the type of citation prefix you use, try setting the fill prefix
584explicitly. @xref{Filling}.
585
586@node Mail Mode Misc
587@subsection Mail Mode Miscellany
588
589@table @kbd
590@item C-c C-t
591Move to the beginning of the message body text (@code{mail-text}).
592@item C-c C-w
593Insert the file @file{~/.signature} at the end of the message text
594(@code{mail-signature}).
595@item C-c C-i @var{file} @key{RET}
596Insert the contents of @var{file} at the end of the outgoing message
597(@code{mail-attach-file}).
598@item M-x ispell-message
599Perform spelling correction on the message text, but not on citations from
600other messages.
601@end table
602
603@kindex C-c C-t @r{(Mail mode)}
604@findex mail-text
605 @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header
606separator line---that is, to the beginning of the message body text.
607
608@kindex C-c C-w @r{(Mail mode)}
609@findex mail-signature
610@vindex mail-signature
611 @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text at
612the end of the message to say more about who you are. The text comes
613from the file @file{~/.signature} in your home directory. To insert
614your signature automatically, set the variable @code{mail-signature} to
615@code{t}; after that, starting a mail message automatically inserts the
616contents of your @file{~/.signature} file. If you want to omit your
617signature from a particular message, delete it from the buffer before
618you send the message.
619
620 You can also set @code{mail-signature} to a string; then that string
621is inserted automatically as your signature when you start editing a
622message to send. If you set it to some other Lisp expression, the
623expression is evaluated each time, and its value (which should be a
624string) specifies the signature.
625
626@findex ispell-message
627 You can do spelling correction on the message text you have written
628with the command @kbd{M-x ispell-message}. If you have yanked an
629incoming message into the outgoing draft, this command skips what was
630yanked, but it checks the text that you yourself inserted. (It looks
631for indentation or @code{mail-yank-prefix} to distinguish the cited
632lines from your input.) @xref{Spelling}.
633
634@kindex C-c C-i @r{(Mail mode)}
635@findex mail-attach-file
636 To include a file in the outgoing message, you can use @kbd{C-x i},
637the usual command to insert a file in the current buffer. But it is
638often more convenient to use a special command, @kbd{C-c C-i}
639(@code{mail-attach-file}). This command inserts the file contents at
640the end of the buffer, after your signature if any, with a delimiter
641line that includes the file name. Note that this is not a MIME
642attachment.
643
644@vindex mail-mode-hook
645@vindex mail-setup-hook
646 Turning on Mail mode (which @kbd{C-x m} does automatically) runs the
647normal hooks @code{text-mode-hook} and @code{mail-mode-hook}.
648Initializing a new outgoing message runs the normal hook
649@code{mail-setup-hook}; if you want to add special fields to your mail
650header or make other changes to the appearance of the mail buffer, use
651that hook. @xref{Hooks}.
652
653 The main difference between these hooks is just when they are
654invoked. Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs
655as soon as the @samp{*mail*} buffer is created. Then the
656@code{mail-setup} function inserts the default contents of the buffer.
657After these default contents are inserted, @code{mail-setup-hook} runs.
658
659@node Mail Amusements
660@section Mail Amusements
661
662@findex spook
663@cindex NSA
664 @kbd{M-x spook} adds a line of randomly chosen keywords to an outgoing
665mail message. The keywords are chosen from a list of words that suggest
666you are discussing something subversive.
667
668 The idea behind this feature is the suspicion that the
669NSA@footnote{The US National Security Agency.} snoops on
670all electronic mail messages that contain keywords suggesting they might
671find them interesting. (The NSA says they don't, but that's what they
672@emph{would} say.) The idea is that if lots of people add suspicious
673words to their messages, the NSA will get so busy with spurious input
674that they will have to give up reading it all.
675
676 Here's how to insert spook keywords automatically whenever you start
677entering an outgoing message:
678
679@example
680(add-hook 'mail-setup-hook 'spook)
681@end example
682
683 Whether or not this confuses the NSA, it at least amuses people.
684
685@findex fortune-to-signature
686@cindex fortune cookies
687 You can use the @code{fortune} program to put a ``fortune cookie''
688message into outgoing mail. To do this, add
689@code{fortune-to-signature} to @code{mail-setup-hook}:
690
691@example
692(add-hook 'mail-setup-hook 'fortune-to-signature)
693@end example
694
695@node Mail Methods
696@section Mail-Composition Methods
697@cindex mail-composition methods
698
699@cindex MH mail interface
700@cindex Message mode for sending mail
701 In this chapter we have described the usual Emacs mode for editing
702and sending mail---Mail mode. Emacs has alternative facilities for
703editing and sending mail, including
704MH-E and Message mode, not documented in this manual.
705@xref{Top,,MH-E,mh-e, The Emacs Interface to MH}. @xref{Top,,Message,message,
706Message Manual}. You can choose any of them as your preferred method.
707The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use
708whichever agent you have specified, as do various other Emacs commands
709and facilities that send mail.
710
711@vindex mail-user-agent
712 To specify your mail-composition method, customize the variable
713@code{mail-user-agent}. Currently legitimate values include
714@code{sendmail-user-agent} (Mail mode), @code{mh-e-user-agent},
715@code{message-user-agent} and @code{gnus-user-agent}.
716
717 If you select a different mail-composition method, the information
718in this chapter about the @samp{*mail*} buffer and Mail mode does not
719apply; the other methods use a different format of text in a different
720buffer, and their commands are different as well.
721
722@ignore
723 arch-tag: d8a3dfc3-5d87-45c5-a7f2-69871b8e4fd6
724@end ignore
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
new file mode 100644
index 00000000000..3a0e091ea40
--- /dev/null
+++ b/doc/emacs/text.texi
@@ -0,0 +1,2901 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Text, Programs, Indentation, Top
6@chapter Commands for Human Languages
7@cindex text
8@cindex manipulating text
9
10 The term @dfn{text} has two widespread meanings in our area of the
11computer field. One is data that is a sequence of characters. Any file
12that you edit with Emacs is text, in this sense of the word. The other
13meaning is more restrictive: a sequence of characters in a human language
14for humans to read (possibly after processing by a text formatter), as
15opposed to a program or binary data. This chapter is concerned with
16editing text in the narrower sense.
17
18 Human languages have syntactic/stylistic conventions that can be
19supported or used to advantage by editor commands: conventions involving
20words, sentences, paragraphs, and capital letters. This chapter
21describes Emacs commands for all of these things. There are also
22commands for @dfn{filling}, which means rearranging the lines of a
23paragraph to be approximately equal in length. The commands for moving
24over and killing words, sentences and paragraphs, while intended
25primarily for editing text, are also often useful for editing programs.
26
27 Emacs has several major modes for editing human-language text. If the
28file contains text pure and simple, use Text mode, which customizes
29Emacs in small ways for the syntactic conventions of text. Outline mode
30provides special commands for operating on text with an outline
31structure.
32@iftex
33@xref{Outline Mode}.
34@end iftex
35
36 For text which contains embedded commands for text formatters, Emacs
37has other major modes, each for a particular formatter. Thus, for
38input to @TeX{}, you would use @TeX{}
39@iftex
40mode (@pxref{TeX Mode,,@TeX{} Mode}).
41@end iftex
42@ifnottex
43mode.
44@end ifnottex
45For input to groff or nroff, use Nroff mode.
46
47 Instead of using a text formatter, you can edit formatted text in
48WYSIWYG style (``what you see is what you get''), with Enriched mode.
49Then the formatting appears on the screen in Emacs while you edit.
50@iftex
51@xref{Formatted Text}.
52@end iftex
53
54@cindex ASCII art
55 If you need to edit pictures made out of text characters (commonly
56referred to as ``ASCII art''), use @kbd{M-x edit-picture} to enter
57Picture mode, a special major mode for editing such pictures.
58@iftex
59@xref{Picture Mode,,, emacs-xtra, Specialized Emacs Features}.
60@end iftex
61@ifnottex
62@xref{Picture Mode}.
63@end ifnottex
64
65
66@cindex skeletons
67@cindex templates
68@cindex autotyping
69@cindex automatic typing
70 The ``automatic typing'' features may be useful when writing text.
71@inforef{Top,, autotype}.
72
73@menu
74* Words:: Moving over and killing words.
75* Sentences:: Moving over and killing sentences.
76* Paragraphs:: Moving over paragraphs.
77* Pages:: Moving over pages.
78* Filling:: Filling or justifying text.
79* Case:: Changing the case of text.
80* Text Mode:: The major modes for editing text files.
81* Outline Mode:: Editing outlines.
82* TeX Mode:: Editing input to the formatter TeX.
83* HTML Mode:: Editing HTML, SGML, and XML files.
84* Nroff Mode:: Editing input to the formatter nroff.
85* Formatted Text:: Editing formatted text directly in WYSIWYG fashion.
86* Text Based Tables:: Editing text-based tables in WYSIWYG fashion.
87@end menu
88
89@node Words
90@section Words
91@cindex words
92@cindex Meta commands and words
93
94 Emacs has commands for moving over or operating on words. By convention,
95the keys for them are all Meta characters.
96
97@table @kbd
98@item M-f
99Move forward over a word (@code{forward-word}).
100@item M-b
101Move backward over a word (@code{backward-word}).
102@item M-d
103Kill up to the end of a word (@code{kill-word}).
104@item M-@key{DEL}
105Kill back to the beginning of a word (@code{backward-kill-word}).
106@item M-@@
107Mark the end of the next word (@code{mark-word}).
108@item M-t
109Transpose two words or drag a word across others
110(@code{transpose-words}).
111@end table
112
113 Notice how these keys form a series that parallels the character-based
114@kbd{C-f}, @kbd{C-b}, @kbd{C-d}, @key{DEL} and @kbd{C-t}. @kbd{M-@@} is
115cognate to @kbd{C-@@}, which is an alias for @kbd{C-@key{SPC}}.
116
117@kindex M-f
118@kindex M-b
119@findex forward-word
120@findex backward-word
121 The commands @kbd{M-f} (@code{forward-word}) and @kbd{M-b}
122(@code{backward-word}) move forward and backward over words. These
123Meta characters are thus analogous to the corresponding control
124characters, @kbd{C-f} and @kbd{C-b}, which move over single characters
125in the text. The analogy extends to numeric arguments, which serve as
126repeat counts. @kbd{M-f} with a negative argument moves backward, and
127@kbd{M-b} with a negative argument moves forward. Forward motion
128stops right after the last letter of the word, while backward motion
129stops right before the first letter.
130
131@kindex M-d
132@findex kill-word
133 @kbd{M-d} (@code{kill-word}) kills the word after point. To be
134precise, it kills everything from point to the place @kbd{M-f} would
135move to. Thus, if point is in the middle of a word, @kbd{M-d} kills
136just the part after point. If some punctuation comes between point and the
137next word, it is killed along with the word. (If you wish to kill only the
138next word but not the punctuation before it, simply do @kbd{M-f} to get
139the end, and kill the word backwards with @kbd{M-@key{DEL}}.)
140@kbd{M-d} takes arguments just like @kbd{M-f}.
141
142@findex backward-kill-word
143@kindex M-DEL
144 @kbd{M-@key{DEL}} (@code{backward-kill-word}) kills the word before
145point. It kills everything from point back to where @kbd{M-b} would
146move to. For instance, if point is after the space in @w{@samp{FOO,
147BAR}}, it kills @w{@samp{FOO, }}. If you wish to kill just
148@samp{FOO}, and not the comma and the space, use @kbd{M-b M-d} instead
149of @kbd{M-@key{DEL}}.
150
151@c Don't index M-t and transpose-words here, they are indexed in
152@c fixit.texi, in the node "Transpose".
153@c @kindex M-t
154@c @findex transpose-words
155 @kbd{M-t} (@code{transpose-words}) exchanges the word before or
156containing point with the following word. The delimiter characters between
157the words do not move. For example, @w{@samp{FOO, BAR}} transposes into
158@w{@samp{BAR, FOO}} rather than @samp{@w{BAR FOO,}}. @xref{Transpose}, for
159more on transposition.
160
161@kindex M-@@
162@findex mark-word
163 To operate on the next @var{n} words with an operation which applies
164between point and mark, you can either set the mark at point and then move
165over the words, or you can use the command @kbd{M-@@} (@code{mark-word})
166which does not move point, but sets the mark where @kbd{M-f} would move
167to. @kbd{M-@@} accepts a numeric argument that says how many words to
168scan for the place to put the mark. In Transient Mark mode, this command
169activates the mark.
170
171 The word commands' understanding of word boundaries is controlled
172by the syntax table. Any character can, for example, be declared to
173be a word delimiter. @xref{Syntax}.
174
175@node Sentences
176@section Sentences
177@cindex sentences
178@cindex manipulating sentences
179
180 The Emacs commands for manipulating sentences and paragraphs are mostly
181on Meta keys, so as to be like the word-handling commands.
182
183@table @kbd
184@item M-a
185Move back to the beginning of the sentence (@code{backward-sentence}).
186@item M-e
187Move forward to the end of the sentence (@code{forward-sentence}).
188@item M-k
189Kill forward to the end of the sentence (@code{kill-sentence}).
190@item C-x @key{DEL}
191Kill back to the beginning of the sentence (@code{backward-kill-sentence}).
192@end table
193
194@kindex M-a
195@kindex M-e
196@findex backward-sentence
197@findex forward-sentence
198 The commands @kbd{M-a} and @kbd{M-e} (@code{backward-sentence} and
199@code{forward-sentence}) move to the beginning and end of the current
200sentence, respectively. They were chosen to resemble @kbd{C-a} and
201@kbd{C-e}, which move to the beginning and end of a line. Unlike
202them, @kbd{M-a} and @kbd{M-e} move over successive sentences if
203repeated.
204
205 Moving backward over a sentence places point just before the first
206character of the sentence; moving forward places point right after the
207punctuation that ends the sentence. Neither one moves over the
208whitespace at the sentence boundary.
209
210@kindex M-k
211@kindex C-x DEL
212@findex kill-sentence
213@findex backward-kill-sentence
214 Just as @kbd{C-a} and @kbd{C-e} have a kill command, @kbd{C-k}, to go
215with them, so @kbd{M-a} and @kbd{M-e} have a corresponding kill command
216@kbd{M-k} (@code{kill-sentence}) which kills from point to the end of
217the sentence. With minus one as an argument it kills back to the
218beginning of the sentence. Larger arguments serve as a repeat count.
219There is also a command, @kbd{C-x @key{DEL}}
220(@code{backward-kill-sentence}), for killing back to the beginning of a
221sentence. This command is useful when you change your mind in the
222middle of composing text.
223
224 The sentence commands assume that you follow the American typist's
225convention of putting two spaces at the end of a sentence; they consider
226a sentence to end wherever there is a @samp{.}, @samp{?} or @samp{!}
227followed by the end of a line or two spaces, with any number of
228@samp{)}, @samp{]}, @samp{'}, or @samp{"} characters allowed in between.
229A sentence also begins or ends wherever a paragraph begins or ends.
230It is useful to follow this convention, because it makes a distinction
231between periods that end a sentence and periods that indicate
232abbreviations; that enables the Emacs sentence commands to distinguish,
233too. These commands do not stop for periods that indicate abbreviations.
234
235@vindex sentence-end-double-space
236 If you want to use just one space between sentences, you can set the
237variable @code{sentence-end-double-space} to @code{nil} to make the
238sentence commands stop for single spaces. However, this mode has a
239drawback: there is no way to distinguish between periods that end
240sentences and those that indicate abbreviations. For convenient and
241reliable editing, we therefore recommend you follow the two-space
242convention. The variable @code{sentence-end-double-space} also
243affects filling (@pxref{Fill Commands}) in related ways.
244
245@vindex sentence-end
246 The variable @code{sentence-end} controls how to recognize the end
247of a sentence. If non-@code{nil}, it is a regexp that matches the
248last few characters of a sentence, together with the whitespace
249following the sentence. If the value is @code{nil}, the default, then
250Emacs computes the regexp according to various criteria such as the
251value of @code{sentence-end-double-space}. @xref{Regexp Example}, for
252a detailed explanation of one of the regular expressions Emacs uses
253for this purpose.
254
255@vindex sentence-end-without-period
256 Some languages do not use periods to indicate the end of a sentence.
257For example, sentences in Thai end with a double space but without a
258period. Set the variable @code{sentence-end-without-period} to
259@code{t} in such cases.
260
261@node Paragraphs
262@section Paragraphs
263@cindex paragraphs
264@cindex manipulating paragraphs
265@kindex M-@{
266@kindex M-@}
267@findex backward-paragraph
268@findex forward-paragraph
269
270 The Emacs commands for manipulating paragraphs are also on Meta keys.
271
272@table @kbd
273@item M-@{
274Move back to previous paragraph beginning (@code{backward-paragraph}).
275@item M-@}
276Move forward to next paragraph end (@code{forward-paragraph}).
277@item M-h
278Put point and mark around this or next paragraph (@code{mark-paragraph}).
279@end table
280
281 @kbd{M-@{} moves to the beginning of the current or previous
282paragraph, while @kbd{M-@}} moves to the end of the current or next
283paragraph. Blank lines and text-formatter command lines separate
284paragraphs and are not considered part of any paragraph. If there is
285a blank line before the paragraph, @kbd{M-@{} moves to the blank line,
286because that is convenient in practice.
287
288 In Text mode, an indented line is not a paragraph break. If you
289want indented lines to have this effect, use Paragraph-Indent Text
290mode instead. @xref{Text Mode}.
291
292 In major modes for programs, paragraphs begin and end only at blank
293lines. This makes the paragraph commands useful, even though there
294are no paragraphs as such in a program.
295
296 When you have set a fill prefix, then paragraphs are delimited by
297all lines which don't start with the fill prefix. @xref{Filling}.
298
299@kindex M-h
300@findex mark-paragraph
301 When you wish to operate on a paragraph, you can use the command
302@kbd{M-h} (@code{mark-paragraph}) to set the region around it. Thus,
303for example, @kbd{M-h C-w} kills the paragraph around or after point.
304The @kbd{M-h} command puts point at the beginning and mark at the end of
305the paragraph point was in. In Transient Mark mode, it activates the
306mark. If point is between paragraphs (in a run of blank lines, or at a
307boundary), the paragraph following point is surrounded by point and
308mark. If there are blank lines preceding the first line of the
309paragraph, one of these blank lines is included in the region.
310
311@vindex paragraph-start
312@vindex paragraph-separate
313 The precise definition of a paragraph boundary is controlled by the
314variables @code{paragraph-separate} and @code{paragraph-start}. The
315value of @code{paragraph-start} is a regexp that should match any line
316that either starts or separates paragraphs. The value of
317@code{paragraph-separate} is another regexp that should match only lines
318that separate paragraphs without being part of any paragraph (for
319example, blank lines). Lines that start a new paragraph and are
320contained in it must match only @code{paragraph-start}, not
321@code{paragraph-separate}. Each regular expression must match at the
322left margin. For example, in Fundamental mode, @code{paragraph-start}
323is @w{@code{"\f\\|[ \t]*$"}}, and @code{paragraph-separate} is
324@w{@code{"[ \t\f]*$"}}.
325
326 Normally it is desirable for page boundaries to separate paragraphs.
327The default values of these variables recognize the usual separator for
328pages.
329
330@node Pages
331@section Pages
332
333@cindex pages
334@cindex formfeed
335 Files are often thought of as divided into @dfn{pages} by the
336@dfn{formfeed} character (@acronym{ASCII} control-L, octal code 014).
337When you print hardcopy for a file, this character forces a page break;
338thus, each page of the file goes on a separate page on paper. Most Emacs
339commands treat the page-separator character just like any other
340character: you can insert it with @kbd{C-q C-l}, and delete it with
341@key{DEL}. Thus, you are free to paginate your file or not. However,
342since pages are often meaningful divisions of the file, Emacs provides
343commands to move over them and operate on them.
344
345@table @kbd
346@item C-x [
347Move point to previous page boundary (@code{backward-page}).
348@item C-x ]
349Move point to next page boundary (@code{forward-page}).
350@item C-x C-p
351Put point and mark around this page (or another page) (@code{mark-page}).
352@item C-x l
353Count the lines in this page (@code{count-lines-page}).
354@end table
355
356@kindex C-x [
357@kindex C-x ]
358@findex forward-page
359@findex backward-page
360 The @kbd{C-x [} (@code{backward-page}) command moves point to immediately
361after the previous page delimiter. If point is already right after a page
362delimiter, it skips that one and stops at the previous one. A numeric
363argument serves as a repeat count. The @kbd{C-x ]} (@code{forward-page})
364command moves forward past the next page delimiter.
365
366@kindex C-x C-p
367@findex mark-page
368 The @kbd{C-x C-p} command (@code{mark-page}) puts point at the
369beginning of the current page and the mark at the end. The page
370delimiter at the end is included (the mark follows it). The page
371delimiter at the front is excluded (point follows it). In Transient
372Mark mode, this command activates the mark.
373
374 @kbd{C-x C-p C-w} is a handy way to kill a page to move it
375elsewhere. If you move to another page delimiter with @kbd{C-x [} and
376@kbd{C-x ]}, then yank the killed page, all the pages will be properly
377delimited once again. The reason @kbd{C-x C-p} includes only the
378following page delimiter in the region is to ensure that.
379
380 A numeric argument to @kbd{C-x C-p} is used to specify which page to go
381to, relative to the current one. Zero means the current page. One means
382the next page, and @minus{}1 means the previous one.
383
384@kindex C-x l
385@findex count-lines-page
386 The @kbd{C-x l} command (@code{count-lines-page}) is good for deciding
387where to break a page in two. It displays in the echo area the total number
388of lines in the current page, and then divides it up into those preceding
389the current line and those following, as in
390
391@example
392Page has 96 (72+25) lines
393@end example
394
395@noindent
396 Notice that the sum is off by one; this is correct if point is not at the
397beginning of a line.
398
399@vindex page-delimiter
400 The variable @code{page-delimiter} controls where pages begin. Its
401value is a regexp that matches the beginning of a line that separates
402pages. The normal value of this variable is @code{"^\f"}, which
403matches a formfeed character at the beginning of a line.
404
405@node Filling
406@section Filling Text
407@cindex filling text
408
409 @dfn{Filling} text means breaking it up into lines that fit a
410specified width. Emacs does filling in two ways. In Auto Fill mode,
411inserting text with self-inserting characters also automatically fills
412it. There are also explicit fill commands that you can use when editing
413text leaves it unfilled. When you edit formatted text, you can specify
414a style of filling for each portion of the text (@pxref{Formatted
415Text}).
416
417@menu
418* Auto Fill:: Auto Fill mode breaks long lines automatically.
419* Fill Commands:: Commands to refill paragraphs and center lines.
420* Fill Prefix:: Filling paragraphs that are indented
421 or in a comment, etc.
422* Adaptive Fill:: How Emacs can determine the fill prefix automatically.
423* Refill:: Keeping paragraphs filled.
424* Longlines:: Editing text with very long lines.
425@end menu
426
427@node Auto Fill
428@subsection Auto Fill Mode
429@cindex Auto Fill mode
430@cindex mode, Auto Fill
431
432 @dfn{Auto Fill} mode is a minor mode in which lines are broken
433automatically when they become too wide. Breaking happens only when
434you type a @key{SPC} or @key{RET}.
435
436@table @kbd
437@item M-x auto-fill-mode
438Enable or disable Auto Fill mode.
439@item @key{SPC}
440@itemx @key{RET}
441In Auto Fill mode, break lines when appropriate.
442@end table
443
444@findex auto-fill-mode
445 @kbd{M-x auto-fill-mode} turns Auto Fill mode on if it was off, or off
446if it was on. With a positive numeric argument it always turns Auto
447Fill mode on, and with a negative argument always turns it off. You can
448see when Auto Fill mode is in effect by the presence of the word
449@samp{Fill} in the mode line, inside the parentheses. Auto Fill mode is
450a minor mode which is enabled or disabled for each buffer individually.
451@xref{Minor Modes}.
452
453 In Auto Fill mode, lines are broken automatically at spaces when they
454get longer than the desired width. Line breaking and rearrangement
455takes place only when you type @key{SPC} or @key{RET}. If you wish to
456insert a space or newline without permitting line-breaking, type
457@kbd{C-q @key{SPC}} or @kbd{C-q C-j} (recall that a newline is really a
458control-J). Also, @kbd{C-o} inserts a newline without line breaking.
459
460 Auto Fill mode works well with programming-language modes, because it
461indents new lines with @key{TAB}. If a line ending in a comment gets
462too long, the text of the comment is split into two comment lines.
463Optionally, new comment delimiters are inserted at the end of the first
464line and the beginning of the second so that each line is a separate
465comment; the variable @code{comment-multi-line} controls the choice
466(@pxref{Comments}).
467
468 Adaptive filling (@pxref{Adaptive Fill}) works for Auto Filling as
469well as for explicit fill commands. It takes a fill prefix
470automatically from the second or first line of a paragraph.
471
472 Auto Fill mode does not refill entire paragraphs; it can break lines but
473cannot merge lines. So editing in the middle of a paragraph can result in
474a paragraph that is not correctly filled. The easiest way to make the
475paragraph properly filled again is usually with the explicit fill commands.
476@ifnottex
477@xref{Fill Commands}.
478@end ifnottex
479
480 Many users like Auto Fill mode and want to use it in all text files.
481The section on init files says how to arrange this permanently for yourself.
482@xref{Init File}.
483
484@node Fill Commands
485@subsection Explicit Fill Commands
486
487@table @kbd
488@item M-q
489Fill current paragraph (@code{fill-paragraph}).
490@item C-x f
491Set the fill column (@code{set-fill-column}).
492@item M-x fill-region
493Fill each paragraph in the region (@code{fill-region}).
494@item M-x fill-region-as-paragraph
495Fill the region, considering it as one paragraph.
496@item M-s
497Center a line.
498@end table
499
500@kindex M-q
501@findex fill-paragraph
502 To refill a paragraph, use the command @kbd{M-q}
503(@code{fill-paragraph}). This operates on the paragraph that point is
504inside, or the one after point if point is between paragraphs.
505Refilling works by removing all the line-breaks, then inserting new ones
506where necessary.
507
508@findex fill-region
509 To refill many paragraphs, use @kbd{M-x fill-region}, which
510finds the paragraphs in the region and fills each of them.
511
512@findex fill-region-as-paragraph
513 @kbd{M-q} and @code{fill-region} use the same criteria as @kbd{M-h}
514for finding paragraph boundaries (@pxref{Paragraphs}). For more
515control, you can use @kbd{M-x fill-region-as-paragraph}, which refills
516everything between point and mark as a single paragraph. This command
517deletes any blank lines within the region, so separate blocks of text
518end up combined into one block.
519
520@cindex justification
521 A numeric argument to @kbd{M-q} tells it to @dfn{justify} the text
522as well as filling it. This means that extra spaces are inserted to
523make the right margin line up exactly at the fill column. To remove
524the extra spaces, use @kbd{M-q} with no argument. (Likewise for
525@code{fill-region}.) Another way to control justification, and choose
526other styles of filling, is with the @code{justification} text
527property; see @ref{Format Justification}.
528
529@kindex M-s @r{(Text mode)}
530@cindex centering
531@findex center-line
532 The command @kbd{M-s} (@code{center-line}) centers the current line
533within the current fill column. With an argument @var{n}, it centers
534@var{n} lines individually and moves past them. This binding is
535made by Text mode and is available only in that and related modes
536(@pxref{Text Mode}).
537
538@vindex fill-column
539@kindex C-x f
540@findex set-fill-column
541 The maximum line width for filling is in the variable
542@code{fill-column}. Altering the value of @code{fill-column} makes it
543local to the current buffer; until that time, the default value is in
544effect. The default is initially 70. @xref{Locals}. The easiest way
545to set @code{fill-column} is to use the command @kbd{C-x f}
546(@code{set-fill-column}). With a numeric argument, it uses that as the
547new fill column. With just @kbd{C-u} as argument, it sets
548@code{fill-column} to the current horizontal position of point.
549
550 Emacs commands normally consider a period followed by two spaces or by
551a newline as the end of a sentence; a period followed by just one space
552indicates an abbreviation and not the end of a sentence. To preserve
553the distinction between these two ways of using a period, the fill
554commands do not break a line after a period followed by just one space.
555
556 If the variable @code{sentence-end-double-space} is @code{nil}, the
557fill commands expect and leave just one space at the end of a sentence.
558Ordinarily this variable is @code{t}, so the fill commands insist on
559two spaces for the end of a sentence, as explained above. @xref{Sentences}.
560
561@vindex colon-double-space
562 If the variable @code{colon-double-space} is non-@code{nil}, the
563fill commands put two spaces after a colon.
564
565@vindex fill-nobreak-predicate
566 The variable @code{fill-nobreak-predicate} is a hook (an abnormal
567hook, @pxref{Hooks}) specifying additional conditions where
568line-breaking is not allowed. Each function is called with no
569arguments, with point at a place where Emacs is considering breaking
570the line. If a function returns a non-@code{nil} value, then that's
571a bad place to break the line. Two standard functions you can use are
572@code{fill-single-word-nobreak-p} (don't break after the first word of
573a sentence or before the last) and @code{fill-french-nobreak-p} (don't
574break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}).
575
576@node Fill Prefix
577@subsection The Fill Prefix
578
579@cindex fill prefix
580 To fill a paragraph in which each line starts with a special marker
581(which might be a few spaces, giving an indented paragraph), you can use
582the @dfn{fill prefix} feature. The fill prefix is a string that Emacs
583expects every line to start with, and which is not included in filling.
584You can specify a fill prefix explicitly; Emacs can also deduce the
585fill prefix automatically (@pxref{Adaptive Fill}).
586
587@table @kbd
588@item C-x .
589Set the fill prefix (@code{set-fill-prefix}).
590@item M-q
591Fill a paragraph using current fill prefix (@code{fill-paragraph}).
592@item M-x fill-individual-paragraphs
593Fill the region, considering each change of indentation as starting a
594new paragraph.
595@item M-x fill-nonuniform-paragraphs
596Fill the region, considering only paragraph-separator lines as starting
597a new paragraph.
598@end table
599
600@kindex C-x .
601@findex set-fill-prefix
602 To specify a fill prefix for the current buffer, move to a line that
603starts with the desired prefix, put point at the end of the prefix,
604and type @w{@kbd{C-x .}}@: (@code{set-fill-prefix}). (That's a period
605after the @kbd{C-x}.) To turn off the fill prefix, specify an empty
606prefix: type @w{@kbd{C-x .}}@: with point at the beginning of a line.
607
608 When a fill prefix is in effect, the fill commands remove the fill
609prefix from each line of the paragraph before filling and insert it on
610each line after filling. (The beginning of the first line of the
611paragraph is left unchanged, since often that is intentionally
612different.) Auto Fill mode also inserts the fill prefix automatically
613when it makes a new line. The @kbd{C-o} command inserts the fill
614prefix on new lines it creates, when you use it at the beginning of a
615line (@pxref{Blank Lines}). Conversely, the command @kbd{M-^} deletes
616the prefix (if it occurs) after the newline that it deletes
617(@pxref{Indentation}).
618
619 For example, if @code{fill-column} is 40 and you set the fill prefix
620to @samp{;; }, then @kbd{M-q} in the following text
621
622@example
623;; This is an
624;; example of a paragraph
625;; inside a Lisp-style comment.
626@end example
627
628@noindent
629produces this:
630
631@example
632;; This is an example of a paragraph
633;; inside a Lisp-style comment.
634@end example
635
636 Lines that do not start with the fill prefix are considered to start
637paragraphs, both in @kbd{M-q} and the paragraph commands; this gives
638good results for paragraphs with hanging indentation (every line
639indented except the first one). Lines which are blank or indented once
640the prefix is removed also separate or start paragraphs; this is what
641you want if you are writing multi-paragraph comments with a comment
642delimiter on each line.
643
644@findex fill-individual-paragraphs
645 You can use @kbd{M-x fill-individual-paragraphs} to set the fill
646prefix for each paragraph automatically. This command divides the
647region into paragraphs, treating every change in the amount of
648indentation as the start of a new paragraph, and fills each of these
649paragraphs. Thus, all the lines in one ``paragraph'' have the same
650amount of indentation. That indentation serves as the fill prefix for
651that paragraph.
652
653@findex fill-nonuniform-paragraphs
654 @kbd{M-x fill-nonuniform-paragraphs} is a similar command that divides
655the region into paragraphs in a different way. It considers only
656paragraph-separating lines (as defined by @code{paragraph-separate}) as
657starting a new paragraph. Since this means that the lines of one
658paragraph may have different amounts of indentation, the fill prefix
659used is the smallest amount of indentation of any of the lines of the
660paragraph. This gives good results with styles that indent a paragraph's
661first line more or less that the rest of the paragraph.
662
663@vindex fill-prefix
664 The fill prefix is stored in the variable @code{fill-prefix}. Its value
665is a string, or @code{nil} when there is no fill prefix. This is a
666per-buffer variable; altering the variable affects only the current buffer,
667but there is a default value which you can change as well. @xref{Locals}.
668
669 The @code{indentation} text property provides another way to control
670the amount of indentation paragraphs receive. @xref{Format Indentation}.
671
672@node Adaptive Fill
673@subsection Adaptive Filling
674
675@cindex adaptive filling
676 The fill commands can deduce the proper fill prefix for a paragraph
677automatically in certain cases: either whitespace or certain punctuation
678characters at the beginning of a line are propagated to all lines of the
679paragraph.
680
681 If the paragraph has two or more lines, the fill prefix is taken from
682the paragraph's second line, but only if it appears on the first line as
683well.
684
685 If a paragraph has just one line, fill commands @emph{may} take a
686prefix from that line. The decision is complicated because there are
687three reasonable things to do in such a case:
688
689@itemize @bullet
690@item
691Use the first line's prefix on all the lines of the paragraph.
692
693@item
694Indent subsequent lines with whitespace, so that they line up under the
695text that follows the prefix on the first line, but don't actually copy
696the prefix from the first line.
697
698@item
699Don't do anything special with the second and following lines.
700@end itemize
701
702 All three of these styles of formatting are commonly used. So the
703fill commands try to determine what you would like, based on the prefix
704that appears and on the major mode. Here is how.
705
706@vindex adaptive-fill-first-line-regexp
707 If the prefix found on the first line matches
708@code{adaptive-fill-first-line-regexp}, or if it appears to be a
709comment-starting sequence (this depends on the major mode), then the
710prefix found is used for filling the paragraph, provided it would not
711act as a paragraph starter on subsequent lines.
712
713 Otherwise, the prefix found is converted to an equivalent number of
714spaces, and those spaces are used as the fill prefix for the rest of the
715lines, provided they would not act as a paragraph starter on subsequent
716lines.
717
718 In Text mode, and other modes where only blank lines and page
719delimiters separate paragraphs, the prefix chosen by adaptive filling
720never acts as a paragraph starter, so it can always be used for filling.
721
722@vindex adaptive-fill-mode
723@vindex adaptive-fill-regexp
724 The variable @code{adaptive-fill-regexp} determines what kinds of line
725beginnings can serve as a fill prefix: any characters at the start of
726the line that match this regular expression are used. If you set the
727variable @code{adaptive-fill-mode} to @code{nil}, the fill prefix is
728never chosen automatically.
729
730@vindex adaptive-fill-function
731 You can specify more complex ways of choosing a fill prefix
732automatically by setting the variable @code{adaptive-fill-function} to a
733function. This function is called with point after the left margin of a
734line, and it should return the appropriate fill prefix based on that
735line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets
736a chance to find a prefix.
737
738@node Refill
739@subsection Refill Mode
740@cindex refilling text, word processor style
741@cindex modes, Refill
742@cindex Refill minor mode
743
744 Refill minor mode provides support for keeping paragraphs filled as
745you type or modify them in other ways. It provides an effect similar
746to typical word processor behavior. This works by running a
747paragraph-filling command at suitable times.
748
749 To toggle the use of Refill mode in the current buffer, type
750@kbd{M-x refill-mode}. When you are typing text, only characters
751which normally trigger auto filling, like the space character, will
752trigger refilling. This is to avoid making it too slow. Apart from
753self-inserting characters, other commands which modify the text cause
754refilling.
755
756 The current implementation is preliminary and not robust. You can
757get better ``line wrapping'' behavior using Longlines mode.
758@xref{Longlines}. However, Longlines mode has an important
759side-effect: the newlines that it inserts for you are not saved to
760disk, so the files that you make with Longlines mode will appear to be
761completely unfilled if you edit them without Longlines mode.
762
763@node Longlines
764@subsection Long Lines Mode
765@cindex refilling text, word processor style
766@cindex modes, Long Lines
767@cindex word wrap
768@cindex Long Lines minor mode
769
770 Long Lines mode is a minor mode for @dfn{word wrapping}; it lets you
771edit ``unfilled'' text files, which Emacs would normally display as a
772bunch of extremely long lines. Many text editors, such as those built
773into many web browsers, normally do word wrapping.
774
775@findex longlines-mode
776 To enable Long Lines mode, type @kbd{M-x longlines-mode}. If the
777text is full of long lines, this will ``wrap'' them
778immediately---i.e., break up to fit in the window. As you edit the
779text, Long Lines mode automatically re-wraps lines by inserting or
780deleting @dfn{soft newlines} as necessary (@pxref{Hard and Soft
781Newlines}.) These soft newlines won't show up when you save the
782buffer into a file, or when you copy the text into the kill ring,
783clipboard, or a register.
784
785@findex longlines-auto-wrap
786 Word wrapping is @emph{not} the same as ordinary filling
787(@pxref{Fill Commands}). It does not contract multiple spaces into a
788single space, recognize fill prefixes (@pxref{Fill Prefix}), or
789perform adaptive filling (@pxref{Adaptive Fill}). The reason for this
790is that a wrapped line is still, conceptually, a single line. Each
791soft newline is equivalent to exactly one space in that long line, and
792vice versa. However, you can still call filling functions such as
793@kbd{M-q}, and these will work as expected, inserting soft newlines
794that won't show up on disk or when the text is copied. You can even
795rely entirely on the normal fill commands by turning off automatic
796line wrapping, with @kbd{C-u M-x longlines-auto-wrap}. To turn
797automatic line wrapping back on, type @kbd{M-x longlines-auto-wrap}.
798
799@findex longlines-show-hard-newlines
800 Type @kbd{RET} to insert a hard newline, one which automatic
801refilling will not remove. If you want to see where all the hard
802newlines are, type @kbd{M-x longlines-show-hard-newlines}. This will
803mark each hard newline with a special symbol. The same command with a
804prefix argument turns this display off.
805
806 Long Lines mode does not change normal text files that are already
807filled, since the existing newlines are considered hard newlines.
808Before Long Lines can do anything, you need to transform each
809paragraph into a long line. One way is to set @code{fill-column} to a
810large number (e.g., @kbd{C-u 9999 C-x f}), re-fill all the paragraphs,
811and then set @code{fill-column} back to its original value.
812
813@node Case
814@section Case Conversion Commands
815@cindex case conversion
816
817 Emacs has commands for converting either a single word or any arbitrary
818range of text to upper case or to lower case.
819
820@table @kbd
821@item M-l
822Convert following word to lower case (@code{downcase-word}).
823@item M-u
824Convert following word to upper case (@code{upcase-word}).
825@item M-c
826Capitalize the following word (@code{capitalize-word}).
827@item C-x C-l
828Convert region to lower case (@code{downcase-region}).
829@item C-x C-u
830Convert region to upper case (@code{upcase-region}).
831@end table
832
833@kindex M-l
834@kindex M-u
835@kindex M-c
836@cindex words, case conversion
837@cindex converting text to upper or lower case
838@cindex capitalizing words
839@findex downcase-word
840@findex upcase-word
841@findex capitalize-word
842 The word conversion commands are the most useful. @kbd{M-l}
843(@code{downcase-word}) converts the word after point to lower case, moving
844past it. Thus, repeating @kbd{M-l} converts successive words.
845@kbd{M-u} (@code{upcase-word}) converts to all capitals instead, while
846@kbd{M-c} (@code{capitalize-word}) puts the first letter of the word
847into upper case and the rest into lower case. All these commands convert
848several words at once if given an argument. They are especially convenient
849for converting a large amount of text from all upper case to mixed case,
850because you can move through the text using @kbd{M-l}, @kbd{M-u} or
851@kbd{M-c} on each word as appropriate, occasionally using @kbd{M-f} instead
852to skip a word.
853
854 When given a negative argument, the word case conversion commands apply
855to the appropriate number of words before point, but do not move point.
856This is convenient when you have just typed a word in the wrong case: you
857can give the case conversion command and continue typing.
858
859 If a word case conversion command is given in the middle of a word,
860it applies only to the part of the word which follows point. (This is
861comparable to what @kbd{M-d} (@code{kill-word}) does.) With a
862negative argument, case conversion applies only to the part of the
863word before point.
864
865@kindex C-x C-l
866@kindex C-x C-u
867@findex downcase-region
868@findex upcase-region
869 The other case conversion commands are @kbd{C-x C-u}
870(@code{upcase-region}) and @kbd{C-x C-l} (@code{downcase-region}), which
871convert everything between point and mark to the specified case. Point and
872mark do not move.
873
874 The region case conversion commands @code{upcase-region} and
875@code{downcase-region} are normally disabled. This means that they ask
876for confirmation if you try to use them. When you confirm, you may
877enable the command, which means it will not ask for confirmation again.
878@xref{Disabling}.
879
880@node Text Mode
881@section Text Mode
882@cindex Text mode
883@cindex mode, Text
884@findex text-mode
885
886 When you edit files of text in a human language, it's more convenient
887to use Text mode rather than Fundamental mode. To enter Text mode, type
888@kbd{M-x text-mode}.
889
890 In Text mode, only blank lines and page delimiters separate
891paragraphs. As a result, paragraphs can be indented, and adaptive
892filling determines what indentation to use when filling a paragraph.
893@xref{Adaptive Fill}.
894
895@kindex TAB @r{(Text mode)}
896 Text mode defines @key{TAB} to run @code{indent-relative}
897(@pxref{Indentation}), so that you can conveniently indent a line like
898the previous line.
899
900 Text mode turns off the features concerned with comments except when
901you explicitly invoke them. It changes the syntax table so that
902single-quotes are considered part of words. However, if a word starts
903with single-quotes, these are treated as a prefix for purposes such as
904capitalization. That is, @kbd{M-c} will convert @samp{'hello'} into
905@samp{'Hello'}, as expected.
906
907@cindex Paragraph-Indent Text mode
908@cindex mode, Paragraph-Indent Text
909@findex paragraph-indent-text-mode
910@findex paragraph-indent-minor-mode
911 If you indent the first lines of paragraphs, then you should use
912Paragraph-Indent Text mode rather than Text mode. In this mode, you
913do not need to have blank lines between paragraphs, because the
914first-line indentation is sufficient to start a paragraph; however
915paragraphs in which every line is indented are not supported. Use
916@kbd{M-x paragraph-indent-text-mode} to enter this mode. Use @kbd{M-x
917paragraph-indent-minor-mode} to enable an equivalent minor mode in
918situations where you can't change the major mode---in mail
919composition, for instance.
920
921@kindex M-TAB @r{(Text mode)}
922 Text mode, and all the modes based on it, define @kbd{M-@key{TAB}}
923as the command @code{ispell-complete-word}, which performs completion
924of the partial word in the buffer before point, using the spelling
925dictionary as the space of possible words. @xref{Spelling}. If your
926window manager defines @kbd{M-@key{TAB}} to switch windows, you can
927type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.
928
929@vindex text-mode-hook
930 Entering Text mode runs the hook @code{text-mode-hook}. Other major
931modes related to Text mode also run this hook, followed by hooks of
932their own; this includes Paragraph-Indent Text mode, Nroff mode, @TeX{}
933mode, Outline mode, and Mail mode. Hook functions on
934@code{text-mode-hook} can look at the value of @code{major-mode} to see
935which of these modes is actually being entered. @xref{Hooks}.
936
937@ifnottex
938 Emacs provides two other modes for editing text that is to be passed
939through a text formatter to produce fancy formatted printed output.
940@xref{Nroff Mode}, for editing input to the formatter nroff.
941@xref{TeX Mode,,@TeX{} Mode}, for editing input to the formatter TeX.
942
943 Another mode is used for editing outlines. It allows you to view the
944text at various levels of detail. You can view either the outline
945headings alone or both headings and text; you can also hide some of the
946headings at lower levels from view to make the high level structure more
947visible. @xref{Outline Mode}.
948@end ifnottex
949
950@node Outline Mode
951@section Outline Mode
952@cindex Outline mode
953@cindex mode, Outline
954@cindex invisible lines
955
956@findex outline-mode
957@findex outline-minor-mode
958@vindex outline-minor-mode-prefix
959 Outline mode is a major mode much like Text mode but intended for
960editing outlines. It allows you to make parts of the text temporarily
961invisible so that you can see the outline structure. Type @kbd{M-x
962outline-mode} to switch to Outline mode as the major mode of the current
963buffer.
964
965 When Outline mode makes a line invisible, the line does not appear
966on the screen. The screen appears exactly as if the invisible line
967were deleted, except that an ellipsis (three periods in a row) appears
968at the end of the previous visible line. (Multiple consecutive
969invisible lines produce just one ellipsis.)
970
971 Editing commands that operate on lines, such as @kbd{C-n} and
972@kbd{C-p}, treat the text of the invisible line as part of the previous
973visible line. Killing the ellipsis at the end of a visible line
974really kills all the following invisible lines.
975
976 Outline minor mode provides the same commands as the major mode,
977Outline mode, but you can use it in conjunction with other major modes.
978Type @kbd{M-x outline-minor-mode} to enable the Outline minor mode in
979the current buffer. You can also specify this in the text of a file,
980with a file local variable of the form @samp{mode: outline-minor}
981(@pxref{File Variables}).
982
983@kindex C-c @@ @r{(Outline minor mode)}
984 The major mode, Outline mode, provides special key bindings on the
985@kbd{C-c} prefix. Outline minor mode provides similar bindings with
986@kbd{C-c @@} as the prefix; this is to reduce the conflicts with the
987major mode's special commands. (The variable
988@code{outline-minor-mode-prefix} controls the prefix used.)
989
990@vindex outline-mode-hook
991 Entering Outline mode runs the hook @code{text-mode-hook} followed by
992the hook @code{outline-mode-hook} (@pxref{Hooks}).
993
994@menu
995* Format: Outline Format. What the text of an outline looks like.
996* Motion: Outline Motion. Special commands for moving through
997 outlines.
998* Visibility: Outline Visibility. Commands to control what is visible.
999* Views: Outline Views. Outlines and multiple views.
1000* Foldout:: Folding means zooming in on outlines.
1001@end menu
1002
1003@node Outline Format
1004@subsection Format of Outlines
1005
1006@cindex heading lines (Outline mode)
1007@cindex body lines (Outline mode)
1008 Outline mode assumes that the lines in the buffer are of two types:
1009@dfn{heading lines} and @dfn{body lines}. A heading line represents a
1010topic in the outline. Heading lines start with one or more stars; the
1011number of stars determines the depth of the heading in the outline
1012structure. Thus, a heading line with one star is a major topic; all the
1013heading lines with two stars between it and the next one-star heading
1014are its subtopics; and so on. Any line that is not a heading line is a
1015body line. Body lines belong with the preceding heading line. Here is
1016an example:
1017
1018@example
1019* Food
1020This is the body,
1021which says something about the topic of food.
1022
1023** Delicious Food
1024This is the body of the second-level header.
1025
1026** Distasteful Food
1027This could have
1028a body too, with
1029several lines.
1030
1031*** Dormitory Food
1032
1033* Shelter
1034Another first-level topic with its header line.
1035@end example
1036
1037 A heading line together with all following body lines is called
1038collectively an @dfn{entry}. A heading line together with all following
1039deeper heading lines and their body lines is called a @dfn{subtree}.
1040
1041@vindex outline-regexp
1042 You can customize the criterion for distinguishing heading lines by
1043setting the variable @code{outline-regexp}. (The recommended ways to
1044do this are in a major mode function or with a file local variable.)
1045Any line whose beginning has a match for this regexp is considered a
1046heading line. Matches that start within a line (not at the left
1047margin) do not count.
1048
1049 The length of the matching text determines the level of the heading;
1050longer matches make a more deeply nested level. Thus, for example, if
1051a text formatter has commands @samp{@@chapter}, @samp{@@section} and
1052@samp{@@subsection} to divide the document into chapters and sections,
1053you could make those lines count as heading lines by setting
1054@code{outline-regexp} to @samp{"@@chap\\|@@\\(sub\\)*section"}. Note
1055the trick: the two words @samp{chapter} and @samp{section} are equally
1056long, but by defining the regexp to match only @samp{chap} we ensure
1057that the length of the text matched on a chapter heading is shorter,
1058so that Outline mode will know that sections are contained in
1059chapters. This works as long as no other command starts with
1060@samp{@@chap}.
1061
1062@vindex outline-level
1063 You can explicitly specify a rule for calculating the level of a
1064heading line by setting the variable @code{outline-level}. The value
1065of @code{outline-level} should be a function that takes no arguments
1066and returns the level of the current heading. The recommended ways to
1067set this variable are in a major mode command or with a file local
1068variable.
1069
1070@node Outline Motion
1071@subsection Outline Motion Commands
1072
1073 Outline mode provides special motion commands that move backward and
1074forward to heading lines.
1075
1076@table @kbd
1077@item C-c C-n
1078Move point to the next visible heading line
1079(@code{outline-next-visible-heading}).
1080@item C-c C-p
1081Move point to the previous visible heading line
1082(@code{outline-previous-visible-heading}).
1083@item C-c C-f
1084Move point to the next visible heading line at the same level
1085as the one point is on (@code{outline-forward-same-level}).
1086@item C-c C-b
1087Move point to the previous visible heading line at the same level
1088(@code{outline-backward-same-level}).
1089@item C-c C-u
1090Move point up to a lower-level (more inclusive) visible heading line
1091(@code{outline-up-heading}).
1092@end table
1093
1094@findex outline-next-visible-heading
1095@findex outline-previous-visible-heading
1096@kindex C-c C-n @r{(Outline mode)}
1097@kindex C-c C-p @r{(Outline mode)}
1098 @kbd{C-c C-n} (@code{outline-next-visible-heading}) moves down to the next
1099heading line. @kbd{C-c C-p} (@code{outline-previous-visible-heading}) moves
1100similarly backward. Both accept numeric arguments as repeat counts. The
1101names emphasize that invisible headings are skipped, but this is not really
1102a special feature. All editing commands that look for lines ignore the
1103invisible lines automatically.
1104
1105@findex outline-up-heading
1106@findex outline-forward-same-level
1107@findex outline-backward-same-level
1108@kindex C-c C-f @r{(Outline mode)}
1109@kindex C-c C-b @r{(Outline mode)}
1110@kindex C-c C-u @r{(Outline mode)}
1111 More powerful motion commands understand the level structure of headings.
1112@kbd{C-c C-f} (@code{outline-forward-same-level}) and
1113@kbd{C-c C-b} (@code{outline-backward-same-level}) move from one
1114heading line to another visible heading at the same depth in
1115the outline. @kbd{C-c C-u} (@code{outline-up-heading}) moves
1116backward to another heading that is less deeply nested.
1117
1118@node Outline Visibility
1119@subsection Outline Visibility Commands
1120
1121 The other special commands of outline mode are used to make lines visible
1122or invisible. Their names all start with @code{hide} or @code{show}.
1123Most of them fall into pairs of opposites. They are not undoable; instead,
1124you can undo right past them. Making lines visible or invisible is simply
1125not recorded by the undo mechanism.
1126
1127 Many of these commands act on the ``current'' heading line. If
1128point is on a heading line, that is the current heading line; if point
1129is on a body line, the current heading line is the nearest preceding
1130header line.
1131
1132@table @kbd
1133@item C-c C-c
1134Make the current heading line's body invisible (@code{hide-entry}).
1135@item C-c C-e
1136Make the current heading line's body visible (@code{show-entry}).
1137@item C-c C-d
1138Make everything under the current heading invisible, not including the
1139heading itself (@code{hide-subtree}).
1140@item C-c C-s
1141Make everything under the current heading visible, including body,
1142subheadings, and their bodies (@code{show-subtree}).
1143@item C-c C-l
1144Make the body of the current heading line, and of all its subheadings,
1145invisible (@code{hide-leaves}).
1146@item C-c C-k
1147Make all subheadings of the current heading line, at all levels,
1148visible (@code{show-branches}).
1149@item C-c C-i
1150Make immediate subheadings (one level down) of the current heading
1151line visible (@code{show-children}).
1152@item C-c C-t
1153Make all body lines in the buffer invisible (@code{hide-body}).
1154@item C-c C-a
1155Make all lines in the buffer visible (@code{show-all}).
1156@item C-c C-q
1157Hide everything except the top @var{n} levels of heading lines
1158(@code{hide-sublevels}).
1159@item C-c C-o
1160Hide everything except for the heading or body that point is in, plus
1161the headings leading up from there to the top level of the outline
1162(@code{hide-other}).
1163@end table
1164
1165@findex hide-entry
1166@findex show-entry
1167@kindex C-c C-c @r{(Outline mode)}
1168@kindex C-c C-e @r{(Outline mode)}
1169 Two commands that are exact opposites are @kbd{C-c C-c}
1170(@code{hide-entry}) and @kbd{C-c C-e} (@code{show-entry}). They apply
1171to the body lines directly following the current heading line.
1172Subheadings and their bodies are not affected.
1173
1174@findex hide-subtree
1175@findex show-subtree
1176@kindex C-c C-s @r{(Outline mode)}
1177@kindex C-c C-d @r{(Outline mode)}
1178@cindex subtree (Outline mode)
1179 Two more powerful opposites are @kbd{C-c C-d} (@code{hide-subtree})
1180and @kbd{C-c C-s} (@code{show-subtree}). Both apply to the current
1181heading line's @dfn{subtree}: its body, all its subheadings, both
1182direct and indirect, and all of their bodies. In other words, the
1183subtree contains everything following the current heading line, up to
1184and not including the next heading of the same or higher rank.
1185
1186@findex hide-leaves
1187@findex show-branches
1188@kindex C-c C-l @r{(Outline mode)}
1189@kindex C-c C-k @r{(Outline mode)}
1190 Intermediate between a visible subtree and an invisible one is having
1191all the subheadings visible but none of the body. There are two
1192commands for doing this, depending on whether you want to hide the
1193bodies or make the subheadings visible. They are @kbd{C-c C-l}
1194(@code{hide-leaves}) and @kbd{C-c C-k} (@code{show-branches}).
1195
1196@kindex C-c C-i @r{(Outline mode)}
1197@findex show-children
1198 A little weaker than @code{show-branches} is @kbd{C-c C-i}
1199(@code{show-children}). It makes just the direct subheadings
1200visible---those one level down. Deeper subheadings remain invisible, if
1201they were invisible.
1202
1203@findex hide-body
1204@findex show-all
1205@kindex C-c C-t @r{(Outline mode)}
1206@kindex C-c C-a @r{(Outline mode)}
1207 Two commands have a blanket effect on the whole file. @kbd{C-c C-t}
1208(@code{hide-body}) makes all body lines invisible, so that you see just
1209the outline structure (as a special exception, it will not hide lines
1210at the top of the file, preceding the first header line, even though
1211these are technically body lines). @kbd{C-c C-a} (@code{show-all})
1212makes all lines visible. These commands can be thought of as a pair
1213of opposites even though @kbd{C-c C-a} applies to more than just body
1214lines.
1215
1216@findex hide-sublevels
1217@kindex C-c C-q @r{(Outline mode)}
1218 The command @kbd{C-c C-q} (@code{hide-sublevels}) hides all but the
1219top level headings. With a numeric argument @var{n}, it hides everything
1220except the top @var{n} levels of heading lines.
1221
1222@findex hide-other
1223@kindex C-c C-o @r{(Outline mode)}
1224 The command @kbd{C-c C-o} (@code{hide-other}) hides everything except
1225the heading and body text that point is in, plus its parents (the headers
1226leading up from there to top level in the outline) and the top level
1227headings.
1228
1229@findex reveal-mode
1230 When incremental search finds text that is hidden by Outline mode,
1231it makes that part of the buffer visible. If you exit the search
1232at that position, the text remains visible. You can also
1233automatically make text visible as you navigate in it by using
1234@kbd{M-x reveal-mode}.
1235
1236@node Outline Views
1237@subsection Viewing One Outline in Multiple Views
1238
1239@cindex multiple views of outline
1240@cindex views of an outline
1241@cindex outline with multiple views
1242@cindex indirect buffers and outlines
1243 You can display two views of a single outline at the same time, in
1244different windows. To do this, you must create an indirect buffer using
1245@kbd{M-x make-indirect-buffer}. The first argument of this command is
1246the existing outline buffer name, and its second argument is the name to
1247use for the new indirect buffer. @xref{Indirect Buffers}.
1248
1249 Once the indirect buffer exists, you can display it in a window in the
1250normal fashion, with @kbd{C-x 4 b} or other Emacs commands. The Outline
1251mode commands to show and hide parts of the text operate on each buffer
1252independently; as a result, each buffer can have its own view. If you
1253want more than two views on the same outline, create additional indirect
1254buffers.
1255
1256@node Foldout
1257@subsection Folding Editing
1258
1259@cindex folding editing
1260 The Foldout package extends Outline mode and Outline minor mode with
1261``folding'' commands. The idea of folding is that you zoom in on a
1262nested portion of the outline, while hiding its relatives at higher
1263levels.
1264
1265 Consider an Outline mode buffer with all the text and subheadings under
1266level-1 headings hidden. To look at what is hidden under one of these
1267headings, you could use @kbd{C-c C-e} (@kbd{M-x show-entry}) to expose
1268the body, or @kbd{C-c C-i} to expose the child (level-2) headings.
1269
1270@kindex C-c C-z
1271@findex foldout-zoom-subtree
1272 With Foldout, you use @kbd{C-c C-z} (@kbd{M-x foldout-zoom-subtree}).
1273This exposes the body and child subheadings, and narrows the buffer so
1274that only the @w{level-1} heading, the body and the level-2 headings are
1275visible. Now to look under one of the level-2 headings, position the
1276cursor on it and use @kbd{C-c C-z} again. This exposes the level-2 body
1277and its level-3 child subheadings and narrows the buffer again. Zooming
1278in on successive subheadings can be done as much as you like. A string
1279in the mode line shows how deep you've gone.
1280
1281 When zooming in on a heading, to see only the child subheadings specify
1282a numeric argument: @kbd{C-u C-c C-z}. The number of levels of children
1283can be specified too (compare @kbd{M-x show-children}), e.g.@: @kbd{M-2
1284C-c C-z} exposes two levels of child subheadings. Alternatively, the
1285body can be specified with a negative argument: @kbd{M-- C-c C-z}. The
1286whole subtree can be expanded, similarly to @kbd{C-c C-s} (@kbd{M-x
1287show-subtree}), by specifying a zero argument: @kbd{M-0 C-c C-z}.
1288
1289 While you're zoomed in, you can still use Outline mode's exposure and
1290hiding functions without disturbing Foldout. Also, since the buffer is
1291narrowed, ``global'' editing actions will only affect text under the
1292zoomed-in heading. This is useful for restricting changes to a
1293particular chapter or section of your document.
1294
1295@kindex C-c C-x
1296@findex foldout-exit-fold
1297 To unzoom (exit) a fold, use @kbd{C-c C-x} (@kbd{M-x foldout-exit-fold}).
1298This hides all the text and subheadings under the top-level heading and
1299returns you to the previous view of the buffer. Specifying a numeric
1300argument exits that many levels of folds. Specifying a zero argument
1301exits all folds.
1302
1303 To cancel the narrowing of a fold without hiding the text and
1304subheadings, specify a negative argument. For example, @kbd{M--2 C-c
1305C-x} exits two folds and leaves the text and subheadings exposed.
1306
1307 Foldout mode also provides mouse commands for entering and exiting
1308folds, and for showing and hiding text:
1309
1310@table @asis
1311@item @kbd{C-M-Mouse-1} zooms in on the heading clicked on
1312@itemize @asis
1313@item
1314single click: expose body.
1315@item
1316double click: expose subheadings.
1317@item
1318triple click: expose body and subheadings.
1319@item
1320quad click: expose entire subtree.
1321@end itemize
1322@item @kbd{C-M-Mouse-2} exposes text under the heading clicked on
1323@itemize @asis
1324@item
1325single click: expose body.
1326@item
1327double click: expose subheadings.
1328@item
1329triple click: expose body and subheadings.
1330@item
1331quad click: expose entire subtree.
1332@end itemize
1333@item @kbd{C-M-Mouse-3} hides text under the heading clicked on or exits fold
1334@itemize @asis
1335@item
1336single click: hide subtree.
1337@item
1338double click: exit fold and hide text.
1339@item
1340triple click: exit fold without hiding text.
1341@item
1342quad click: exit all folds and hide text.
1343@end itemize
1344@end table
1345
1346@vindex foldout-mouse-modifiers
1347 You can specify different modifier keys (instead of
1348@kbd{Control-Meta-}) by setting @code{foldout-mouse-modifiers}; but if
1349you have already loaded the @file{foldout.el} library, you must reload
1350it in order for this to take effect.
1351
1352 To use the Foldout package, you can type @kbd{M-x load-library
1353@key{RET} foldout @key{RET}}; or you can arrange for to do that
1354automatically by putting this in your @file{.emacs} file:
1355
1356@example
1357(eval-after-load "outline" '(require 'foldout))
1358@end example
1359
1360@node TeX Mode
1361@section @TeX{} Mode
1362@cindex @TeX{} mode
1363@cindex La@TeX{} mode
1364@cindex Sli@TeX{} mode
1365@cindex Doc@TeX{} mode
1366@cindex mode, @TeX{}
1367@cindex mode, La@TeX{}
1368@cindex mode, Sli@TeX{}
1369@cindex mode, Doc@TeX{}
1370@findex tex-mode
1371@findex plain-tex-mode
1372@findex latex-mode
1373@findex slitex-mode
1374@findex doctex-mode
1375
1376 @TeX{} is a powerful text formatter written by Donald Knuth; it is
1377also free software, like GNU Emacs. La@TeX{} is a simplified input
1378format for @TeX{}, implemented by @TeX{} macros; it comes with @TeX{}.
1379Sli@TeX{} is a special form of La@TeX{}.@footnote{Sli@TeX{} is
1380obsoleted by the @samp{slides} document class and other alternative
1381packages in recent La@TeX{} versions.} Doc@TeX{} (@file{.dtx}) is a
1382special file format in which the La@TeX{} sources are written,
1383combining sources with documentation.
1384
1385 Emacs has a special @TeX{} mode for editing @TeX{} input files.
1386It provides facilities for checking the balance of delimiters and for
1387invoking @TeX{} on all or part of the file.
1388
1389@vindex tex-default-mode
1390 @TeX{} mode has four variants: Plain @TeX{} mode, La@TeX{} mode,
1391Sli@TeX{} mode, and Doc@TeX{} mode (these distinct major modes differ
1392only slightly). They are designed for editing the four different
1393formats. The command @kbd{M-x tex-mode} looks at the contents of the
1394buffer to determine whether the contents appear to be either La@TeX{}
1395input, Sli@TeX{}, or Doc@TeX{} input; if so, it selects the
1396appropriate mode. If the file contents do not appear to be La@TeX{},
1397Sli@TeX{} or Doc@TeX{}, it selects Plain @TeX{} mode. If the contents
1398are insufficient to determine this, the variable
1399@code{tex-default-mode} controls which mode is used.
1400
1401 When @kbd{M-x tex-mode} does not guess right, you can use the commands
1402@kbd{M-x plain-tex-mode}, @kbd{M-x latex-mode}, @kbd{M-x slitex-mode},
1403and @kbd{doctex-mode} to select explicitly the particular variants of
1404@TeX{} mode.
1405
1406@menu
1407* Editing: TeX Editing. Special commands for editing in TeX mode.
1408* LaTeX: LaTeX Editing. Additional commands for LaTeX input files.
1409* Printing: TeX Print. Commands for printing part of a file with TeX.
1410* Misc: TeX Misc. Customization of TeX mode, and related features.
1411@end menu
1412
1413@node TeX Editing
1414@subsection @TeX{} Editing Commands
1415
1416 Here are the special commands provided in @TeX{} mode for editing the
1417text of the file.
1418
1419@table @kbd
1420@item "
1421Insert, according to context, either @samp{``} or @samp{"} or
1422@samp{''} (@code{tex-insert-quote}).
1423@item C-j
1424Insert a paragraph break (two newlines) and check the previous
1425paragraph for unbalanced braces or dollar signs
1426(@code{tex-terminate-paragraph}).
1427@item M-x tex-validate-region
1428Check each paragraph in the region for unbalanced braces or dollar signs.
1429@item C-c @{
1430Insert @samp{@{@}} and position point between them (@code{tex-insert-braces}).
1431@item C-c @}
1432Move forward past the next unmatched close brace (@code{up-list}).
1433@end table
1434
1435@findex tex-insert-quote
1436@kindex " @r{(@TeX{} mode)}
1437 In @TeX{}, the character @samp{"} is not normally used; we use
1438@samp{``} to start a quotation and @samp{''} to end one. To make
1439editing easier under this formatting convention, @TeX{} mode overrides
1440the normal meaning of the key @kbd{"} with a command that inserts a pair
1441of single-quotes or backquotes (@code{tex-insert-quote}). To be
1442precise, this command inserts @samp{``} after whitespace or an open
1443brace, @samp{"} after a backslash, and @samp{''} after any other
1444character.
1445
1446 If you need the character @samp{"} itself in unusual contexts, use
1447@kbd{C-q} to insert it. Also, @kbd{"} with a numeric argument always
1448inserts that number of @samp{"} characters. You can turn off the
1449feature of @kbd{"} expansion by eliminating that binding in the local
1450map (@pxref{Key Bindings}).
1451
1452 In @TeX{} mode, @samp{$} has a special syntax code which attempts to
1453understand the way @TeX{} math mode delimiters match. When you insert a
1454@samp{$} that is meant to exit math mode, the position of the matching
1455@samp{$} that entered math mode is displayed for a second. This is the
1456same feature that displays the open brace that matches a close brace that
1457is inserted. However, there is no way to tell whether a @samp{$} enters
1458math mode or leaves it; so when you insert a @samp{$} that enters math
1459mode, the previous @samp{$} position is shown as if it were a match, even
1460though they are actually unrelated.
1461
1462@findex tex-insert-braces
1463@kindex C-c @{ @r{(@TeX{} mode)}
1464@findex up-list
1465@kindex C-c @} @r{(@TeX{} mode)}
1466 @TeX{} uses braces as delimiters that must match. Some users prefer
1467to keep braces balanced at all times, rather than inserting them
1468singly. Use @kbd{C-c @{} (@code{tex-insert-braces}) to insert a pair of
1469braces. It leaves point between the two braces so you can insert the
1470text that belongs inside. Afterward, use the command @kbd{C-c @}}
1471(@code{up-list}) to move forward past the close brace.
1472
1473@findex tex-validate-region
1474@findex tex-terminate-paragraph
1475@kindex C-j @r{(@TeX{} mode)}
1476 There are two commands for checking the matching of braces. @kbd{C-j}
1477(@code{tex-terminate-paragraph}) checks the paragraph before point, and
1478inserts two newlines to start a new paragraph. It outputs a message in
1479the echo area if any mismatch is found. @kbd{M-x tex-validate-region}
1480checks a region, paragraph by paragraph. The errors are listed in the
1481@samp{*Occur*} buffer, and you can use @kbd{C-c C-c} or @kbd{Mouse-2} in
1482that buffer to go to a particular mismatch.
1483
1484 Note that Emacs commands count square brackets and parentheses in
1485@TeX{} mode, not just braces. This is not strictly correct for the
1486purpose of checking @TeX{} syntax. However, parentheses and square
1487brackets are likely to be used in text as matching delimiters and it is
1488useful for the various motion commands and automatic match display to
1489work with them.
1490
1491@node LaTeX Editing
1492@subsection La@TeX{} Editing Commands
1493
1494 La@TeX{} mode, and its variant, Sli@TeX{} mode, provide a few extra
1495features not applicable to plain @TeX{}.
1496
1497@table @kbd
1498@item C-c C-o
1499Insert @samp{\begin} and @samp{\end} for La@TeX{} block and position
1500point on a line between them (@code{tex-latex-block}).
1501@item C-c C-e
1502Close the innermost La@TeX{} block not yet closed
1503(@code{tex-close-latex-block}).
1504@end table
1505
1506@findex tex-latex-block
1507@kindex C-c C-o @r{(La@TeX{} mode)}
1508@vindex latex-block-names
1509 In La@TeX{} input, @samp{\begin} and @samp{\end} commands are used to
1510group blocks of text. To insert a @samp{\begin} and a matching
1511@samp{\end} (on a new line following the @samp{\begin}), use @kbd{C-c
1512C-o} (@code{tex-latex-block}). A blank line is inserted between the
1513two, and point is left there. You can use completion when you enter the
1514block type; to specify additional block type names beyond the standard
1515list, set the variable @code{latex-block-names}. For example, here's
1516how to add @samp{theorem}, @samp{corollary}, and @samp{proof}:
1517
1518@example
1519(setq latex-block-names '("theorem" "corollary" "proof"))
1520@end example
1521
1522@findex tex-close-latex-block
1523@kindex C-c C-e @r{(La@TeX{} mode)}
1524 In La@TeX{} input, @samp{\begin} and @samp{\end} commands must
1525balance. You can use @kbd{C-c C-e} (@code{tex-close-latex-block}) to
1526insert automatically a matching @samp{\end} to match the last unmatched
1527@samp{\begin}. It indents the @samp{\end} to match the corresponding
1528@samp{\begin}. It inserts a newline after @samp{\end} if point is at
1529the beginning of a line.
1530
1531@node TeX Print
1532@subsection @TeX{} Printing Commands
1533
1534 You can invoke @TeX{} as an inferior of Emacs on either the entire
1535contents of the buffer or just a region at a time. Running @TeX{} in
1536this way on just one chapter is a good way to see what your changes
1537look like without taking the time to format the entire file.
1538
1539@table @kbd
1540@item C-c C-r
1541Invoke @TeX{} on the current region, together with the buffer's header
1542(@code{tex-region}).
1543@item C-c C-b
1544Invoke @TeX{} on the entire current buffer (@code{tex-buffer}).
1545@item C-c @key{TAB}
1546Invoke Bib@TeX{} on the current file (@code{tex-bibtex-file}).
1547@item C-c C-f
1548Invoke @TeX{} on the current file (@code{tex-file}).
1549@item C-c C-l
1550Recenter the window showing output from the inferior @TeX{} so that
1551the last line can be seen (@code{tex-recenter-output-buffer}).
1552@item C-c C-k
1553Kill the @TeX{} subprocess (@code{tex-kill-job}).
1554@item C-c C-p
1555Print the output from the last @kbd{C-c C-r}, @kbd{C-c C-b}, or @kbd{C-c
1556C-f} command (@code{tex-print}).
1557@item C-c C-v
1558Preview the output from the last @kbd{C-c C-r}, @kbd{C-c C-b}, or @kbd{C-c
1559C-f} command (@code{tex-view}).
1560@item C-c C-q
1561Show the printer queue (@code{tex-show-print-queue}).
1562@item C-c C-c
1563Invoke some other compilation command on the entire current buffer
1564(@code{tex-compile}).
1565@end table
1566
1567@findex tex-buffer
1568@kindex C-c C-b @r{(@TeX{} mode)}
1569@findex tex-print
1570@kindex C-c C-p @r{(@TeX{} mode)}
1571@findex tex-view
1572@kindex C-c C-v @r{(@TeX{} mode)}
1573@findex tex-show-print-queue
1574@kindex C-c C-q @r{(@TeX{} mode)}
1575 You can pass the current buffer through an inferior @TeX{} by means of
1576@kbd{C-c C-b} (@code{tex-buffer}). The formatted output appears in a
1577temporary file; to print it, type @kbd{C-c C-p} (@code{tex-print}).
1578Afterward, you can use @kbd{C-c C-q} (@code{tex-show-print-queue}) to
1579view the progress of your output towards being printed. If your terminal
1580has the ability to display @TeX{} output files, you can preview the
1581output on the terminal with @kbd{C-c C-v} (@code{tex-view}).
1582
1583@cindex @env{TEXINPUTS} environment variable
1584@vindex tex-directory
1585 You can specify the directory to use for running @TeX{} by setting the
1586variable @code{tex-directory}. @code{"."} is the default value. If
1587your environment variable @env{TEXINPUTS} contains relative directory
1588names, or if your files contains @samp{\input} commands with relative
1589file names, then @code{tex-directory} @emph{must} be @code{"."} or you
1590will get the wrong results. Otherwise, it is safe to specify some other
1591directory, such as @code{"/tmp"}.
1592
1593@vindex tex-run-command
1594@vindex latex-run-command
1595@vindex slitex-run-command
1596@vindex tex-dvi-print-command
1597@vindex tex-dvi-view-command
1598@vindex tex-show-queue-command
1599 If you want to specify which shell commands are used in the inferior @TeX{},
1600you can do so by setting the values of the variables @code{tex-run-command},
1601@code{latex-run-command}, @code{slitex-run-command},
1602@code{tex-dvi-print-command}, @code{tex-dvi-view-command}, and
1603@code{tex-show-queue-command}. The default values may
1604(or may not) be appropriate for your system.
1605
1606 Normally, the file name given to these commands comes at the end of
1607the command string; for example, @samp{latex @var{filename}}. In some
1608cases, however, the file name needs to be embedded in the command; an
1609example is when you need to provide the file name as an argument to one
1610command whose output is piped to another. You can specify where to put
1611the file name with @samp{*} in the command string. For example,
1612
1613@example
1614(setq tex-dvi-print-command "dvips -f * | lpr")
1615@end example
1616
1617@findex tex-kill-job
1618@kindex C-c C-k @r{(@TeX{} mode)}
1619@findex tex-recenter-output-buffer
1620@kindex C-c C-l @r{(@TeX{} mode)}
1621 The terminal output from @TeX{}, including any error messages, appears
1622in a buffer called @samp{*tex-shell*}. If @TeX{} gets an error, you can
1623switch to this buffer and feed it input (this works as in Shell mode;
1624@pxref{Interactive Shell}). Without switching to this buffer you can
1625scroll it so that its last line is visible by typing @kbd{C-c
1626C-l}.
1627
1628 Type @kbd{C-c C-k} (@code{tex-kill-job}) to kill the @TeX{} process if
1629you see that its output is no longer useful. Using @kbd{C-c C-b} or
1630@kbd{C-c C-r} also kills any @TeX{} process still running.
1631
1632@findex tex-region
1633@kindex C-c C-r @r{(@TeX{} mode)}
1634 You can also pass an arbitrary region through an inferior @TeX{} by typing
1635@kbd{C-c C-r} (@code{tex-region}). This is tricky, however, because most files
1636of @TeX{} input contain commands at the beginning to set parameters and
1637define macros, without which no later part of the file will format
1638correctly. To solve this problem, @kbd{C-c C-r} allows you to designate a
1639part of the file as containing essential commands; it is included before
1640the specified region as part of the input to @TeX{}. The designated part
1641of the file is called the @dfn{header}.
1642
1643@cindex header (@TeX{} mode)
1644 To indicate the bounds of the header in Plain @TeX{} mode, you insert two
1645special strings in the file. Insert @samp{%**start of header} before the
1646header, and @samp{%**end of header} after it. Each string must appear
1647entirely on one line, but there may be other text on the line before or
1648after. The lines containing the two strings are included in the header.
1649If @samp{%**start of header} does not appear within the first 100 lines of
1650the buffer, @kbd{C-c C-r} assumes that there is no header.
1651
1652 In La@TeX{} mode, the header begins with @samp{\documentclass} or
1653@samp{\documentstyle} and ends with @samp{\begin@{document@}}. These
1654are commands that La@TeX{} requires you to use in any case, so nothing
1655special needs to be done to identify the header.
1656
1657@findex tex-file
1658@kindex C-c C-f @r{(@TeX{} mode)}
1659 The commands (@code{tex-buffer}) and (@code{tex-region}) do all of their
1660work in a temporary directory, and do not have available any of the auxiliary
1661files needed by @TeX{} for cross-references; these commands are generally
1662not suitable for running the final copy in which all of the cross-references
1663need to be correct.
1664
1665 When you want the auxiliary files for cross references, use @kbd{C-c
1666C-f} (@code{tex-file}) which runs @TeX{} on the current buffer's file,
1667in that file's directory. Before running @TeX{}, it offers to save any
1668modified buffers. Generally, you need to use (@code{tex-file}) twice to
1669get the cross-references right.
1670
1671@vindex tex-start-options
1672 The value of the variable @code{tex-start-options} specifies
1673options for the @TeX{} run.
1674
1675@vindex tex-start-commands
1676 The value of the variable @code{tex-start-commands} specifies @TeX{}
1677commands for starting @TeX{}. The default value causes @TeX{} to run
1678in nonstop mode. To run @TeX{} interactively, set the variable to
1679@code{""}.
1680
1681@vindex tex-main-file
1682 Large @TeX{} documents are often split into several files---one main
1683file, plus subfiles. Running @TeX{} on a subfile typically does not
1684work; you have to run it on the main file. In order to make
1685@code{tex-file} useful when you are editing a subfile, you can set the
1686variable @code{tex-main-file} to the name of the main file. Then
1687@code{tex-file} runs @TeX{} on that file.
1688
1689 The most convenient way to use @code{tex-main-file} is to specify it
1690in a local variable list in each of the subfiles. @xref{File
1691Variables}.
1692
1693@findex tex-bibtex-file
1694@kindex C-c TAB @r{(@TeX{} mode)}
1695@vindex tex-bibtex-command
1696 For La@TeX{} files, you can use Bib@TeX{} to process the auxiliary
1697file for the current buffer's file. Bib@TeX{} looks up bibliographic
1698citations in a data base and prepares the cited references for the
1699bibliography section. The command @kbd{C-c @key{TAB}}
1700(@code{tex-bibtex-file}) runs the shell command
1701(@code{tex-bibtex-command}) to produce a @samp{.bbl} file for the
1702current buffer's file. Generally, you need to do @kbd{C-c C-f}
1703(@code{tex-file}) once to generate the @samp{.aux} file, then do
1704@kbd{C-c @key{TAB}} (@code{tex-bibtex-file}), and then repeat @kbd{C-c C-f}
1705(@code{tex-file}) twice more to get the cross-references correct.
1706
1707@findex tex-compile
1708@kindex C-c C-c @r{(@TeX{} mode)}
1709 To invoke some other compilation program on the current @TeX{}
1710buffer, type @kbd{C-c C-c} (@code{tex-compile}). This command knows
1711how to pass arguments to many common programs, including
1712@file{pdflatex}, @file{yap}, @file{xdvi}, and @file{dvips}. You can
1713select your desired compilation program using the standard completion
1714keys (@pxref{Completion}).
1715
1716@node TeX Misc
1717@subsection @TeX{} Mode Miscellany
1718
1719@vindex tex-shell-hook
1720@vindex tex-mode-hook
1721@vindex latex-mode-hook
1722@vindex slitex-mode-hook
1723@vindex plain-tex-mode-hook
1724 Entering any variant of @TeX{} mode runs the hooks
1725@code{text-mode-hook} and @code{tex-mode-hook}. Then it runs either
1726@code{plain-tex-mode-hook}, @code{latex-mode-hook}, or
1727@code{slitex-mode-hook}, whichever is appropriate. Starting the
1728@TeX{} shell runs the hook @code{tex-shell-hook}. @xref{Hooks}.
1729
1730@findex iso-iso2tex
1731@findex iso-tex2iso
1732@findex iso-iso2gtex
1733@findex iso-gtex2iso
1734@cindex Latin-1 @TeX{} encoding
1735@cindex @TeX{} encoding
1736 The commands @kbd{M-x iso-iso2tex}, @kbd{M-x iso-tex2iso}, @kbd{M-x
1737iso-iso2gtex} and @kbd{M-x iso-gtex2iso} can be used to convert
1738between Latin-1 encoded files and @TeX{}-encoded equivalents.
1739@ignore
1740@c Too cryptic to be useful, too cryptic for me to make it better -- rms.
1741 They
1742are included by default in the @code{format-alist} variable, so they
1743can be used with @kbd{M-x format-find-file}, for instance.
1744@end ignore
1745
1746@ignore @c Not worth documenting if it is only for Czech -- rms.
1747@findex tildify-buffer
1748@findex tildify-region
1749@cindex ties, @TeX{}, inserting
1750@cindex hard spaces, @TeX{}, inserting
1751 The commands @kbd{M-x tildify-buffer} and @kbd{M-x tildify-region}
1752insert @samp{~} (@dfn{tie}) characters where they are conventionally
1753required. This is set up for Czech---customize the group
1754@samp{tildify} for other languages or for other sorts of markup.
1755@end ignore
1756
1757@cindex Ref@TeX{} package
1758@cindex references, La@TeX{}
1759@cindex La@TeX{} references
1760 For managing all kinds of references for La@TeX{}, you can use
1761Ref@TeX{}. @inforef{Top,, reftex}.
1762
1763@node HTML Mode
1764@section SGML, XML, and HTML Modes
1765
1766 The major modes for SGML and HTML include indentation support and
1767commands to operate on tags. This section describes the special
1768commands of these modes. (HTML mode is a slightly customized variant
1769of SGML mode.)
1770
1771@table @kbd
1772@item C-c C-n
1773@kindex C-c C-n @r{(SGML mode)}
1774@findex sgml-name-char
1775Interactively specify a special character and insert the SGML
1776@samp{&}-command for that character.
1777
1778@item C-c C-t
1779@kindex C-c C-t @r{(SGML mode)}
1780@findex sgml-tag
1781Interactively specify a tag and its attributes (@code{sgml-tag}).
1782This command asks you for a tag name and for the attribute values,
1783then inserts both the opening tag and the closing tag, leaving point
1784between them.
1785
1786With a prefix argument @var{n}, the command puts the tag around the
1787@var{n} words already present in the buffer after point. With
1788@minus{}1 as argument, it puts the tag around the region. (In
1789Transient Mark mode, it does this whenever a region is active.)
1790
1791@item C-c C-a
1792@kindex C-c C-a @r{(SGML mode)}
1793@findex sgml-attributes
1794Interactively insert attribute values for the current tag
1795(@code{sgml-attributes}).
1796
1797@item C-c C-f
1798@kindex C-c C-f @r{(SGML mode)}
1799@findex sgml-skip-tag-forward
1800Skip across a balanced tag group (which extends from an opening tag
1801through its corresponding closing tag) (@code{sgml-skip-tag-forward}).
1802A numeric argument acts as a repeat count.
1803
1804@item C-c C-b
1805@kindex C-c C-b @r{(SGML mode)}
1806@findex sgml-skip-tag-backward
1807Skip backward across a balanced tag group (which extends from an
1808opening tag through its corresponding closing tag)
1809(@code{sgml-skip-tag-forward}). A numeric argument acts as a repeat
1810count.
1811
1812@item C-c C-d
1813@kindex C-c C-d @r{(SGML mode)}
1814@findex sgml-delete-tag
1815Delete the tag at or after point, and delete the matching tag too
1816(@code{sgml-delete-tag}). If the tag at or after point is an opening
1817tag, delete the closing tag too; if it is a closing tag, delete the
1818opening tag too.
1819
1820@item C-c ? @var{tag} @key{RET}
1821@kindex C-c ? @r{(SGML mode)}
1822@findex sgml-tag-help
1823Display a description of the meaning of tag @var{tag}
1824(@code{sgml-tag-help}). If the argument @var{tag} is empty, describe
1825the tag at point.
1826
1827@item C-c /
1828@kindex C-c / @r{(SGML mode)}
1829@findex sgml-close-tag
1830Insert a close tag for the innermost unterminated tag
1831(@code{sgml-close-tag}). If called from within a tag or a comment,
1832close this element instead of inserting a close tag.
1833
1834@item C-c 8
1835@kindex C-c 8 @r{(SGML mode)}
1836@findex sgml-name-8bit-mode
1837Toggle a minor mode in which Latin-1 characters insert the
1838corresponding SGML commands that stand for them, instead of the
1839characters themselves (@code{sgml-name-8bit-mode}).
1840
1841@item C-c C-v
1842@kindex C-c C-v @r{(SGML mode)}
1843@findex sgml-validate
1844Run a shell command (which you must specify) to validate the current
1845buffer as SGML (@code{sgml-validate}).
1846
1847@item C-c TAB
1848@kindex C-c TAB @r{(SGML mode)}
1849@findex sgml-tags-invisible
1850Toggle the visibility of existing tags in the buffer. This can be
1851used as a cheap preview.
1852@end table
1853
1854@vindex sgml-xml-mode
1855 SGML mode and HTML mode support XML also. In XML, every opening tag
1856must have an explicit closing tag. When @code{sgml-xml-mode} is
1857non-@code{nil}, SGML mode and HTML mode always insert explicit
1858closing tags. When you visit a file, these modes determine from the
1859file contents whether it is XML or not, and set @code{sgml-xml-mode}
1860accordingly, so that they do the right thing for the file in either
1861case.
1862
1863@node Nroff Mode
1864@section Nroff Mode
1865
1866@cindex nroff
1867@findex nroff-mode
1868 Nroff mode is a mode like Text mode but modified to handle nroff commands
1869present in the text. Invoke @kbd{M-x nroff-mode} to enter this mode. It
1870differs from Text mode in only a few ways. All nroff command lines are
1871considered paragraph separators, so that filling will never garble the
1872nroff commands. Pages are separated by @samp{.bp} commands. Comments
1873start with backslash-doublequote. Also, three special commands are
1874provided that are not in Text mode:
1875
1876@findex forward-text-line
1877@findex backward-text-line
1878@findex count-text-lines
1879@kindex M-n @r{(Nroff mode)}
1880@kindex M-p @r{(Nroff mode)}
1881@kindex M-? @r{(Nroff mode)}
1882@table @kbd
1883@item M-n
1884Move to the beginning of the next line that isn't an nroff command
1885(@code{forward-text-line}). An argument is a repeat count.
1886@item M-p
1887Like @kbd{M-n} but move up (@code{backward-text-line}).
1888@item M-?
1889Displays in the echo area the number of text lines (lines that are not
1890nroff commands) in the region (@code{count-text-lines}).
1891@end table
1892
1893@findex electric-nroff-mode
1894 The other feature of Nroff mode is that you can turn on Electric Nroff
1895mode. This is a minor mode that you can turn on or off with @kbd{M-x
1896electric-nroff-mode} (@pxref{Minor Modes}). When the mode is on, each
1897time you use @key{RET} to end a line that contains an nroff command that
1898opens a kind of grouping, the matching nroff command to close that
1899grouping is automatically inserted on the following line. For example,
1900if you are at the beginning of a line and type @kbd{.@: ( b @key{RET}},
1901this inserts the matching command @samp{.)b} on a new line following
1902point.
1903
1904 If you use Outline minor mode with Nroff mode (@pxref{Outline Mode}),
1905heading lines are lines of the form @samp{.H} followed by a number (the
1906header level).
1907
1908@vindex nroff-mode-hook
1909 Entering Nroff mode runs the hook @code{text-mode-hook}, followed by
1910the hook @code{nroff-mode-hook} (@pxref{Hooks}).
1911
1912@node Formatted Text
1913@section Editing Formatted Text
1914
1915@cindex Enriched mode
1916@cindex mode, Enriched
1917@cindex formatted text
1918@cindex WYSIWYG
1919@cindex word processing
1920 @dfn{Enriched mode} is a minor mode for editing files that contain
1921formatted text in WYSIWYG fashion, as in a word processor. Currently,
1922formatted text in Enriched mode can specify fonts, colors, underlining,
1923margins, and types of filling and justification. In the future, we plan
1924to implement other formatting features as well.
1925
1926 Enriched mode is a minor mode (@pxref{Minor Modes}). It is
1927typically used in conjunction with Text mode (@pxref{Text Mode}), but
1928you can also use it with other major modes such as Outline mode and
1929Paragraph-Indent Text mode.
1930
1931@cindex text/enriched MIME format
1932 Potentially, Emacs can store formatted text files in various file
1933formats. Currently, only one format is implemented: @dfn{text/enriched}
1934format, which is defined by the MIME protocol. @xref{Format
1935Conversion,, Format Conversion, elisp, the Emacs Lisp Reference Manual},
1936for details of how Emacs recognizes and converts file formats.
1937
1938 The Emacs distribution contains a formatted text file that can serve as
1939an example. Its name is @file{etc/enriched.doc}. It contains samples
1940illustrating all the features described in this section. It also
1941contains a list of ideas for future enhancements.
1942
1943@menu
1944* Requesting Formatted Text:: Entering and exiting Enriched mode.
1945* Hard and Soft Newlines:: There are two different kinds of newlines.
1946* Editing Format Info:: How to edit text properties.
1947* Faces: Format Faces. Bold, italic, underline, etc.
1948* Color: Format Colors. Changing the color of text.
1949* Indent: Format Indentation. Changing the left and right margins.
1950* Justification: Format Justification.
1951 Centering, setting text flush with the
1952 left or right margin, etc.
1953* Other: Format Properties. The "special" text properties submenu.
1954* Forcing Enriched Mode:: How to force use of Enriched mode.
1955@end menu
1956
1957@node Requesting Formatted Text
1958@subsection Requesting to Edit Formatted Text
1959
1960 Whenever you visit a file that Emacs saved in the text/enriched
1961format, Emacs automatically converts the formatting information in the
1962file into Emacs's own internal format (known as @dfn{text
1963properties}), and turns on Enriched mode.
1964
1965@findex enriched-mode
1966 To create a new file of formatted text, first visit the nonexistent
1967file, then type @kbd{M-x enriched-mode} before you start inserting text.
1968This command turns on Enriched mode. Do this before you begin inserting
1969text, to ensure that the text you insert is handled properly.
1970
1971 More generally, the command @code{enriched-mode} turns Enriched mode
1972on if it was off, and off if it was on. With a prefix argument, this
1973command turns Enriched mode on if the argument is positive, and turns
1974the mode off otherwise.
1975
1976 When you save a buffer while Enriched mode is enabled in it, Emacs
1977automatically converts the text to text/enriched format while writing it
1978into the file. When you visit the file again, Emacs will automatically
1979recognize the format, reconvert the text, and turn on Enriched mode
1980again.
1981
1982@vindex enriched-translations
1983 You can add annotations for saving additional text properties, which
1984Emacs normally does not save, by adding to @code{enriched-translations}.
1985Note that the text/enriched standard requires any non-standard
1986annotations to have names starting with @samp{x-}, as in
1987@samp{x-read-only}. This ensures that they will not conflict with
1988standard annotations that may be added later.
1989
1990 @xref{Text Properties,,, elisp, the Emacs Lisp Reference Manual},
1991for more information about text properties.
1992
1993@node Hard and Soft Newlines
1994@subsection Hard and Soft Newlines
1995@cindex hard newline
1996@cindex soft newline
1997@cindex newlines, hard and soft
1998
1999@cindex use-hard-newlines
2000 In formatted text, Emacs distinguishes between two different kinds of
2001newlines, @dfn{hard} newlines and @dfn{soft} newlines. (You can enable
2002or disable this feature separately in any buffer with the command
2003@code{use-hard-newlines}.)
2004
2005 Hard newlines are used to separate paragraphs, or items in a list, or
2006anywhere that there should always be a line break regardless of the
2007margins. The @key{RET} command (@code{newline}) and @kbd{C-o}
2008(@code{open-line}) insert hard newlines.
2009
2010 Soft newlines are used to make text fit between the margins. All the
2011fill commands, including Auto Fill, insert soft newlines---and they
2012delete only soft newlines.
2013
2014 Although hard and soft newlines look the same, it is important to bear
2015the difference in mind. Do not use @key{RET} to break lines in the
2016middle of filled paragraphs, or else you will get hard newlines that are
2017barriers to further filling. Instead, let Auto Fill mode break lines,
2018so that if the text or the margins change, Emacs can refill the lines
2019properly. @xref{Auto Fill}.
2020
2021 On the other hand, in tables and lists, where the lines should always
2022remain as you type them, you can use @key{RET} to end lines. For these
2023lines, you may also want to set the justification style to
2024@code{unfilled}. @xref{Format Justification}.
2025
2026@node Editing Format Info
2027@subsection Editing Format Information
2028
2029 There are two ways to alter the formatting information for a formatted
2030text file: with keyboard commands, and with the mouse.
2031
2032 The easiest way to add properties to your document is with the Text
2033Properties menu. You can get to this menu in two ways: from the Edit
2034menu in the menu bar (use @kbd{@key{F10} e t} if you have no mouse),
2035or with @kbd{C-Mouse-2} (hold the @key{CTRL} key and press the middle
2036mouse button). There are also keyboard commands described in the
2037following section.
2038
2039 Most of the items in the Text Properties menu lead to other submenus.
2040These are described in the sections that follow. Some items run
2041commands directly:
2042
2043@table @code
2044@findex facemenu-remove-face-props
2045@item Remove Face Properties
2046Delete from the region all face and color text properties
2047(@code{facemenu-remove-face-props}).
2048
2049@findex facemenu-remove-all
2050@item Remove Text Properties
2051Delete @emph{all} text properties from the region
2052(@code{facemenu-remove-all}).
2053
2054@findex describe-text-properties
2055@cindex text properties of characters
2056@cindex overlays at character position
2057@cindex widgets at buffer position
2058@cindex buttons at buffer position
2059@item Describe Properties
2060List all the text properties, widgets, buttons, and overlays of the
2061character following point (@code{describe-text-properties}).
2062
2063@item Display Faces
2064Display a list of all the defined faces (@code{list-faces-display}).
2065
2066@item Display Colors
2067Display a list of all the defined colors (@code{list-colors-display}).
2068@end table
2069
2070@node Format Faces
2071@subsection Faces in Formatted Text
2072
2073 The Faces submenu lists various Emacs faces including @code{bold},
2074@code{italic}, and @code{underline} (@pxref{Faces}). These menu items
2075operate on the region if it is active and nonempty. Otherwise, they
2076specify to use that face for an immediately following self-inserting
2077character. Instead of the menu, you can use these keyboard commands:
2078
2079@table @kbd
2080@kindex M-o d @r{(Enriched mode)}
2081@findex facemenu-set-default
2082@item M-o d
2083Remove all @code{face} properties from the region (which includes
2084specified colors), or force the following inserted character to have no
2085@code{face} property (@code{facemenu-set-default}).
2086@kindex M-o b @r{(Enriched mode)}
2087@findex facemenu-set-bold
2088@item M-o b
2089Add the face @code{bold} to the region or to the following inserted
2090character (@code{facemenu-set-bold}).
2091@kindex M-o i @r{(Enriched mode)}
2092@findex facemenu-set-italic
2093@item M-o i
2094Add the face @code{italic} to the region or to the following inserted
2095character (@code{facemenu-set-italic}).
2096@kindex M-o l @r{(Enriched mode)}
2097@findex facemenu-set-bold-italic
2098@item M-o l
2099Add the face @code{bold-italic} to the region or to the following
2100inserted character (@code{facemenu-set-bold-italic}).
2101@kindex M-o u @r{(Enriched mode)}
2102@findex facemenu-set-underline
2103@item M-o u
2104Add the face @code{underline} to the region or to the following inserted
2105character (@code{facemenu-set-underline}).
2106@kindex M-o o @r{(Enriched mode)}
2107@findex facemenu-set-face
2108@item M-o o @var{face} @key{RET}
2109Add the face @var{face} to the region or to the following inserted
2110character (@code{facemenu-set-face}).
2111@end table
2112
2113 With a prefix argument, all these commands apply to an immediately
2114following self-inserting character, disregarding the region.
2115
2116 A self-inserting character normally inherits the @code{face}
2117property (and most other text properties) from the preceding character
2118in the buffer. If you use the above commands to specify face for the
2119next self-inserting character, or the next section's commands to
2120specify a foreground or background color for it, then it does not
2121inherit the @code{face} property from the preceding character; instead
2122it uses whatever you specified. It will still inherit other text
2123properties, though.
2124
2125 Strictly speaking, these commands apply only to the first following
2126self-inserting character that you type. But if you insert additional
2127characters after it, they will inherit from the first one. So it
2128appears that these commands apply to all of them.
2129
2130 Enriched mode defines two additional faces: @code{excerpt} and
2131@code{fixed}. These correspond to codes used in the text/enriched file
2132format.
2133
2134 The @code{excerpt} face is intended for quotations. This face is the
2135same as @code{italic} unless you customize it (@pxref{Face Customization}).
2136
2137 The @code{fixed} face means, ``Use a fixed-width font for this part
2138of the text.'' Applying the @code{fixed} face to a part of the text
2139will cause that part of the text to appear in a fixed-width font, even
2140if the default font is variable-width. This applies to Emacs and to
2141other systems that display text/enriched format. So if you
2142specifically want a certain part of the text to use a fixed-width
2143font, you should specify the @code{fixed} face for that part.
2144
2145 By default, the @code{fixed} face looks the same as @code{bold}.
2146This is an attempt to distinguish it from @code{default}. You may
2147wish to customize @code{fixed} to some other fixed-width medium font.
2148@xref{Face Customization}.
2149
2150 If your terminal cannot display different faces, you will not be
2151able to see them, but you can still edit documents containing faces,
2152and even add faces and colors to documents. The faces you specify
2153will be visible when the file is viewed on a terminal that can display
2154them.
2155
2156@node Format Colors
2157@subsection Colors in Formatted Text
2158
2159 You can specify foreground and background colors for portions of the
2160text. There is a menu for specifying the foreground color and a menu
2161for specifying the background color. Each color menu lists all the
2162colors that you have used in Enriched mode in the current Emacs session.
2163
2164 If you specify a color with a prefix argument---or, in Transient
2165Mark mode, if the region is not active---then it applies to any
2166immediately following self-inserting input. Otherwise, the command
2167applies to the region.
2168
2169 Each color menu contains one additional item: @samp{Other}. You can use
2170this item to specify a color that is not listed in the menu; it reads
2171the color name with the minibuffer. To display a list of available colors
2172and their names, use the @samp{Display Colors} menu item in the Text
2173Properties menu (@pxref{Editing Format Info}).
2174
2175 Any color that you specify in this way, or that is mentioned in a
2176formatted text file that you read in, is added to the corresponding
2177color menu for the duration of the Emacs session.
2178
2179@findex facemenu-set-foreground
2180@findex facemenu-set-background
2181 There are no predefined key bindings for specifying colors, but you can do so
2182with the extended commands @kbd{M-x facemenu-set-foreground} and
2183@kbd{M-x facemenu-set-background}. Both of these commands read the name
2184of the color with the minibuffer.
2185
2186@node Format Indentation
2187@subsection Indentation in Formatted Text
2188
2189 When editing formatted text, you can specify different amounts of
2190indentation for the right or left margin of an entire paragraph or a
2191part of a paragraph. The margins you specify automatically affect the
2192Emacs fill commands (@pxref{Filling}) and line-breaking commands.
2193
2194 The Indentation submenu provides a convenient interface for specifying
2195these properties. The submenu contains four items:
2196
2197@table @code
2198@kindex C-x TAB @r{(Enriched mode)}
2199@findex increase-left-margin
2200@item Indent More
2201Indent the region by 4 columns (@code{increase-left-margin}). In
2202Enriched mode, this command is also available on @kbd{C-x @key{TAB}}; if
2203you supply a numeric argument, that says how many columns to add to the
2204margin (a negative argument reduces the number of columns).
2205
2206@item Indent Less
2207Remove 4 columns of indentation from the region.
2208
2209@item Indent Right More
2210Make the text narrower by indenting 4 columns at the right margin.
2211
2212@item Indent Right Less
2213Remove 4 columns of indentation from the right margin.
2214@end table
2215
2216 You can use these commands repeatedly to increase or decrease the
2217indentation.
2218
2219 The most common way to use them is to change the indentation of an
2220entire paragraph. For other uses, the effects of refilling can be
2221hard to predict, except in some special cases like the one described
2222next.
2223
2224 The most common other use is to format paragraphs with @dfn{hanging
2225indents}, which means that the first line is indented less than
2226subsequent lines. To set up a hanging indent, increase the
2227indentation of the region starting after the first word of the
2228paragraph and running until the end of the paragraph.
2229
2230 Indenting the first line of a paragraph is easier. Set the margin for
2231the whole paragraph where you want it to be for the body of the
2232paragraph, then indent the first line by inserting extra spaces or tabs.
2233
2234@vindex standard-indent
2235 The variable @code{standard-indent} specifies how many columns these
2236commands should add to or subtract from the indentation. The default
2237value is 4. The overall default right margin for Enriched mode is
2238controlled by the variable @code{fill-column}, as usual.
2239
2240@kindex C-c [ @r{(Enriched mode)}
2241@kindex C-c ] @r{(Enriched mode)}
2242@findex set-left-margin
2243@findex set-right-margin
2244 There are also two commands for setting the left or right margin of
2245the region absolutely: @code{set-left-margin} and
2246@code{set-right-margin}. Enriched mode binds these commands to
2247@kbd{C-c [} and @kbd{C-c ]}, respectively. You can specify the
2248margin width either with a numeric argument or in the minibuffer.
2249
2250 Sometimes, as a result of editing, the filling of a paragraph becomes
2251messed up---parts of the paragraph may extend past the left or right
2252margins. When this happens, use @kbd{M-q} (@code{fill-paragraph}) to
2253refill the paragraph.
2254
2255 The fill prefix, if any, works in addition to the specified paragraph
2256indentation: @kbd{C-x .} does not include the specified indentation's
2257whitespace in the new value for the fill prefix, and the fill commands
2258look for the fill prefix after the indentation on each line. @xref{Fill
2259Prefix}.
2260
2261@node Format Justification
2262@subsection Justification in Formatted Text
2263
2264 When editing formatted text, you can specify various styles of
2265justification for a paragraph. The style you specify automatically
2266affects the Emacs fill commands.
2267
2268 The Justification submenu provides a convenient interface for specifying
2269the style. The submenu contains five items:
2270
2271@table @code
2272@item Left
2273This is the most common style of justification (at least for English).
2274Lines are aligned at the left margin but left uneven at the right.
2275
2276@item Right
2277This aligns each line with the right margin. Spaces and tabs are added
2278on the left, if necessary, to make lines line up on the right.
2279
2280@item Full
2281This justifies the text, aligning both edges of each line. Justified
2282text looks very nice in a printed book, where the spaces can all be
2283adjusted equally, but it does not look as nice with a fixed-width font
2284on the screen. Perhaps a future version of Emacs will be able to adjust
2285the width of spaces in a line to achieve elegant justification.
2286
2287@item Center
2288This centers every line between the current margins.
2289
2290@item Unfilled
2291This turns off filling entirely. Each line will remain as you wrote it;
2292the fill and auto-fill functions will have no effect on text which has
2293this setting. You can, however, still indent the left margin. In
2294unfilled regions, all newlines are treated as hard newlines (@pxref{Hard
2295and Soft Newlines}) .
2296@end table
2297
2298 In Enriched mode, you can also specify justification from the keyboard
2299using the @kbd{M-j} prefix character:
2300
2301@table @kbd
2302@kindex M-j l @r{(Enriched mode)}
2303@findex set-justification-left
2304@item M-j l
2305Make the region left-filled (@code{set-justification-left}).
2306@kindex M-j r @r{(Enriched mode)}
2307@findex set-justification-right
2308@item M-j r
2309Make the region right-filled (@code{set-justification-right}).
2310@kindex M-j b @r{(Enriched mode)}
2311@findex set-justification-full
2312@item M-j b
2313Make the region fully justified (@code{set-justification-full}).
2314@kindex M-j c @r{(Enriched mode)}
2315@kindex M-S @r{(Enriched mode)}
2316@findex set-justification-center
2317@item M-j c
2318@itemx M-S
2319Make the region centered (@code{set-justification-center}).
2320@kindex M-j u @r{(Enriched mode)}
2321@findex set-justification-none
2322@item M-j u
2323Make the region unfilled (@code{set-justification-none}).
2324@end table
2325
2326 Justification styles apply to entire paragraphs. All the
2327justification-changing commands operate on the paragraph containing
2328point, or, if the region is active, on all paragraphs which overlap the
2329region.
2330
2331@vindex default-justification
2332 The default justification style is specified by the variable
2333@code{default-justification}. Its value should be one of the symbols
2334@code{left}, @code{right}, @code{full}, @code{center}, or @code{none}.
2335This is a per-buffer variable. Setting the variable directly affects
2336only the current buffer. However, customizing it in a Custom buffer
2337sets (as always) the default value for buffers that do not override it.
2338@xref{Locals}, and @ref{Easy Customization}.
2339
2340@node Format Properties
2341@subsection Setting Other Text Properties
2342
2343 The Special Properties menu lets you add or remove three other useful text
2344properties: @code{read-only}, @code{invisible} and @code{intangible}.
2345The @code{intangible} property disallows moving point within the text,
2346the @code{invisible} text property hides text from display, and the
2347@code{read-only} property disallows alteration of the text.
2348
2349 Each of these special properties has a menu item to add it to the
2350region. The last menu item, @samp{Remove Special}, removes all of these
2351special properties from the text in the region.
2352
2353 Currently, the @code{invisible} and @code{intangible} properties are
2354@emph{not} saved in the text/enriched format. The @code{read-only}
2355property is saved, but it is not a standard part of the text/enriched
2356format, so other editors may not respect it.
2357
2358@node Forcing Enriched Mode
2359@subsection Forcing Enriched Mode
2360
2361 Normally, Emacs knows when you are editing formatted text because it
2362recognizes the special annotations used in the file that you visited.
2363However, sometimes you must take special actions to convert file
2364contents or turn on Enriched mode:
2365
2366@itemize @bullet
2367@item
2368When you visit a file that was created with some other editor, Emacs may
2369not recognize the file as being in the text/enriched format. In this
2370case, when you visit the file you will see the formatting commands
2371rather than the formatted text. Type @kbd{M-x format-decode-buffer} to
2372translate it. This also automatically turns on Enriched mode.
2373
2374@item
2375When you @emph{insert} a file into a buffer, rather than visiting it,
2376Emacs does the necessary conversions on the text which you insert, but
2377it does not enable Enriched mode. If you wish to do that, type @kbd{M-x
2378enriched-mode}.
2379@end itemize
2380
2381 The command @code{format-decode-buffer} translates text in various
2382formats into Emacs's internal format. It asks you to specify the format
2383to translate from; however, normally you can type just @key{RET}, which
2384tells Emacs to guess the format.
2385
2386@findex format-find-file
2387 If you wish to look at a text/enriched file in its raw form, as a
2388sequence of characters rather than as formatted text, use the @kbd{M-x
2389find-file-literally} command. This visits a file, like
2390@code{find-file}, but does not do format conversion. It also inhibits
2391character code conversion (@pxref{Coding Systems}) and automatic
2392uncompression (@pxref{Compressed Files}). To disable format conversion
2393but allow character code conversion and/or automatic uncompression if
2394appropriate, use @code{format-find-file} with suitable arguments.
2395
2396@node Text Based Tables
2397@section Editing Text-based Tables
2398@cindex table mode
2399@cindex text-based tables
2400
2401 Table mode provides an easy and intuitive way to create and edit WYSIWYG
2402text-based tables. Here is an example of such a table:
2403
2404@smallexample
2405@group
2406+-----------------+--------------------------------+-----------------+
2407| Command | Description | Key Binding |
2408+-----------------+--------------------------------+-----------------+
2409| forward-char |Move point right N characters | C-f |
2410| |(left if N is negative). | |
2411| | | |
2412| |On reaching end of buffer, stop | |
2413| |and signal error. | |
2414+-----------------+--------------------------------+-----------------+
2415| backward-char |Move point left N characters | C-b |
2416| |(right if N is negative). | |
2417| | | |
2418| |On attempt to pass beginning or | |
2419| |end of buffer, stop and signal | |
2420| |error. | |
2421+-----------------+--------------------------------+-----------------+
2422@end group
2423@end smallexample
2424
2425 Table mode allows the contents of the table such as this one to be
2426easily manipulated by inserting or deleting characters inside a cell.
2427A cell is effectively a localized rectangular edit region and edits to
2428a cell do not affect the contents of the surrounding cells. If the
2429contents do not fit into a cell, then the cell is automatically
2430expanded in the vertical and/or horizontal directions and the rest of
2431the table is restructured and reformatted in accordance with the
2432growth of the cell.
2433
2434@menu
2435* Table Definition:: What is a text based table.
2436* Table Creation:: How to create a table.
2437* Table Recognition:: How to activate and deactivate tables.
2438* Cell Commands:: Cell-oriented commands in a table.
2439* Cell Justification:: Justifying cell contents.
2440* Row Commands:: Manipulating rows of table cell.
2441* Column Commands:: Manipulating columns of table cell.
2442* Fixed Width Mode:: Fixing cell width.
2443* Table Conversion:: Converting between plain text and tables.
2444* Measuring Tables:: Analyzing table dimension.
2445* Table Misc:: Table miscellany.
2446@end menu
2447
2448@node Table Definition
2449@subsection What is a Text-based Table?
2450
2451 Keep the following examples of valid tables in mind as a reference
2452while you read this section:
2453
2454@example
2455 +--+----+---+ +-+ +--+-----+
2456 | | | | | | | | |
2457 +--+----+---+ +-+ | +--+--+
2458 | | | | | | | |
2459 +--+----+---+ +--+--+ |
2460 | | |
2461 +-----+--+
2462@end example
2463
2464 A table consists of a rectangular frame whose inside is divided into
2465cells. Each cell must be at least one character wide and one
2466character high, not counting its border lines. A cell can be
2467subdivided into multiple rectangular cells, but cells cannot overlap.
2468
2469 The table frame and cell border lines are made of three special
2470characters. These variables specify those characters:
2471
2472@table @code
2473@vindex table-cell-vertical-char
2474@item table-cell-vertical-char
2475Holds the character used for vertical lines. The default value is
2476@samp{|}.
2477
2478@vindex table-cell-horizontal-char
2479@item table-cell-horizontal-char
2480Holds the character used for horizontal lines. The default value is
2481@samp{-}.
2482
2483@vindex table-cell-intersection-char
2484@item table-cell-intersection-char
2485Holds the character used at where horizontal line and vertical line
2486meet. The default value is @samp{+}.
2487@end table
2488
2489@noindent
2490Based on this definition, the following five tables are examples of invalid
2491tables:
2492
2493@example
2494 +-----+ +-----+ +--+ +-++--+ ++
2495 | | | | | | | || | ++
2496 | +-+ | | | | | | || |
2497 | | | | +--+ | +--+--+ +-++--+
2498 | +-+ | | | | | | | +-++--+
2499 | | | | | | | | | || |
2500 +-----+ +--+--+ +--+--+ +-++--+
2501 a b c d e
2502@end example
2503
2504From left to right:
2505
2506@enumerate a
2507@item
2508Overlapped cells or non-rectangular cells are not allowed.
2509@item
2510Same as a.
2511@item
2512The border must be rectangular.
2513@item
2514Cells must have a minimum width/height of one character.
2515@item
2516Same as d.
2517@end enumerate
2518
2519@node Table Creation
2520@subsection How to Create a Table?
2521@cindex create a text-based table
2522@cindex table creation
2523
2524@findex table-insert
2525 The command to create a table is @code{table-insert}. When called
2526interactively, it asks for the number of columns, number of rows, cell
2527width and cell height. The number of columns is the number of cells
2528horizontally side by side. The number of rows is the number of cells
2529vertically within the table's height. The cell width is a number of
2530characters that each cell holds, left to right. The cell height is a
2531number of lines each cell holds. The cell width and the cell height
2532can be either an integer (when the value is constant across the table)
2533or a series of integer, separated by spaces or commas, where each
2534number corresponds to the next cell within a row from left to right,
2535or the next cell within a column from top to bottom.
2536
2537@node Table Recognition
2538@subsection Table Recognition
2539@cindex table recognition
2540
2541@findex table-recognize
2542@findex table-unrecognize
2543 Table mode maintains special text properties in the buffer to allow
2544editing in a convenient fashion. When a buffer with tables is saved
2545to its file, these text properties are lost, so when you visit this
2546file again later, Emacs does not see a table, but just formatted text.
2547To resurrect the table text properties, issue the @kbd{M-x
2548table-recognize} command. It scans the current buffer, recognizes
2549valid table cells, and attaches appropriate text properties to allow
2550for table editing. The converse command, @code{table-unrecognize}, is
2551used to remove the special text properties and convert the buffer back
2552to plain text.
2553
2554 Special commands exist to enable or disable tables within a region,
2555enable or disable individual tables, and enable/disable individual
2556cells. These commands are:
2557
2558@table @kbd
2559@findex table-recognize-region
2560@item M-x table-recognize-region
2561Recognize tables within the current region and activate them.
2562@findex table-unrecognize-region
2563@item M-x table-unrecognize-region
2564Deactivate tables within the current region.
2565@findex table-recognize-table
2566@item M-x table-recognize-table
2567Recognize the table under point and activate it.
2568@findex table-unrecognize-table
2569@item M-x table-unrecognize-table
2570Deactivate the table under point.
2571@findex table-recognize-cell
2572@item M-x table-recognize-cell
2573Recognize the cell under point and activate it.
2574@findex table-unrecognize-cell
2575@item M-x table-unrecognize-cell
2576Deactivate the cell under point.
2577@end table
2578
2579 For another way of converting text into tables, see @ref{Table
2580Conversion}.
2581
2582@node Cell Commands
2583@subsection Commands for Table Cells
2584
2585@findex table-forward-cell
2586@findex table-backward-cell
2587 The commands @code{table-forward-cell} and
2588@code{table-backward-cell} move point from the current cell to an
2589adjacent cell forward and backward respectively. The order of the
2590cells is cyclic: when point is in the last cell of a table, typing
2591@kbd{M-x table-forward-cell} moves to the first cell in the table.
2592Likewise @kbd{M-x table-backward-cell} from the first cell in a table
2593moves to the last cell.
2594
2595@findex table-span-cell
2596 The command @code{table-span-cell} merges the current cell with the
2597adjacent cell in a specified direction---right, left, above or below.
2598You specify the direction with the minibuffer. It does not allow
2599merges which don't result in a legitimate cell layout.
2600
2601@findex table-split-cell
2602@cindex text-based tables, split a cell
2603@cindex split table cell
2604 The command @code{table-split-cell} splits the current cell
2605vertically or horizontally. This command is a wrapper to the
2606direction specific commands @code{table-split-cell-vertically} and
2607@code{table-split-cell-horizontally}. You specify the direction with
2608a minibuffer argument.
2609
2610@findex table-split-cell-vertically
2611 The command @code{table-split-cell-vertically} splits the current
2612cell vertically and creates a pair of cells above and below where
2613point is located. The content in the original cell is split as well.
2614
2615@findex table-split-cell-horizontally
2616 The command @code{table-split-cell-horizontally} splits the current
2617cell horizontally and creates a pair of cells right and left of where
2618point is located. If the cell being split is not empty, this asks you
2619how to handle the cell contents. The three options are: @code{split},
2620@code{left}, or @code{right}. @code{split} splits the contents at
2621point literally, while the @code{left} and @code{right} options move
2622the entire contents into the left or right cell respectively.
2623
2624@cindex enlarge a table cell
2625@cindex shrink a table cell
2626 The next four commands enlarge or shrink a cell. They use numeric
2627arguments (@pxref{Arguments}) to specify how many columns or rows to
2628enlarge or shrink a particular table.
2629
2630@table @kbd
2631@findex table-heighten-cell
2632@item M-x table-heighten-cell
2633Enlarge the current cell vertically.
2634@findex table-shorten-cell
2635@item M-x table-shorten-cell
2636Shrink the current cell vertically.
2637@findex table-widen-cell
2638@item M-x table-widen-cell
2639Enlarge the current cell horizontally.
2640@findex table-narrow-cell
2641@item M-x table-narrow-cell
2642Shrink the current cell horizontally.
2643@end table
2644
2645@node Cell Justification
2646@subsection Cell Justification
2647@cindex cell text justification
2648
2649 You can specify text justification for each cell. The justification
2650is remembered independently for each cell and the subsequent editing
2651of cell contents is subject to the specified justification.
2652
2653@findex table-justify
2654 The command @code{table-justify} ask you to specify what to justify:
2655a cell, a column, or a row. If you select cell justification, this
2656command sets the justification only for the current cell. Selecting
2657column or row justification sets the justification for all the cells
2658within a column or row respectively. The command then ask you which
2659kind of justification to apply: @code{left}, @code{center},
2660@code{right}, @code{top}, @code{middle}, @code{bottom}, or
2661@code{none}. Horizontal justification and vertical justification are
2662specified independently. The options @code{left}, @code{center}, and
2663@code{right} specify horizontal justification while the options
2664@code{top}, @code{middle}, @code{bottom}, and @code{none} specify
2665vertical justification. The vertical justification @code{none}
2666effectively removes vertical justification. Horizontal justification
2667must be one of @code{left}, @code{center}, or @code{right}.
2668
2669@vindex table-detect-cell-alignment
2670 Justification information is stored in the buffer as a part of text
2671property. Therefore, this information is ephemeral and does not
2672survive through the loss of the buffer (closing the buffer and
2673revisiting the buffer erase any previous text properties). To
2674countermand for this, the command @code{table-recognize} and other
2675recognition commands (@pxref{Table Recognition}) are equipped with a
2676convenience feature (turned on by default). During table recognition,
2677the contents of a cell are examined to determine which justification
2678was originally applied to the cell and then applies this justification
2679to the cell. This is a speculative algorithm and is therefore not
2680perfect, however, the justification is deduced correctly most of the
2681time. To disable this feature, customize the variable
2682@code{table-detect-cell-alignment} and set it to @code{nil}.
2683
2684@node Row Commands
2685@subsection Commands for Table Rows
2686@cindex table row commands
2687
2688@cindex insert row in table
2689@findex table-insert-row
2690 The command @code{table-insert-row} inserts a row of cells before
2691the current row in a table. The current row where point is located is
2692pushed down after the newly inserted row. A numeric prefix argument
2693specifies the number of rows to insert. Note that in order to insert
2694rows @emph{after} the last row at the bottom of a table, you must
2695place point below the table---that is, outside the table---prior to
2696invoking this command.
2697
2698@cindex delete row in table
2699@findex table-delete-row
2700 The command @code{table-delete-row} deletes a row of cells at point.
2701A numeric prefix argument specifies the number of rows to delete.
2702
2703@node Column Commands
2704@subsection Commands for Table Columns
2705@cindex table column commands
2706
2707@cindex insert column in table
2708@findex table-insert-column
2709 The command @code{table-insert-column} inserts a column of cells to
2710the left of the current row in a table. This pushes the current
2711column to the right. To insert a column to the right side of the
2712rightmost column, place point to the right of the rightmost column,
2713which is outside of the table, prior to invoking this command. A
2714numeric prefix argument specifies the number of columns to insert.
2715
2716@cindex delete column in table
2717 A command @code{table-delete-column} deletes a column of cells at
2718point. A numeric prefix argument specifies the number of columns to
2719delete.
2720
2721@node Fixed Width Mode
2722@subsection Fix Width of Cells
2723@cindex fix width of table cells
2724
2725@findex table-fixed-width-mode
2726 The command @code{table-fixed-width-mode} toggles fixed width mode
2727on and off. When fixed width mode is turned on, editing inside a
2728cell never changes the cell width; when it is off, the cell width
2729expands automatically in order to prevent a word from being folded
2730into multiple lines. By default, fixed width mode is disabled.
2731
2732@node Table Conversion
2733@subsection Conversion Between Plain Text and Tables
2734@cindex text to table
2735@cindex table to text
2736
2737@findex table-capture
2738 The command @code{table-capture} captures plain text in a region and
2739turns it into a table. Unlike @code{table-recognize} (@pxref{Table
2740Recognition}), the original text does not have a table appearance but
2741may hold a logical table structure. For example, some elements
2742separated by known patterns form a two dimensional structure which can
2743be turned into a table.
2744
2745 Here's an example of data that @code{table-capture} can operate on.
2746The numbers are horizontally separated by a comma and vertically
2747separated by a newline character.
2748
2749@example
27501, 2, 3, 4
27515, 6, 7, 8
2752, 9, 10
2753@end example
2754
2755@noindent
2756Invoking @kbd{M-x table-capture} on that text produces this table:
2757
2758@example
2759+-----+-----+-----+-----+
2760|1 |2 |3 |4 |
2761+-----+-----+-----+-----+
2762|5 |6 |7 |8 |
2763+-----+-----+-----+-----+
2764| |9 |10 | |
2765+-----+-----+-----+-----+
2766@end example
2767
2768@noindent
2769The conversion uses @samp{,} for the column delimiter and newline for
2770a row delimiter, cells are left justified, and minimum cell width is
27715.
2772
2773@findex table-release
2774 The command @code{table-release} does the opposite of
2775@code{table-capture}. It releases a table by removing the table frame
2776and cell borders. This leaves the table contents as plain text. One
2777of the useful applications of @code{table-capture} and
2778@code{table-release} is to edit a text in layout. Look at the
2779following three paragraphs (the latter two are indented with header
2780lines):
2781
2782@example
2783@samp{table-capture} is a powerful command, but mastering its
2784power requires some practice. Here are some things it can do:
2785
2786Parse Cell Items By using column delimiter regular
2787 expression and raw delimiter regular
2788 expression, it parses the specified text
2789 area and extracts cell items from
2790 non-table text and then forms a table out
2791 of them.
2792
2793Capture Text Area When no delimiters are specified it
2794 creates a single cell table. The text in
2795 the specified region is placed in that
2796 cell.
2797@end example
2798
2799@noindent
2800Applying @code{table-capture} to a region containing the above three
2801paragraphs, with empty strings for column delimiter regexp and row
2802delimiter regexp, creates a table with a single cell like the
2803following one.
2804
2805@c The first line's right-hand frame in the following two examples
2806@c sticks out to accommodate for the removal of @samp in the
2807@c produced output!!
2808@smallexample
2809@group
2810+-----------------------------------------------------------------+
2811|@samp{table-capture} is a powerful command, but mastering its |
2812|power requires some practice. Here are some things it can do: |
2813| |
2814|Parse Cell Items By using column delimiter regular |
2815| expression and raw delimiter regular |
2816| expression, it parses the specified text |
2817| area and extracts cell items from |
2818| non-table text and then forms a table out |
2819| of them. |
2820| |
2821|Capture Text Area When no delimiters are specified it |
2822| creates a single cell table. The text in |
2823| the specified region is placed in that |
2824| cell. |
2825+-----------------------------------------------------------------+
2826@end group
2827@end smallexample
2828
2829@noindent
2830By splitting the cell appropriately we now have a table consisting of
2831paragraphs occupying its own cell. Each cell can now be edited
2832independently without affecting the layout of other cells.
2833
2834@smallexample
2835+-----------------------------------------------------------------+
2836|@samp{table-capture} is a powerful command, but mastering its |
2837|power requires some practice. Here are some things it can do: |
2838+---------------------+-------------------------------------------+
2839|Parse Cell Items |By using column delimiter regular |
2840| |expression and raw delimiter regular |
2841| |expression, it parses the specified text |
2842| |area and extracts cell items from |
2843| |non-table text and then forms a table out |
2844| |of them. |
2845+---------------------+-------------------------------------------+
2846|Capture Text Area |When no delimiters are specified it |
2847| |creates a single cell table. The text in |
2848| |the specified region is placed in that |
2849| |cell. |
2850+---------------------+-------------------------------------------+
2851@end smallexample
2852
2853@noindent
2854By applying @code{table-release}, which does the opposite process, the
2855contents become once again plain text. @code{table-release} works as
2856a companion command to @code{table-capture}.
2857
2858@node Measuring Tables
2859@subsection Analyzing Table Dimensions
2860@cindex table dimensions
2861
2862@findex table-query-dimension
2863 The command @code{table-query-dimension} analyzes a table structure
2864and reports information regarding its dimensions. In case of the
2865above example table, the @code{table-query-dimension} command displays
2866in echo area:
2867
2868@smallexample
2869Cell: (21w, 6h), Table: (67w, 16h), Dim: (2c, 3r), Total Cells: 5
2870@end smallexample
2871
2872@noindent
2873This indicates that the current cell is 21 character wide and 6 lines
2874high, the entire table is 67 characters wide and 16 lines high. The
2875table has 2 columns and 3 rows. It has a total of 5 cells, since the
2876first row has a spanned cell.
2877
2878@node Table Misc
2879@subsection Table Miscellany
2880
2881@cindex insert string into table cells
2882@findex table-insert-sequence
2883 The command @code{table-insert-sequence} inserts a string into each
2884cell. Each string is a part of a sequence i.e.@: a series of
2885increasing integer numbers.
2886
2887@cindex table in language format
2888@cindex table for HTML and LaTeX
2889@findex table-generate-source
2890 The command @code{table-generate-source} generates a table formatted
2891for a specific markup language. It asks for a language (which must be
2892one of @code{html}, @code{latex}, or @code{cals}), a destination
2893buffer where to put the result, and the table caption (a string), and
2894then inserts the generated table in the proper syntax into the
2895destination buffer. The default destination buffer is
2896@code{table.@var{lang}}, where @var{lang} is the language you
2897specified.
2898
2899@ignore
2900 arch-tag: 8db54ed8-2036-49ca-b0df-23811d03dc70
2901@end ignore
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
new file mode 100644
index 00000000000..ea494445a4e
--- /dev/null
+++ b/doc/emacs/trouble.texi
@@ -0,0 +1,1066 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
3@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@iftex
6@chapter Dealing with Common Problems
7
8 If you type an Emacs command you did not intend, the results are often
9mysterious. This chapter tells what you can do to cancel your mistake or
10recover from a mysterious situation. Emacs bugs and system crashes are
11also considered.
12@end iftex
13
14@ifnottex
15@raisesections
16@end ifnottex
17
18@node Quitting, Lossage, Customization, Top
19@section Quitting and Aborting
20@cindex quitting
21
22@table @kbd
23@item C-g
24@itemx C-@key{BREAK} @r{(MS-DOS only)}
25Quit: cancel running or partially typed command.
26@item C-]
27Abort innermost recursive editing level and cancel the command which
28invoked it (@code{abort-recursive-edit}).
29@item @key{ESC} @key{ESC} @key{ESC}
30Either quit or abort, whichever makes sense (@code{keyboard-escape-quit}).
31@item M-x top-level
32Abort all recursive editing levels that are currently executing.
33@item C-x u
34Cancel a previously made change in the buffer contents (@code{undo}).
35@end table
36
37 There are two ways of canceling a command before it has finished:
38@dfn{quitting} with @kbd{C-g}, and @dfn{aborting} with @kbd{C-]} or
39@kbd{M-x top-level}. Quitting cancels a partially typed command, or
40one which is still running. Aborting exits a recursive editing level
41and cancels the command that invoked the recursive edit.
42(@xref{Recursive Edit}.)
43
44@cindex quitting
45@kindex C-g
46 Quitting with @kbd{C-g} is the way to get rid of a partially typed
47command, or a numeric argument that you don't want. It also stops a
48running command in the middle in a relatively safe way, so you can use
49it if you accidentally give a command which takes a long time. In
50particular, it is safe to quit out of a kill command; either your text
51will @emph{all} still be in the buffer, or it will @emph{all} be in
52the kill ring, or maybe both. Quitting an incremental search does
53special things, documented under searching; it may take two successive
54@kbd{C-g} characters to get out of a search (@pxref{Incremental
55Search}).
56
57 On MS-DOS, the character @kbd{C-@key{BREAK}} serves as a quit character
58like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to
59recognize @kbd{C-g} while a command is running, between interactions
60with the user. By contrast, it @emph{is} feasible to recognize
61@kbd{C-@key{BREAK}} at all times.
62@iftex
63@xref{MS-DOS Keyboard,,,emacs-xtra, Specialized Emacs Features}.
64@end iftex
65@ifnottex
66@xref{MS-DOS Keyboard}.
67@end ifnottex
68
69
70@findex keyboard-quit
71 @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t}
72the instant @kbd{C-g} is typed; Emacs Lisp checks this variable
73frequently, and quits if it is non-@code{nil}. @kbd{C-g} is only
74actually executed as a command if you type it while Emacs is waiting for
75input. In that case, the command it runs is @code{keyboard-quit}.
76
77 On a text terminal, if you quit with @kbd{C-g} a second time before
78the first @kbd{C-g} is recognized, you activate the ``emergency
79escape'' feature and return to the shell. @xref{Emergency Escape}.
80
81@cindex NFS and quitting
82 There are some situations where you cannot quit. When Emacs is
83waiting for the operating system to do something, quitting is
84impossible unless special pains are taken for the particular system
85call within Emacs where the waiting occurs. We have done this for the
86system calls that users are likely to want to quit from, but it's
87possible you will a case not handled. In one very common
88case---waiting for file input or output using NFS---Emacs itself knows
89how to quit, but many NFS implementations simply do not allow user
90programs to stop waiting for NFS when the NFS server is hung.
91
92@cindex aborting recursive edit
93@findex abort-recursive-edit
94@kindex C-]
95 Aborting with @kbd{C-]} (@code{abort-recursive-edit}) is used to get
96out of a recursive editing level and cancel the command which invoked
97it. Quitting with @kbd{C-g} does not do this, and could not do this,
98because it is used to cancel a partially typed command @emph{within} the
99recursive editing level. Both operations are useful. For example, if
100you are in a recursive edit and type @kbd{C-u 8} to enter a numeric
101argument, you can cancel that argument with @kbd{C-g} and remain in the
102recursive edit.
103
104@findex keyboard-escape-quit
105@kindex ESC ESC ESC
106 The sequence @kbd{@key{ESC} @key{ESC} @key{ESC}}
107(@code{keyboard-escape-quit}) can either quit or abort. (We defined
108it this way because @key{ESC} means ``get out'' in many PC programs.)
109It can cancel a prefix argument, clear a selected region, or get out
110of a Query Replace, like @kbd{C-g}. It can get out of the minibuffer
111or a recursive edit, like @kbd{C-]}. It can also get out of splitting
112the frame into multiple windows, as with @kbd{C-x 1}. One thing it
113cannot do, however, is stop a command that is running. That's because
114it executes as an ordinary command, and Emacs doesn't notice it until
115it is ready for the next command.
116
117@findex top-level
118 The command @kbd{M-x top-level} is equivalent to ``enough'' @kbd{C-]}
119commands to get you out of all the levels of recursive edits that you
120are in. @kbd{C-]} gets you out one level at a time, but @kbd{M-x
121top-level} goes out all levels at once. Both @kbd{C-]} and @kbd{M-x
122top-level} are like all other commands, and unlike @kbd{C-g}, in that
123they take effect only when Emacs is ready for a command. @kbd{C-]} is
124an ordinary key and has its meaning only because of its binding in the
125keymap. @xref{Recursive Edit}.
126
127 @kbd{C-x u} (@code{undo}) is not strictly speaking a way of canceling
128a command, but you can think of it as canceling a command that already
129finished executing. @xref{Undo}, for more information
130about the undo facility.
131
132@node Lossage, Bugs, Quitting, Top
133@section Dealing with Emacs Trouble
134
135 This section describes various conditions in which Emacs fails to work
136normally, and how to recognize them and correct them. For a list of
137additional problems you might encounter, see @ref{Bugs and problems, ,
138Bugs and problems, efaq, GNU Emacs FAQ}, and the file @file{etc/PROBLEMS}
139in the Emacs distribution. Type @kbd{C-h C-f} to read the FAQ; type
140@kbd{C-h C-e} to read the @file{PROBLEMS} file.
141
142@menu
143* DEL Does Not Delete:: What to do if @key{DEL} doesn't delete.
144* Stuck Recursive:: `[...]' in mode line around the parentheses.
145* Screen Garbled:: Garbage on the screen.
146* Text Garbled:: Garbage in the text.
147* Memory Full:: How to cope when you run out of memory.
148* After a Crash:: Recovering editing in an Emacs session that crashed.
149* Emergency Escape:: Emergency escape---
150 What to do if Emacs stops responding.
151* Total Frustration:: When you are at your wits' end.
152@end menu
153
154@node DEL Does Not Delete
155@subsection If @key{DEL} Fails to Delete
156@cindex @key{DEL} vs @key{BACKSPACE}
157@cindex @key{BACKSPACE} vs @key{DEL}
158@cindex usual erasure key
159
160 Every keyboard has a large key, a little ways above the @key{RET} or
161@key{ENTER} key, which you normally use outside Emacs to erase the
162last character that you typed. We call this key @dfn{the usual
163erasure key}. In Emacs, it is supposed to be equivalent to @key{DEL},
164and when Emacs is properly configured for your terminal, it translates
165that key into the character @key{DEL}.
166
167 When Emacs starts up on a graphical display, it determines
168automatically which key should be @key{DEL}. In some unusual cases
169Emacs gets the wrong information from the system. If the usual
170erasure key deletes forwards instead of backwards, that is probably
171what happened---Emacs ought to be treating the @key{DELETE} key as
172@key{DEL}, but it isn't.
173
174 On a graphical display, if the usual erasure key is labeled
175@key{BACKSPACE} and there is a @key{DELETE} key elsewhere, but the
176@key{DELETE} key deletes backward instead of forward, that too
177suggests Emacs got the wrong information---but in the opposite sense.
178It ought to be treating the @key{BACKSPACE} key as @key{DEL}, and
179treating @key{DELETE} differently, but it isn't.
180
181 On a text-only terminal, if you find the usual erasure key prompts
182for a Help command, like @kbd{Control-h}, instead of deleting a
183character, it means that key is actually sending the @key{BS}
184character. Emacs ought to be treating @key{BS} as @key{DEL}, but it
185isn't.
186
187 In all of those cases, the immediate remedy is the same: use the
188command @kbd{M-x normal-erase-is-backspace-mode}. This toggles
189between the two modes that Emacs supports for handling @key{DEL}, so
190if Emacs starts in the wrong mode, this should switch to the right
191mode. On a text-only terminal, if you want to ask for help when
192@key{BS} is treated as @key{DEL}, use @key{F1}; @kbd{C-?} may also
193work, if it sends character code 127.
194
195@findex normal-erase-is-backspace-mode
196 To fix the problem automatically for every Emacs session, you can
197put one of the following lines into your @file{.emacs} file
198(@pxref{Init File}). For the first case above, where @key{DELETE}
199deletes forwards instead of backwards, use this line to make
200@key{DELETE} act as @key{DEL} (resulting in behavior compatible
201with Emacs 20 and previous versions):
202
203@lisp
204(normal-erase-is-backspace-mode 0)
205@end lisp
206
207@noindent
208For the other two cases, where @key{BACKSPACE} ought to act as
209@key{DEL}, use this line:
210
211@lisp
212(normal-erase-is-backspace-mode 1)
213@end lisp
214
215@vindex normal-erase-is-backspace
216 Another way to fix the problem for every Emacs session is to
217customize the variable @code{normal-erase-is-backspace}: the value
218@code{t} specifies the mode where @key{BS} or @key{BACKSPACE} is
219@key{DEL}, and @code{nil} specifies the other mode. @xref{Easy
220Customization}.
221
222 On a graphical display, it can also happen that the usual erasure key
223is labeled @key{BACKSPACE}, there is a @key{DELETE} key elsewhere, and
224both keys delete forward. This probably means that someone has
225redefined your @key{BACKSPACE} key as a @key{DELETE} key. With X,
226this is typically done with a command to the @code{xmodmap} program
227when you start the server or log in. The most likely motive for this
228customization was to support old versions of Emacs, so we recommend
229you simply remove it now.
230
231@node Stuck Recursive
232@subsection Recursive Editing Levels
233
234 Recursive editing levels are important and useful features of Emacs, but
235they can seem like malfunctions if you do not understand them.
236
237 If the mode line has square brackets @samp{[@dots{}]} around the parentheses
238that contain the names of the major and minor modes, you have entered a
239recursive editing level. If you did not do this on purpose, or if you
240don't understand what that means, you should just get out of the recursive
241editing level. To do so, type @kbd{M-x top-level}. This is called getting
242back to top level. @xref{Recursive Edit}.
243
244@node Screen Garbled
245@subsection Garbage on the Screen
246
247 If the text on a text terminal looks wrong, the first thing to do is
248see whether it is wrong in the buffer. Type @kbd{C-l} to redisplay
249the entire screen. If the screen appears correct after this, the
250problem was entirely in the previous screen update. (Otherwise, see
251the following section.)
252
253 Display updating problems often result from an incorrect terminfo
254entry for the terminal you are using. The file @file{etc/TERMS} in
255the Emacs distribution gives the fixes for known problems of this
256sort. @file{INSTALL} contains general advice for these problems in
257one of its sections. To investigate the possibility that you have
258this sort of problem, try Emacs on another terminal made by a
259different manufacturer. If problems happen frequently on one kind of
260terminal but not another kind, it is likely to be a bad terminfo entry,
261though it could also be due to a bug in Emacs that appears for
262terminals that have or that lack specific features.
263
264@node Text Garbled
265@subsection Garbage in the Text
266
267 If @kbd{C-l} shows that the text is wrong, first type @kbd{C-h l} to
268see what commands you typed to produce the observed results. Then try
269undoing the changes step by step using @kbd{C-x u}, until it gets back
270to a state you consider correct.
271
272 If a large portion of text appears to be missing at the beginning or
273end of the buffer, check for the word @samp{Narrow} in the mode line.
274If it appears, the text you don't see is probably still present, but
275temporarily off-limits. To make it accessible again, type @kbd{C-x n
276w}. @xref{Narrowing}.
277
278@node Memory Full
279@subsection Running out of Memory
280@cindex memory full
281@cindex out of memory
282
283 If you get the error message @samp{Virtual memory exceeded}, save
284your modified buffers with @kbd{C-x s}. This method of saving them
285has the smallest need for additional memory. Emacs keeps a reserve of
286memory which it makes available when this error happens; that should
287be enough to enable @kbd{C-x s} to complete its work. When the
288reserve has been used, @samp{!MEM FULL!} appears at the beginning of
289the mode line, indicating there is no more reserve.
290
291 Once you have saved your modified buffers, you can exit this Emacs
292session and start another, or you can use @kbd{M-x kill-some-buffers}
293to free space in the current Emacs job. If this frees up sufficient
294space, Emacs will refill its memory reserve, and @samp{!MEM FULL!}
295will disappear from the mode line. That means you can safely go on
296editing in the same Emacs session.
297
298 Do not use @kbd{M-x buffer-menu} to save or kill buffers when you run
299out of memory, because the buffer menu needs a fair amount of memory
300itself, and the reserve supply may not be enough.
301
302@node After a Crash
303@subsection Recovery After a Crash
304
305 If Emacs or the computer crashes, you can recover the files you were
306editing at the time of the crash from their auto-save files. To do
307this, start Emacs again and type the command @kbd{M-x recover-session}.
308
309 This command initially displays a buffer which lists interrupted
310session files, each with its date. You must choose which session to
311recover from. Typically the one you want is the most recent one. Move
312point to the one you choose, and type @kbd{C-c C-c}.
313
314 Then @code{recover-session} considers each of the files that you
315were editing during that session; for each such file, it asks whether
316to recover that file. If you answer @kbd{y} for a file, it shows the
317dates of that file and its auto-save file, then asks once again
318whether to recover that file. For the second question, you must
319confirm with @kbd{yes}. If you do, Emacs visits the file but gets the
320text from the auto-save file.
321
322 When @code{recover-session} is done, the files you've chosen to
323recover are present in Emacs buffers. You should then save them. Only
324this---saving them---updates the files themselves.
325
326 As a last resort, if you had buffers with content which were not
327associated with any files, or if the autosave was not recent enough to
328have recorded important changes, you can use the
329@file{etc/emacs-buffer.gdb} script with GDB (the GNU Debugger) to
330retrieve them from a core dump--provided that a core dump was saved,
331and that the Emacs executable was not stripped of its debugging
332symbols.
333
334 As soon as you get the core dump, rename it to another name such as
335@file{core.emacs}, so that another crash won't overwrite it.
336
337 To use this script, run @code{gdb} with the file name of your Emacs
338executable and the file name of the core dump, e.g. @samp{gdb
339/usr/bin/emacs core.emacs}. At the @code{(gdb)} prompt, load the
340recovery script: @samp{source /usr/src/emacs/etc/emacs-buffer.gdb}.
341Then type the command @code{ybuffer-list} to see which buffers are
342available. For each buffer, it lists a buffer number. To save a
343buffer, use @code{ysave-buffer}; you specify the buffer number, and
344the file name to write that buffer into. You should use a file name
345which does not already exist; if the file does exist, the script does
346not make a backup of its old contents.
347
348@node Emergency Escape
349@subsection Emergency Escape
350
351 On text-only terminals, the @dfn{emergency escape} feature suspends
352Emacs immediately if you type @kbd{C-g} a second time before Emacs can
353actually respond to the first one by quitting. This is so you can
354always get out of GNU Emacs no matter how badly it might be hung.
355When things are working properly, Emacs recognizes and handles the
356first @kbd{C-g} so fast that the second one won't trigger emergency
357escape. However, if some problem prevents Emacs from handling the
358first @kbd{C-g} properly, then the second one will get you back to the
359shell.
360
361 When you resume Emacs after a suspension caused by emergency escape,
362it asks two questions before going back to what it had been doing:
363
364@example
365Auto-save? (y or n)
366Abort (and dump core)? (y or n)
367@end example
368
369@noindent
370Answer each one with @kbd{y} or @kbd{n} followed by @key{RET}.
371
372 Saying @kbd{y} to @samp{Auto-save?} causes immediate auto-saving of
373all modified buffers in which auto-saving is enabled. Saying @kbd{n}
374skips this.
375
376 Saying @kbd{y} to @samp{Abort (and dump core)?} causes Emacs to
377crash, dumping core. This is to enable a wizard to figure out why
378Emacs was failing to quit in the first place. Execution does not
379continue after a core dump.
380
381 If you answer this question @kbd{n}, Emacs execution resumes. With
382luck, Emacs will ultimately do the requested quit. If not, each
383subsequent @kbd{C-g} invokes emergency escape again.
384
385 If Emacs is not really hung, just slow, you may invoke the double
386@kbd{C-g} feature without really meaning to. Then just resume and
387answer @kbd{n} to both questions, and you will get back to the former
388state. The quit you requested will happen by and by.
389
390 Emergency escape is active only for text terminals. On graphical
391displays, you can use the mouse to kill Emacs or switch to another
392program.
393
394 On MS-DOS, you must type @kbd{C-@key{BREAK}} (twice) to cause
395emergency escape---but there are cases where it won't work, when
396system call hangs or when Emacs is stuck in a tight loop in C code.
397
398@node Total Frustration
399@subsection Help for Total Frustration
400@cindex Eliza
401@cindex doctor
402
403 If using Emacs (or something else) becomes terribly frustrating and none
404of the techniques described above solve the problem, Emacs can still help
405you.
406
407 First, if the Emacs you are using is not responding to commands, type
408@kbd{C-g C-g} to get out of it and then start a new one.
409
410@findex doctor
411 Second, type @kbd{M-x doctor @key{RET}}.
412
413 The Emacs psychotherapist will help you feel better. Each time you
414say something to the psychotherapist, you must end it by typing
415@key{RET} @key{RET}. This indicates you are finished typing.
416
417@node Bugs, Contributing, Lossage, Top
418@section Reporting Bugs
419
420@cindex bugs
421 Sometimes you will encounter a bug in Emacs. Although we cannot
422promise we can or will fix the bug, and we might not even agree that it
423is a bug, we want to hear about problems you encounter. Often we agree
424they are bugs and want to fix them.
425
426 To make it possible for us to fix a bug, you must report it. In order
427to do so effectively, you must know when and how to do it.
428
429 Before reporting a bug, it is a good idea to see if it is already
430known. You can find the list of known problems in the file
431@file{etc/PROBLEMS} in the Emacs distribution; type @kbd{C-h C-e} to read
432it. Some additional user-level problems can be found in @ref{Bugs and
433problems, , Bugs and problems, efaq, GNU Emacs FAQ}. Looking up your
434problem in these two documents might provide you with a solution or a
435work-around, or give you additional information about related issues.
436
437@menu
438* Criteria: Bug Criteria. Have you really found a bug?
439* Understanding Bug Reporting:: How to report a bug effectively.
440* Checklist:: Steps to follow for a good bug report.
441* Sending Patches:: How to send a patch for GNU Emacs.
442@end menu
443
444@node Bug Criteria
445@subsection When Is There a Bug
446
447 If Emacs accesses an invalid memory location (``segmentation
448fault''), or exits with an operating system error message that
449indicates a problem in the program (as opposed to something like
450``disk full''), then it is certainly a bug.
451
452 If Emacs updates the display in a way that does not correspond to what is
453in the buffer, then it is certainly a bug. If a command seems to do the
454wrong thing but the problem corrects itself if you type @kbd{C-l}, it is a
455case of incorrect display updating.
456
457 Taking forever to complete a command can be a bug, but you must make
458certain that it was really Emacs's fault. Some commands simply take a
459long time. Type @kbd{C-g} (@kbd{C-@key{BREAK}} on MS-DOS) and then @kbd{C-h l}
460to see whether the input Emacs received was what you intended to type;
461if the input was such that you @emph{know} it should have been processed
462quickly, report a bug. If you don't know whether the command should
463take a long time, find out by looking in the manual or by asking for
464assistance.
465
466 If a command you are familiar with causes an Emacs error message in a
467case where its usual definition ought to be reasonable, it is probably a
468bug.
469
470 If a command does the wrong thing, that is a bug. But be sure you know
471for certain what it ought to have done. If you aren't familiar with the
472command, or don't know for certain how the command is supposed to work,
473then it might actually be working right. Rather than jumping to
474conclusions, show the problem to someone who knows for certain.
475
476 Finally, a command's intended definition may not be the best
477possible definition for editing with. This is a very important sort
478of problem, but it is also a matter of judgment. Also, it is easy to
479come to such a conclusion out of ignorance of some of the existing
480features. It is probably best not to complain about such a problem
481until you have checked the documentation in the usual ways, feel
482confident that you understand it, and know for certain that what you
483want is not available. Ask other Emacs users, too. If you are not
484sure what the command is supposed to do after a careful reading of the
485manual, check the index and glossary for any terms that may be
486unclear.
487
488 If after careful rereading of the manual you still do not understand
489what the command should do, that indicates a bug in the manual, which
490you should report. The manual's job is to make everything clear to
491people who are not Emacs experts---including you. It is just as
492important to report documentation bugs as program bugs.
493
494 If the on-line documentation string of a function or variable disagrees
495with the manual, one of them must be wrong; that is a bug.
496
497@node Understanding Bug Reporting
498@subsection Understanding Bug Reporting
499
500@findex emacs-version
501 When you decide that there is a bug, it is important to report it and to
502report it in a way which is useful. What is most useful is an exact
503description of what commands you type, starting with the shell command to
504run Emacs, until the problem happens.
505
506 The most important principle in reporting a bug is to report
507@emph{facts}. Hypotheses and verbal descriptions are no substitute for
508the detailed raw data. Reporting the facts is straightforward, but many
509people strain to posit explanations and report them instead of the
510facts. If the explanations are based on guesses about how Emacs is
511implemented, they will be useless; meanwhile, lacking the facts, we will
512have no real information about the bug.
513
514 For example, suppose that you type @kbd{C-x C-f /glorp/baz.ugh
515@key{RET}}, visiting a file which (you know) happens to be rather
516large, and Emacs displays @samp{I feel pretty today}. The best way to
517report the bug is with a sentence like the preceding one, because it
518gives all the facts.
519
520 A bad way would be to assume that the problem is due to the size of
521the file and say, ``I visited a large file, and Emacs displayed @samp{I
522feel pretty today}.'' This is what we mean by ``guessing
523explanations.'' The problem is just as likely to be due to the fact
524that there is a @samp{z} in the file name. If this is so, then when we
525got your report, we would try out the problem with some ``large file,''
526probably with no @samp{z} in its name, and not see any problem. There
527is no way in the world that we could guess that we should try visiting a
528file with a @samp{z} in its name.
529
530 Alternatively, the problem might be due to the fact that the file starts
531with exactly 25 spaces. For this reason, you should make sure that you
532inform us of the exact contents of any file that is needed to reproduce the
533bug. What if the problem only occurs when you have typed the @kbd{C-x C-a}
534command previously? This is why we ask you to give the exact sequence of
535characters you typed since starting the Emacs session.
536
537 You should not even say ``visit a file'' instead of @kbd{C-x C-f} unless
538you @emph{know} that it makes no difference which visiting command is used.
539Similarly, rather than saying ``if I have three characters on the line,''
540say ``after I type @kbd{@key{RET} A B C @key{RET} C-p},'' if that is
541the way you entered the text.
542
543 So please don't guess any explanations when you report a bug. If you
544want to actually @emph{debug} the problem, and report explanations that
545are more than guesses, that is useful---but please include the facts as
546well.
547
548@node Checklist
549@subsection Checklist for Bug Reports
550
551@cindex reporting bugs
552 The best way to send a bug report is to mail it electronically to the
553Emacs maintainers at @email{bug-gnu-emacs@@gnu.org}, or to
554@email{emacs-pretest-bug@@gnu.org} if you are pretesting an Emacs beta
555release. (If you want to suggest a change as an improvement, use the
556same address.)
557
558 If you'd like to read the bug reports, you can find them on the
559newsgroup @samp{gnu.emacs.bug}; keep in mind, however, that as a
560spectator you should not criticize anything about what you see there.
561The purpose of bug reports is to give information to the Emacs
562maintainers. Spectators are welcome only as long as they do not
563interfere with this. In particular, some bug reports contain fairly
564large amounts of data; spectators should not complain about this.
565
566 Please do not post bug reports using netnews; mail is more reliable
567than netnews about reporting your correct address, which we may need
568in order to ask you for more information. If your data is more than
569500,000 bytes, please don't include it directly in the bug report;
570instead, offer to send it on request, or make it available by ftp and
571say where.
572
573@findex report-emacs-bug
574 A convenient way to send a bug report for Emacs is to use the command
575@kbd{M-x report-emacs-bug}. This sets up a mail buffer (@pxref{Sending
576Mail}) and automatically inserts @emph{some} of the essential
577information. However, it cannot supply all the necessary information;
578you should still read and follow the guidelines below, so you can enter
579the other crucial information by hand before you send the message.
580
581 To enable maintainers to investigate a bug, your report
582should include all these things:
583
584@itemize @bullet
585@item
586The version number of Emacs. Without this, we won't know whether there
587is any point in looking for the bug in the current version of GNU
588Emacs.
589
590You can get the version number by typing @kbd{M-x emacs-version
591@key{RET}}. If that command does not work, you probably have something
592other than GNU Emacs, so you will have to report the bug somewhere
593else.
594
595@item
596The type of machine you are using, and the operating system name and
597version number. @kbd{M-x emacs-version @key{RET}} provides this
598information too. Copy its output from the @samp{*Messages*} buffer, so
599that you get it all and get it accurately.
600
601@item
602The operands given to the @code{configure} command when Emacs was
603installed.
604
605@item
606A complete list of any modifications you have made to the Emacs source.
607(We may not have time to investigate the bug unless it happens in an
608unmodified Emacs. But if you've made modifications and you don't tell
609us, you are sending us on a wild goose chase.)
610
611Be precise about these changes. A description in English is not
612enough---send a context diff for them.
613
614Adding files of your own, or porting to another machine, is a
615modification of the source.
616
617@item
618Details of any other deviations from the standard procedure for installing
619GNU Emacs.
620
621@item
622The complete text of any files needed to reproduce the bug.
623
624 If you can tell us a way to cause the problem without visiting any files,
625please do so. This makes it much easier to debug. If you do need files,
626make sure you arrange for us to see their exact contents. For example, it
627can matter whether there are spaces at the ends of lines, or a
628newline after the last line in the buffer (nothing ought to care whether
629the last line is terminated, but try telling the bugs that).
630
631@item
632The precise commands we need to type to reproduce the bug.
633
634@findex open-dribble-file
635@cindex dribble file
636@cindex logging keystrokes
637The easy way to record the input to Emacs precisely is to write a
638dribble file. To start the file, execute the Lisp expression
639
640@example
641(open-dribble-file "~/dribble")
642@end example
643
644@noindent
645using @kbd{M-:} or from the @samp{*scratch*} buffer just after
646starting Emacs. From then on, Emacs copies all your input to the
647specified dribble file until the Emacs process is killed.
648
649@item
650@findex open-termscript
651@cindex termscript file
652@cindex @env{TERM} environment variable
653For possible display bugs, the terminal type (the value of environment
654variable @env{TERM}), the complete termcap entry for the terminal from
655@file{/etc/termcap} (since that file is not identical on all machines),
656and the output that Emacs actually sent to the terminal.
657
658The way to collect the terminal output is to execute the Lisp expression
659
660@example
661(open-termscript "~/termscript")
662@end example
663
664@noindent
665using @kbd{M-:} or from the @samp{*scratch*} buffer just after
666starting Emacs. From then on, Emacs copies all terminal output to the
667specified termscript file as well, until the Emacs process is killed.
668If the problem happens when Emacs starts up, put this expression into
669your @file{.emacs} file so that the termscript file will be open when
670Emacs displays the screen for the first time.
671
672Be warned: it is often difficult, and sometimes impossible, to fix a
673terminal-dependent bug without access to a terminal of the type that
674stimulates the bug.
675
676@item
677If non-@acronym{ASCII} text or internationalization is relevant, the locale that
678was current when you started Emacs. On GNU/Linux and Unix systems, or
679if you use a Posix-style shell such as Bash, you can use this shell
680command to view the relevant values:
681
682@smallexample
683echo LC_ALL=$LC_ALL LC_COLLATE=$LC_COLLATE LC_CTYPE=$LC_CTYPE \
684 LC_MESSAGES=$LC_MESSAGES LC_TIME=$LC_TIME LANG=$LANG
685@end smallexample
686
687Alternatively, use the @command{locale} command, if your system has it,
688to display your locale settings.
689
690You can use the @kbd{M-!} command to execute these commands from
691Emacs, and then copy the output from the @samp{*Messages*} buffer into
692the bug report. Alternatively, @kbd{M-x getenv @key{RET} LC_ALL
693@key{RET}} will display the value of @code{LC_ALL} in the echo area, and
694you can copy its output from the @samp{*Messages*} buffer.
695
696@item
697A description of what behavior you observe that you believe is
698incorrect. For example, ``The Emacs process gets a fatal signal,'' or,
699``The resulting text is as follows, which I think is wrong.''
700
701Of course, if the bug is that Emacs gets a fatal signal, then one can't
702miss it. But if the bug is incorrect text, the maintainer might fail to
703notice what is wrong. Why leave it to chance?
704
705Even if the problem you experience is a fatal signal, you should still
706say so explicitly. Suppose something strange is going on, such as, your
707copy of the source is out of sync, or you have encountered a bug in the
708C library on your system. (This has happened!) Your copy might crash
709and the copy here might not. If you @emph{said} to expect a crash, then
710when Emacs here fails to crash, we would know that the bug was not
711happening. If you don't say to expect a crash, then we would not know
712whether the bug was happening---we would not be able to draw any
713conclusion from our observations.
714
715@item
716If the bug is that the Emacs Manual or the Emacs Lisp Reference Manual
717fails to describe the actual behavior of Emacs, or that the text is
718confusing, copy in the text from the online manual which you think is
719at fault. If the section is small, just the section name is enough.
720
721@item
722If the manifestation of the bug is an Emacs error message, it is
723important to report the precise text of the error message, and a
724backtrace showing how the Lisp program in Emacs arrived at the error.
725
726To get the error message text accurately, copy it from the
727@samp{*Messages*} buffer into the bug report. Copy all of it, not just
728part.
729
730@findex toggle-debug-on-error
731@pindex Edebug
732To make a backtrace for the error, use @kbd{M-x toggle-debug-on-error}
733before the error happens (that is to say, you must give that command
734and then make the bug happen). This causes the error to start the Lisp
735debugger, which shows you a backtrace. Copy the text of the
736debugger's backtrace into the bug report. @xref{Debugger,, The Lisp
737Debugger, elisp, the Emacs Lisp Reference Manual}, for information on
738debugging Emacs Lisp programs with the Edebug package.
739
740This use of the debugger is possible only if you know how to make the
741bug happen again. If you can't make it happen again, at least copy
742the whole error message.
743
744@item
745Check whether any programs you have loaded into the Lisp world,
746including your @file{.emacs} file, set any variables that may affect the
747functioning of Emacs. Also, see whether the problem happens in a
748freshly started Emacs without loading your @file{.emacs} file (start
749Emacs with the @code{-q} switch to prevent loading the init file). If
750the problem does @emph{not} occur then, you must report the precise
751contents of any programs that you must load into the Lisp world in order
752to cause the problem to occur.
753
754@item
755If the problem does depend on an init file or other Lisp programs that
756are not part of the standard Emacs system, then you should make sure it
757is not a bug in those programs by complaining to their maintainers
758first. After they verify that they are using Emacs in a way that is
759supposed to work, they should report the bug.
760
761@item
762If you wish to mention something in the GNU Emacs source, show the line
763of code with a few lines of context. Don't just give a line number.
764
765The line numbers in the development sources don't match those in your
766sources. It would take extra work for the maintainers to determine what
767code is in your version at a given line number, and we could not be
768certain.
769
770@item
771Additional information from a C debugger such as GDB might enable
772someone to find a problem on a machine which he does not have available.
773If you don't know how to use GDB, please read the GDB manual---it is not
774very long, and using GDB is easy. You can find the GDB distribution,
775including the GDB manual in online form, in most of the same places you
776can find the Emacs distribution. To run Emacs under GDB, you should
777switch to the @file{src} subdirectory in which Emacs was compiled, then
778do @samp{gdb emacs}. It is important for the directory @file{src} to be
779current so that GDB will read the @file{.gdbinit} file in this
780directory.
781
782However, you need to think when you collect the additional information
783if you want it to show what causes the bug.
784
785@cindex backtrace for bug reports
786For example, many people send just a backtrace, but that is not very
787useful by itself. A simple backtrace with arguments often conveys
788little about what is happening inside GNU Emacs, because most of the
789arguments listed in the backtrace are pointers to Lisp objects. The
790numeric values of these pointers have no significance whatever; all that
791matters is the contents of the objects they point to (and most of the
792contents are themselves pointers).
793
794@findex debug_print
795To provide useful information, you need to show the values of Lisp
796objects in Lisp notation. Do this for each variable which is a Lisp
797object, in several stack frames near the bottom of the stack. Look at
798the source to see which variables are Lisp objects, because the debugger
799thinks of them as integers.
800
801To show a variable's value in Lisp syntax, first print its value, then
802use the user-defined GDB command @code{pr} to print the Lisp object in
803Lisp syntax. (If you must use another debugger, call the function
804@code{debug_print} with the object as an argument.) The @code{pr}
805command is defined by the file @file{.gdbinit}, and it works only if you
806are debugging a running process (not with a core dump).
807
808To make Lisp errors stop Emacs and return to GDB, put a breakpoint at
809@code{Fsignal}.
810
811For a short listing of Lisp functions running, type the GDB
812command @code{xbacktrace}.
813
814The file @file{.gdbinit} defines several other commands that are useful
815for examining the data types and contents of Lisp objects. Their names
816begin with @samp{x}. These commands work at a lower level than
817@code{pr}, and are less convenient, but they may work even when
818@code{pr} does not, such as when debugging a core dump or when Emacs has
819had a fatal signal.
820
821@cindex debugging Emacs, tricks and techniques
822More detailed advice and other useful techniques for debugging Emacs
823are available in the file @file{etc/DEBUG} in the Emacs distribution.
824That file also includes instructions for investigating problems
825whereby Emacs stops responding (many people assume that Emacs is
826``hung,'' whereas in fact it might be in an infinite loop).
827
828To find the file @file{etc/DEBUG} in your Emacs installation, use the
829directory name stored in the variable @code{data-directory}.
830@end itemize
831
832Here are some things that are not necessary in a bug report:
833
834@itemize @bullet
835@item
836A description of the envelope of the bug---this is not necessary for a
837reproducible bug.
838
839Often people who encounter a bug spend a lot of time investigating
840which changes to the input file will make the bug go away and which
841changes will not affect it.
842
843This is often time-consuming and not very useful, because the way we
844will find the bug is by running a single example under the debugger
845with breakpoints, not by pure deduction from a series of examples.
846You might as well save time by not searching for additional examples.
847It is better to send the bug report right away, go back to editing,
848and find another bug to report.
849
850Of course, if you can find a simpler example to report @emph{instead} of
851the original one, that is a convenience. Errors in the output will be
852easier to spot, running under the debugger will take less time, etc.
853
854However, simplification is not vital; if you can't do this or don't have
855time to try, please report the bug with your original test case.
856
857@item
858A core dump file.
859
860Debugging the core dump might be useful, but it can only be done on
861your machine, with your Emacs executable. Therefore, sending the core
862dump file to the Emacs maintainers won't be useful. Above all, don't
863include the core file in an email bug report! Such a large message
864can be extremely inconvenient.
865
866@item
867A system-call trace of Emacs execution.
868
869System-call traces are very useful for certain special kinds of
870debugging, but in most cases they give little useful information. It is
871therefore strange that many people seem to think that @emph{the} way to
872report information about a crash is to send a system-call trace. Perhaps
873this is a habit formed from experience debugging programs that don't
874have source code or debugging symbols.
875
876In most programs, a backtrace is normally far, far more informative than
877a system-call trace. Even in Emacs, a simple backtrace is generally
878more informative, though to give full information you should supplement
879the backtrace by displaying variable values and printing them as Lisp
880objects with @code{pr} (see above).
881
882@item
883A patch for the bug.
884
885A patch for the bug is useful if it is a good one. But don't omit the
886other information that a bug report needs, such as the test case, on the
887assumption that a patch is sufficient. We might see problems with your
888patch and decide to fix the problem another way, or we might not
889understand it at all. And if we can't understand what bug you are
890trying to fix, or why your patch should be an improvement, we mustn't
891install it.
892
893@ifnottex
894@xref{Sending Patches}, for guidelines on how to make it easy for us to
895understand and install your patches.
896@end ifnottex
897
898@item
899A guess about what the bug is or what it depends on.
900
901Such guesses are usually wrong. Even experts can't guess right about
902such things without first using the debugger to find the facts.
903@end itemize
904
905@node Sending Patches
906@subsection Sending Patches for GNU Emacs
907
908@cindex sending patches for GNU Emacs
909@cindex patches, sending
910 If you would like to write bug fixes or improvements for GNU Emacs,
911that is very helpful. When you send your changes, please follow these
912guidelines to make it easy for the maintainers to use them. If you
913don't follow these guidelines, your information might still be useful,
914but using it will take extra work. Maintaining GNU Emacs is a lot of
915work in the best of circumstances, and we can't keep up unless you do
916your best to help.
917
918@itemize @bullet
919@item
920Send an explanation with your changes of what problem they fix or what
921improvement they bring about. For a bug fix, just include a copy of the
922bug report, and explain why the change fixes the bug.
923
924(Referring to a bug report is not as good as including it, because then
925we will have to look it up, and we have probably already deleted it if
926we've already fixed the bug.)
927
928@item
929Always include a proper bug report for the problem you think you have
930fixed. We need to convince ourselves that the change is right before
931installing it. Even if it is correct, we might have trouble
932understanding it if we don't have a way to reproduce the problem.
933
934@item
935Include all the comments that are appropriate to help people reading the
936source in the future understand why this change was needed.
937
938@item
939Don't mix together changes made for different reasons.
940Send them @emph{individually}.
941
942If you make two changes for separate reasons, then we might not want to
943install them both. We might want to install just one. If you send them
944all jumbled together in a single set of diffs, we have to do extra work
945to disentangle them---to figure out which parts of the change serve
946which purpose. If we don't have time for this, we might have to ignore
947your changes entirely.
948
949If you send each change as soon as you have written it, with its own
950explanation, then two changes never get tangled up, and we can consider
951each one properly without any extra work to disentangle them.
952
953@item
954Send each change as soon as that change is finished. Sometimes people
955think they are helping us by accumulating many changes to send them all
956together. As explained above, this is absolutely the worst thing you
957could do.
958
959Since you should send each change separately, you might as well send it
960right away. That gives us the option of installing it immediately if it
961is important.
962
963@item
964Use @samp{diff -c} to make your diffs. Diffs without context are hard
965to install reliably. More than that, they are hard to study; we must
966always study a patch to decide whether we want to install it. Unidiff
967format is better than contextless diffs, but not as easy to read as
968@samp{-c} format.
969
970If you have GNU diff, use @samp{diff -c -F'^[_a-zA-Z0-9$]+ *('} when
971making diffs of C code. This shows the name of the function that each
972change occurs in.
973
974@item
975Avoid any ambiguity as to which is the old version and which is the new.
976Please make the old version the first argument to diff, and the new
977version the second argument. And please give one version or the other a
978name that indicates whether it is the old version or your new changed
979one.
980
981@item
982Write the change log entries for your changes. This is both to save us
983the extra work of writing them, and to help explain your changes so we
984can understand them.
985
986The purpose of the change log is to show people where to find what was
987changed. So you need to be specific about what functions you changed;
988in large functions, it's often helpful to indicate where within the
989function the change was.
990
991On the other hand, once you have shown people where to find the change,
992you need not explain its purpose in the change log. Thus, if you add a
993new function, all you need to say about it is that it is new. If you
994feel that the purpose needs explaining, it probably does---but put the
995explanation in comments in the code. It will be more useful there.
996
997Please read the @file{ChangeLog} files in the @file{src} and
998@file{lisp} directories to see what sorts of information to put in,
999and to learn the style that we use. @xref{Change Log}.
1000
1001@item
1002When you write the fix, keep in mind that we can't install a change that
1003would break other systems. Please think about what effect your change
1004will have if compiled on another type of system.
1005
1006Sometimes people send fixes that @emph{might} be an improvement in
1007general---but it is hard to be sure of this. It's hard to install
1008such changes because we have to study them very carefully. Of course,
1009a good explanation of the reasoning by which you concluded the change
1010was correct can help convince us.
1011
1012The safest changes are changes to the configuration files for a
1013particular machine. These are safe because they can't create new bugs
1014on other machines.
1015
1016Please help us keep up with the workload by designing the patch in a
1017form that is clearly safe to install.
1018@end itemize
1019
1020@node Contributing, Service, Bugs, Top
1021@section Contributing to Emacs Development
1022
1023If you would like to help pretest Emacs releases to assure they work
1024well, or if you would like to work on improving Emacs, please contact
1025the maintainers at @email{emacs-devel@@gnu.org}. A pretester
1026should be prepared to investigate bugs as well as report them. If you'd
1027like to work on improving Emacs, please ask for suggested projects or
1028suggest your own ideas.
1029
1030If you have already written an improvement, please tell us about it. If
1031you have not yet started work, it is useful to contact
1032@email{emacs-devel@@gnu.org} before you start; it might be
1033possible to suggest ways to make your extension fit in better with the
1034rest of Emacs.
1035
1036The development version of Emacs can be downloaded from the CVS
1037repository where it is actively maintained by a group of developers.
1038See the Emacs project page
1039@url{http://savannah.gnu.org/projects/emacs/} for details.
1040
1041@node Service, Copying, Contributing, Top
1042@section How To Get Help with GNU Emacs
1043
1044If you need help installing, using or changing GNU Emacs, there are two
1045ways to find it:
1046
1047@itemize @bullet
1048@item
1049Send a message to the mailing list
1050@email{help-gnu-emacs@@gnu.org}, or post your request on
1051newsgroup @code{gnu.emacs.help}. (This mailing list and newsgroup
1052interconnect, so it does not matter which one you use.)
1053
1054@item
1055Look in the service directory for someone who might help you for a fee.
1056The service directory is found in the file named @file{etc/SERVICE} in the
1057Emacs distribution.
1058@end itemize
1059
1060@ifnottex
1061@lowersections
1062@end ifnottex
1063
1064@ignore
1065 arch-tag: c9cba76d-b2cb-4e0c-ae3f-19d5ef35817c
1066@end ignore
diff --git a/doc/emacs/vc-xtra.texi b/doc/emacs/vc-xtra.texi
new file mode 100644
index 00000000000..6ec69d60896
--- /dev/null
+++ b/doc/emacs/vc-xtra.texi
@@ -0,0 +1,32 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included in emacs-xtra.texi when producing the printed
6@c version.
7@iftex
8@node Advanced VC Usage
9@section Advanced VC Usage
10
11 Commonly used features of Emacs' version control (VC) support are
12described in the main Emacs manual (@pxref{Version Control,,,emacs,
13the Emacs Manual}). This chapter describes more advanced VC usage.
14
15@menu
16* VC Dired Mode:: Listing files managed by version control.
17* VC Dired Commands:: Commands to use in a VC Dired buffer.
18* Remote Repositories:: Efficient access to remote CVS servers.
19* Snapshots:: Sets of file versions treated as a unit.
20* Miscellaneous VC:: Various other commands and features of VC.
21* Customizing VC:: Variables that change VC's behavior.
22@end menu
23@end iftex
24
25@iftex
26@include vc1-xtra.texi
27@include vc2-xtra.texi
28@end iftex
29
30@ignore
31 arch-tag: 11a18d0e-1baf-49da-8e38-f61195ae4dc3
32@end ignore
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
new file mode 100644
index 00000000000..6d5df78848c
--- /dev/null
+++ b/doc/emacs/vc1-xtra.texi
@@ -0,0 +1,151 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in vc-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node VC Dired Mode
8@subsection Dired under VC
9
10@cindex PCL-CVS
11@pindex cvs
12@cindex CVS Dired Mode
13 The VC Dired Mode described here works with all the version control
14systems that VC supports. Another more powerful facility, designed
15specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS,
16pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
17
18@kindex C-x v d
19@findex vc-directory
20 When you are working on a large program, it is often useful to find
21out which files have changed within an entire directory tree, or to view
22the status of all files under version control at once, and to perform
23version control operations on collections of files. You can use the
24command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
25that includes only files relevant for version control.
26
27@vindex vc-dired-terse-display
28 @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks
29much like an ordinary Dired buffer
30@iftex
31(@pxref{Dired,,,emacs, the Emacs Manual});
32@end iftex
33@ifnottex
34(@pxref{Dired});
35@end ifnottex
36however, normally it shows only the noteworthy files (those locked or
37not up-to-date). This is called @dfn{terse display}. If you set the
38variable @code{vc-dired-terse-display} to @code{nil}, then VC Dired
39shows all relevant files---those managed under version control, plus
40all subdirectories (@dfn{full display}). The command @kbd{v t} in a
41VC Dired buffer toggles between terse display and full display
42(@pxref{VC Dired Commands}).
43
44@vindex vc-dired-recurse
45 By default, VC Dired produces a recursive listing of noteworthy or
46relevant files at or below the given directory. You can change this by
47setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
48Dired shows only the files in the given directory.
49
50 The line for an individual file shows the version control state in the
51place of the hard link count, owner, group, and size of the file. If
52the file is unmodified, in sync with the master file, the version
53control state shown is blank. Otherwise it consists of text in
54parentheses. Under RCS and SCCS, the name of the user locking the file
55is shown; under CVS, an abbreviated version of the @samp{cvs status}
56output is used. Here is an example using RCS:
57
58@smallexample
59@group
60 /home/jim/project:
61
62 -rw-r--r-- (jim) Apr 2 23:39 file1
63 -r--r--r-- Apr 5 20:21 file2
64@end group
65@end smallexample
66
67@noindent
68The files @samp{file1} and @samp{file2} are under version control,
69@samp{file1} is locked by user jim, and @samp{file2} is unlocked.
70
71 Here is an example using CVS:
72
73@smallexample
74@group
75 /home/joe/develop:
76
77 -rw-r--r-- (modified) Aug 2 1997 file1.c
78 -rw-r--r-- Apr 4 20:09 file2.c
79 -rw-r--r-- (merge) Sep 13 1996 file3.c
80@end group
81@end smallexample
82
83 Here @samp{file1.c} is modified with respect to the repository, and
84@samp{file2.c} is not. @samp{file3.c} is modified, but other changes
85have also been checked in to the repository---you need to merge them
86with the work file before you can check it in.
87
88@vindex vc-stay-local
89@vindex vc-cvs-stay-local
90 In the above, if the repository were on a remote machine, VC would
91only contact it when the variable @code{vc-stay-local} (or
92@code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is
93because access to the repository may be slow, or you may be working
94offline and not have access to the repository at all. As a
95consequence, VC would not be able to tell you that @samp{file3.c} is
96in the ``merge'' state; you would learn that only when you try to
97check-in your modified copy of the file, or use a command such as
98@kbd{C-x v m}.
99
100 In practice, this is not a problem because CVS handles this case
101consistently whenever it arises. In VC, you'll simply get prompted to
102merge the remote changes into your work file first. The benefits of
103less network communication usually outweigh the disadvantage of not
104seeing remote changes immediately.
105
106@vindex vc-directory-exclusion-list
107 When VC Dired displays subdirectories (in the ``full'' display mode),
108it omits some that should never contain any files under version control.
109By default, this includes Version Control subdirectories such as
110@samp{RCS} and @samp{CVS}; you can customize this by setting the
111variable @code{vc-directory-exclusion-list}.
112
113 You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
114ordinary Dired, that allows you to specify additional switches for the
115@samp{ls} command.
116
117@node VC Dired Commands
118@subsection VC Dired Commands
119
120 All the usual Dired commands work normally in VC Dired mode, except
121for @kbd{v}, which is redefined as the version control prefix. You can
122invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
123typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply
124to the file name on the current line.
125
126 The command @kbd{v v} (@code{vc-next-action}) operates on all the
127marked files, so that you can lock or check in several files at once.
128If it operates on more than one file, it handles each file according to
129its current state; thus, it might lock one file, but check in another
130file. This could be confusing; it is up to you to avoid confusing
131behavior by marking a set of files that are in a similar state. If no
132files are marked, @kbd{v v} operates on the file in the current line.
133
134 If any files call for check-in, @kbd{v v} reads a single log entry,
135then uses it for all the files being checked in. This is convenient for
136registering or checking in several files at once, as part of the same
137change.
138
139@findex vc-dired-toggle-terse-mode
140@findex vc-dired-mark-locked
141 You can toggle between terse display (only locked files, or files not
142up-to-date) and full display at any time by typing @kbd{v t}
143(@code{vc-dired-toggle-terse-mode}). There is also a special command
144@kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
145locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l
146t k} is another way to delete from the buffer all files except those
147currently locked.
148
149@ignore
150 arch-tag: 8e8c2a01-ad41-4e61-a89a-60131ad67263
151@end ignore
diff --git a/doc/emacs/vc2-xtra.texi b/doc/emacs/vc2-xtra.texi
new file mode 100644
index 00000000000..83f28088726
--- /dev/null
+++ b/doc/emacs/vc2-xtra.texi
@@ -0,0 +1,789 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in vc-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Remote Repositories
8@subsection Remote Repositories
9@cindex remote repositories (CVS)
10
11 A common way of using CVS is to set up a central CVS repository on
12some Internet host, then have each developer check out a personal
13working copy of the files on his local machine. Committing changes to
14the repository, and picking up changes from other users into one's own
15working area, then works by direct interactions with the CVS server.
16
17 One difficulty is that access to the CVS server is often slow, and
18that developers might need to work off-line as well. VC is designed
19to reduce the amount of network interaction necessary.
20
21@menu
22* Version Backups:: Keeping local copies of repository versions.
23* Local Version Control:: Using another version system for local editing.
24@end menu
25
26@node Version Backups
27@subsubsection Version Backups
28@cindex version backups
29
30@cindex automatic version backups
31 When VC sees that the CVS repository for a file is on a remote
32machine, it automatically makes local backups of unmodified versions
33of the file---@dfn{automatic version backups}. This means that you
34can compare the file to the repository version (@kbd{C-x v =}), or
35revert to that version (@kbd{C-x v u}), without any network
36interactions.
37
38 The local copy of the unmodified file is called a @dfn{version
39backup} to indicate that it corresponds exactly to a version that is
40stored in the repository. Note that version backups are not the same
41as ordinary Emacs backup files
42@iftex
43(@pxref{Backup,,,emacs, the Emacs Manual}).
44@end iftex
45@ifnottex
46(@pxref{Backup}).
47@end ifnottex
48But they follow a similar naming convention.
49
50 For a file that comes from a remote CVS repository, VC makes a
51version backup whenever you save the first changes to the file, and
52removes it after you have committed your modified version to the
53repository. You can disable the making of automatic version backups by
54setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
55
56@cindex manual version backups
57 The name of the automatic version backup for version @var{version}
58of file @var{file} is @code{@var{file}.~@var{version}.~}. This is
59almost the same as the name used by @kbd{C-x v ~}
60@iftex
61(@pxref{Old Versions,,,emacs, the Emacs Manual}),
62@end iftex
63@ifnottex
64(@pxref{Old Versions}),
65@end ifnottex
66the only difference being the additional dot (@samp{.}) after the
67version number. This similarity is intentional, because both kinds of
68files store the same kind of information. The file made by @kbd{C-x v
69~} acts as a @dfn{manual version backup}.
70
71 All the VC commands that operate on old versions of a file can use
72both kinds of version backups. For instance, @kbd{C-x v ~} uses
73either an automatic or a manual version backup, if possible, to get
74the contents of the version you request. Likewise, @kbd{C-x v =} and
75@kbd{C-x v u} use either an automatic or a manual version backup, if
76one of them exists, to get the contents of a version to compare or
77revert to. If you changed a file outside of Emacs, so that no
78automatic version backup was created for the previous text, you can
79create a manual backup of that version using @kbd{C-x v ~}, and thus
80obtain the benefit of the local copy for Emacs commands.
81
82 The only difference in Emacs's handling of manual and automatic
83version backups, once they exist, is that Emacs deletes automatic
84version backups when you commit to the repository. By contrast,
85manual version backups remain until you delete them.
86
87@node Local Version Control
88@subsubsection Local Version Control
89@cindex local version control
90@cindex local back end (version control)
91
92When you make many changes to a file that comes from a remote
93repository, it can be convenient to have version control on your local
94machine as well. You can then record intermediate versions, revert to
95a previous state, etc., before you actually commit your changes to the
96remote server.
97
98VC lets you do this by putting a file under a second, local version
99control system, so that the file is effectively registered in two
100systems at the same time. For the description here, we will assume
101that the remote system is CVS, and you use RCS locally, although the
102mechanism works with any combination of version control systems
103(@dfn{back ends}).
104
105To make it work with other back ends, you must make sure that the
106``more local'' back end comes before the ``more remote'' back end in
107the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By
108default, this variable is set up so that you can use remote CVS and
109local RCS as described here.
110
111To start using local RCS for a file that comes from a remote CVS
112server, you must @emph{register the file in RCS}, by typing @kbd{C-u
113C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a
114prefix argument, and specify RCS as the back end.)
115
116You can do this at any time; it does not matter whether you have
117already modified the file with respect to the version in the CVS
118repository. If possible, VC tries to make the RCS master start with
119the unmodified repository version, then checks in any local changes
120as a new version. This works if you have not made any changes yet, or
121if the unmodified repository version exists locally as a version
122backup (@pxref{Version Backups}). If the unmodified version is not
123available locally, the RCS master starts with the modified version;
124the only drawback to this is that you cannot compare your changes
125locally to what is stored in the repository.
126
127The version number of the RCS master is derived from the current CVS
128version, starting a branch from it. For example, if the current CVS
129version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in
130the RCS master will be identical to version 1.23 under CVS; your first
131changes are checked in as 1.23.1.1. (If the unmodified file is not
132available locally, VC will check in the modified file twice, both as
1331.23 and 1.23.1.1, to make the revision numbers consistent.)
134
135If you do not use locking under CVS (the default), locking is also
136disabled for RCS, so that editing under RCS works exactly as under
137CVS.
138
139When you are done with local editing, you can commit the final version
140back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
141This initializes the log entry buffer
142@iftex
143(@pxref{Log Buffer,,,emacs, the Emacs Manual})
144@end iftex
145@ifnottex
146(@pxref{Log Buffer})
147@end ifnottex
148to contain all the log entries you have recorded in the RCS master;
149you can edit them as you wish, and then commit in CVS by typing
150@kbd{C-c C-c}. If the commit is successful, VC removes the RCS
151master, so that the file is once again registered under CVS only.
152(The RCS master is not actually deleted, just renamed by appending
153@samp{~} to the name, so that you can refer to it later if you wish.)
154
155While using local RCS, you can pick up recent changes from the CVS
156repository into your local file, or commit some of your changes back
157to CVS, without terminating local RCS version control. To do this,
158switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
159
160@table @kbd
161@item C-x v b
162Switch to another back end that the current file is registered
163under (@code{vc-switch-backend}).
164
165@item C-u C-x v b @var{backend} @key{RET}
166Switch to @var{backend} for the current file.
167@end table
168
169@kindex C-x v b
170@findex vc-switch-backend
171@kbd{C-x v b} does not change the buffer contents, or any files; it
172only changes VC's perspective on how to handle the file. Any
173subsequent VC commands for that file will operate on the back end that
174is currently selected.
175
176If the current file is registered in more than one back end, typing
177@kbd{C-x v b} ``cycles'' through all of these back ends. With a
178prefix argument, it asks for the back end to use in the minibuffer.
179
180Thus, if you are using local RCS, and you want to pick up some recent
181changes in the file from remote CVS, first visit the file, then type
182@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
183@key{RET}} to merge the news
184@iftex
185(@pxref{Merging,,,emacs, the Emacs Manual}).
186@end iftex
187@ifnottex
188(@pxref{Merging}).
189@end ifnottex
190You can then switch back to RCS by typing @kbd{C-x v b} again, and
191continue to edit locally.
192
193But if you do this, the revision numbers in the RCS master no longer
194correspond to those of CVS. Technically, this is not a problem, but
195it can become difficult to keep track of what is in the CVS repository
196and what is not. So we suggest that you return from time to time to
197CVS-only operation, by committing your local changes back to the
198repository using @kbd{C-u C-x v v cvs @key{RET}}.
199
200@node Snapshots
201@subsection Snapshots
202@cindex snapshots and version control
203
204 A @dfn{snapshot} is a named set of file versions (one for each
205registered file) that you can treat as a unit. One important kind of
206snapshot is a @dfn{release}, a (theoretically) stable version of the
207system that is ready for distribution to users.
208
209@menu
210* Making Snapshots:: The snapshot facilities.
211* Snapshot Caveats:: Things to be careful of when using snapshots.
212@end menu
213
214@node Making Snapshots
215@subsubsection Making and Using Snapshots
216
217 There are two basic commands for snapshots; one makes a
218snapshot with a given name, the other retrieves a named snapshot.
219
220@table @code
221@kindex C-x v s
222@findex vc-create-snapshot
223@item C-x v s @var{name} @key{RET}
224Define the last saved versions of every registered file in or under the
225current directory as a snapshot named @var{name}
226(@code{vc-create-snapshot}).
227
228@kindex C-x v r
229@findex vc-retrieve-snapshot
230@item C-x v r @var{name} @key{RET}
231For all registered files at or below the current directory level, select
232whatever versions correspond to the snapshot @var{name}
233(@code{vc-retrieve-snapshot}).
234
235This command reports an error if any files are locked at or below the
236current directory, without changing anything; this is to avoid
237overwriting work in progress.
238@end table
239
240 A snapshot uses a very small amount of resources---just enough to record
241the list of file names and which version belongs to the snapshot. Thus,
242you need not hesitate to create snapshots whenever they are useful.
243
244 You can give a snapshot name as an argument to @kbd{C-x v =} or
245@kbd{C-x v ~}
246@iftex
247(@pxref{Old Versions,,,emacs, the Emacs Manual}).
248@end iftex
249@ifnottex
250(@pxref{Old Versions}).
251@end ifnottex
252Thus, you can use it to compare a snapshot against the current files,
253or two snapshots against each other, or a snapshot against a named
254version.
255
256@node Snapshot Caveats
257@subsubsection Snapshot Caveats
258
259@cindex named configurations (RCS)
260 VC's snapshot facilities are modeled on RCS's named-configuration
261support. They use RCS's native facilities for this, so
262snapshots made using RCS through VC are visible even when you bypass VC.
263
264 With CVS, Meta-CVS, and Subversion, VC also uses the native
265mechanism provided by that back end to make snapshots and retrieve them
266(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
267
268@c worded verbosely to avoid overfull hbox.
269 For SCCS, VC implements snapshots itself. The files it uses contain
270name/file/version-number triples. These snapshots are visible only
271through VC.
272
273 There is no support for VC snapshots using GNU Arch yet.
274
275 A snapshot is a set of checked-in versions. So make sure that all the
276files are checked in and not locked when you make a snapshot.
277
278 File renaming and deletion can create some difficulties with snapshots.
279This is not a VC-specific problem, but a general design issue in version
280control systems that no one has solved very well yet.
281
282 If you rename a registered file, you need to rename its master along
283with it (the command @code{vc-rename-file} does this automatically). If
284you are using SCCS, you must also update the records of the snapshot, to
285mention the file by its new name (@code{vc-rename-file} does this,
286too). An old snapshot that refers to a master file that no longer
287exists under the recorded name is invalid; VC can no longer retrieve
288it. It would be beyond the scope of this manual to explain enough about
289RCS and SCCS to explain how to update the snapshots by hand.
290
291 Using @code{vc-rename-file} makes the snapshot remain valid for
292retrieval, but it does not solve all problems. For example, some of the
293files in your program probably refer to others by name. At the very
294least, the makefile probably mentions the file that you renamed. If you
295retrieve an old snapshot, the renamed file is retrieved under its new
296name, which is not the name that the makefile expects. So the program
297won't really work as retrieved.
298
299@node Miscellaneous VC
300@subsection Miscellaneous Commands and Features of VC
301
302 This section explains the less-frequently-used features of VC.
303
304@menu
305* Change Logs and VC:: Generating a change log file from log entries.
306* Renaming and VC:: A command to rename both the source and master
307 file correctly.
308* Version Headers:: Inserting version control headers into working files.
309@end menu
310
311@node Change Logs and VC
312@subsubsection Change Logs and VC
313
314 If you use RCS or CVS for a program and also maintain a change log
315file for it
316@iftex
317(@pxref{Change Log,,,emacs, the Emacs Manual}),
318@end iftex
319@ifnottex
320(@pxref{Change Log}),
321@end ifnottex
322you can generate change log entries automatically from the version
323control log entries:
324
325@table @kbd
326@item C-x v a
327@kindex C-x v a
328@findex vc-update-change-log
329Visit the current directory's change log file and, for registered files
330in that directory, create new entries for versions checked in since the
331most recent entry in the change log file.
332(@code{vc-update-change-log}).
333
334This command works with RCS or CVS only, not with any of the other
335back ends.
336
337@item C-u C-x v a
338As above, but only find entries for the current buffer's file.
339
340@item M-1 C-x v a
341As above, but find entries for all the currently visited files that are
342maintained with version control. This works only with RCS, and it puts
343all entries in the log for the default directory, which may not be
344appropriate.
345@end table
346
347 For example, suppose the first line of @file{ChangeLog} is dated
3481999-04-10, and that the only check-in since then was by Nathaniel
349Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
350messages that start with `#'.}. Then @kbd{C-x v a} visits
351@file{ChangeLog} and inserts text like this:
352
353@iftex
354@medbreak
355@end iftex
356@smallexample
357@group
3581999-05-22 Nathaniel Bowditch <nat@@apn.org>
359
360 * rcs2log: Ignore log messages that start with `#'.
361@end group
362@end smallexample
363@iftex
364@medbreak
365@end iftex
366
367@noindent
368You can then edit the new change log entry further as you wish.
369
370 Some of the new change log entries may duplicate what's already in
371ChangeLog. You will have to remove these duplicates by hand.
372
373 Normally, the log entry for file @file{foo} is displayed as @samp{*
374foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted
375if the text of the log entry starts with @w{@samp{(@var{functionname}):
376}}. For example, if the log entry for @file{vc.el} is
377@samp{(vc-do-command): Check call-process status.}, then the text in
378@file{ChangeLog} looks like this:
379
380@iftex
381@medbreak
382@end iftex
383@smallexample
384@group
3851999-05-06 Nathaniel Bowditch <nat@@apn.org>
386
387 * vc.el (vc-do-command): Check call-process status.
388@end group
389@end smallexample
390@iftex
391@medbreak
392@end iftex
393
394 When @kbd{C-x v a} adds several change log entries at once, it groups
395related log entries together if they all are checked in by the same
396author at nearly the same time. If the log entries for several such
397files all have the same text, it coalesces them into a single entry.
398For example, suppose the most recent check-ins have the following log
399entries:
400
401@flushleft
402@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
403@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
404@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
405@end flushleft
406
407@noindent
408They appear like this in @file{ChangeLog}:
409
410@iftex
411@medbreak
412@end iftex
413@smallexample
414@group
4151999-04-01 Nathaniel Bowditch <nat@@apn.org>
416
417 * vc.texinfo: Fix expansion typos.
418
419 * vc.el, vc-hooks.el: Don't call expand-file-name.
420@end group
421@end smallexample
422@iftex
423@medbreak
424@end iftex
425
426 Normally, @kbd{C-x v a} separates log entries by a blank line, but you
427can mark several related log entries to be clumped together (without an
428intervening blank line) by starting the text of each related log entry
429with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label
430itself is not copied to @file{ChangeLog}. For example, suppose the log
431entries are:
432
433@flushleft
434@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
435@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
436@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
437@end flushleft
438
439@noindent
440Then the text in @file{ChangeLog} looks like this:
441
442@iftex
443@medbreak
444@end iftex
445@smallexample
446@group
4471999-04-01 Nathaniel Bowditch <nat@@apn.org>
448
449 * vc.texinfo: Fix expansion typos.
450 * vc.el, vc-hooks.el: Don't call expand-file-name.
451@end group
452@end smallexample
453@iftex
454@medbreak
455@end iftex
456
457 A log entry whose text begins with @samp{#} is not copied to
458@file{ChangeLog}. For example, if you merely fix some misspellings in
459comments, you can log the change with an entry beginning with @samp{#}
460to avoid putting such trivia into @file{ChangeLog}.
461
462@node Renaming and VC
463@subsubsection Renaming VC Work Files and Master Files
464
465@findex vc-rename-file
466 When you rename a registered file, you must also rename its master
467file correspondingly to get proper results. Use @code{vc-rename-file}
468to rename the source file as you specify, and rename its master file
469accordingly. It also updates any snapshots (@pxref{Snapshots}) that
470mention the file, so that they use the new name; despite this, the
471snapshot thus modified may not completely work (@pxref{Snapshot
472Caveats}).
473
474 Some back ends do not provide an explicit rename operation to their
475repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v}
476on the original and renamed buffers and provide the necessary edit
477log.
478
479 You cannot use @code{vc-rename-file} on a file that is locked by
480someone else.
481
482@node Version Headers
483@subsubsection Inserting Version Control Headers
484
485 Sometimes it is convenient to put version identification strings
486directly into working files. Certain special strings called
487@dfn{version headers} are replaced in each successive version by the
488number of that version, the name of the user who created it, and other
489relevant information. All of the back ends that VC supports have such
490a mechanism, except GNU Arch.
491
492 VC does not normally use the information contained in these headers.
493The exception is RCS---with RCS, version headers are sometimes more
494reliable than the master file to determine which version of the file
495you are editing. Note that in a multi-branch environment, version
496headers are necessary to make VC behave correctly
497@iftex
498(@pxref{Multi-User Branching,,,emacs, the Emacs Manual}).
499@end iftex
500@ifnottex
501(@pxref{Multi-User Branching}).
502@end ifnottex
503
504 Searching for RCS version headers is controlled by the variable
505@code{vc-consult-headers}. If it is non-@code{nil} (the default),
506Emacs searches for headers to determine the version number you are
507editing. Setting it to @code{nil} disables this feature.
508
509 Note that although CVS uses the same kind of version headers as RCS
510does, VC never searches for these headers if you are using CVS,
511regardless of the above setting.
512
513@kindex C-x v h
514@findex vc-insert-headers
515 You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
516insert a suitable header string.
517
518@table @kbd
519@item C-x v h
520Insert headers in a file for use with your version-control system.
521@end table
522
523@vindex vc-@var{backend}-header
524 The default header string is @samp{@w{$}Id$} for RCS and
525@samp{@w{%}W%} for SCCS. You can specify other headers to insert by
526setting the variables @code{vc-@var{backend}-header} where
527@var{backend} is @code{rcs} or @code{sccs}.
528
529 Instead of a single string, you can specify a list of strings; then
530each string in the list is inserted as a separate header on a line of
531its own.
532
533 It may be necessary to use apparently-superfluous backslashes when
534writing the strings that you put in this variable. For instance, you
535might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra
536backslash prevents the string constant from being interpreted as a
537header, if the Emacs Lisp file containing it is maintained with
538version control.
539
540@vindex vc-comment-alist
541 Each header is inserted surrounded by tabs, inside comment delimiters,
542on a new line at point. Normally the ordinary comment
543start and comment end strings of the current mode are used, but for
544certain modes, there are special comment delimiters for this purpose;
545the variable @code{vc-comment-alist} specifies them. Each element of
546this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
547
548@vindex vc-static-header-alist
549 The variable @code{vc-static-header-alist} specifies further strings
550to add based on the name of the buffer. Its value should be a list of
551elements of the form @code{(@var{regexp} . @var{format})}. Whenever
552@var{regexp} matches the buffer name, @var{format} is inserted as part
553of the header. A header line is inserted for each element that matches
554the buffer name, and for each string specified by
555@code{vc-@var{backend}-header}. The header line is made by processing the
556string from @code{vc-@var{backend}-header} with the format taken from the
557element. The default value for @code{vc-static-header-alist} is as follows:
558
559@example
560@group
561(("\\.c$" .
562 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
563#endif /* lint */\n"))
564@end group
565@end example
566
567@noindent
568It specifies insertion of text of this form:
569
570@example
571@group
572
573#ifndef lint
574static char vcid[] = "@var{string}";
575#endif /* lint */
576@end group
577@end example
578
579@noindent
580Note that the text above starts with a blank line.
581
582 If you use more than one version header in a file, put them close
583together in the file. The mechanism in @code{revert-buffer} that
584preserves markers may not handle markers positioned between two version
585headers.
586
587@node Customizing VC
588@subsection Customizing VC
589
590@vindex vc-handled-backends
591The variable @code{vc-handled-backends} determines which version
592control systems VC should handle. The default value is @code{(RCS CVS
593SVN SCCS BZR GIT HG Arch MCVS)}, so it contains all the version systems
594that are currently supported. If you want VC to ignore one or more of
595these systems, exclude its name from the list. To disable VC entirely,
596set this variable to @code{nil}.
597
598The order of systems in the list is significant: when you visit a file
599registered in more than one system (@pxref{Local Version Control}), VC
600uses the system that comes first in @code{vc-handled-backends} by
601default. The order is also significant when you register a file for
602the first time, see
603@iftex
604@ref{Registering,,,emacs, the Emacs Manual},
605@end iftex
606@ifnottex
607@ref{Registering},
608@end ifnottex
609for details.
610
611@menu
612* General VC Options:: Options that apply to multiple back ends.
613* RCS and SCCS:: Options for RCS and SCCS.
614* CVS Options:: Options for CVS.
615@end menu
616
617@node General VC Options
618@subsubsection General Options
619
620@vindex vc-make-backup-files
621 Emacs normally does not save backup files for source files that are
622maintained with version control. If you want to make backup files even
623for files that use version control, set the variable
624@code{vc-make-backup-files} to a non-@code{nil} value.
625
626@vindex vc-keep-workfiles
627 Normally the work file exists all the time, whether it is locked or
628not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking
629in a new version with @kbd{C-x v v} deletes the work file; but any
630attempt to visit the file with Emacs creates it again. (With CVS, work
631files are always kept.)
632
633@vindex vc-follow-symlinks
634 Editing a version-controlled file through a symbolic link can be
635dangerous. It bypasses the version control system---you can edit the
636file without locking it, and fail to check your changes in. Also,
637your changes might overwrite those of another user. To protect against
638this, VC checks each symbolic link that you visit, to see if it points
639to a file under version control.
640
641 The variable @code{vc-follow-symlinks} controls what to do when a
642symbolic link points to a version-controlled file. If it is @code{nil},
643VC only displays a warning message. If it is @code{t}, VC automatically
644follows the link, and visits the real file instead, telling you about
645this in the echo area. If the value is @code{ask} (the default), VC
646asks you each time whether to follow the link.
647
648@vindex vc-suppress-confirm
649 If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
650and @kbd{C-x v i} can save the current buffer without asking, and
651@kbd{C-x v u} also operates without asking for confirmation. (This
652variable does not affect @kbd{C-x v c}; that operation is so drastic
653that it should always ask for confirmation.)
654
655@vindex vc-command-messages
656 VC mode does much of its work by running the shell commands for RCS,
657CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC
658displays messages to indicate which shell commands it runs, and
659additional messages when the commands finish.
660
661@vindex vc-path
662 You can specify additional directories to search for version control
663programs by setting the variable @code{vc-path}. These directories
664are searched before the usual search path. It is rarely necessary to
665set this variable, because VC normally finds the proper files
666automatically.
667
668@node RCS and SCCS
669@subsubsection Options for RCS and SCCS
670
671@cindex non-strict locking (RCS)
672@cindex locking, non-strict (RCS)
673 By default, RCS uses locking to coordinate the activities of several
674users, but there is a mode called @dfn{non-strict locking} in which
675you can check-in changes without locking the file first. Use
676@samp{rcs -U} to switch to non-strict locking for a particular file,
677see the @code{rcs} manual page for details.
678
679 When deducing the version control state of an RCS file, VC first
680looks for an RCS version header string in the file (@pxref{Version
681Headers}). If there is no header string, VC normally looks at the
682file permissions of the work file; this is fast. But there might be
683situations when the file permissions cannot be trusted. In this case
684the master file has to be consulted, which is rather expensive. Also
685the master file can only tell you @emph{if} there's any lock on the
686file, but not whether your work file really contains that locked
687version.
688
689@vindex vc-consult-headers
690 You can tell VC not to use version headers to determine the file
691status by setting @code{vc-consult-headers} to @code{nil}. VC then
692always uses the file permissions (if it is supposed to trust them), or
693else checks the master file.
694
695@vindex vc-mistrust-permissions
696 You can specify the criterion for whether to trust the file
697permissions by setting the variable @code{vc-mistrust-permissions}.
698Its value can be @code{t} (always mistrust the file permissions and
699check the master file), @code{nil} (always trust the file
700permissions), or a function of one argument which makes the decision.
701The argument is the directory name of the @file{RCS} subdirectory. A
702non-@code{nil} value from the function says to mistrust the file
703permissions. If you find that the file permissions of work files are
704changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
705Then VC always checks the master file to determine the file's status.
706
707 VC determines the version control state of files under SCCS much as
708with RCS. It does not consider SCCS version headers, though. Thus,
709the variable @code{vc-mistrust-permissions} affects SCCS use, but
710@code{vc-consult-headers} does not.
711
712@node CVS Options
713@subsubsection Options specific for CVS
714
715@cindex locking (CVS)
716 By default, CVS does not use locking to coordinate the activities of
717several users; anyone can change a work file at any time. However,
718there are ways to restrict this, resulting in behavior that resembles
719locking.
720
721@cindex CVSREAD environment variable (CVS)
722 For one thing, you can set the @env{CVSREAD} environment variable
723(the value you use makes no difference). If this variable is defined,
724CVS makes your work files read-only by default. In Emacs, you must
725type @kbd{C-x v v} to make the file writable, so that editing works
726in fact similar as if locking was used. Note however, that no actual
727locking is performed, so several users can make their files writable
728at the same time. When setting @env{CVSREAD} for the first time, make
729sure to check out all your modules anew, so that the file protections
730are set correctly.
731
732@cindex cvs watch feature
733@cindex watching files (CVS)
734 Another way to achieve something similar to locking is to use the
735@dfn{watch} feature of CVS. If a file is being watched, CVS makes it
736read-only by default, and you must also use @kbd{C-x v v} in Emacs to
737make it writable. VC calls @code{cvs edit} to make the file writable,
738and CVS takes care to notify other developers of the fact that you
739intend to change the file. See the CVS documentation for details on
740using the watch feature.
741
742@vindex vc-stay-local
743@vindex vc-cvs-stay-local
744@cindex remote repositories (CVS)
745 When a file's repository is on a remote machine, VC tries to keep
746network interactions to a minimum. This is controlled by the variable
747@code{vc-cvs-stay-local}. There is another variable,
748@code{vc-stay-local}, which enables the feature also for other back
749ends that support it, including CVS. In the following, we will talk
750only about @code{vc-cvs-stay-local}, but everything applies to
751@code{vc-stay-local} as well.
752
753If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
754only the entry in the local CVS subdirectory to determine the file's
755state (and possibly information returned by previous CVS commands).
756One consequence of this is that when you have modified a file, and
757somebody else has already checked in other changes to the file, you
758are not notified of it until you actually try to commit. (But you can
759try to pick up any recent changes from the repository first, using
760@kbd{C-x v m @key{RET}},
761@iftex
762@pxref{Merging,,,emacs, the Emacs Manual}).
763@end iftex
764@ifnottex
765@pxref{Merging}).
766@end ifnottex
767
768 When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
769version backups, so that simple diff and revert operations are
770completely local (@pxref{Version Backups}).
771
772 On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
773then VC queries the remote repository @emph{before} it decides what to
774do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
775repositories. It also does not make any version backups.
776
777 You can also set @code{vc-cvs-stay-local} to a regular expression
778that is matched against the repository host name; VC then stays local
779only for repositories from hosts that match the pattern.
780
781@vindex vc-cvs-global-switches
782 You can specify additional command line options to pass to all CVS
783operations in the variable @code{vc-cvs-global-switches}. These
784switches are inserted immediately after the @code{cvs} command, before
785the name of the operation to invoke.
786
787@ignore
788 arch-tag: 140b8629-4339-4b5e-9e50-72453e51615e
789@end ignore
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi
new file mode 100644
index 00000000000..fa9cadc1351
--- /dev/null
+++ b/doc/emacs/windows.texi
@@ -0,0 +1,387 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Windows, Frames, Buffers, Top
6@chapter Multiple Windows
7@cindex windows in Emacs
8@cindex multiple windows in Emacs
9
10 Emacs can split a frame into two or many windows. Multiple windows
11can display parts of different buffers, or different parts of one
12buffer. Multiple frames always imply multiple windows, because each
13frame has its own set of windows. Each window belongs to one and only
14one frame.
15
16@menu
17* Basic Window:: Introduction to Emacs windows.
18* Split Window:: New windows are made by splitting existing windows.
19* Other Window:: Moving to another window or doing something to it.
20* Pop Up Window:: Finding a file or buffer in another window.
21* Force Same Window:: Forcing certain buffers to appear in the selected
22 window rather than in another window.
23* Change Window:: Deleting windows and changing their sizes.
24* Window Convenience:: Convenience functions for window handling.
25@end menu
26
27@node Basic Window
28@section Concepts of Emacs Windows
29
30 Each Emacs window displays one Emacs buffer at any time. A single
31buffer may appear in more than one window; if it does, any changes in
32its text are displayed in all the windows where it appears. But these
33windows can show different parts of the buffer, because each window
34has its own value of point.
35
36@cindex selected window
37 At any time, one Emacs window is the @dfn{selected window}; the
38buffer this window is displaying is the current buffer. The terminal's
39cursor shows the location of point in this window. Each other window
40has a location of point as well. On text-only terminals, there is no
41way to show where those locations are, since the terminal has only one
42cursor. On a graphical display, the location of point in a
43non-selected window is indicated by a hollow box; the cursor in the
44selected window is blinking or solid.
45
46 Commands to move point affect the value of point for the selected Emacs
47window only. They do not change the value of point in other Emacs
48windows, even those showing the same buffer. The same is true for commands
49such as @kbd{C-x b} to switch buffers in the selected window;
50they do not affect other windows at all. However, there are other commands
51such as @kbd{C-x 4 b} that select a different window and switch buffers in
52it. Also, all commands that display information in a window, including
53(for example) @kbd{C-h f} (@code{describe-function}) and @kbd{C-x C-b}
54(@code{list-buffers}), work by switching buffers in a nonselected window
55without affecting the selected window.
56
57 When multiple windows show the same buffer, they can have different
58regions, because they can have different values of point. However,
59they all have the same value for the mark, because each buffer has
60only one mark position.
61
62 Each window has its own mode line, which displays the buffer name,
63modification status and major and minor modes of the buffer that is
64displayed in the window. The selected window's mode line appears in a
65different color. @xref{Mode Line}, for full details on the mode line.
66
67@node Split Window
68@section Splitting Windows
69
70@table @kbd
71@item C-x 2
72Split the selected window into two windows, one above the other
73(@code{split-window-vertically}).
74@item C-x 3
75Split the selected window into two windows positioned side by side
76(@code{split-window-horizontally}).
77@item C-Mouse-2
78In the mode line or scroll bar of a window, split that window.
79@end table
80
81@kindex C-x 2
82@findex split-window-vertically
83 The command @kbd{C-x 2} (@code{split-window-vertically}) breaks the
84selected window into two windows, one above the other. Both windows start
85out displaying the same buffer, with the same value of point. By default
86the two windows each get half the height of the window that was split; a
87numeric argument specifies how many lines to give to the top window.
88
89@kindex C-x 3
90@findex split-window-horizontally
91 @kbd{C-x 3} (@code{split-window-horizontally}) breaks the selected
92window into two side-by-side windows. A numeric argument specifies how
93many columns to give the one on the left. If you are not using
94scrollbars, a vertical line separates the two windows.
95You can customize its color with the face @code{vertical-border}.
96Windows that are not the full width of the screen have mode lines, but
97they are truncated. On terminals where Emacs does not support
98highlighting, truncated mode lines sometimes do not appear in inverse
99video.
100
101@kindex C-Mouse-2 @r{(scroll bar)}
102 You can split a window horizontally or vertically by clicking
103@kbd{C-Mouse-2} in the mode line or the scroll bar. The line of
104splitting goes through the place where you click: if you click on the
105mode line, the new scroll bar goes above the spot; if you click in the
106scroll bar, the mode line of the split window is side by side with
107your click.
108
109@vindex truncate-partial-width-windows
110 When a window is less than the full width, text lines too long to
111fit are frequent. Continuing all those lines might be confusing, so
112if the variable @code{truncate-partial-width-windows} is
113non-@code{nil}, that forces truncation in all windows less than the
114full width of the screen, independent of the buffer being displayed
115and its value for @code{truncate-lines}. @xref{Line Truncation}.
116
117 Horizontal scrolling is often used in side-by-side windows.
118@xref{Horizontal Scrolling}.
119
120@vindex split-window-keep-point
121 If @code{split-window-keep-point} is non-@code{nil}, the default,
122both of the windows resulting from @kbd{C-x 2} inherit the value of
123point from the window that was split. This means that scrolling is
124inevitable. If this variable is @code{nil}, then @kbd{C-x 2} tries to
125avoid scrolling the text currently visible on the screen, by putting
126point in each window at a position already visible in the window. It
127also selects whichever window contains the screen line that the cursor
128was previously on. Some users prefer that mode on slow terminals.
129
130@node Other Window
131@section Using Other Windows
132
133@table @kbd
134@item C-x o
135Select another window (@code{other-window}). That is @kbd{o}, not zero.
136@item C-M-v
137Scroll the next window (@code{scroll-other-window}).
138@item M-x compare-windows
139Find next place where the text in the selected window does not match
140the text in the next window.
141@item Mouse-1
142@kbd{Mouse-1}, in a window's mode line, selects that window
143but does not move point in it (@code{mouse-select-window}).
144@end table
145
146@kindex C-x o
147@findex other-window
148 To select a different window, click with @kbd{Mouse-1} on its mode
149line. With the keyboard, you can switch windows by typing @kbd{C-x o}
150(@code{other-window}). That is an @kbd{o}, for ``other,'' not a zero.
151When there are more than two windows, this command moves through all the
152windows in a cyclic order, generally top to bottom and left to right.
153After the rightmost and bottommost window, it goes back to the one at
154the upper left corner. A numeric argument means to move several steps
155in the cyclic order of windows. A negative argument moves around the
156cycle in the opposite order. When the minibuffer is active, the
157minibuffer is the last window in the cycle; you can switch from the
158minibuffer window to one of the other windows, and later switch back and
159finish supplying the minibuffer argument that is requested.
160@xref{Minibuffer Edit}.
161
162@kindex C-M-v
163@findex scroll-other-window
164 The usual scrolling commands (@pxref{Display}) apply to the selected
165window only, but there is one command to scroll the next window.
166@kbd{C-M-v} (@code{scroll-other-window}) scrolls the window that
167@kbd{C-x o} would select. It takes arguments, positive and negative,
168like @kbd{C-v}. (In the minibuffer, @kbd{C-M-v} scrolls the window
169that contains the minibuffer help display, if any, rather than the
170next window in the standard cyclic order.)
171
172 The command @kbd{M-x compare-windows} lets you compare two files or
173buffers visible in two windows, by moving through them to the next
174mismatch. @xref{Comparing Files}, for details.
175
176@vindex mouse-autoselect-window
177 If you set @code{mouse-autoselect-window} to a non-@code{nil} value,
178moving the mouse into a different window selects that window. This
179feature is off by default.
180
181@node Pop Up Window
182@section Displaying in Another Window
183
184@cindex selecting buffers in other windows
185@kindex C-x 4
186 @kbd{C-x 4} is a prefix key for commands that select another window
187(splitting the window if there is only one) and select a buffer in that
188window. Different @kbd{C-x 4} commands have different ways of finding the
189buffer to select.
190
191@table @kbd
192@item C-x 4 b @var{bufname} @key{RET}
193Select buffer @var{bufname} in another window. This runs
194@code{switch-to-buffer-other-window}.
195@item C-x 4 C-o @var{bufname} @key{RET}
196Display buffer @var{bufname} in another window, but
197don't select that buffer or that window. This runs
198@code{display-buffer}.
199@item C-x 4 f @var{filename} @key{RET}
200Visit file @var{filename} and select its buffer in another window. This
201runs @code{find-file-other-window}. @xref{Visiting}.
202@item C-x 4 d @var{directory} @key{RET}
203Select a Dired buffer for directory @var{directory} in another window.
204This runs @code{dired-other-window}. @xref{Dired}.
205@item C-x 4 m
206Start composing a mail message in another window. This runs
207@code{mail-other-window}; its same-window analogue is @kbd{C-x m}
208(@pxref{Sending Mail}).
209@item C-x 4 .
210Find a tag in the current tags table, in another window. This runs
211@code{find-tag-other-window}, the multiple-window variant of @kbd{M-.}
212(@pxref{Tags}).
213@item C-x 4 r @var{filename} @key{RET}
214Visit file @var{filename} read-only, and select its buffer in another
215window. This runs @code{find-file-read-only-other-window}.
216@xref{Visiting}.
217@end table
218
219@node Force Same Window
220@section Forcing Display in the Same Window
221
222 Certain Emacs commands switch to a specific buffer with special
223contents. For example, @kbd{M-x shell} switches to a buffer named
224@samp{*shell*}. By convention, all these commands are written to pop up
225the buffer in a separate window. But you can specify that certain of
226these buffers should appear in the selected window.
227
228@vindex same-window-buffer-names
229 If you add a buffer name to the list @code{same-window-buffer-names},
230the effect is that such commands display that particular buffer by
231switching to it in the selected window. For example, if you add the
232element @code{"*grep*"} to the list, the @code{grep} command will
233display its output buffer in the selected window.
234
235 The default value of @code{same-window-buffer-names} is not
236@code{nil}: it specifies buffer names @samp{*info*}, @samp{*mail*} and
237@samp{*shell*} (as well as others used by more obscure Emacs packages).
238This is why @kbd{M-x shell} normally switches to the @samp{*shell*}
239buffer in the selected window. If you delete this element from the
240value of @code{same-window-buffer-names}, the behavior of @kbd{M-x
241shell} will change---it will pop up the buffer in another window
242instead.
243
244@vindex same-window-regexps
245 You can specify these buffers more generally with the variable
246@code{same-window-regexps}. Set it to a list of regular expressions;
247then any buffer whose name matches one of those regular expressions is
248displayed by switching to it in the selected window. (Once again, this
249applies only to buffers that normally get displayed for you in a
250separate window.) The default value of this variable specifies Telnet
251and rlogin buffers.
252
253 An analogous feature lets you specify buffers which should be
254displayed in their own individual frames. @xref{Special Buffer Frames}.
255
256@node Change Window
257@section Deleting and Rearranging Windows
258
259@table @kbd
260@item C-x 0
261Delete the selected window (@code{delete-window}). The last character
262in this key sequence is a zero.
263@item C-x 1
264Delete all windows in the selected frame except the selected window
265(@code{delete-other-windows}).
266@item C-x 4 0
267Delete the selected window and kill the buffer that was showing in it
268(@code{kill-buffer-and-window}). The last character in this key
269sequence is a zero.
270@item C-x ^
271Make selected window taller (@code{enlarge-window}).
272@item C-x @}
273Make selected window wider (@code{enlarge-window-horizontally}).
274@item C-x @{
275Make selected window narrower (@code{shrink-window-horizontally}).
276@item C-x -
277Shrink this window if its buffer doesn't need so many lines
278(@code{shrink-window-if-larger-than-buffer}).
279@item C-x +
280Make all windows the same height (@code{balance-windows}).
281@end table
282
283@kindex C-x 0
284@findex delete-window
285 To delete a window, type @kbd{C-x 0} (@code{delete-window}). (That is
286a zero.) The space occupied by the deleted window is given to an
287adjacent window (but not the minibuffer window, even if that is active
288at the time). Once a window is deleted, its attributes are forgotten;
289only restoring a window configuration can bring it back. Deleting the
290window has no effect on the buffer it used to display; the buffer
291continues to exist, and you can select it in any window with @kbd{C-x
292b}.
293
294@findex kill-buffer-and-window
295@kindex C-x 4 0
296 @kbd{C-x 4 0} (@code{kill-buffer-and-window}) is a stronger command
297than @kbd{C-x 0}; it kills the current buffer and then deletes the
298selected window.
299
300@kindex C-x 1
301@findex delete-other-windows
302 @kbd{C-x 1} (@code{delete-other-windows}) is more powerful in a
303different way; it deletes all the windows except the selected one (and
304the minibuffer); the selected window expands to use the whole frame
305except for the echo area.
306
307@kindex C-x ^
308@findex enlarge-window
309@kindex C-x @}
310@findex enlarge-window-horizontally
311@vindex window-min-height
312@vindex window-min-width
313 To readjust the division of space among vertically adjacent windows,
314use @kbd{C-x ^} (@code{enlarge-window}). It makes the currently
315selected window one line bigger, or as many lines as is specified
316with a numeric argument. With a negative argument, it makes the
317selected window smaller. @kbd{C-x @}}
318(@code{enlarge-window-horizontally}) makes the selected window wider by
319the specified number of columns. @kbd{C-x @{}
320(@code{shrink-window-horizontally}) makes the selected window narrower
321by the specified number of columns.
322
323 When you make a window bigger, the space comes from its peers. If
324this makes any window too small, it is deleted and its space is given
325to an adjacent window. The minimum size is specified by the variables
326@code{window-min-height} and @code{window-min-width}.
327
328@kindex C-x -
329@findex shrink-window-if-larger-than-buffer
330 The command @kbd{C-x -} (@code{shrink-window-if-larger-than-buffer})
331reduces the height of the selected window, if it is taller than
332necessary to show the whole text of the buffer it is displaying. It
333gives the extra lines to other windows in the frame.
334
335@kindex C-x +
336@findex balance-windows
337 You can also use @kbd{C-x +} (@code{balance-windows}) to even out the
338heights of all the windows in the selected frame.
339
340 Mouse clicks on the mode line provide another way to change window
341heights and to delete windows. @xref{Mode Line Mouse}.
342
343@node Window Convenience
344@section Window Handling Convenience Features and Customization
345
346@findex winner-mode
347@cindex Winner mode
348@cindex mode, Winner
349@cindex undoing window configuration changes
350@cindex window configuration changes, undoing
351 @kbd{M-x winner-mode} is a global minor mode that records the
352changes in the window configuration (i.e. how the frames are
353partitioned into windows), so that you can ``undo'' them. To undo,
354use @kbd{C-c left} (@code{winner-undo}). If you change your mind
355while undoing, you can redo the changes you had undone using @kbd{C-c
356right} (@code{M-x winner-redo}). Another way to enable Winner mode is
357by customizing the variable @code{winner-mode}.
358
359@cindex Windmove package
360@cindex directional window selection
361@findex windmove-right
362@findex windmove-default-keybindings
363 The Windmove commands move directionally between neighboring windows in
364a frame. @kbd{M-x windmove-right} selects the window immediately to the
365right of the currently selected one, and similarly for the ``left,'' ``up,''
366and ``down'' counterparts. @kbd{M-x windmove-default-keybindings} binds
367these commands to @kbd{S-right} etc. (Not all terminals support shifted
368arrow keys, however.)
369
370 Follow minor mode (@kbd{M-x follow-mode}) synchronizes several
371windows on the same buffer so that they always display adjacent
372sections of that buffer. @xref{Follow Mode}.
373
374@vindex scroll-all-mode
375@cindex scrolling windows together
376@cindex Scroll-all mode
377@cindex mode, Scroll-all
378 @kbd{M-x scroll-all-mode} provides commands to scroll all visible
379windows together. You can also turn it on by customizing the variable
380@code{scroll-all-mode}. The commands provided are @kbd{M-x
381scroll-all-scroll-down-all}, @kbd{M-x scroll-all-page-down-all} and
382their corresponding ``up'' equivalents. To make this mode useful,
383you should bind these commands to appropriate keys.
384
385@ignore
386 arch-tag: 8bea7453-d4b1-49b1-9bf4-cfe4383e1113
387@end ignore
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
new file mode 100644
index 00000000000..c402ec89f88
--- /dev/null
+++ b/doc/emacs/xresources.texi
@@ -0,0 +1,1216 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1987, 1993, 1994, 1995, 1997, 2001, 2002, 2003,
3@c 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node X Resources, Antinews, Emacs Invocation, Top
6@appendix X Options and Resources
7
8 You can customize some X-related aspects of Emacs behavior using X
9resources, as is usual for programs that use X. On MS-Windows, you
10can customize some of the same aspects using the system registry.
11@xref{MS-Windows Registry}. Likewise, Emacs on MacOS Carbon emulates X
12resources using the Preferences system. @xref{Mac Environment Variables}.
13
14 When Emacs is built using an ``X toolkit'', such as Lucid or
15LessTif, you need to use X resources to customize the appearance of
16the widgets, including the menu-bar, scroll-bar, and dialog boxes.
17This is because the libraries that implement these don't provide for
18customization through Emacs. GTK+ widgets use a separate system of
19@ifnottex
20``GTK resources'', which we will also describe.
21@end ifnottex
22@iftex
23``GTK resources.'' In this chapter we describe the most commonly used
24resource specifications. For full documentation, see the online
25manual.
26
27@c Add xref for LessTif/Motif menu resources.
28@end iftex
29
30
31@menu
32* Resources:: Using X resources with Emacs (in general).
33* Table of Resources:: Table of specific X resources that affect Emacs.
34* Face Resources:: X resources for customizing faces.
35* Lucid Resources:: X resources for Lucid menus.
36* LessTif Resources:: X resources for LessTif and Motif menus.
37* GTK resources:: Resources for GTK widgets.
38@end menu
39
40@node Resources
41@appendixsec X Resources
42@cindex resources
43@cindex X resources
44@cindex @file{~/.Xdefaults} file
45@cindex @file{~/.Xresources} file
46
47 Programs running under the X Window System organize their user
48options under a hierarchy of classes and resources. You can specify
49default values for these options in your X resources file, usually
50named @file{~/.Xdefaults} or @file{~/.Xresources}.
51If changes in @file{~/.Xdefaults} do not
52take effect, it is because your X server stores its own list of
53resources; to update them, use the shell command @command{xrdb}---for
54instance, @samp{xrdb ~/.Xdefaults}.
55
56 Each line in the file specifies a value for one option or for a
57collection of related options, for one program or for several programs
58(optionally even for all programs).
59
60@cindex Registry (MS-Windows)
61 MS-Windows systems do not support @file{~/.Xdefaults} files, so
62instead Emacs compiled for Windows looks for X resources in the
63Windows Registry, first under the key
64@samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} and then under the key
65@samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}. The menu and scroll
66bars are native widgets on MS-Windows, so they are only customizable
67via the system-wide settings in the Display Control Panel. You can
68also set resources using the @samp{-xrm} command line option (see
69below.)
70
71@iftex
72 Applications such as Emacs look for resources with specific names
73and their particular meanings. Case distinctions are significant in
74these names. Each resource specification in @file{~/.Xdefaults}
75states the name of the program and the name of the resource. For
76Emacs, the program name is @samp{Emacs}. It looks like this:
77
78@example
79Emacs.borderWidth: 2
80@end example
81@end iftex
82@ifnottex
83 Programs define named resources with particular meanings. They also
84define how to group resources into named classes. For instance, in
85Emacs, the @samp{internalBorder} resource controls the width of the
86internal border, and the @samp{borderWidth} resource controls the width
87of the external border. Both of these resources are part of the
88@samp{BorderWidth} class. Case distinctions are significant in these
89names.
90
91 Every resource definition is associated with a specific program
92name---the name of the executable file that you ran. For Emacs, that
93is normally @samp{emacs}. To specify a definition for all instances
94of Emacs, regardless of their names, use @samp{Emacs}.
95
96 In @file{~/.Xdefaults}, you can specify a value for a single resource
97on one line, like this:
98
99@example
100emacs.borderWidth: 2
101@end example
102
103@noindent
104Or you can use a class name to specify the same value for all resources
105in that class. Here's an example:
106
107@example
108emacs.BorderWidth: 2
109@end example
110
111 If you specify a value for a class, it becomes the default for all
112resources in that class. You can specify values for individual
113resources as well; these override the class value, for those particular
114resources. Thus, this example specifies 2 as the default width for all
115borders, but overrides this value with 4 for the external border:
116
117@example
118emacs.BorderWidth: 2
119emacs.borderWidth: 4
120@end example
121@end ifnottex
122
123 The order in which the lines appear in the file does not matter.
124Also, command-line options always override the X resources file.
125
126@ifnottex
127Here is a list of X command-line options and their corresponding
128resource names.
129
130@table @samp
131@item -name @var{name}
132@opindex --name
133@itemx --name=@var{name}
134@cindex resource name, command-line argument
135Use @var{name} as the resource name (and the title) for the initial
136Emacs frame. This option does not affect subsequent frames, but Lisp
137programs can specify frame names when they create frames.
138
139If you don't specify this option, the default is to use the Emacs
140executable's name as the resource name.
141
142@item -xrm @var{resource-values}
143@opindex --xrm
144@itemx --xrm=@var{resource-values}
145@cindex resource values, command-line argument
146Specify X resource values for this Emacs job (see below).
147@end table
148
149 For consistency, @samp{-name} also specifies the name to use for
150other resource values that do not belong to any particular frame.
151
152 The resources that name Emacs invocations also belong to a class; its
153name is @samp{Emacs}. If you write @samp{Emacs} instead of
154@samp{emacs}, the resource applies to all frames in all Emacs jobs,
155regardless of frame titles and regardless of the name of the executable
156file. Here is an example:
157
158@example
159Emacs.BorderWidth: 2
160Emacs.borderWidth: 4
161@end example
162
163 You can specify a string of additional resource values for Emacs to
164use with the command line option @samp{-xrm @var{resources}}. The text
165@var{resources} should have the same format that you would use inside a file
166of X resources. To include multiple resource specifications in
167@var{resources}, put a newline between them, just as you would in a file.
168You can also use @samp{#include "@var{filename}"} to include a file full
169of resource specifications. Resource values specified with @samp{-xrm}
170take precedence over all other resource specifications.
171
172 One way to experiment with the effect of different resource settings
173is to use the @code{editres} program. Select @samp{Get Tree} from the
174@end ifnottex
175@iftex
176 You can experiment with the effect of different resource settings
177with the @code{editres} program. Select @samp{Get Tree} from the
178@end iftex
179@samp{Commands} menu, then click on an Emacs frame. This will display
180a tree showing the structure of X toolkit widgets used in an Emacs
181frame. Select one of them, such as @samp{menubar}, then select
182@samp{Show Resource Box} from the @samp{Commands} menu. This displays
183a list of all the meaningful X resources for that widget, and allows
184you to edit them. Changes take effect when you click on the
185@samp{Apply} button. (See the @code{editres} man page for more
186details.)
187
188@node Table of Resources
189@appendixsec Table of X Resources for Emacs
190
191 This table lists the resource names that designate options for
192Emacs, not counting those for the appearance of the menu bar, each
193with the class that it belongs to:
194
195@table @asis
196@item @code{background} (class @code{Background})
197Background color name.
198
199@ifnottex
200@item @code{bitmapIcon} (class @code{BitmapIcon})
201Use a bitmap icon (a picture of a gnu) if @samp{on}, let the window
202manager choose an icon if @samp{off}.
203@end ifnottex
204
205@item @code{borderColor} (class @code{BorderColor})
206Color name for the external border.
207
208@ifnottex
209@item @code{borderWidth} (class @code{BorderWidth})
210Width in pixels of the external border.
211@end ifnottex
212
213@item @code{cursorColor} (class @code{Foreground})
214Color name for text cursor (point).
215
216@ifnottex
217@item @code{cursorBlink} (class @code{CursorBlink})
218Specifies whether to make the cursor blink. The default is @samp{on}. Use
219@samp{off} or @samp{false} to turn cursor blinking off.
220@end ifnottex
221
222@item @code{font} (class @code{Font})
223Font name (or fontset name, @pxref{Fontsets}) for @code{default} font.
224
225@item @code{foreground} (class @code{Foreground})
226Color name for text.
227
228@item @code{geometry} (class @code{Geometry})
229Window size and position. Be careful not to specify this resource as
230@samp{emacs*geometry}, because that may affect individual menus as well
231as the Emacs frame itself.
232
233If this resource specifies a position, that position applies only to the
234initial Emacs frame (or, in the case of a resource for a specific frame
235name, only that frame). However, the size, if specified here, applies to
236all frames.
237
238@ifnottex
239@item @code{fullscreen} (class @code{Fullscreen})
240The desired fullscreen size. The value can be one of @code{fullboth},
241@code{fullwidth} or @code{fullheight}, which correspond to
242the command-line options @samp{-fs}, @samp{-fw}, and @samp{-fh}
243(@pxref{Window Size X}).
244
245Note that this applies to the initial frame only.
246@end ifnottex
247
248@item @code{iconName} (class @code{Title})
249Name to display in the icon.
250
251@item @code{internalBorder} (class @code{BorderWidth})
252Width in pixels of the internal border.
253
254@item @code{lineSpacing} (class @code{LineSpacing})
255@cindex line spacing
256@cindex leading
257Additional space (@dfn{leading}) between lines, in pixels.
258
259@item @code{menuBar} (class @code{MenuBar})
260@cindex menu bar
261Give frames menu bars if @samp{on}; don't have menu bars if @samp{off}.
262@ifnottex
263@xref{Lucid Resources}, and @ref{LessTif Resources},
264@end ifnottex
265@iftex
266@xref{Lucid Resources},
267@end iftex
268for how to control the appearance of the menu bar if you have one.
269
270@ifnottex
271@item @code{minibuffer} (class @code{Minibuffer})
272If @samp{none}, don't make a minibuffer in this frame.
273It will use a separate minibuffer frame instead.
274
275@item @code{paneFont} (class @code{Font})
276@cindex font for menus
277Font name for menu pane titles, in non-toolkit versions of Emacs.
278@end ifnottex
279
280@item @code{pointerColor} (class @code{Foreground})
281Color of the mouse cursor.
282
283@ifnottex
284@item @code{privateColormap} (class @code{PrivateColormap})
285If @samp{on}, use a private color map, in the case where the ``default
286visual'' of class PseudoColor and Emacs is using it.
287
288@item @code{reverseVideo} (class @code{ReverseVideo})
289Switch foreground and background default colors if @samp{on}, use colors as
290specified if @samp{off}.
291@end ifnottex
292
293@item @code{screenGamma} (class @code{ScreenGamma})
294@cindex gamma correction
295Gamma correction for colors, equivalent to the frame parameter
296@code{screen-gamma}.
297
298@item @code{scrollBarWidth} (class @code{ScrollBarWidth})
299@cindex scrollbar width
300The scroll bar width in pixels, equivalent to the frame parameter
301@code{scroll-bar-width}.
302
303@ifnottex
304@item @code{selectionFont} (class @code{SelectionFont})
305Font name for pop-up menu items, in non-toolkit versions of Emacs. (For
306toolkit versions, see @ref{Lucid Resources}, also see @ref{LessTif
307Resources}.)
308
309@item @code{selectionTimeout} (class @code{SelectionTimeout})
310Number of milliseconds to wait for a selection reply.
311If the selection owner doesn't reply in this time, we give up.
312A value of 0 means wait as long as necessary.
313
314@item @code{synchronous} (class @code{Synchronous})
315@cindex debugging X problems
316@cindex synchronous X mode
317Run Emacs in synchronous mode if @samp{on}. Synchronous mode is
318useful for debugging X problems.
319@end ifnottex
320
321@item @code{title} (class @code{Title})
322Name to display in the title bar of the initial Emacs frame.
323
324@item @code{toolBar} (class @code{ToolBar})
325@cindex tool bar
326Number of lines to reserve for the tool bar. A zero value suppresses
327the tool bar. If the value is non-zero and
328@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size
329will be changed automatically so that all tool bar items are visible.
330 If the value of @code{auto-resize-tool-bars} is @code{grow-only},
331the tool bar expands automatically, but does not contract automatically.
332To contract the tool bar, you must redraw the frame by entering @kbd{C-l}.
333
334@item @code{useXIM} (class @code{UseXIM})
335@cindex XIM
336@cindex X input methods
337@cindex input methods, X
338Turn off use of X input methods (XIM) if @samp{false} or @samp{off}.
339This is only relevant if your Emacs is actually built with XIM
340support. It is potentially useful to turn off XIM for efficiency,
341especially slow X client/server links.
342
343@item @code{verticalScrollBars} (class @code{ScrollBars})
344Give frames scroll bars if @samp{on}; don't have scroll bars if
345@samp{off}.
346
347@ifnottex
348@item @code{visualClass} (class @code{VisualClass})
349Specify the ``visual'' that X should use. This tells X how to handle
350colors.
351
352The value should start with one of @samp{TrueColor},
353@samp{PseudoColor}, @samp{DirectColor}, @samp{StaticColor},
354@samp{GrayScale}, and @samp{StaticGray}, followed by
355@samp{-@var{depth}}, where @var{depth} is the number of color planes.
356Most terminals only allow a few ``visuals,'' and the @samp{dpyinfo}
357program outputs information saying which ones.
358@end ifnottex
359@end table
360
361@node Face Resources
362@appendixsec X Resources for Faces
363
364 You can use resources to customize the appearance of particular
365faces (@pxref{Faces}):
366
367@table @code
368@item @var{face}.attributeForeground
369Foreground color for face @var{face}.
370@item @var{face}.attributeBackground
371Background color for face @var{face}.
372@item @var{face}.attributeUnderline
373Underline flag for face @var{face}. Use @samp{on} or @samp{true} for
374yes.
375@item @var{face}.attributeStrikeThrough
376@itemx @var{face}.attributeOverline
377@itemx @var{face}.attributeBox
378@itemx @var{face}.attributeInverse
379Likewise, for other boolean font attributes.
380@item @var{face}.attributeStipple
381The name of a pixmap data file to use for the stipple pattern, or
382@code{false} to not use stipple for the face @var{face}.
383@item @var{face}.attributeBackgroundPixmap
384The background pixmap for the face @var{face}. Should be a name of a
385pixmap file or @code{false}.
386@item @var{face}.attributeFont
387Font name (full XFD name or valid X abbreviation) for face @var{face}.
388Instead of this, you can specify the font through separate attributes.
389@end table
390
391 Instead of using @code{attributeFont} to specify a font name, you can
392select a font through these separate attributes:
393
394@table @code
395@item @var{face}.attributeFamily
396Font family for face @var{face}.
397@item @var{face}.attributeHeight
398Height of the font to use for face @var{face}: either an integer
399specifying the height in units of 1/10@dmn{pt}, or a floating point
400number that specifies a scale factor to scale the underlying face's
401default font, or a function to be called with the default height which
402will return a new height.
403@item @var{face}.attributeWidth
404@itemx @var{face}.attributeWeight
405@itemx @var{face}.attributeSlant
406Each of these resources corresponds to a like-named font attribute,
407and you write the resource value the same as the symbol you would use
408for the font attribute value.
409@item @var{face}.attributeBold
410Bold flag for face @var{face}---instead of @code{attributeWeight}. Use @samp{on} or @samp{true} for
411yes.
412@item @var{face}.attributeItalic
413Italic flag for face @var{face}---instead of @code{attributeSlant}.
414@end table
415
416@node Lucid Resources
417@appendixsec Lucid Menu X Resources
418@cindex Menu X Resources (Lucid widgets)
419@cindex Lucid Widget X Resources
420
421@ifnottex
422 If the Emacs installed at your site was built to use the X toolkit
423with the Lucid menu widgets, then the menu bar is a separate widget and
424has its own resources. The resource names contain @samp{pane.menubar}
425(following, as always, the name of the Emacs invocation, or @samp{Emacs},
426which stands for all Emacs invocations). Specify them like this:
427
428@example
429Emacs.pane.menubar.@var{resource}: @var{value}
430@end example
431
432@noindent
433For example, to specify the font @samp{8x16} for the menu-bar items,
434write this:
435@end ifnottex
436@iftex
437 If the Emacs installed at your site was built to use the X toolkit
438with the Lucid menu widgets, then the menu bar is a separate widget
439and has its own resources. The resource specifications start with
440@samp{Emacs.pane.menubar}---for instance, to specify the font
441@samp{8x16} for the menu-bar items, write this:
442@end iftex
443
444@example
445Emacs.pane.menubar.font: 8x16
446@end example
447
448@noindent
449Resources for @emph{non-menubar} toolkit pop-up menus have
450@samp{menu*} instead of @samp{pane.menubar}. For example, to specify
451the font @samp{8x16} for the pop-up menu items, write this:
452
453@example
454Emacs.menu*.font: 8x16
455@end example
456
457@noindent
458For dialog boxes, use @samp{dialog*}:
459
460@example
461Emacs.dialog*.font: 8x16
462@end example
463
464@noindent
465The Lucid menus can display multilingual text in your locale. For
466more information about fontsets see the man page for
467@code{XCreateFontSet}. To enable multilingual menu text you specify a
468@code{fontSet} resource instead of the font resource. If both
469@code{font} and @code{fontSet} resources are specified, the
470@code{fontSet} resource is used.
471
472 Thus, to specify @samp{-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*}
473for both the popup and menu bar menus, write this:
474
475@example
476Emacs*menu*fontSet: -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*
477@end example
478
479@noindent
480The @samp{*menu*} as a wildcard matches @samp{pane.menubar} and
481@samp{menu@dots{}}.
482
483Experience shows that on some systems you may need to add
484@samp{shell.}@: before the @samp{pane.menubar} or @samp{menu*}. On
485some other systems, you must not add @samp{shell.}. The generic wildcard
486approach should work on both kinds of systems.
487
488 Here is a list of the specific resources for menu bars and pop-up menus:
489
490@table @code
491@item font
492Font for menu item text.
493@item fontSet
494Fontset for menu item text.
495@item foreground
496Color of the foreground.
497@item background
498Color of the background.
499@item buttonForeground
500In the menu bar, the color of the foreground for a selected item.
501@ifnottex
502@item horizontalSpacing
503Horizontal spacing in pixels between items. Default is 3.
504@item verticalSpacing
505Vertical spacing in pixels between items. Default is 2.
506@item arrowSpacing
507Horizontal spacing between the arrow (which indicates a submenu) and
508the associated text. Default is 10.
509@item shadowThickness
510Thickness of shadow line around the widget. Default is 1.
511
512Also determines the thickness of shadow lines around other objects,
513for instance 3D buttons and arrows. If you have the impression that
514the arrows in the menus do not stand out clearly enough or that the
515difference between ``in'' and ``out'' buttons is difficult to see, set
516this to 2. If you have no problems with visibility, the default
517probably looks better. The background color may also have some effect
518on the contrast.
519@end ifnottex
520@item margin
521The margin of the menu bar, in characters. Default is 1.
522@end table
523
524@ifnottex
525@node LessTif Resources
526@appendixsec LessTif Menu X Resources
527@cindex Menu X Resources (LessTif widgets)
528@cindex LessTif Widget X Resources
529
530 If the Emacs installed at your site was built to use the X toolkit
531with the LessTif or Motif widgets, then the menu bar, the dialog
532boxes, the pop-up menus, and the file-selection box are separate
533widgets and have their own resources.
534
535 The resource names for the menu bar contain @samp{pane.menubar}
536(following, as always, the name of the Emacs invocation, or
537@samp{Emacs}, which stands for all Emacs invocations). Specify them
538like this:
539
540@smallexample
541Emacs.pane.menubar.@var{subwidget}.@var{resource}: @var{value}
542@end smallexample
543
544 Each individual string in the menu bar is a subwidget; the subwidget's
545name is the same as the menu item string. For example, the word
546@samp{File} in the menu bar is part of a subwidget named
547@samp{emacs.pane.menubar.File}. Most likely, you want to specify the
548same resources for the whole menu bar. To do this, use @samp{*} instead
549of a specific subwidget name. For example, to specify the font
550@samp{8x16} for the menu-bar items, write this:
551
552@smallexample
553Emacs.pane.menubar.*.fontList: 8x16
554@end smallexample
555
556@noindent
557This also specifies the resource value for submenus.
558
559 Each item in a submenu in the menu bar also has its own name for X
560resources; for example, the @samp{File} submenu has an item named
561@samp{Save (current buffer)}. A resource specification for a submenu
562item looks like this:
563
564@smallexample
565Emacs.pane.menubar.popup_*.@var{menu}.@var{item}.@var{resource}: @var{value}
566@end smallexample
567
568@noindent
569For example, here's how to specify the font for the @samp{Save (current
570buffer)} item:
571
572@smallexample
573Emacs.pane.menubar.popup_*.File.Save (current buffer).fontList: 8x16
574@end smallexample
575
576@noindent
577For an item in a second-level submenu, such as @samp{Complete Word}
578under @samp{Spell Checking} under @samp{Tools}, the resource fits this
579template:
580
581@smallexample
582Emacs.pane.menubar.popup_*.popup_*.@var{menu}.@var{resource}: @var{value}
583@end smallexample
584
585@noindent
586For example,
587
588@smallexample
589Emacs.pane.menubar.popup_*.popup_*.Spell Checking.Complete Word: @var{value}
590@end smallexample
591
592@noindent
593(This should be one long line.)
594
595 It's impossible to specify a resource for all the menu-bar items
596without also specifying it for the submenus as well. So if you want the
597submenu items to look different from the menu bar itself, you must ask
598for that in two steps. First, specify the resource for all of them;
599then, override the value for submenus alone. Here is an example:
600
601@smallexample
602Emacs.pane.menubar.*.fontList: 8x16
603Emacs.pane.menubar.popup_*.fontList: 8x16
604@end smallexample
605
606@noindent
607For LessTif pop-up menus, use @samp{menu*} instead of
608@samp{pane.menubar}. For example, to specify the font @samp{8x16} for
609the pop-up menu items, write this:
610
611@smallexample
612Emacs.menu*.fontList: 8x16
613@end smallexample
614
615@noindent
616For LessTif dialog boxes, use @samp{dialog} instead of @samp{menu}:
617
618@example
619Emacs.dialog*.fontList: 8x16
620Emacs.dialog*.foreground: hotpink
621@end example
622
623To specify resources for the LessTif file-selection box, use
624@samp{fsb*}, like this:
625
626@example
627Emacs.fsb*.fontList: 8x16
628@end example
629
630@iftex
631@medbreak
632@end iftex
633 Here is a list of the specific resources for LessTif menu bars and
634pop-up menus:
635
636@table @code
637@item armColor
638The color to show in an armed button.
639@item fontList
640The font to use.
641@item marginBottom
642@itemx marginHeight
643@itemx marginLeft
644@itemx marginRight
645@itemx marginTop
646@itemx marginWidth
647Amount of space to leave around the item, within the border.
648@item borderWidth
649The width of the border around the menu item, on all sides.
650@item shadowThickness
651The width of the border shadow.
652@item bottomShadowColor
653The color for the border shadow, on the bottom and the right.
654@item topShadowColor
655The color for the border shadow, on the top and the left.
656@end table
657@end ifnottex
658
659
660@node GTK resources
661@appendixsec GTK resources
662@iftex
663 The most common way to customize the GTK widgets Emacs uses (menus, dialogs
664tool bars and scroll bars) is by choosing an appropriate theme, for example
665with the GNOME theme selector. You can also do Emacs specific customization
666by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}. Some GTK
667themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything
668works with all themes. To customize Emacs font, background, faces, etc., use
669the normal X resources (@pxref{Resources}). We will present some examples of
670customizations here, but for a more detailed description, see the online manual
671
672 The first example is just one line. It changes the font on all GTK widgets
673to courier with size 12:
674
675@smallexample
676gtk-font-name = "courier 12"
677@end smallexample
678
679 The thing to note is that the font name is not an X font name, like
680-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*, but a Pango font name. A Pango
681font name is basically of the format "family style size", where the style
682is optional as in the case above. A name with a style could be for example:
683
684@smallexample
685gtk-font-name = "helvetica bold 10"
686@end smallexample
687
688 To customize widgets you first define a style and then apply the style to
689the widgets. Here is an example that sets the font for menus, but not
690for other widgets:
691
692@smallexample
693# @r{Define the style @samp{menufont}.}
694style "menufont"
695@{
696 font_name = "helvetica bold 14" # This is a Pango font name
697@}
698
699# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
700widget "*emacs-menuitem*" style "menufont"
701@end smallexample
702
703The widget name in this example contains wildcards, so the style will be
704applied to all widgets that match "*emacs-menuitem*". The widgets are
705named by the way they are contained, from the outer widget to the inner widget.
706So to apply the style "my_style" (not shown) with the full, absolute name, for
707the menubar and the scroll bar in Emacs we use:
708
709@smallexample
710widget "Emacs.pane.menubar" style "my_style"
711widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"
712@end smallexample
713
714But to avoid having to type it all, wildcards are often used. @samp{*}
715matches zero or more characters and @samp{?} matches one character. So "*"
716matches all widgets.
717
718 Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem).
719You can assign styles by name or by class. In this example we have used the
720class:
721
722@smallexample
723style "menufont"
724@{
725 font_name = "helvetica bold 14"
726@}
727
728widget_class "*GtkMenuBar" style "menufont"
729@end smallexample
730
731@noindent
732The names and classes for the GTK widgets Emacs uses are:
733
734@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some}
735@item @code{emacs-filedialog}
736@tab @code{GtkFileSelection}
737@item @code{emacs-dialog}
738@tab @code{GtkDialog}
739@item @code{Emacs}
740@tab @code{GtkWindow}
741@item @code{pane}
742@tab @code{GtkVHbox}
743@item @code{emacs}
744@tab @code{GtkFixed}
745@item @code{verticalScrollBar}
746@tab @code{GtkVScrollbar}
747@item @code{emacs-toolbar}
748@tab @code{GtkToolbar}
749@item @code{menubar}
750@tab @code{GtkMenuBar}
751@item @code{emacs-menuitem}
752@tab anything in menus
753@end multitable
754
755 GTK absolute names are quite strange when it comes to menus
756and dialogs. The names do not start with @samp{Emacs}, as they are
757free-standing windows and not contained (in the GTK sense) by the
758Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this:
759
760@smallexample
761widget "*emacs-dialog*" style "my_dialog_style"
762widget "*emacs-filedialog* style "my_file_style"
763widget "*emacs-menuitem* style "my_menu_style"
764@end smallexample
765
766 If you specify a customization in @file{~/.emacs.d/gtkrc}, then it
767automatically applies only to Emacs, since other programs don't read
768that file. For example, the drop down menu in the file dialog can not
769be customized by any absolute widget name, only by an absolute class
770name. This is because the widgets in the drop down menu do not
771have names and the menu is not contained in the Emacs GtkWindow. To
772have all menus in Emacs look the same, use this in
773@file{~/.emacs.d/gtkrc}:
774
775@smallexample
776widget_class "*Menu*" style "my_menu_style"
777@end smallexample
778
779 Here is a more elaborate example, showing how to change the parts of
780the scroll bar:
781
782@smallexample
783style "scroll"
784@{
785 fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.}
786 bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.}
787 bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.}
788 bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.}
789@}
790
791widget "*verticalScrollBar*" style "scroll"
792@end smallexample
793@end iftex
794
795@ifnottex
796@cindex GTK resources and customization
797@cindex resource files for GTK
798@cindex @file{~/.gtkrc-2.0} file
799@cindex @file{~/.emacs.d/gtkrc} file
800
801 If Emacs was built to use the GTK widget set, then the menu bar, tool bar,
802scroll bar and the dialogs are customized with the standard GTK
803customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific
804file @file{~/.emacs.d/gtkrc}. We recommend that you use
805@file{~/.emacs.d/gtkrc} for customizations, since @file{~/.gtkrc-2.0}
806seems to be ignored when running GConf with GNOME. These files apply
807only to GTK widget features. To customize Emacs font, background,
808faces, etc., use the normal X resources (@pxref{Resources}).
809
810 Some GTK themes override these mechanisms, which means that using
811these mechanisms will not work to customize them.
812
813 In these files you first define a style and say what it means; then
814you specify to apply the style to various widget types (@pxref{GTK
815widget names}). Here is an example of how to change the font for
816Emacs menus:
817
818@smallexample
819# @r{Define the style @samp{menufont}.}
820style "menufont"
821@{
822 font_name = "helvetica bold 14" # This is a Pango font name
823@}
824
825# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
826widget "*emacs-menuitem*" style "menufont"
827@end smallexample
828
829 Here is a more elaborate example, showing how to change the parts of
830the scroll bar:
831
832@smallexample
833style "scroll"
834@{
835 fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.}
836 bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.}
837 bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.}
838 bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.}
839@}
840
841widget "*verticalScrollBar*" style "scroll"
842@end smallexample
843
844 There are also parameters that affect GTK as a whole. For example,
845the property @code{gtk-font-name} sets the default font for GTK. You
846must use Pango font names (@pxref{GTK styles}). A GTK resources file
847that just sets a default font looks like this:
848
849@smallexample
850gtk-font-name = "courier 12"
851@end smallexample
852
853 The GTK resources file is fully described in the GTK API document.
854This can be found in
855@file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html},
856where @file{prefix} is the directory in which the GTK libraries were
857installed (usually @file{/usr} or @file{/usr/local}). You can also
858find the document online, at
859@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}.
860
861@menu
862* GTK widget names:: How widgets in GTK are named in general.
863* GTK Names in Emacs:: GTK widget names in Emacs.
864* GTK styles:: What can be customized in a GTK widget.
865@end menu
866
867@node GTK widget names
868@appendixsubsec GTK widget names
869@cindex GTK widget names
870
871 A GTK widget is specified by its @dfn{widget class} and
872@dfn{widget name}. The widget class is the type of the widget: for
873example, @code{GtkMenuBar}. The widget name is the name given to a
874specific widget. A widget always has a class, but need not have a
875name.
876
877 @dfn{Absolute names} are sequences of widget names or widget
878classes, corresponding to hierarchies of widgets embedded within
879other widgets. For example, if a @code{GtkWindow} named @code{top}
880contains a @code{GtkVBox} named @code{box}, which in turn contains
881a @code{GtkMenuBar} called @code{menubar}, the absolute class name
882of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and
883its absolute widget name is @code{top.box.menubar}.
884
885 When assigning a style to a widget, you can use the absolute class
886name or the absolute widget name.
887
888 There are two commands to specify changes for widgets:
889
890@table @asis
891@item @code{widget_class}
892specifies a style for widgets based on the absolute class name.
893
894@item @code{widget}
895specifies a style for widgets based on the absolute class name,
896or just the class.
897@end table
898
899@noindent
900You must specify the class and the style in double-quotes, and put
901these commands at the top level in the GTK customization file, like
902this:
903
904@smallexample
905style "menufont"
906@{
907 font_name = "helvetica bold 14"
908@}
909
910widget "top.box.menubar" style "menufont"
911widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont"
912@end smallexample
913
914 Matching of absolute names uses shell wildcard syntax: @samp{*}
915matches zero or more characters and @samp{?} matches one character.
916This example assigns @code{base_style} to all widgets:
917
918@smallexample
919widget "*" style "base_style"
920@end smallexample
921
922 Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar}
923and the corresponding absolute widget name @code{top.box.menubar}, all
924these examples specify @code{my_style} for the menu bar:
925
926@smallexample
927widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style"
928widget_class "GtkWindow.*.GtkMenuBar" style "my_style"
929widget_class "*GtkMenuBar" style "my_style"
930widget "top.box.menubar" style "my_style"
931widget "*box*menubar" style "my_style"
932widget "*menubar" style "my_style"
933widget "*menu*" style "my_style"
934@end smallexample
935
936@node GTK Names in Emacs
937@appendixsubsec GTK Widget Names in Emacs
938@cindex GTK widget names
939@cindex GTK widget classes
940
941 In Emacs, the top level widget for a frame is a @code{GtkWindow}
942that contains a @code{GtkVBox}. The @code{GtkVBox} contains the
943@code{GtkMenuBar} and a @code{GtkFixed} widget. The vertical scroll
944bars, @code{GtkVScrollbar}, are contained in the @code{GtkFixed}
945widget. The text you write in Emacs is drawn in the @code{GtkFixed}
946widget.
947
948 Dialogs in Emacs are @code{GtkDialog} widgets. The file dialog is a
949@code{GtkFileSelection} widget.
950
951@noindent
952To set a style for the menu bar using the absolute class name, use:
953
954@smallexample
955widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style"
956@end smallexample
957
958@noindent
959For the scroll bar, the absolute class name is:
960
961@smallexample
962widget_class
963 "GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar"
964 style "my_style"
965@end smallexample
966
967@noindent
968The names for the emacs widgets, and their classes, are:
969
970@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some}
971@item @code{emacs-filedialog}
972@tab @code{GtkFileSelection}
973@item @code{emacs-dialog}
974@tab @code{GtkDialog}
975@item @code{Emacs}
976@tab @code{GtkWindow}
977@item @code{pane}
978@tab @code{GtkVHbox}
979@item @code{emacs}
980@tab @code{GtkFixed}
981@item @code{verticalScrollBar}
982@tab @code{GtkVScrollbar}
983@item @code{emacs-toolbar}
984@tab @code{GtkToolbar}
985@item @code{menubar}
986@tab @code{GtkMenuBar}
987@item @code{emacs-menuitem}
988@tab anything in menus
989@end multitable
990
991@noindent
992Thus, for Emacs you can write the two examples above as:
993
994@smallexample
995widget "Emacs.pane.menubar" style "my_style"
996widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"
997@end smallexample
998
999 GTK absolute names are quite strange when it comes to menus
1000and dialogs. The names do not start with @samp{Emacs}, as they are
1001free-standing windows and not contained (in the GTK sense) by the
1002Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this:
1003
1004@smallexample
1005widget "*emacs-dialog*" style "my_dialog_style"
1006widget "*emacs-filedialog* style "my_file_style"
1007widget "*emacs-menuitem* style "my_menu_style"
1008@end smallexample
1009
1010 If you specify a customization in @file{~/.emacs.d/gtkrc}, then it
1011automatically applies only to Emacs, since other programs don't read
1012that file. For example, the drop down menu in the file dialog can not
1013be customized by any absolute widget name, only by an absolute class
1014name. This is because the widgets in the drop down menu do not
1015have names and the menu is not contained in the Emacs GtkWindow. To
1016have all menus in Emacs look the same, use this in
1017@file{~/.emacs.d/gtkrc}:
1018
1019@smallexample
1020widget_class "*Menu*" style "my_menu_style"
1021@end smallexample
1022
1023@node GTK styles
1024@appendixsubsec GTK styles
1025@cindex GTK styles
1026
1027 In a GTK style you specify the appearance widgets shall have. You
1028can specify foreground and background color, background pixmap and
1029font. The edit widget (where you edit the text) in Emacs is a GTK
1030widget, but trying to specify a style for the edit widget will have no
1031effect. This is so that Emacs compiled for GTK is compatible with
1032Emacs compiled for other X toolkits. The settings for foreground,
1033background and font for the edit widget is taken from the X resources;
1034@pxref{Resources}. Here is an example of two style declarations,
1035@samp{default} and @samp{ruler}:
1036
1037@smallexample
1038pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps"
1039
1040style "default"
1041@{
1042 font_name = "helvetica 12"
1043
1044 bg[NORMAL] = @{ 0.83, 0.80, 0.73 @}
1045 bg[SELECTED] = @{ 0.0, 0.55, 0.55 @}
1046 bg[INSENSITIVE] = @{ 0.77, 0.77, 0.66 @}
1047 bg[ACTIVE] = @{ 0.0, 0.55, 0.55 @}
1048 bg[PRELIGHT] = @{ 0.0, 0.55, 0.55 @}
1049
1050 fg[NORMAL] = "black"
1051 fg[SELECTED] = @{ 0.9, 0.9, 0.9 @}
1052 fg[ACTIVE] = "black"
1053 fg[PRELIGHT] = @{ 0.9, 0.9, 0.9 @}
1054
1055 base[INSENSITIVE] = "#777766"
1056 text[INSENSITIVE] = @{ 0.60, 0.65, 0.57 @}
1057
1058 bg_pixmap[NORMAL] = "background.xpm"
1059 bg_pixmap[INSENSITIVE] = "background.xpm"
1060 bg_pixmap[ACTIVE] = "background.xpm"
1061 bg_pixmap[PRELIGHT] = "<none>"
1062
1063@}
1064
1065style "ruler" = "default"
1066@{
1067 font_name = "helvetica 8"
1068@}
1069
1070@end smallexample
1071
1072 The style @samp{ruler} inherits from @samp{default}. This way you can build
1073on existing styles. The syntax for fonts and colors is described below.
1074
1075 As this example shows, it is possible to specify several values for
1076foreground and background depending on the widget's @dfn{state}. The
1077possible states are:
1078
1079@table @code
1080@item NORMAL
1081This is the default state for widgets.
1082@item ACTIVE
1083This is the state for a widget that is ready to do something. It is
1084also for the trough of a scroll bar, i.e. @code{bg[ACTIVE] = "red"}
1085sets the scroll bar trough to red. Buttons that have been pressed but
1086not released yet (``armed'') are in this state.
1087@item PRELIGHT
1088This is the state for a widget that can be manipulated, when the mouse
1089pointer is over it---for example when the mouse is over the thumb in
1090the scroll bar or over a menu item. When the mouse is over a button
1091that is not pressed, the button is in this state.
1092@item SELECTED
1093This is the state for data that has been selected by the user. It can
1094be selected text or items selected in a list. This state is not used
1095in Emacs.
1096@item INSENSITIVE
1097This is the state for widgets that are visible, but they can not be
1098manipulated in the usual way---for example, buttons that can't be
1099pressed, and disabled menu items. To display disabled menu items in
1100yellow, use @code{fg[INSENSITIVE] = "yellow"}.
1101@end table
1102
1103 Here are the things that can go in a style declaration:
1104
1105@table @code
1106@item bg[@var{state}] = @var{color}
1107This specifies the background color for the widget. Note that
1108editable text doesn't use @code{bg}; it uses @code{base} instead.
1109
1110@item base[@var{state}] = @var{color}
1111This specifies the background color for editable text. In Emacs, this
1112color is used for the background of the text fields in the file
1113dialog.
1114
1115@item bg_pixmap[@var{state}] = "@var{pixmap}"
1116This specifies an image background (instead of a background color).
1117@var{pixmap} should be the image file name. GTK can use a number of
1118image file formats, including XPM, XBM, GIF, JPEG and PNG. If you
1119want a widget to use the same image as its parent, use
1120@samp{<parent>}. If you don't want any image, use @samp{<none>}.
1121@samp{<none>} is the way to cancel a background image inherited from a
1122parent style.
1123
1124You can't specify the file by its absolute file name. GTK looks for
1125the pixmap file in directories specified in @code{pixmap_path}.
1126@code{pixmap_path} is a colon-separated list of directories within
1127double quotes, specified at the top level in a @file{gtkrc} file
1128(i.e. not inside a style definition; see example above):
1129
1130@smallexample
1131pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps"
1132@end smallexample
1133
1134@item fg[@var{state}] = @var{color}
1135This specifies the foreground color for widgets to use. It is the
1136color of text in menus and buttons, and the color for the arrows in
1137the scroll bar. For editable text, use @code{text}.
1138
1139@item text[@var{state}] = @var{color}
1140This is the color for editable text. In Emacs, this color is used for the
1141text fields in the file dialog.
1142
1143@item font_name = "@var{font}"
1144This specifies the font for text in the widget. @var{font} is a
1145Pango font name, for example @samp{Sans Italic 10}, @samp{Helvetica
1146Bold 12}, @samp{Courier 14}, @samp{Times 18}. See below for exact
1147syntax. The names are case insensitive.
1148@end table
1149
1150 There are three ways to specify a color: by name, in hexadecimal
1151form, and with an RGB triplet.
1152
1153@noindent
1154A color name is written within double quotes, for example @code{"red"}.
1155
1156@noindent
1157Hexadecimal form is the same as in X:
1158@code{#@var{rrrr}@var{gggg}@var{bbbb}}, where all three color specs
1159must have the same number of hex digits (1, 2, 3 or 4).
1160
1161@noindent
1162An RGB triplet looks like @code{@{ @var{r}, @var{g}, @var{b} @}},
1163where @var{r}, @var{g} and @var{b} are either integers in the range
11640-65535 or floats in the range 0.0-1.0.
1165
1166 Pango font names have the form ``@var{family-list} @var{style-options}
1167@var{size}.''
1168@cindex Pango font name
1169@noindent
1170@var{family-list} is a comma separated list of font families optionally
1171terminated by a comma. This way you can specify several families and the
1172first one found will be used. @var{family} corresponds to the second part in
1173an X font name, for example in
1174
1175@smallexample
1176-adobe-times-medium-r-normal--12-120-75-75-p-64-iso10646-1
1177@end smallexample
1178
1179@noindent
1180the family name is @samp{times}.
1181
1182@noindent
1183@var{style-options} is a whitespace separated list of words where each word
1184is a style, variant, weight, or stretch. The default value for all of
1185these is @code{normal}.
1186
1187@noindent
1188A `style' corresponds to the fourth part of an X font name. In X font
1189names it is the character @samp{r}, @samp{i} or @samp{o}; in Pango
1190font names the corresponding values are @code{normal}, @code{italic},
1191or @code{oblique}.
1192
1193@noindent
1194A `variant' is either @code{normal} or @code{small-caps}.
1195Small caps is a font with the lower case characters replaced by
1196smaller variants of the capital characters.
1197
1198@noindent
1199Weight describes the ``boldness'' of a font. It corresponds to the third
1200part of an X font name. It is one of @code{ultra-light}, @code{light},
1201@code{normal}, @code{bold}, @code{ultra-bold}, or @code{heavy}.
1202
1203@noindent
1204Stretch gives the width of the font relative to other designs within a
1205family. It corresponds to the fifth part of an X font name. It is one of
1206@code{ultra-condensed}, @code{extra-condensed}, @code{condensed},
1207@code{semi-condensed}, @code{normal}, @code{semi-expanded},
1208@code{expanded}, @code{extra-expanded}, or @code{ultra-expanded}.
1209
1210@noindent
1211@var{size} is a decimal number that describes the font size in points.
1212@end ifnottex
1213
1214@ignore
1215 arch-tag: 9b6ff773-48b6-41f6-b2f9-f114b8bdd97f
1216@end ignore