[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 32f36db4f8 1/2: Prefer defvar-keymap in window.el
From: |
Stefan Kangas |
Subject: |
master 32f36db4f8 1/2: Prefer defvar-keymap in window.el |
Date: |
Thu, 17 Nov 2022 03:35:38 -0500 (EST) |
branch: master
commit 32f36db4f89deb453f401c3d66cbb02c61f2c838
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
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 905803b19e..d466f2975d 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)