]> code.delx.au - gnu-emacs/blobdiff - doc/emacs/regs.texi
Update copyright year to 2015
[gnu-emacs] / doc / emacs / regs.texi
index 72fd6458dde189ad137b400a720df8f6b26297d6..dc53c3b524838a5fa38cd42fea4cc08eedad11af 100644 (file)
@@ -1,6 +1,6 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2012
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2015 Free Software
+@c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Registers
 @chapter Registers
@@ -29,6 +29,15 @@ you store something else in that register.  To see what register
 Display a description of what register @var{r} contains.
 @end table
 
+@vindex register-preview-delay
+@cindex preview of registers
+  All of the commands that prompt for a register will display a
+``preview'' window that lists the existing registers (if there are
+any) after a short delay.  To change the length of the delay,
+customize @code{register-preview-delay}.  To prevent this display, set
+that option to @code{nil}.  You can explicitly request a preview
+window by pressing @kbd{C-h} or @key{F1}.
+
   @dfn{Bookmarks} record files and positions in them, so you can
 return to those positions when you look at the file again.  Bookmarks
 are similar in spirit to registers, so they are also documented in
@@ -41,6 +50,7 @@ this chapter.
 * Configuration Registers::  Saving window configurations in registers.
 * Number Registers::         Numbers in registers.
 * File Registers::           File names in registers.
+* Keyboard Macro Registers:: Keyboard macros in registers.
 * Bookmarks::                Bookmarks are like registers, but persistent.
 @end menu
 
@@ -92,6 +102,13 @@ Copy region into register @var{r} (@code{copy-to-register}).
 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}.
+
+@kindex C-x r +
+When register @var{r} contains text, you can use @kbd{C-x r +}
+(@code{increment-register}) to append to that register.  Note that
+command @kbd{C-x r +} behaves differently if @var{r} contains a
+number.  @xref{Number Registers}.
+
 @item M-x prepend-to-register @key{RET} @var{r}
 Prepend region to text in register @var{r}.
 @end table
@@ -116,12 +133,25 @@ region after appending it to the register.  The command
 the region text to the text in the register instead of
 @emph{appending} it.
 
+@vindex register-separator
+  When you are collecting text using @code{append-to-register} and
+@code{prepend-to-register}, you may want to separate individual
+collected pieces using a separator.  In that case, configure a
+@code{register-separator} and store the separator text in to that
+register.  For example, to get double newlines as text separator
+during the collection process, you can use the following setting.
+
+@example
+(setq register-separator ?+)
+(set-register register-separator "\n\n")
+@end example
+
 @kindex C-x r i
 @findex insert-register
   @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 sets the mark
-after, without activating it.  With a numeric argument, it instead
-puts point after the text and the mark before.
+@var{r}.  Normally it leaves point after the text and sets the mark
+before, without activating it.  With a numeric argument, it instead
+puts before after the text and the mark after.
 
 @node Rectangle Registers
 @section Saving Rectangles in Registers
@@ -152,7 +182,7 @@ rather than a text string, if the register contains a rectangle.
 @cindex saving window configuration in a register
 
 @findex window-configuration-to-register
-@findex frame-configuration-to-register
+@findex frameset-to-register
 @kindex C-x r w
 @kindex C-x r f
   You can save the window configuration of the selected frame in a
@@ -166,7 +196,7 @@ Save the state of the selected frame's windows in register @var{r}
 (@code{window-configuration-to-register}).
 @item C-x r f @var{r}
 Save the state of all frames, including all their windows, in register
-@var{r} (@code{frame-configuration-to-register}).
+@var{r} (@code{frameset-to-register}).
 @end table
 
   Use @kbd{C-x r j @var{r}} to restore a window or frame configuration.
@@ -191,8 +221,10 @@ 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{r} by @var{number}
-(@code{increment-register}).
+If @var{r} contains a number, increment the number in that register by
+@var{number}.  Note that command @kbd{C-x r +}
+(@code{increment-register}) behaves differently if @var{r} contains
+text.  @xref{Text Registers}.
 @item C-x r i @var{r}
 Insert the number from register @var{r} into the buffer.
 @end table
@@ -208,10 +240,10 @@ numeric argument stores zero in the 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
-used to put a file name in a register:
+used to put a file @var{name} into register @var{r}:
 
 @smallexample
-(set-register ?@var{r} '(file . @var{name}))
+(set-register @var{r} '(file . @var{name}))
 @end smallexample
 
 @need 3000
@@ -229,6 +261,23 @@ puts the file name shown in register @samp{z}.
 @var{r}}.  (This is the same command used to jump to a position or
 restore a frame configuration.)
 
+@node Keyboard Macro Registers
+@section Keyboard Macro Registers
+@cindex saving keyboard macro in a register
+@cindex keyboard macros, in registers
+
+@kindex C-x C-k x
+@findex kmacro-to-register
+  If you need to execute a keyboard macro (@pxref{Keyboard Macros})
+frequently, it is more convenient to put it in a register or save it
+(@pxref{Save Keyboard Macro}).  @kbd{C-x C-k x @var{r}}
+(@code{kmacro-to-register}) stores the last keyboard macro in register
+@var{r}.
+
+  To execute the keyboard macro in register @var{r}, type @kbd{C-x r j
+@var{r}}.  (This is the same command used to jump to a position or
+restore a frameset.)
+
 @node Bookmarks
 @section Bookmarks
 @cindex bookmarks
@@ -295,6 +344,10 @@ a number, says how many bookmark modifications should go by between
 saving.  If you set this variable to @code{nil}, Emacs only
 saves bookmarks if you explicitly use @kbd{M-x bookmark-save}.
 
+@vindex bookmark-default-file
+  The variable @code{bookmark-default-file} specifies the file in
+which to save bookmarks by default.
+
 @vindex bookmark-search-size
   Bookmark position values are saved with surrounding context, so that
 @code{bookmark-jump} can find the proper position even if the file is