aboutsummaryrefslogtreecommitdiffstats
path: root/man/basic.texi
diff options
context:
space:
mode:
authorRichard M. Stallman2006-01-29 16:51:26 +0000
committerRichard M. Stallman2006-01-29 16:51:26 +0000
commitb96ade76c429f5ccedc6cbed9078b50dae21fdf7 (patch)
tree0e1da4776191228db384a1b231d3cf517a1e99e2 /man/basic.texi
parent597993cf4433604ea65e40d33ad6cfe83dab2fb7 (diff)
downloademacs-b96ade76c429f5ccedc6cbed9078b50dae21fdf7.tar.gz
emacs-b96ade76c429f5ccedc6cbed9078b50dae21fdf7.zip
Minor cleanups.
(Undo): selective-undo moved.
Diffstat (limited to 'man/basic.texi')
-rw-r--r--man/basic.texi80
1 files changed, 35 insertions, 45 deletions
diff --git a/man/basic.texi b/man/basic.texi
index 85de3b5b669..5676a562867 100644
--- a/man/basic.texi
+++ b/man/basic.texi
@@ -154,9 +154,9 @@ rebind @key{DEL} to other commands.
154clicking the left mouse button where you want to move to. 154clicking the left mouse button where you want to move to.
155 155
156 There are also control and meta characters for cursor motion. Some 156 There are also control and meta characters for cursor motion. Some
157are equivalent to the arrow keys (these date back to the days before 157are equivalent to the arrow keys (it is faster to use these control
158terminals had arrow keys, and are usable on terminals which don't have 158keys than move your hand over to the arrow keys). Others do more
159them). Others do more sophisticated things. 159sophisticated things.
160 160
161@kindex C-a 161@kindex C-a
162@kindex C-e 162@kindex C-e
@@ -282,8 +282,8 @@ Delete the character after point (@code{delete-char}).
282@item @key{DELETE} 282@item @key{DELETE}
283@itemx @key{BACKSPACE} 283@itemx @key{BACKSPACE}
284One of these keys, whichever is the large key above the @key{RET} or 284One of these keys, whichever is the large key above the @key{RET} or
285@key{ENTER} key, deletes the character before point, like @key{DEL}. 285@key{ENTER} key, deletes the character before point---it is @key{DEL}.
286If that is @key{BACKSPACE}, and your keyboard also has @key{DELETE}, 286If @key{BACKSPACE} is @key{DEL}, and your keyboard also has @key{DELETE},
287then @key{DELETE} deletes forwards, like @kbd{C-d}. 287then @key{DELETE} deletes forwards, like @kbd{C-d}.
288@item C-k 288@item C-k
289Kill to the end of the line (@code{kill-line}). 289Kill to the end of the line (@code{kill-line}).
@@ -330,8 +330,6 @@ Undo one batch of changes---usually, one command worth (@code{undo}).
330@item C-_ 330@item C-_
331@itemx C-/ 331@itemx C-/
332The same. 332The same.
333@item C-u C-x u
334Undo one batch of changes in the region.
335@end table 333@end table
336 334
337@kindex C-x u 335@kindex C-x u
@@ -358,20 +356,6 @@ hand, if you want to ignore previous undo commands, use @kbd{M-x
358undo-only}. This is like @code{undo}, but will not redo changes 356undo-only}. This is like @code{undo}, but will not redo changes
359you have just undone. 357you have just undone.
360 358
361@cindex selective undo
362@kindex C-u C-x u
363 Ordinary undo applies to all changes made in the current buffer. You
364can also perform @dfn{selective undo}, limited to the current region
365(@pxref{Mark}).
366To do this, specify the region you want, then run the @code{undo}
367command with a prefix argument (the value does not matter): @kbd{C-u C-x
368u} or @kbd{C-u C-_}. This undoes the most recent change in the region.
369To undo further changes in the same region, repeat the @code{undo}
370command (no prefix argument is needed). In Transient Mark mode
371(@pxref{Transient Mark}), any use of @code{undo} when there is an
372active region performs selective undo; you do not need a prefix
373argument.
374
375 If you notice that a buffer has been modified accidentally, the 359 If you notice that a buffer has been modified accidentally, the
376easiest way to recover is to type @kbd{C-_} repeatedly until the stars 360easiest way to recover is to type @kbd{C-_} repeatedly until the stars
377disappear from the front of the mode line. At this time, all the 361disappear from the front of the mode line. At this time, all the
@@ -386,15 +370,20 @@ will see whether it was an intentional change. If it was an accident,
386leave it undone. If it was deliberate, redo the change as described 370leave it undone. If it was deliberate, redo the change as described
387above. 371above.
388 372
389 Not all buffers record undo information. Buffers whose names start with 373 Normal undo applies to the buffer as a whole. You can also
390spaces don't; these buffers are used internally by Emacs and its extensions 374selectively undo changes in any part of the buffer (@pxref{Selective
391to hold text that users don't normally look at or edit. 375Undo}).
376
377 Some specialized buffers do not record undo information. Buffers
378whose names start with spaces never do; these buffers are used
379internally by Emacs and its extensions to hold text that users don't
380normally look at or edit.
392 381
393 You cannot undo mere cursor motion; only changes in the buffer 382 The undo command applies only to changes in the buffer; you can't
394contents save undo information. However, some cursor motion commands 383use it to undo mere cursor motion. However, some cursor motion
395set the mark, so if you use these commands from time to time, you can 384commands set the mark, so if you use these commands from time to time,
396move back to the neighborhoods you have moved through by popping the 385you can move back to the neighborhoods you have moved through by
397mark ring (@pxref{Mark Ring}). 386popping the mark ring (@pxref{Mark Ring}).
398 387
399@vindex undo-limit 388@vindex undo-limit
400@vindex undo-strong-limit 389@vindex undo-strong-limit
@@ -428,24 +417,26 @@ undo data, then it is probably a bug and you should report it.
428 The reason the @code{undo} command has three key bindings, @kbd{C-x 417 The reason the @code{undo} command has three key bindings, @kbd{C-x
429u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a 418u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a
430single-character key, but @kbd{C-x u} is more straightforward for 419single-character key, but @kbd{C-x u} is more straightforward for
431beginners to type. 420beginners to type. Meanwhile, @kbd{C--} on a text-only terminal is
421really @kbd{C-_}, which makes it a natural and easily typed binding
422for undoing.
432 423
433@node Basic Files 424@node Basic Files
434@section Files 425@section Files
435 426
436 The commands described above are sufficient for creating and altering 427 The commands described above are sufficient for creating and altering
437text in an Emacs buffer; the more advanced Emacs commands just make 428text in an Emacs buffer; the more advanced Emacs commands just make
438things easier. But to keep any text permanently you must put it in a 429things easier. However, to keep any text permanently you must put it in a
439@dfn{file}. Files are named units of text which are stored by the 430@dfn{file}. Files are named units of text which are stored by the
440operating system for you to retrieve later by name. To look at or use 431operating system for you to retrieve later by name. To look at or use
441the contents of a file in any way, including editing the file with 432the contents of a file in any way, including editing the file with
442Emacs, you must specify the file name. 433Emacs, you must specify the file name.
443 434
444 Consider a file named @file{/usr/rms/foo.c}. In Emacs, to begin editing 435 Consider a file named @file{test.emacs}. (We can assume it is in
445this file, type 436your home directory.) In Emacs, to begin editing this file, type
446 437
447@example 438@example
448C-x C-f /usr/rms/foo.c @key{RET} 439C-x C-f test.emacs @key{RET}
449@end example 440@end example
450 441
451@noindent 442@noindent
@@ -459,8 +450,8 @@ copying the contents of the file into the buffer, and then displaying
459the buffer for you to edit. If you alter the text, you can @dfn{save} 450the buffer for you to edit. If you alter the text, you can @dfn{save}
460the new text in the file by typing @kbd{C-x C-s} (@code{save-buffer}). 451the new text in the file by typing @kbd{C-x C-s} (@code{save-buffer}).
461This makes the changes permanent by copying the altered buffer contents 452This makes the changes permanent by copying the altered buffer contents
462back into the file @file{/usr/rms/foo.c}. Until you save, the changes 453back into the file @file{test.emacs}. Until you save, the changes
463exist only inside Emacs, and the file @file{foo.c} is unaltered. 454exist only inside Emacs, and the file @file{test.emacs} is unaltered.
464 455
465 To create a file, just visit the file with @kbd{C-x C-f} as if it 456 To create a file, just visit the file with @kbd{C-x C-f} as if it
466already existed. This creates an empty buffer in which you can insert 457already existed. This creates an empty buffer in which you can insert
@@ -777,15 +768,14 @@ holding down modifier keys; @kbd{C-u} works on all terminals. To type a
777negative argument, type a minus sign after @kbd{C-u}. Just a minus sign 768negative argument, type a minus sign after @kbd{C-u}. Just a minus sign
778without digits normally means @minus{}1. 769without digits normally means @minus{}1.
779 770
780 @kbd{C-u} followed by a character which is neither a digit nor a minus 771 @kbd{C-u} without digits or minus sign has the special meaning of
781sign has the special meaning of ``multiply by four.'' It multiplies the 772``four times'': it multiplies the argument for the next command by
782argument for the next command by four. @kbd{C-u} twice multiplies it by 773four. @kbd{C-u C-u} multiplies it by sixteen. Thus, @kbd{C-u C-u
783sixteen. Thus, @kbd{C-u C-u C-f} moves forward sixteen characters. This 774C-f} moves forward sixteen characters. This is a good way to move
784is a good way to move forward ``fast,'' since it moves about 1/5 of a line 775forward ``fast,'' since it moves about 1/5 of a line in the usual size
785in the usual size screen. Other useful combinations are @kbd{C-u C-n}, 776screen. Other useful combinations are @kbd{C-u C-n}, @kbd{C-u C-u
786@kbd{C-u C-u C-n} (move down a good fraction of a screen), @kbd{C-u C-u 777C-n} (move down a good fraction of a screen), @kbd{C-u C-u C-o} (make
787C-o} (make ``a lot'' of blank lines), and @kbd{C-u C-k} (kill four 778``a lot'' of blank lines), and @kbd{C-u C-k} (kill four lines).@refill
788lines).@refill
789 779
790 Some commands care only about whether there is an argument, and not about 780 Some commands care only about whether there is an argument, and not about
791its value. For example, the command @kbd{M-q} (@code{fill-paragraph}) with 781its value. For example, the command @kbd{M-q} (@code{fill-paragraph}) with