Rename the property 'repeat-continue-only' to 'repeat-continue'

* doc/lispref/keymaps.texi (Creating Keymaps):
* lisp/keymap.el (defvar-keymap):
* lisp/repeat.el (repeat-get-map, describe-repeat-maps):
* test/lisp/repeat-tests.el (repeat-tests-another-repeat-map)
(repeat-tests-repeat-map): Replace 'repeat-continue-only'
with 'repeat-continue' (bug#74140).
This commit is contained in:
Juri Linkov 2024-12-17 20:58:09 +02:00
parent f025c9df48
commit 69facd33a8
5 changed files with 25 additions and 25 deletions

View file

@ -481,7 +481,7 @@ This means all the commands in the keymap are repeatable, and is the
most common usage.
@item (:enter (commands ...) :exit (commands ...)
@itemx :continue-only (commands ...) :hints ((command . "hint") ...))
@itemx :continue (commands ...) :hints ((command . "hint") ...))
This specifies that the commands in the @code{:enter} list enter
@code{repeat-mode}, and the commands in the @code{:exit} list exit
repeat mode.
@ -496,7 +496,7 @@ If the @code{:exit} list is empty then no commands in the map exit
useful if the keymap being defined contains a command that should not
have the @code{repeat-map} property.
The @code{:continue-only'} list specifies the commands that should not
The @code{:continue} list specifies the commands that should not
enter @code{repeat-mode}. These command should only continue the
already activated repeating sequence.

View file

@ -1010,11 +1010,11 @@ widths can be determined. Columns widths can be set explicitly, or they
will be calculated based on the window width.
+++
** New symbol property 'repeat-continue-only' for 'repeat-mode'.
** New symbol property 'repeat-continue' for 'repeat-mode'.
A command with this symbol property whose value is a list of repeat
maps will not activate the repeat map in 'repeat-mode'. It will only
continue the already activated repeating sequence. Also 'defvar-keymap'
supports a new keyword ':continue-only' with a list of commands that
supports a new keyword ':continue' with a list of commands that
only continue the active repeating sequence.
** New function 'completion-table-with-metadata'.

View file

@ -687,7 +687,7 @@ value can also be a property list with properties `:enter',
`:exit' and `:hints', for example:
:repeat (:enter (commands ...) :exit (commands ...)
:continue-only (commands ...)
:continue (commands ...)
:hints ((command . \"hint\") ...))
`:enter' specifies the list of additional commands that only
@ -703,7 +703,7 @@ Specifying a list of commands is useful when those commands exist
in this specific map, but should not have the `repeat-map' symbol
property.
`:continue-only' specifies the list of commands that should not
`:continue' specifies the list of commands that should not
enter `repeat-mode'. These command should only continue the
already activated repeating sequence.
@ -745,9 +745,9 @@ in the echo area.
def)
(dolist (def (plist-get repeat :enter))
(push `(put ',def 'repeat-map ',variable-name) props))
(dolist (def (plist-get repeat :continue-only))
(push `(put ',def 'repeat-continue-only
(cons ',variable-name (get ',def 'repeat-continue-only)))
(dolist (def (plist-get repeat :continue))
(push `(put ',def 'repeat-continue
(cons ',variable-name (get ',def 'repeat-continue)))
props))
(while defs
(pop defs)

View file

@ -457,11 +457,11 @@ See `describe-repeat-maps' for a list of all repeatable commands."
"Return a transient map for keys repeatable after the current command."
(when repeat-mode
(let ((rep-map (or rep-map repeat-map (repeat--command-property 'repeat-map)))
(continue-only (repeat--command-property 'repeat-continue-only)))
(when continue-only
(continue (repeat--command-property 'repeat-continue)))
(when continue
(if repeat-in-progress
(when (and (consp continue-only)
(memq repeat-in-progress continue-only))
(when (and (consp continue)
(memq repeat-in-progress continue))
(setq rep-map repeat-in-progress))
(setq rep-map nil)))
(when rep-map
@ -661,7 +661,7 @@ Click on a keymap to see the commands repeatable by the keymap.\n")
(setq map-commands (seq-uniq map-commands))
(setq commands-continue
(seq-filter (lambda (s) (memq (car keymap)
(get s 'repeat-continue-only)))
(get s 'repeat-continue)))
map-commands))
(setq commands-enter
(seq-difference repeat-commands map-commands))

View file

@ -77,9 +77,9 @@
(defvar-keymap repeat-tests-another-repeat-map
:doc "Keymap for repeating other sequences."
:repeat ( :enter (repeat-tests-call-s)
:continue-only (repeat-tests-call-o
repeat-tests-call-u))
:repeat ( :enter (repeat-tests-call-s)
:continue (repeat-tests-call-o
repeat-tests-call-u))
"s" 'ignore ;; for non-nil repeat-check-key only
"t" 'repeat-tests-call-t
"C-M-o" 'repeat-tests-call-o
@ -87,9 +87,9 @@
(defvar-keymap repeat-tests-repeat-map
:doc "Keymap for repeating sequences."
:repeat ( :enter (repeat-tests-call-a)
:continue-only (repeat-tests-call-o)
:exit (repeat-tests-call-q))
:repeat ( :enter (repeat-tests-call-a)
:continue (repeat-tests-call-o)
:exit (repeat-tests-call-q))
"a" 'ignore ;; for non-nil repeat-check-key only
"c" 'repeat-tests-call-c
"d" 'repeat-tests-call-d
@ -202,11 +202,11 @@
;; TODO: :tags '(:expensive-test) for repeat-exit-timeout
(ert-deftest repeat-tests-continue-only ()
(ert-deftest repeat-tests-continue ()
(with-repeat-mode repeat-tests-global-map
(let ((repeat-echo-function 'ignore)
(repeat-check-key nil))
;; 'C-M-o' used as continue-only
;; 'C-M-o' used as continue
(repeat-tests--check
"C-M-a c C-M-o c z"
'((1 a) (1 c) (1 o) (1 c)) "z")
@ -223,7 +223,7 @@
(repeat-tests--check
"C-M-s t t z"
'((1 s) (1 t) (1 t)) "z")
;; 'C-M-u' used as continue-only
;; 'C-M-u' used as continue
(repeat-tests--check
"C-M-s t C-M-u t z"
'((1 s) (1 t) (1 u) (1 t)) "z")
@ -268,7 +268,7 @@
:repeat-map repeat-tests-bind-keys-repeat-map
:continue
("c" . repeat-tests-bind-call-c)
;; :continue-only
;; :continue
("C-M-o" . repeat-tests-bind-call-o)
:exit
("q" . repeat-tests-bind-call-q))
@ -279,7 +279,7 @@
(with-repeat-mode repeat-tests-bind-keys-map
(let ((repeat-echo-function 'ignore)
(repeat-check-key nil))
;; 'C-M-o' used as continue-only
;; 'C-M-o' used as continue
(repeat-tests--check
"C-M-a c C-M-o c z"
'((1 a) (1 c) (1 o) (1 c)) "z")