diff options
| author | Eli Zaretskii | 2023-12-23 12:46:55 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-12-23 12:46:55 +0200 |
| commit | 44be4e92eca68ec4498c424573f0505aca69d39c (patch) | |
| tree | f2aecfe72fd82eb6464e620fbd9f66d5b4ad7b59 | |
| parent | e69fafdbc8893a0456535605082c7d7c469fdabd (diff) | |
| download | emacs-44be4e92eca68ec4498c424573f0505aca69d39c.tar.gz emacs-44be4e92eca68ec4498c424573f0505aca69d39c.zip | |
; Improve and correct documentation of registers (bug#66394)
Suggested by Thierry Volpiatto <thievol@posteo.net>.
* doc/emacs/regs.texi (Registers): Mention filtering of registers
in the preview.
* lisp/register.el (register-use-preview)
(register--preview-function, register-preview-info): Doc fixes.
| -rw-r--r-- | doc/emacs/regs.texi | 9 | ||||
| -rw-r--r-- | lisp/register.el | 11 |
2 files changed, 12 insertions, 8 deletions
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi index d7542e996dc..988e606741f 100644 --- a/doc/emacs/regs.texi +++ b/doc/emacs/regs.texi | |||
| @@ -65,9 +65,16 @@ the registers in the preview window. To overwrite the value of an | |||
| 65 | existing registers in this mode, you need to type @key{RET} after | 65 | existing registers in this mode, you need to type @key{RET} after |
| 66 | selecting the register by navigation or typing its name. | 66 | selecting the register by navigation or typing its name. |
| 67 | 67 | ||
| 68 | In addition, the registers shown by the preview are filtered according | ||
| 69 | to the command that popped the preview: for example, the preview shown | ||
| 70 | by @code{insert-register} will only show registers whose values can be | ||
| 71 | inserted into the buffer, omitting registers which hold window | ||
| 72 | configurations, positions, and other un-insertable values. | ||
| 73 | |||
| 68 | @item nil | 74 | @item nil |
| 69 | This value requests behavior similar to @code{traditional}, but the | 75 | This value requests behavior similar to @code{traditional}, but the |
| 70 | preview is shown without delay. | 76 | preview is shown without delay, and is filtered according to the |
| 77 | command. | ||
| 71 | 78 | ||
| 72 | @item never | 79 | @item never |
| 73 | This value is like @code{nil}, but it disables the preview. | 80 | This value is like @code{nil}, but it disables the preview. |
diff --git a/lisp/register.el b/lisp/register.el index bd8e8c2edcd..d1d55dff660 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -138,10 +138,7 @@ When set to \\='never, behave as with nil, but with no preview buffer at | |||
| 138 | all; the preview buffer is still accessible with `help-char' (C-h). | 138 | all; the preview buffer is still accessible with `help-char' (C-h). |
| 139 | When set to \\='traditional (the default), provide a more basic preview | 139 | When set to \\='traditional (the default), provide a more basic preview |
| 140 | according to `register-preview-delay'; this preserves the traditional | 140 | according to `register-preview-delay'; this preserves the traditional |
| 141 | behavior of Emacs 29 and before. | 141 | behavior of Emacs 29 and before." |
| 142 | |||
| 143 | This has no effect when the value of `register--read-with-preview-function' | ||
| 144 | is `register-read-with-preview-traditional'." | ||
| 145 | :type '(choice | 142 | :type '(choice |
| 146 | (const :tag "Use preview" t) | 143 | (const :tag "Use preview" t) |
| 147 | (const :tag "Use quick preview" nil) | 144 | (const :tag "Use quick preview" nil) |
| @@ -192,8 +189,7 @@ and is used when `register-use-preview' is set to \\='traditional." | |||
| 192 | (register-describe-oneline (car r)))) | 189 | (register-describe-oneline (car r)))) |
| 193 | 190 | ||
| 194 | (cl-defgeneric register--preview-function (read-preview-function) | 191 | (cl-defgeneric register--preview-function (read-preview-function) |
| 195 | "Return a function to format a register for previewing. | 192 | "Return a function to format registers for previewing by READ-PREVIEW-FUNCTION.") |
| 196 | This is according to the value of `read-preview-function'.") | ||
| 197 | (cl-defmethod register--preview-function ((_read-preview-function | 193 | (cl-defmethod register--preview-function ((_read-preview-function |
| 198 | (eql register-read-with-preview-traditional))) | 194 | (eql register-read-with-preview-traditional))) |
| 199 | #'register-preview-default) | 195 | #'register-preview-default) |
| @@ -207,7 +203,8 @@ TYPES are the supported types of registers. | |||
| 207 | MSG is the minibuffer message to show when a register is selected. | 203 | MSG is the minibuffer message to show when a register is selected. |
| 208 | ACT is the type of action the command is doing on register. | 204 | ACT is the type of action the command is doing on register. |
| 209 | SMATCH accept a boolean value to say if the command accepts non-matching | 205 | SMATCH accept a boolean value to say if the command accepts non-matching |
| 210 | registers." | 206 | registers. |
| 207 | If NOCONFIRM is non-nil, request confirmation of register name by RET." | ||
| 211 | types msg act smatch noconfirm) | 208 | types msg act smatch noconfirm) |
| 212 | 209 | ||
| 213 | (cl-defgeneric register-command-info (command) | 210 | (cl-defgeneric register-command-info (command) |