From: Stefan Kangas Date: Fri, 27 Dec 2024 04:21:36 +0000 (+0100) Subject: Prefer defvar-keymap in two-column.el X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=90f22cfda86ff87a87abe9462cb8a38e823a3247;p=emacs.git Prefer defvar-keymap in two-column.el * lisp/textmodes/two-column.el (2C-mode-map, 2C-minor-mode-map): Convert to defvar-keymap. (cherry picked from commit 43b81b7ecaf465eef268dd2cd94f00a0c4da87ea) --- diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index 41cd82ce728..e4cbbbec95f 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -162,14 +162,12 @@ minus this value." :type 'boolean) -(defvar 2C-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "2" #'2C-two-columns) - (define-key map [f2] #'2C-two-columns) - (define-key map "b" #'2C-associate-buffer) - (define-key map "s" #'2C-split) - map) - "Keymap for commands for setting up two-column mode.") +(defvar-keymap 2C-mode-map + :doc "Keymap for commands for setting up two-column mode." + "2" #'2C-two-columns + "" #'2C-two-columns + "b" #'2C-associate-buffer + "s" #'2C-split) ;;;###autoload (autoload '2C-command "two-column" () t 'keymap) (fset '2C-command 2C-mode-map) @@ -177,21 +175,19 @@ minus this value." ;; This one is for historical reasons and simple keyboards, it is not ;; at all mnemonic. All usual sequences containing 2 were used, and ;; f2 could not be set up in a standard way under Emacs 18. -;;;###autoload (global-set-key "\C-x6" #'2C-command) - -;;;###autoload (global-set-key [f2] #'2C-command) - -(defvar 2C-minor-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "1" #'2C-merge) - (define-key map "d" #'2C-dissociate) - (define-key map "o" #'2C-associated-buffer) - (define-key map "\^m" #'2C-newline) - (define-key map "|" #'2C-toggle-autoscroll) - (define-key map "{" #'2C-shrink-window-horizontally) - (define-key map "}" #'2C-enlarge-window-horizontally) - map) - "Keymap for commands for use in two-column mode.") +;;;###autoload (keymap-global-set "C-x 6" #'2C-command) + +;;;###autoload (keymap-global-set "" #'2C-command) + +(defvar-keymap 2C-minor-mode-map + :doc "Keymap for commands for use in two-column mode." + "1" #'2C-merge + "d" #'2C-dissociate + "o" #'2C-associated-buffer + "RET" #'2C-newline + "|" #'2C-toggle-autoscroll + "{" #'2C-shrink-window-horizontally + "}" #'2C-enlarge-window-horizontally) (setq minor-mode-map-alist (cons (cons '2C-mode