summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-10-31 16:42:26 +0100
committerStefan Kangas <stefankangas@gmail.com>2022-10-31 16:42:26 +0100
commit3b555dc91d21476fa4384f17188661ef2bd3c4e5 (patch)
tree46b2a7ae019d7dd9c641384d21a25f636b90f6fb /lisp/cus-edit.el
parentb250f89e63a135e04e61d66e1a83ff6d3c609e2c (diff)
downloademacs-3b555dc91d21476fa4384f17188661ef2bd3c4e5.tar.gz
Prefer defvar-keymap in cus-edit.el
* lisp/cus-edit.el (custom-mode-map, custom-mode-link-map): Prefer defvar-keymap.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el58
1 files 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 <abraham@dina.kvl.dk>
;; Maintainer: emacs-devel@gnu.org
;; Keywords: help, faces
@@ -23,7 +23,7 @@
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; 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
+ "<remap> <self-insert-command>" #'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
+ "<down-mouse-2>" nil
+ "<down-mouse-1>" #'mouse-drag-region
+ "<mouse-2>" #'widget-move-and-invoke)
(defvar custom-field-keymap
(let ((map (copy-keymap widget-field-keymap)))