From 32f36db4f89deb453f401c3d66cbb02c61f2c838 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 16 Nov 2022 13:42:40 +0100 Subject: [PATCH] Prefer defvar-keymap in window.el * lisp/window.el (other-window-repeat-map) (resize-window-repeat-map): Prefer defvar-keymap. --- lisp/window.el | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 905803b19e6..d466f2975d6 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -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) -- 2.39.2