From 6c6524f70f93b88378c54be5bf4a7c21f422a8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barra=20=C3=93=20Cath=C3=A1in?= Date: Tue, 6 Feb 2024 22:01:14 +0000 Subject: [PATCH 3/3] Wrote documentation for new to register functions. * doc/emacs/regs.texi (File and Buffer Registers): Revised documentation to explain the new commands, rather than the set-register elisp. --- doc/emacs/regs.texi | 55 ++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi index cac5b32c566..9dce7557de2 100644 --- a/doc/emacs/regs.texi +++ b/doc/emacs/regs.texi @@ -289,41 +289,46 @@ File and Buffer Registers @section Keeping File and Buffer Names in Registers @cindex saving file name in a register @cindex saving buffer name in a register +@kindex C-x r F +@kindex C-x r B 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 @var{name} into register @var{r}: +conveniently if you put their names in registers. Here's how you can +put a file into a buffer. -@smallexample -(set-register @var{r} '(file . @var{name})) -@end smallexample - -@need 3000 -@noindent -For example, - -@smallexample -(set-register ?z '(file . "/gd/gnu/emacs/19.0/src/ChangeLog")) -@end smallexample - -@noindent -puts the file name shown in register @samp{z}. +@table @kbd +@item C-x r F @var{r} +@kindex C-x r F +@findex file-to-register +Store the currently visited file or directory into register @var{r} (@code{file-to-register}). +@item C-u C-x r F @var{r} +@kindex C-x r F +@findex file-to-register +Prompt for a file, and store into register @var{r} (@code{file-to-register}). +@end table To visit the file whose name is 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 frame configuration.) - Similarly, if there are certain buffers you visit frequently, you -can put their names in registers. For instance, if you visit the -@samp{*Messages*} buffer often, you can use the following snippet to -put that buffer into the @samp{m} register: + Similarly, if there are certain buffers you visit frequently, you can +put their names in registers. You can use the following command to put a +buffer into a register. -@smallexample -(set-register ?m '(buffer . "*Messages*")) -@end smallexample +@table @kbd +@item C-x r B @var{r} +@kindex C-x r B +@findex buffer-to-register +Store the current buffer into register @var{r} (@code{buffer-to-register}). +@item C-u C-x r B @var{r} +@kindex C-x r B +@findex buffer-to-register +Prompt for a buffer, and store into register @var{r} (@code{buffer-to-register}). +@end table - To switch to the buffer whose name is in register @var{r}, type -@kbd{C-x r j @var{r}}. + To visit the buffer whose name is 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 frame configuration.) @node Keyboard Macro Registers @section Keyboard Macro Registers -- 2.43.0