]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer defvar-keymap in window.el
authorStefan Kangas <stefankangas@gmail.com>
Wed, 16 Nov 2022 12:42:40 +0000 (13:42 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Thu, 17 Nov 2022 08:34:24 +0000 (09:34 +0100)
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map): Prefer defvar-keymap.

lisp/window.el

index 905803b19e6ebfae924e3a214bad4df410bebfec..d466f2975d6f6e18f8aa0df8cb4d4a26d34dd37b 100644 (file)
@@ -1,7 +1,6 @@
 ;;; window.el --- GNU Emacs window commands aside from those written in C  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985, 1989, 1992-1994, 2000-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
@@ -10562,27 +10561,25 @@ displaying that processes's buffer."
 (define-key ctl-x-4-map "1" 'same-window-prefix)
 (define-key ctl-x-4-map "4" 'other-window-prefix)
 
-(defvar other-window-repeat-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "o" 'other-window)
-    (define-key map "O" (lambda ()
-                          (interactive)
-                          (setq repeat-map 'other-window-repeat-map)
-                          (other-window -1)))
-    map)
-  "Keymap to repeat `other-window' key sequences.  Used in `repeat-mode'.")
+(defvar-keymap other-window-repeat-map
+  :doc "Keymap to repeat `other-window' key sequences.
+Used in `repeat-mode'."
+  "o" #'other-window
+  "O" (lambda ()
+        (interactive)
+        (setq repeat-map 'other-window-repeat-map)
+        (other-window -1)))
 (put 'other-window 'repeat-map 'other-window-repeat-map)
 
-(defvar resize-window-repeat-map
-  (let ((map (make-sparse-keymap)))
-    ;; Standard keys:
-    (define-key map "^" 'enlarge-window)
-    (define-key map "}" 'enlarge-window-horizontally)
-    (define-key map "{" 'shrink-window-horizontally)
-    ;; Additional keys:
-    (define-key map "v" 'shrink-window)
-    map)
-  "Keymap to repeat window resizing commands.  Used in `repeat-mode'.")
+(defvar-keymap resize-window-repeat-map
+  :doc "Keymap to repeat window resizing commands.
+Used in `repeat-mode'."
+  ;; Standard keys:
+  "^" #'enlarge-window
+  "}" #'enlarge-window-horizontally
+  "{" #'shrink-window-horizontally
+  ;; Additional keys:
+  "v" #'shrink-window)
 (put 'enlarge-window 'repeat-map 'resize-window-repeat-map)
 (put 'enlarge-window-horizontally 'repeat-map 'resize-window-repeat-map)
 (put 'shrink-window-horizontally 'repeat-map 'resize-window-repeat-map)