]> code.delx.au - gnu-emacs/blobdiff - man/regs.texi
(Shell Commands in Dired): Delete the ? example.
[gnu-emacs] / man / regs.texi
index 8c51c6035956544fd17b1b0d96a01823f689ff7e..7268dd7244616c15c291ab5d512165229f2c4c9f 100644 (file)
@@ -5,13 +5,15 @@
 @chapter Registers
 @cindex registers
 
-  Emacs @dfn{registers} are places you can save text or positions for
-later use.  Once you save text or a rectangle in a register, you can
-copy it into the buffer once or many times; you can move point to a
-position saved in a register once or many times.
+  Emacs @dfn{registers} are compartments where you can save text,
+rectangles, positions, and other things for later use.  Once you save
+text or a rectangle in a register, you can copy it into the buffer
+once, or many times; you can move point to a position saved in a
+register once, or many times.
 
 @findex view-register
-  Each register has a name which is a single character.  A register can
+  Each register has a name, which consists of a single character.
+A register can
 store a piece of text, a rectangle, a position, a window configuration,
 or a file name, but only one thing at any given time.  Whatever you
 store in a register remains there until you store something else in that
@@ -28,13 +30,14 @@ Display a description of what register @var{r} contains.
 * Text: RegText.              Saving text in registers.
 * Rectangle: RegRect.         Saving rectangles in registers.
 * Configurations: RegConfig.  Saving window configurations in registers.
-* Files: RegFiles.            File names in registers.
 * Numbers: RegNumbers.        Numbers in registers.
+* Files: RegFiles.            File names in registers.
 * Bookmarks::                 Bookmarks are like registers, but persistent.
 @end menu
 
 @node RegPos
 @section Saving Positions in Registers
+@cindex saving position in a register
 
   Saving a position records a place in a buffer so that you can move
 back there later.  Moving to a saved position switches to that buffer
@@ -58,7 +61,7 @@ register.
 @findex jump-to-register
   The command @kbd{C-x r j @var{r}} moves point to the position recorded
 in register @var{r}.  The register is not affected; it continues to
-record the same position.  You can jump to the saved position any number
+hold the same position.  You can jump to the saved position any number
 of times.
 
   If you use @kbd{C-x r j} to go to a saved position, but the buffer it
@@ -68,6 +71,7 @@ that were visiting files.
 
 @node RegText
 @section Saving Text in Registers
+@cindex saving text in a register
 
   When you want to insert a copy of the same piece of text several
 times, it may be inconvenient to yank it from the kill ring, since each
@@ -79,15 +83,30 @@ is to store the text in a register and later retrieve it.
 Copy region into register @var{r} (@code{copy-to-register}).
 @item C-x r i @var{r}
 Insert text from register @var{r} (@code{insert-register}).
+@item M-x append-to-register @key{RET} @var{r}
+Append region to text in register @var{r}.
+@item M-x prepend-to-register @key{RET} @var{r}
+Prepend region to text in register @var{r}.
 @end table
 
 @kindex C-x r s
 @kindex C-x r i
 @findex copy-to-register
 @findex insert-register
-  @kbd{C-x r s @var{r}} stores a copy of the text of the region into the
-register named @var{r}.  Given a numeric argument, @kbd{C-x r s @var{r}}
-deletes the text from the buffer as well.
+  @kbd{C-x r s @var{r}} stores a copy of the text of the region into
+the register named @var{r}.  @kbd{C-u C-x r s @var{r}}, the same
+command with a numeric argument, deletes the text from the buffer as
+well; you can think of this as ``moving'' the region text into the register.
+
+@findex append-to-register
+@findex prepend-to-register
+  @kbd{M-x append-to-register @key{RET} @var{r}} appends the copy of
+the text in the region to the text already stored in the register
+named @var{r}.  If invoked with a numeric argument, it deletes the
+region after appending it to the register.  The command
+@code{prepend-to-register} is similar, except that it @emph{prepends}
+the region text to the text in the register, rather than
+@emph{appending} it.
 
   @kbd{C-x r i @var{r}} inserts in the buffer the text from register
 @var{r}.  Normally it leaves point before the text and places the mark
