diff options
| author | Richard M. Stallman | 2006-01-31 18:14:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-01-31 18:14:54 +0000 |
| commit | dc9bfb46ba5512ab376aa68a63c7c709009511b7 (patch) | |
| tree | 9f2d16e89399e2e7e3e419c4a3a269e11c118607 | |
| parent | 191b577e117312b4576227eb4a75e2a96d64e76b (diff) | |
| download | emacs-dc9bfb46ba5512ab376aa68a63c7c709009511b7.tar.gz emacs-dc9bfb46ba5512ab376aa68a63c7c709009511b7.zip | |
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
| -rw-r--r-- | man/basic.texi | 102 |
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 |
| 321 | certain point. Each buffer records changes individually, and the undo | 319 | you can undo all the recent changes, as far as the records go. |
| 322 | command always applies to the current buffer. Usually each editing | 320 | Usually each editing command makes a separate entry in the undo |
| 323 | command makes a separate entry in the undo records, but some commands | 321 | records, but sometimes an entry covers just part of a command, and |
| 324 | such as @code{query-replace} make many entries, and very simple commands | 322 | very simple commands may be grouped. |
| 325 | such as self-inserting characters are often grouped to make undoing less | ||
| 326 | tedious. | ||
| 327 | 323 | ||
| 328 | @table @kbd | 324 | @table @kbd |
| 329 | @item C-x u | 325 | @item C-x u |
| 330 | Undo one batch of changes---usually, one command worth (@code{undo}). | 326 | Undo 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-/ |
| 333 | The same. | 330 | The 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. |
| 341 | The first time you give this command, it undoes the last change. | 334 | The first time you give this command, it undoes the last change. |
| 342 | Point moves back to where it was before the command that made the | 335 | Point moves back to where it was before the command that made the |
| 343 | change. | 336 | change. |
| 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 |
| 346 | earlier changes, back to the limit of the undo information available. | 339 | and earlier changes, back to the limit of the undo information |
| 347 | If all recorded changes have already been undone, the undo command | 340 | available. If all recorded changes have already been undone, the undo |
| 348 | displays an error message and does nothing. | 341 | command 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 | ||
| 352 | commands. Starting from that moment, the previous undo commands become | ||
| 353 | ordinary changes that you can undo. Thus, to redo changes you have | ||
| 354 | undone, type @kbd{C-f} or any other command that will harmlessly break | ||
| 355 | the sequence of undoing, then type more undo commands. On the other | ||
| 356 | hand, if you want to ignore previous undo commands, use @kbd{M-x | ||
| 357 | undo-only}. This is like @code{undo}, but will not redo changes | ||
| 358 | you have just undone. | ||
| 359 | |||
| 360 | If you notice that a buffer has been modified accidentally, the | ||
| 361 | easiest way to recover is to type @kbd{C-_} repeatedly until the stars | ||
| 362 | disappear from the front of the mode line. At this time, all the | ||
| 363 | modifications you made have been canceled. Whenever an undo command | ||
| 364 | makes the stars disappear from the mode line, it means that the buffer | ||
| 365 | contents are the same as they were when the file was last read in or | ||
| 366 | saved. | ||
| 367 | |||
| 368 | If you do not remember whether you changed the buffer deliberately, | ||
| 369 | type @kbd{C-_} once. When you see the last change you made undone, you | ||
| 370 | will see whether it was an intentional change. If it was an accident, | ||
| 371 | leave it undone. If it was deliberate, redo the change as described | ||
| 372 | above. | ||
| 373 | |||
| 374 | Normal undo applies to the buffer as a whole. You can also | ||
| 375 | selectively undo changes in any part of the buffer (@pxref{Selective | ||
| 376 | Undo}). | ||
| 377 | |||
| 378 | Some specialized buffers do not record undo information. Buffers | ||
| 379 | whose names start with spaces never do; these buffers are used | ||
| 380 | internally by Emacs and its extensions to hold text that users don't | ||
| 381 | normally 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 |
| 384 | use it to undo mere cursor motion. However, some cursor motion | 344 | use 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, | |||
| 386 | you can move back to the neighborhoods you have moved through by | 346 | you can move back to the neighborhoods you have moved through by |
| 387 | popping the mark ring (@pxref{Mark Ring}). | 347 | popping 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 | ||
| 394 | discards the oldest undo information from time to time (during garbage | ||
| 395 | collection). You can specify how much undo information to keep by | ||
| 396 | setting three variables: @code{undo-limit}, @code{undo-strong-limit}, | ||
| 397 | and @code{undo-outer-limit}. Their values are expressed in units of | ||
| 398 | bytes of space. | ||
| 399 | |||
| 400 | The variable @code{undo-limit} sets a soft limit: Emacs keeps undo | ||
| 401 | data for enough commands to reach this size, and perhaps exceed it, | ||
| 402 | but does not keep data for any earlier commands beyond that. Its | ||
| 403 | default value is 20000. The variable @code{undo-strong-limit} sets a | ||
| 404 | stricter limit: a previous command (not the most recent one) which | ||
| 405 | pushes the size past this amount is itself forgotten. The default | ||
| 406 | value of @code{undo-strong-limit} is 30000. | ||
| 407 | |||
| 408 | Regardless of the values of those variables, the most recent change | ||
| 409 | is 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 | ||
| 411 | warns you about it. This is the only situation in which you cannot | ||
| 412 | undo 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 | ||
| 414 | future. But if you didn't expect the command to create such large | ||
| 415 | undo 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 | ||
| 419 | u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a | ||
| 420 | single-character key, but @kbd{C-x u} is more straightforward for | ||
| 421 | beginners to type. Meanwhile, @kbd{C--} on a text-only terminal is | ||
| 422 | really @kbd{C-_}, which makes it a natural and easily typed binding | ||
| 423 | for undoing. | ||
| 424 | |||
| 425 | @node Basic Files | 349 | @node Basic Files |
| 426 | @section Files | 350 | @section Files |
| 427 | 351 | ||