aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-01-31 18:14:54 +0000
committerRichard M. Stallman2006-01-31 18:14:54 +0000
commitdc9bfb46ba5512ab376aa68a63c7c709009511b7 (patch)
tree9f2d16e89399e2e7e3e419c4a3a269e11c118607
parent191b577e117312b4576227eb4a75e2a96d64e76b (diff)
downloademacs-dc9bfb46ba5512ab376aa68a63c7c709009511b7.tar.gz
emacs-dc9bfb46ba5512ab376aa68a63c7c709009511b7.zip
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
-rw-r--r--man/basic.texi102
1 files changed, 13 insertions, 89 deletions
diff --git a/man/basic.texi b/man/basic.texi
index ec0acab19d1..5f2b8c4793b 100644
--- a/man/basic.texi
+++ b/man/basic.texi
@@ -21,7 +21,7 @@ use the tutorial, run Emacs and type @kbd{Control-h t}
21* Moving Point:: How to move the cursor to the place where you want to 21* Moving Point:: How to move the cursor to the place where you want to
22 change something. 22 change something.
23* Erasing:: Deleting and killing text. 23* Erasing:: Deleting and killing text.
24* Undo:: Undoing recent changes in the text. 24* Basic Undo:: Undoing recent changes in the text.
25* Files: Basic Files. Visiting, creating, and saving files. 25* Files: Basic Files. Visiting, creating, and saving files.
26* Help: Basic Help. Asking what a character does. 26* Help: Basic Help. Asking what a character does.
27* Blank Lines:: Commands to make or delete blank lines. 27* Blank Lines:: Commands to make or delete blank lines.
@@ -312,73 +312,33 @@ line, it kills all the text up to the end of the line. If you type
312 312
313 @xref{Killing}, for more flexible ways of killing text. 313 @xref{Killing}, for more flexible ways of killing text.
314 314
315@node Undo 315@node Basic Undo
316@section Undoing Changes 316@section Undoing Changes
317@cindex undo
318@cindex changes, undoing
319 317
320 You can undo all the recent changes in the buffer text, up to a 318 Emacs records a list of changes made in the buffer text, so you can
321certain point. Each buffer records changes individually, and the undo 319you can undo all the recent changes, as far as the records go.
322command always applies to the current buffer. Usually each editing 320Usually each editing command makes a separate entry in the undo
323command makes a separate entry in the undo records, but some commands 321records, but sometimes an entry covers just part of a command, and
324such as @code{query-replace} make many entries, and very simple commands 322very simple commands may be grouped.
325such as self-inserting characters are often grouped to make undoing less
326tedious.
327 323
328@table @kbd 324@table @kbd
329@item C-x u 325@item C-x u
330Undo one batch of changes---usually, one command worth (@code{undo}). 326Undo one entry of the undo records---usually, one command worth
327(@code{undo}).
331@item C-_ 328@item C-_
332@itemx C-/ 329@itemx C-/
333The same. 330The same.
334@end table 331@end table
335 332
336@kindex C-x u
337@kindex C-_
338@kindex C-/
339@findex undo
340 The command @kbd{C-x u} (or @kbd{C-_} or @kbd{C-/}) is how you undo. 333 The command @kbd{C-x u} (or @kbd{C-_} or @kbd{C-/}) is how you undo.
341The first time you give this command, it undoes the last change. 334The first time you give this command, it undoes the last change.
342Point moves back to where it was before the command that made the 335Point moves back to where it was before the command that made the
343change. 336change.
344 337
345 Consecutive repetitions of @kbd{C-_} or @kbd{C-x u} undo earlier and 338 Consecutive repetitions of @kbd{C-x u} (or its aliases) undo earlier
346earlier changes, back to the limit of the undo information available. 339and earlier changes, back to the limit of the undo information
347If all recorded changes have already been undone, the undo command 340available. If all recorded changes have already been undone, the undo
348displays an error message and does nothing. 341command displays an error message and does nothing.
349
350@findex undo-only
351 Any command other than an undo command breaks the sequence of undo
352commands. Starting from that moment, the previous undo commands become
353ordinary changes that you can undo. Thus, to redo changes you have
354undone, type @kbd{C-f} or any other command that will harmlessly break
355the sequence of undoing, then type more undo commands. On the other
356hand, if you want to ignore previous undo commands, use @kbd{M-x
357undo-only}. This is like @code{undo}, but will not redo changes
358you have just undone.
359
360 If you notice that a buffer has been modified accidentally, the
361easiest way to recover is to type @kbd{C-_} repeatedly until the stars
362disappear from the front of the mode line. At this time, all the
363modifications you made have been canceled. Whenever an undo command
364makes the stars disappear from the mode line, it means that the buffer
365contents are the same as they were when the file was last read in or
366saved.
367
368 If you do not remember whether you changed the buffer deliberately,
369type @kbd{C-_} once. When you see the last change you made undone, you
370will see whether it was an intentional change. If it was an accident,
371leave it undone. If it was deliberate, redo the change as described
372above.
373
374 Normal undo applies to the buffer as a whole. You can also
375selectively undo changes in any part of the buffer (@pxref{Selective
376Undo}).
377
378 Some specialized buffers do not record undo information. Buffers
379whose names start with spaces never do; these buffers are used
380internally by Emacs and its extensions to hold text that users don't
381normally look at or edit.
382 342
383 The undo command applies only to changes in the buffer; you can't 343 The undo command applies only to changes in the buffer; you can't
384use it to undo mere cursor motion. However, some cursor motion 344use it to undo mere cursor motion. However, some cursor motion
@@ -386,42 +346,6 @@ commands set the mark, so if you use these commands from time to time,
386you can move back to the neighborhoods you have moved through by 346you can move back to the neighborhoods you have moved through by
387popping the mark ring (@pxref{Mark Ring}). 347popping the mark ring (@pxref{Mark Ring}).
388 348
389@vindex undo-limit
390@vindex undo-strong-limit
391@vindex undo-outer-limit
392@cindex undo limit
393 When the undo information for a buffer becomes too large, Emacs
394discards the oldest undo information from time to time (during garbage
395collection). You can specify how much undo information to keep by
396setting three variables: @code{undo-limit}, @code{undo-strong-limit},
397and @code{undo-outer-limit}. Their values are expressed in units of
398bytes of space.
399
400 The variable @code{undo-limit} sets a soft limit: Emacs keeps undo
401data for enough commands to reach this size, and perhaps exceed it,
402but does not keep data for any earlier commands beyond that. Its
403default value is 20000. The variable @code{undo-strong-limit} sets a
404stricter limit: a previous command (not the most recent one) which
405pushes the size past this amount is itself forgotten. The default
406value of @code{undo-strong-limit} is 30000.
407
408 Regardless of the values of those variables, the most recent change
409is never discarded unless it gets bigger than @code{undo-outer-limit}
410(normally 3,000,000). At that point, Emacs discards the undo data and
411warns you about it. This is the only situation in which you cannot
412undo the last command. If this happens, you can increase the value of
413@code{undo-outer-limit} to make it even less likely to happen in the
414future. But if you didn't expect the command to create such large
415undo data, then it is probably a bug and you should report it.
416@xref{Bugs,, Reporting Bugs}.
417
418 The reason the @code{undo} command has three key bindings, @kbd{C-x
419u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a
420single-character key, but @kbd{C-x u} is more straightforward for
421beginners to type. Meanwhile, @kbd{C--} on a text-only terminal is
422really @kbd{C-_}, which makes it a natural and easily typed binding
423for undoing.
424
425@node Basic Files 349@node Basic Files
426@section Files 350@section Files
427 351