aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-12-23 12:46:55 +0200
committerEli Zaretskii2023-12-23 12:46:55 +0200
commit44be4e92eca68ec4498c424573f0505aca69d39c (patch)
treef2aecfe72fd82eb6464e620fbd9f66d5b4ad7b59
parente69fafdbc8893a0456535605082c7d7c469fdabd (diff)
downloademacs-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.texi9
-rw-r--r--lisp/register.el11
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
65existing registers in this mode, you need to type @key{RET} after 65existing registers in this mode, you need to type @key{RET} after
66selecting the register by navigation or typing its name. 66selecting the register by navigation or typing its name.
67 67
68In addition, the registers shown by the preview are filtered according
69to the command that popped the preview: for example, the preview shown
70by @code{insert-register} will only show registers whose values can be
71inserted into the buffer, omitting registers which hold window
72configurations, positions, and other un-insertable values.
73
68@item nil 74@item nil
69This value requests behavior similar to @code{traditional}, but the 75This value requests behavior similar to @code{traditional}, but the
70preview is shown without delay. 76preview is shown without delay, and is filtered according to the
77command.
71 78
72@item never 79@item never
73This value is like @code{nil}, but it disables the preview. 80This 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
138all; the preview buffer is still accessible with `help-char' (C-h). 138all; the preview buffer is still accessible with `help-char' (C-h).
139When set to \\='traditional (the default), provide a more basic preview 139When set to \\='traditional (the default), provide a more basic preview
140according to `register-preview-delay'; this preserves the traditional 140according to `register-preview-delay'; this preserves the traditional
141behavior of Emacs 29 and before. 141behavior of Emacs 29 and before."
142
143This has no effect when the value of `register--read-with-preview-function'
144is `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.")
196This 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.
207MSG is the minibuffer message to show when a register is selected. 203MSG is the minibuffer message to show when a register is selected.
208ACT is the type of action the command is doing on register. 204ACT is the type of action the command is doing on register.
209SMATCH accept a boolean value to say if the command accepts non-matching 205SMATCH accept a boolean value to say if the command accepts non-matching
210registers." 206registers.
207If 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)