@@ -96,6 +115,7 @@ text and the mark before.
 
 @node RegRect
 @section Saving Rectangles in Registers
+@cindex saving rectangle in a register
 
   A register can contain a rectangle instead of linear text.  The
 rectangle is represented as a list of strings.  @xref{Rectangles}, for
@@ -122,6 +142,7 @@ as sorting a rectangle.  @xref{Sorting}.
 
 @node RegConfig
 @section Saving Window Configurations in Registers
+@cindex saving window configuration in a register
 
 @findex window-configuration-to-register
 @findex frame-configuration-to-register
@@ -148,30 +169,34 @@ instead, use @kbd{C-u C-x r j @var{r}}.
 
 @node RegNumbers
 @section Keeping Numbers in Registers
+@cindex saving number in a register
 
   There are commands to store a number in a register, to insert
 the number in the buffer in decimal, and to increment it.  These commands
 can be useful in keyboard macros (@pxref{Keyboard Macros}).
 
 @table @kbd
-@item C-u @var{number} C-x r n @var{reg}
+@item C-u @var{number} C-x r n @var{r}
 @kindex C-x r n
 @findex number-to-register
-Store @var{number} into register @var{reg} (@code{number-to-register}).
-@item C-u @var{number} C-x r + @var{reg}
+Store @var{number} into register @var{r} (@code{number-to-register}).
+@item C-u @var{number} C-x r + @var{r}
 @kindex C-x r +
 @findex increment-register
-Increment the number in register @var{reg} by @var{number}
+Increment the number in register @var{r} by @var{number}
 (@code{increment-register}).
-@item C-x r g @var{reg}
-Insert the number from register @var{reg} into the buffer.
+@item C-x r i @var{r}
+Insert the number from register @var{r} into the buffer.
 @end table
 
-  @kbd{C-x r g} is the same command used to insert any other
-sort of register contents into the buffer.
+  @kbd{C-x r i} is the same command used to insert any other sort of
+register contents into the buffer.  @kbd{C-x r +} with no numeric
+argument increments the register value by 1; @kbd{C-x r n} with no
+numeric argument stores zero in the register.
 
 @node RegFiles
 @section Keeping File Names in Registers
+@cindex saving file name in a register
 
   If you visit certain file names frequently, you can visit them more
 conveniently if you put their names in registers.  Here's the Lisp code
@@ -242,8 +267,8 @@ to the position of the bookmark at the same time.
   To display a list of all your bookmarks in a separate buffer, type
 @kbd{C-x r l} (@code{list-bookmarks}).  If you switch to that buffer,
 you can use it to edit your bookmark definitions or annotate the
-bookmarks.  Type @kbd{C-h m} in that buffer for more information about
-its special editing commands.
+bookmarks.  Type @kbd{C-h m} in the bookmark buffer for more
+information about its special editing commands.
 
   When you kill Emacs, Emacs offers to save your bookmark values in your
 default bookmark file, @file{~/.emacs.bmk}, if you have changed any
@@ -263,7 +288,7 @@ saving.)
   Bookmark position values are saved with surrounding context, so that
 @code{bookmark-jump} can find the proper position even if the file is
 modified slightly.  The variable @code{bookmark-search-size} says how
-many characters of context to record, on each side of the bookmark's
+many characters of context to record on each side of the bookmark's
 position.
 
   Here are some additional commands for working with bookmarks:
@@ -294,3 +319,7 @@ points to.
 Insert in the buffer the @emph{contents} of the file that bookmark
 @var{bookmark} points to.
 @end table
+
+@ignore
+   arch-tag: b00af991-ebc3-4b3a-8e82-a3ac81ff2e64
+@end ignore