From 3b555dc91d21476fa4384f17188661ef2bd3c4e5 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 31 Oct 2022 16:42:26 +0100 Subject: [PATCH] Prefer defvar-keymap in cus-edit.el * lisp/cus-edit.el (custom-mode-map, custom-mode-link-map): Prefer defvar-keymap. --- lisp/cus-edit.el | 58 +++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index e043d9bc17e..00ee9504c22 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1,7 +1,7 @@ ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages -*- lexical-binding:t -*- -;; -;; Copyright (C) 1996-1997, 1999-2022 Free Software Foundation, Inc. -;; + +;; Copyright (C) 1996-2022 Free Software Foundation, Inc. + ;; Author: Per Abrahamsen ;; Maintainer: emacs-devel@gnu.org ;; Keywords: help, faces @@ -23,7 +23,7 @@ ;; along with GNU Emacs. If not, see . ;;; Commentary: -;; + ;; This file implements the code to create and edit customize buffers. ;; ;; See `custom.el'. @@ -428,32 +428,30 @@ Use group `text' for this instead. This group is deprecated." ;;; Custom mode keymaps -(defvar custom-mode-map - (let ((map (make-keymap))) - (set-keymap-parent map widget-keymap) - (define-key map [remap self-insert-command] 'Custom-no-edit) - (define-key map "\^m" 'Custom-newline) - (define-key map " " 'scroll-up-command) - (define-key map [?\S-\ ] 'scroll-down-command) - (define-key map "\177" 'scroll-down-command) - (define-key map "\C-c\C-c" 'Custom-set) - (define-key map "\C-x\C-s" 'Custom-save) - (define-key map "q" 'Custom-buffer-done) - (define-key map "u" 'Custom-goto-parent) - (define-key map "n" 'widget-forward) - (define-key map "p" 'widget-backward) - (define-key map "H" 'custom-toggle-hide-all-widgets) - map) - "Keymap for `Custom-mode'.") - -(defvar custom-mode-link-map - (let ((map (make-keymap))) - (set-keymap-parent map custom-mode-map) - (define-key map [down-mouse-2] nil) - (define-key map [down-mouse-1] 'mouse-drag-region) - (define-key map [mouse-2] 'widget-move-and-invoke) - map) - "Local keymap for links in `Custom-mode'.") +(defvar-keymap custom-mode-map + :doc "Keymap for `Custom-mode'." + :full t + :parent widget-keymap + " " #'Custom-no-edit + "RET" #'Custom-newline + "SPC" #'scroll-up-command + "S-SPC" #'scroll-down-command + "DEL" #'scroll-down-command + "C-c C-c" #'Custom-set + "C-x C-s" #'Custom-save + "q" #'Custom-buffer-done + "u" #'Custom-goto-parent + "n" #'widget-forward + "p" #'widget-backward + "H" #'custom-toggle-hide-all-widgets) + +(defvar-keymap custom-mode-link-map + :doc "Local keymap for links in `Custom-mode'." + :full t + :parent custom-mode-map + "" nil + "" #'mouse-drag-region + "" #'widget-move-and-invoke) (defvar custom-field-keymap (let ((map (copy-keymap widget-field-keymap))) -- 2.39.5