inserted into the buffer, omitting registers which hold window
configurations, positions, and other un-insertable values.
+@item insist
+This value is like @code{t}, but in addition of pressing @key{RET} to
+exit with the choosen value, you can press the same key as the name of
+register.
+
@item nil
This value requests behavior similar to @code{traditional}, but the
preview is shown without delay, and is filtered according to the
+++
*** New mode of prompting for register names and showing preview.
The new user option 'register-use-preview' can be customized to the
-value t to request a different user interface of prompting for
+value t or insist to request a different user interface of prompting for
register names and previewing the registers: Emacs will require
confirmation for overwriting the value of a register, and will show
the preview of registers without delay. You can also customize this
(defcustom register-use-preview 'traditional
"Whether to show register preview when modifying registers.
-When set to `t', show a preview buffer with navigation and highlighting.
+When set to `t', show a preview buffer with navigation and
+highlighting.
+When set to \\='insist behave as with `t' but allow exiting minibuffer
+by pressing a second time the selected register, e.g pressing \"a\"
+select register \"a\" and pressing again \"a\" exit minibuffer.
When nil, show a preview buffer without navigation and highlighting, and
exit the minibuffer immediately after inserting response in minibuffer.
When set to \\='never, behave as with nil, but with no preview buffer at
behavior of Emacs 29 and before."
:type '(choice
(const :tag "Use preview" t)
+ (const :tag "Use preview and exit on second hit" insist)
(const :tag "Use quick preview" nil)
(const :tag "Never use preview" never)
(const :tag "Basic preview like Emacs-29" traditional))
(member new strs))
new old))
(delete-minibuffer-contents)
- (insert input)))
+ (insert input)
+ ;; Exit minibuffer on second hit
+ ;; when *-use-preview == insist.
+ (when (and (string= new old)
+ (eq register-use-preview 'insist))
+ (setq noconfirm t))))
(when (and smatch (not (string= input ""))
(not (member input strs)))
(setq input "")
(setq pat input))))
(if (setq win (get-buffer-window buffer))
(with-selected-window win
+ (when noconfirm
+ ;; Happen only when
+ ;; *-use-preview == insist.
+ (exit-minibuffer))
(let ((ov (make-overlay
(point-min) (point-min)))
;; Allow upper-case and lower-case letters