diff options
| author | Eli Zaretskii | 2023-06-30 10:13:53 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-06-30 10:13:53 +0300 |
| commit | 16e9bdff4f47534d62ac9ebec9c6c49fe5a0e180 (patch) | |
| tree | 20feccb5b0f5e95bbd52559a313042ad5046a8e4 | |
| parent | 884b668b98152a0df0bc0bdea49137f582faa005 (diff) | |
| download | emacs-16e9bdff4f47534d62ac9ebec9c6c49fe5a0e180.tar.gz emacs-16e9bdff4f47534d62ac9ebec9c6c49fe5a0e180.zip | |
Improve documentation of registers
* doc/lispref/text.texi (Registers): Document buffers in
registers. Mention "frameset" as another name for "frame
configuration".
* doc/emacs/regs.texi (Registers, Configuration Registers)
(File and Buffer Registers): Clarify and improve wording. Add
cross-references and indexing.
(Configuration Registers): Rename the section to a more accurate
name. (Bug#64354)
* lisp/register.el (jump-to-register, point-to-register)
(register-alist, frame-configuration-to-register): Doc fixes.
(Bug#64353)
| -rw-r--r-- | doc/emacs/emacs.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/regs.texi | 29 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 13 | ||||
| -rw-r--r-- | lisp/register.el | 14 |
4 files changed, 37 insertions, 21 deletions
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 7071ea44edd..0efd99261ac 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -349,7 +349,7 @@ Registers | |||
| 349 | * Position Registers:: Saving positions in registers. | 349 | * Position Registers:: Saving positions in registers. |
| 350 | * Text Registers:: Saving text in registers. | 350 | * Text Registers:: Saving text in registers. |
| 351 | * Rectangle Registers:: Saving rectangles in registers. | 351 | * Rectangle Registers:: Saving rectangles in registers. |
| 352 | * Configuration Registers:: Saving window configurations in registers. | 352 | * Configuration Registers:: Saving window/frame configurations in registers. |
| 353 | * Number Registers:: Numbers in registers. | 353 | * Number Registers:: Numbers in registers. |
| 354 | * File and Buffer Registers:: File and buffer names in registers. | 354 | * File and Buffer Registers:: File and buffer names in registers. |
| 355 | * Keyboard Macro Registers:: Keyboard macros in registers. | 355 | * Keyboard Macro Registers:: Keyboard macros in registers. |
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi index ec2367d71e3..2bc4640cbf4 100644 --- a/doc/emacs/regs.texi +++ b/doc/emacs/regs.texi | |||
| @@ -22,10 +22,11 @@ because these keys are reserved for quitting (@pxref{Quitting}). | |||
| 22 | 22 | ||
| 23 | @findex view-register | 23 | @findex view-register |
| 24 | A register can store a position, a piece of text, a rectangle, a | 24 | A register can store a position, a piece of text, a rectangle, a |
| 25 | number, a window configuration, or a file name, but only one thing at | 25 | number, a window or frame configuration, a buffer name, or a file |
| 26 | any given time. Whatever you store in a register remains there until | 26 | name, but only one thing at any given time. Whatever you store in a |
| 27 | you store something else in that register. To see what register | 27 | register remains there until you store something else in that |
| 28 | @var{r} contains, use @kbd{M-x view-register}: | 28 | register. To see what register @var{r} contains, use @kbd{M-x |
| 29 | view-register}: | ||
| 29 | 30 | ||
| 30 | @table @kbd | 31 | @table @kbd |
| 31 | @item M-x view-register @key{RET} @var{r} | 32 | @item M-x view-register @key{RET} @var{r} |
| @@ -50,7 +51,7 @@ this chapter. | |||
| 50 | * Position Registers:: Saving positions in registers. | 51 | * Position Registers:: Saving positions in registers. |
| 51 | * Text Registers:: Saving text in registers. | 52 | * Text Registers:: Saving text in registers. |
| 52 | * Rectangle Registers:: Saving rectangles in registers. | 53 | * Rectangle Registers:: Saving rectangles in registers. |
| 53 | * Configuration Registers:: Saving window configurations in registers. | 54 | * Configuration Registers:: Saving window/frame configurations in registers. |
| 54 | * Number Registers:: Numbers in registers. | 55 | * Number Registers:: Numbers in registers. |
| 55 | * File and Buffer Registers:: File and buffer names in registers. | 56 | * File and Buffer Registers:: File and buffer names in registers. |
| 56 | * Keyboard Macro Registers:: Keyboard macros in registers. | 57 | * Keyboard Macro Registers:: Keyboard macros in registers. |
| @@ -182,8 +183,10 @@ previously documented in @ref{Text Registers}, inserts a rectangle | |||
| 182 | rather than a text string, if the register contains a rectangle. | 183 | rather than a text string, if the register contains a rectangle. |
| 183 | 184 | ||
| 184 | @node Configuration Registers | 185 | @node Configuration Registers |
| 185 | @section Saving Window Configurations in Registers | 186 | @section Saving Window and Frame Configurations in Registers |
| 186 | @cindex saving window configuration in a register | 187 | @cindex saving window configuration in a register |
| 188 | @cindex saving frame configuration in a register | ||
| 189 | @cindex frameset, saving in a register | ||
| 187 | 190 | ||
| 188 | @findex window-configuration-to-register | 191 | @findex window-configuration-to-register |
| 189 | @findex frameset-to-register | 192 | @findex frameset-to-register |
| @@ -191,16 +194,17 @@ rather than a text string, if the register contains a rectangle. | |||
| 191 | @kindex C-x r f | 194 | @kindex C-x r f |
| 192 | You can save the window configuration of the selected frame in a | 195 | You can save the window configuration of the selected frame in a |
| 193 | register, or even the configuration of all windows in all frames, and | 196 | register, or even the configuration of all windows in all frames, and |
| 194 | restore the configuration later. @xref{Windows}, for information | 197 | restore the configuration later. @xref{Windows Convenience}, for |
| 195 | about window configurations. | 198 | information about window configurations. |
| 196 | 199 | ||
| 197 | @table @kbd | 200 | @table @kbd |
| 198 | @item C-x r w @var{r} | 201 | @item C-x r w @var{r} |
| 199 | Save the state of the selected frame's windows in register @var{r} | 202 | Save the state of the selected frame's windows in register @var{r} |
| 200 | (@code{window-configuration-to-register}). | 203 | (@code{window-configuration-to-register}). |
| 204 | @cindex frameset | ||
| 201 | @item C-x r f @var{r} | 205 | @item C-x r f @var{r} |
| 202 | Save the state of all frames, including all their windows, in register | 206 | Save the state of all frames, including all their windows (a.k.a.@: |
| 203 | @var{r} (@code{frameset-to-register}). | 207 | @dfn{frameset}), in register @var{r} (@code{frameset-to-register}). |
| 204 | @end table | 208 | @end table |
| 205 | 209 | ||
| 206 | Use @kbd{C-x r j @var{r}} to restore a window or frame configuration. | 210 | Use @kbd{C-x r j @var{r}} to restore a window or frame configuration. |
| @@ -266,7 +270,7 @@ puts the file name shown in register @samp{z}. | |||
| 266 | @var{r}}. (This is the same command used to jump to a position or | 270 | @var{r}}. (This is the same command used to jump to a position or |
| 267 | restore a frame configuration.) | 271 | restore a frame configuration.) |
| 268 | 272 | ||
| 269 | Similarly, if there's certain buffers you visit frequently, you | 273 | Similarly, if there are certain buffers you visit frequently, you |
| 270 | can put their names in registers. For instance, if you visit the | 274 | can put their names in registers. For instance, if you visit the |
| 271 | @samp{*Messages*} buffer often, you can use the following snippet to | 275 | @samp{*Messages*} buffer often, you can use the following snippet to |
| 272 | put that buffer into the @samp{m} register: | 276 | put that buffer into the @samp{m} register: |
| @@ -275,6 +279,9 @@ put that buffer into the @samp{m} register: | |||
| 275 | (set-register ?m '(buffer . "*Messages*")) | 279 | (set-register ?m '(buffer . "*Messages*")) |
| 276 | @end smallexample | 280 | @end smallexample |
| 277 | 281 | ||
| 282 | To switch to the buffer whose name is in register @var{r}, type | ||
| 283 | @kbd{C-x r j @var{r}}. | ||
| 284 | |||
| 278 | @node Keyboard Macro Registers | 285 | @node Keyboard Macro Registers |
| 279 | @section Keyboard Macro Registers | 286 | @section Keyboard Macro Registers |
| 280 | @cindex saving keyboard macro in a register | 287 | @cindex saving keyboard macro in a register |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 0f43f3d464a..af6d6638b36 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -4642,20 +4642,25 @@ A rectangle is represented by a list of strings. | |||
| 4642 | This represents a window configuration to restore in one frame, and a | 4642 | This represents a window configuration to restore in one frame, and a |
| 4643 | position to jump to in the current buffer. | 4643 | position to jump to in the current buffer. |
| 4644 | 4644 | ||
| 4645 | @c FIXME: Mention frameset here. | 4645 | @cindex frameset |
| 4646 | @item @code{(@var{frame-configuration} @var{position})} | 4646 | @item @code{(@var{frame-configuration} @var{position})} |
| 4647 | This represents a frame configuration to restore, and a position | 4647 | This represents a frame configuration to restore, and a position |
| 4648 | to jump to in the current buffer. | 4648 | to jump to in the current buffer. Frame configurations are also |
| 4649 | known as @dfn{framesets}. | ||
| 4649 | 4650 | ||
| 4650 | @item (file @var{filename}) | 4651 | @item @code{(file @var{filename})} |
| 4651 | This represents a file to visit; jumping to this value visits file | 4652 | This represents a file to visit; jumping to this value visits file |
| 4652 | @var{filename}. | 4653 | @var{filename}. |
| 4653 | 4654 | ||
| 4654 | @item (file-query @var{filename} @var{position}) | 4655 | @item @code{(file-query @var{filename} @var{position})} |
| 4655 | This represents a file to visit and a position in it; jumping to this | 4656 | This represents a file to visit and a position in it; jumping to this |
| 4656 | value visits file @var{filename} and goes to buffer position | 4657 | value visits file @var{filename} and goes to buffer position |
| 4657 | @var{position}. Restoring this type of position asks the user for | 4658 | @var{position}. Restoring this type of position asks the user for |
| 4658 | confirmation first. | 4659 | confirmation first. |
| 4660 | |||
| 4661 | @item @code{(buffer @var{buffer-name})} | ||
| 4662 | This represents a buffer; jumping to this value switches to buffer | ||
| 4663 | @var{buffer-name}. | ||
| 4659 | @end table | 4664 | @end table |
| 4660 | 4665 | ||
| 4661 | The functions in this section return unpredictable values unless | 4666 | The functions in this section return unpredictable values unless |
diff --git a/lisp/register.el b/lisp/register.el index d30114bfbc7..667e03418bd 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -69,10 +69,12 @@ A list of the form (file . FILE-NAME) represents the file named FILE-NAME. | |||
| 69 | A list of the form (file-query FILE-NAME POSITION) represents | 69 | A list of the form (file-query FILE-NAME POSITION) represents |
| 70 | position POSITION in the file named FILE-NAME, but query before | 70 | position POSITION in the file named FILE-NAME, but query before |
| 71 | visiting it. | 71 | visiting it. |
| 72 | A list of the form (buffer . BUFFER-NAME) represents the buffer BUFFER-NAME. | ||
| 72 | A list of the form (WINDOW-CONFIGURATION POSITION) | 73 | A list of the form (WINDOW-CONFIGURATION POSITION) |
| 73 | represents a saved window configuration plus a saved value of point. | 74 | represents a saved window configuration plus a saved value of point. |
| 74 | A list of the form (FRAME-CONFIGURATION POSITION) | 75 | A list of the form (FRAME-CONFIGURATION POSITION) |
| 75 | represents a saved frame configuration plus a saved value of point.") | 76 | represents a saved frame configuration (a.k.a. \"frameset\") plus |
| 77 | a saved value of point.") | ||
| 76 | 78 | ||
| 77 | (defgroup register nil | 79 | (defgroup register nil |
| 78 | "Register commands." | 80 | "Register commands." |
| @@ -179,7 +181,7 @@ display such a window regardless." | |||
| 179 | 181 | ||
| 180 | (defun point-to-register (register &optional arg) | 182 | (defun point-to-register (register &optional arg) |
| 181 | "Store current location of point in register REGISTER. | 183 | "Store current location of point in register REGISTER. |
| 182 | With prefix argument, store current frame configuration. | 184 | With prefix argument, store current frame configuration (a.k.a. \"frameset\"). |
| 183 | Use \\[jump-to-register] to go to that location or restore that configuration. | 185 | Use \\[jump-to-register] to go to that location or restore that configuration. |
| 184 | Argument is a character, naming the register. | 186 | Argument is a character, naming the register. |
| 185 | 187 | ||
| @@ -214,6 +216,7 @@ Interactively, reads the register using `register-read-with-preview'." | |||
| 214 | 216 | ||
| 215 | (defun frame-configuration-to-register (register &optional _arg) | 217 | (defun frame-configuration-to-register (register &optional _arg) |
| 216 | "Store the window configuration of all frames in register REGISTER. | 218 | "Store the window configuration of all frames in register REGISTER. |
| 219 | \(This window configuration is also known as \"frameset\"). | ||
| 217 | Use \\[jump-to-register] to restore the configuration. | 220 | Use \\[jump-to-register] to restore the configuration. |
| 218 | Argument is a character, naming the register. | 221 | Argument is a character, naming the register. |
| 219 | 222 | ||
| @@ -240,9 +243,10 @@ If the register contains a file name, find that file. | |||
| 240 | If the register contains a window configuration (one frame) or a frameset | 243 | If the register contains a window configuration (one frame) or a frameset |
| 241 | \(all frames), restore that frame or all frames accordingly. | 244 | \(all frames), restore that frame or all frames accordingly. |
| 242 | First argument is a character, naming the register. | 245 | First argument is a character, naming the register. |
| 243 | Optional second arg non-nil (interactively, prefix argument) says to | 246 | Optional second arg DELETE non-nil (interactively, prefix argument) says |
| 244 | delete any existing frames that the frameset doesn't mention. | 247 | to delete any existing frames that the frameset doesn't mention. |
| 245 | \(Otherwise, these frames are iconified.) | 248 | \(Otherwise, these frames are iconified.) This argument is currently |
| 249 | ignored if the register contains anything but a frameset. | ||
| 246 | 250 | ||
| 247 | Interactively, reads the register using `register-read-with-preview'." | 251 | Interactively, reads the register using `register-read-with-preview'." |
| 248 | (interactive (list (register-read-with-preview "Jump to register: ") | 252 | (interactive (list (register-read-with-preview "Jump to register: ") |