summaryrefslogtreecommitdiff
path: root/test/lisp/kmacro-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/kmacro-tests.el')
-rw-r--r--test/lisp/kmacro-tests.el49
1 files changed, 23 insertions, 26 deletions
diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el
index ecd3d5fc22b..49b40935387 100644
--- a/test/lisp/kmacro-tests.el
+++ b/test/lisp/kmacro-tests.el
@@ -91,33 +91,30 @@ body in KEYS-AND-BODY."
,docstring ,@keys
(kmacro-tests-with-kmacro-clean-slate ,@body))))
-(defvar kmacro-tests-keymap
- (let ((map (make-sparse-keymap)))
- (dotimes (i 26)
- (define-key map (string (+ ?a i)) 'self-insert-command))
- (dotimes (i 10)
- (define-key map (string (+ ?0 i)) 'self-insert-command))
- ;; Define a few key sequences of different lengths.
- (dolist (item '(("\C-a" . beginning-of-line)
- ("\C-b" . backward-char)
- ("\C-e" . end-of-line)
- ("\C-f" . forward-char)
- ("\C-r" . isearch-backward)
- ("\C-u" . universal-argument)
- ("\C-w" . kill-region)
- ("\C-SPC" . set-mark-command)
- ("\M-w" . kill-ring-save)
- ("\M-x" . execute-extended-command)
- ("\C-cd" . downcase-word)
- ("\C-cxu" . upcase-word)
- ("\C-cxq" . quoted-insert)
- ("\C-cxi" . kmacro-insert-counter)
- ("\C-x\C-k" . kmacro-keymap)))
- (define-key map (car item) (cdr item)))
- map)
- "Keymap to use for testing keyboard macros.
+(defvar-keymap kmacro-tests-keymap
+ :doc "Keymap to use for testing keyboard macros.
This is used to obtain consistent results even if tests are run
-in an environment with rebound keys.")
+in an environment with rebound keys."
+ ;; Define a few key sequences of different lengths.
+ "C-a" 'beginning-of-line
+ "C-b" 'backward-char
+ "C-e" 'end-of-line
+ "C-f" 'forward-char
+ "C-r" 'isearch-backward
+ "C-u" 'universal-argument
+ "C-w" 'kill-region
+ "C-SPC" 'set-mark-command
+ "M-w" 'kill-ring-save
+ "M-x" 'execute-extended-command
+ "C-c d" 'downcase-word
+ "C-c x u" 'upcase-word
+ "C-c x q" 'quoted-insert
+ "C-c x i" 'kmacro-insert-counter
+ "C-x C-k" 'kmacro-keymap)
+(dotimes (i 26)
+ (keymap-set kmacro-tests-keymap (string (+ ?a i)) 'self-insert-command))
+(dotimes (i 10)
+ (keymap-set kmacro-tests-keymap (string (+ ?0 i)) 'self-insert-command))
(defvar kmacro-tests-events nil
"Input events used by the kmacro test in progress.")