summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-07-09 14:38:48 +0200
committerStefan Kangas <stefan@marxist.se>2022-07-09 15:34:04 +0200
commitf6840328c0bc3daa151a1dc42ba030eb6240a853 (patch)
tree6b34321f9c5c8866c53e0cc0f64e655bd8825aec /lisp
parent30cf1f34c583d6ed16bdc5b9578370f30c95fe1b (diff)
downloademacs-f6840328c0bc3daa151a1dc42ba030eb6240a853.tar.gz
emacs-f6840328c0bc3daa151a1dc42ba030eb6240a853.tar.bz2
emacs-f6840328c0bc3daa151a1dc42ba030eb6240a853.zip
Prefer defvar-keymap in net/*.el
* lisp/net/dictionary.el (dictionary-mode-map): * lisp/net/dig.el (dig-mode-map): * lisp/net/eudc-hotlist.el (eudc-hotlist-mode-map): * lisp/net/eudc.el (eudc-mode-map): * lisp/net/mairix.el (mairix-searches-mode-map): * lisp/net/newst-treeview.el (newsticker-treeview-list-sort-button-map) (newsticker-treeview-mode-map): * lisp/net/quickurl.el (quickurl-list-mode-map): * lisp/net/rcirc.el (rcirc-mode-map) (rcirc-multiline-minor-mode-map, rcirc-track-minor-mode-map): * lisp/net/rlogin.el (rlogin-mode-map): * lisp/net/secrets.el (secrets-mode-map): * lisp/net/sieve-mode.el (sieve-mode-map): * lisp/net/sieve.el (sieve-manage-mode-map): * lisp/net/snmp-mode.el (snmp-mode-map): * lisp/net/telnet.el (telnet-mode-map): Prefer defvar-keymap.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/dictionary.el36
-rw-r--r--lisp/net/dig.el8
-rw-r--r--lisp/net/eudc-hotlist.el16
-rw-r--r--lisp/net/eudc.el18
-rw-r--r--lisp/net/mairix.el29
-rw-r--r--lisp/net/newst-treeview.el80
-rw-r--r--lisp/net/quickurl.el24
-rw-r--r--lisp/net/rcirc.el75
-rw-r--r--lisp/net/rlogin.el25
-rw-r--r--lisp/net/secrets.el15
-rw-r--r--lisp/net/sieve-mode.el12
-rw-r--r--lisp/net/sieve.el52
-rw-r--r--lisp/net/snmp-mode.el14
-rw-r--r--lisp/net/telnet.el18
14 files changed, 191 insertions, 231 deletions
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index eec405373db..c0ad8c13c5c 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -326,26 +326,22 @@ is utf-8"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Global variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar dictionary-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (set-keymap-parent map button-buffer-map)
-
- (define-key map "q" #'dictionary-close)
- (define-key map "h" #'dictionary-help)
- (define-key map "s" #'dictionary-search)
- (define-key map "d" #'dictionary-lookup-definition)
- (define-key map "D" #'dictionary-select-dictionary)
- (define-key map "M" #'dictionary-select-strategy)
- (define-key map "m" #'dictionary-match-words)
- (define-key map "l" #'dictionary-previous)
- (define-key map "n" #'forward-button)
- (define-key map "p" #'backward-button)
- (define-key map " " #'scroll-up-command)
- (define-key map [?\S-\ ] #'scroll-down-command)
- (define-key map (read-kbd-macro "M-SPC") #'scroll-down-command)
- map)
- "Keymap for the dictionary mode.")
+(defvar-keymap dictionary-mode-map
+ :doc "Keymap for the dictionary mode."
+ :suppress t :parent button-buffer-map
+ "q" #'dictionary-close
+ "h" #'dictionary-help
+ "s" #'dictionary-search
+ "d" #'dictionary-lookup-definition
+ "D" #'dictionary-select-dictionary
+ "M" #'dictionary-select-strategy
+ "m" #'dictionary-match-words
+ "l" #'dictionary-previous
+ "n" #'forward-button
+ "p" #'backward-button
+ "SPC" #'scroll-up-command
+ "S-SPC" #'scroll-down-command
+ "M-SPC" #'scroll-down-command)
(defvar dictionary-connection
nil
diff --git a/lisp/net/dig.el b/lisp/net/dig.el
index 7157d0cb585..d4fad0c61fd 100644
--- a/lisp/net/dig.el
+++ b/lisp/net/dig.el
@@ -123,11 +123,9 @@ Buffer should contain output generated by `dig-invoke'."
(setq str (replace-match "" nil nil str)))
str))
-(defvar dig-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "g" nil)
- (define-key map "q" #'dig-exit)
- map))
+(defvar-keymap dig-mode-map
+ "g" nil
+ "q" #'dig-exit)
(define-derived-mode dig-mode special-mode "Dig"
"Major mode for displaying dig output."
diff --git a/lisp/net/eudc-hotlist.el b/lisp/net/eudc-hotlist.el
index 26afd768051..d70e0cf4f63 100644
--- a/lisp/net/eudc-hotlist.el
+++ b/lisp/net/eudc-hotlist.el
@@ -35,15 +35,13 @@
(defvar eudc-hotlist-menu nil)
(defvar eudc-hotlist-list-beginning nil)
-(defvar eudc-hotlist-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "a" #'eudc-hotlist-add-server)
- (define-key map "d" #'eudc-hotlist-delete-server)
- (define-key map "s" #'eudc-hotlist-select-server)
- (define-key map "t" #'eudc-hotlist-transpose-servers)
- (define-key map "q" #'eudc-hotlist-quit-edit)
- (define-key map "x" #'kill-current-buffer)
- map))
+(defvar-keymap eudc-hotlist-mode-map
+ "a" #'eudc-hotlist-add-server
+ "d" #'eudc-hotlist-delete-server
+ "s" #'eudc-hotlist-select-server
+ "t" #'eudc-hotlist-transpose-servers
+ "q" #'eudc-hotlist-quit-edit
+ "x" #'kill-current-buffer)
(define-derived-mode eudc-hotlist-mode fundamental-mode "EUDC-Servers"
"Major mode used to edit the hotlist of servers.
diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el
index eb1342e4385..9208e40a730 100644
--- a/lisp/net/eudc.el
+++ b/lisp/net/eudc.el
@@ -56,16 +56,14 @@
(defvar eudc-form-widget-list nil)
-(defvar eudc-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-keymap)
- (define-key map "q" #'kill-current-buffer)
- (define-key map "x" #'kill-current-buffer)
- (define-key map "f" #'eudc-query-form)
- (define-key map "b" #'eudc-try-bbdb-insert)
- (define-key map "n" #'eudc-move-to-next-record)
- (define-key map "p" #'eudc-move-to-previous-record)
- map))
+(defvar-keymap eudc-mode-map
+ :parent widget-keymap
+ "q" #'kill-current-buffer
+ "x" #'kill-current-buffer
+ "f" #'eudc-query-form
+ "b" #'eudc-try-bbdb-insert
+ "n" #'eudc-move-to-next-record
+ "p" #'eudc-move-to-previous-record)
(defvar mode-popup-menu)
diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el
index d84763b1626..0b99d2a0b7c 100644
--- a/lisp/net/mairix.el
+++ b/lisp/net/mairix.el
@@ -743,21 +743,20 @@ VALUES may contain values for editable fields from current article."
;;;; Major mode for editing/deleting/saving searches
-(defvar mairix-searches-mode-map
- (let ((map (make-keymap)))
- (define-key map [(return)] 'mairix-select-search)
- (define-key map [(down)] 'mairix-next-search)
- (define-key map [(up)] 'mairix-previous-search)
- (define-key map [(right)] 'mairix-next-search)
- (define-key map [(left)] 'mairix-previous-search)
- (define-key map "\C-p" 'mairix-previous-search)
- (define-key map "\C-n" 'mairix-next-search)
- (define-key map [(q)] 'mairix-select-quit)
- (define-key map [(e)] 'mairix-select-edit)
- (define-key map [(d)] 'mairix-select-delete)
- (define-key map [(s)] 'mairix-select-save)
- map)
- "`mairix-searches-mode' keymap.")
+(defvar-keymap mairix-searches-mode-map
+ :doc "`mairix-searches-mode' keymap."
+ :full t
+ "<return>" #'mairix-select-search
+ "<down>" #'mairix-next-search
+ "<up>" #'mairix-previous-search
+ "<right>" #'mairix-next-search
+ "<left>" #'mairix-previous-search
+ "C-p" #'mairix-previous-search
+ "C-n" #'mairix-next-search
+ "q" #'mairix-select-quit
+ "e" #'mairix-select-edit
+ "d" #'mairix-select-delete
+ "s" #'mairix-select-save)
(defvar mairix-searches-mode-font-lock-keywords
'(("^\\([0-9]+\\)"
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index b429a33dec8..1e04e7d1ca9 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -608,14 +608,10 @@ If CLEAR-BUFFER is non-nil the list buffer is completely erased."
(newsticker--treeview-list-update-faces)
(goto-char (point-min))))
-(defvar newsticker-treeview-list-sort-button-map
- (let ((map (make-sparse-keymap)))
- (define-key map [header-line mouse-1]
- #'newsticker--treeview-list-sort-by-column)
- (define-key map [header-line mouse-2]
- #'newsticker--treeview-list-sort-by-column)
- map)
- "Local keymap for newsticker treeview list window sort buttons.")
+(defvar-keymap newsticker-treeview-list-sort-button-map
+ :doc "Local keymap for newsticker treeview list window sort buttons."
+ "<header-line> <mouse-1>" #'newsticker--treeview-list-sort-by-column
+ "<header-line> <mouse-2>" #'newsticker--treeview-list-sort-by-column)
(defun newsticker--treeview-list-sort-by-column (&optional event)
"Sort the newsticker list window buffer by the column clicked on.
@@ -2012,41 +2008,39 @@ Return t if groups have changed, nil otherwise."
menu)
"Map for newsticker item menu.")
-(defvar newsticker-treeview-mode-map
- (let ((map (make-sparse-keymap 'newsticker-treeview-mode-map)))
- (define-key map " " #'newsticker-treeview-next-page)
- (define-key map "a" #'newsticker-add-url)
- (define-key map "b" #'newsticker-treeview-browse-url-item)
- (define-key map "c" #'newsticker-treeview-customize-current-feed)
- (define-key map "F" #'newsticker-treeview-prev-feed)
- (define-key map "f" #'newsticker-treeview-next-feed)
- (define-key map "g" #'newsticker-treeview-get-news)
- (define-key map "G" #'newsticker-get-all-news)
- (define-key map "i" #'newsticker-treeview-toggle-item-immortal)
- (define-key map "j" #'newsticker-treeview-jump)
- (define-key map "n" #'newsticker-treeview-next-item)
- (define-key map "N" #'newsticker-treeview-next-new-or-immortal-item)
- (define-key map "O" #'newsticker-treeview-mark-list-items-old)
- (define-key map "o" #'newsticker-treeview-mark-item-old)
- (define-key map "p" #'newsticker-treeview-prev-item)
- (define-key map "P" #'newsticker-treeview-prev-new-or-immortal-item)
- (define-key map "q" #'newsticker-treeview-quit)
- (define-key map "S" #'newsticker-treeview-save-item)
- (define-key map "s" #'newsticker-treeview-save)
- (define-key map "u" #'newsticker-treeview-update)
- (define-key map "v" #'newsticker-treeview-browse-url)
- ;;(define-key map "\n" #'newsticker-treeview-scroll-item)
- ;;(define-key map "\C-m" #'newsticker-treeview-scroll-item)
- (define-key map "\M-m" #'newsticker-group-move-feed)
- (define-key map "\M-a" #'newsticker-group-add-group)
- (define-key map "\M-d" #'newsticker-group-delete-group)
- (define-key map "\M-r" #'newsticker-group-rename-group)
- (define-key map [M-down] #'newsticker-group-shift-feed-down)
- (define-key map [M-up] #'newsticker-group-shift-feed-up)
- (define-key map [M-S-down] #'newsticker-group-shift-group-down)
- (define-key map [M-S-up] #'newsticker-group-shift-group-up)
- map)
- "Mode map for newsticker treeview.")
+(defvar-keymap newsticker-treeview-mode-map
+ :doc "Mode map for newsticker treeview."
+ "SPC" #'newsticker-treeview-next-page
+ "a" #'newsticker-add-url
+ "b" #'newsticker-treeview-browse-url-item
+ "c" #'newsticker-treeview-customize-current-feed
+ "F" #'newsticker-treeview-prev-feed
+ "f" #'newsticker-treeview-next-feed
+ "g" #'newsticker-treeview-get-news
+ "G" #'newsticker-get-all-news
+ "i" #'newsticker-treeview-toggle-item-immortal
+ "j" #'newsticker-treeview-jump
+ "n" #'newsticker-treeview-next-item
+ "N" #'newsticker-treeview-next-new-or-immortal-item
+ "O" #'newsticker-treeview-mark-list-items-old
+ "o" #'newsticker-treeview-mark-item-old
+ "p" #'newsticker-treeview-prev-item
+ "P" #'newsticker-treeview-prev-new-or-immortal-item
+ "q" #'newsticker-treeview-quit
+ "S" #'newsticker-treeview-save-item
+ "s" #'newsticker-treeview-save
+ "u" #'newsticker-treeview-update
+ "v" #'newsticker-treeview-browse-url
+ ;;"C-j" #'newsticker-treeview-scroll-item
+ ;;"RET" #'newsticker-treeview-scroll-item
+ "M-m" #'newsticker-group-move-feed
+ "M-a" #'newsticker-group-add-group
+ "M-d" #'newsticker-group-delete-group
+ "M-r" #'newsticker-group-rename-group
+ "M-<down>" #'newsticker-group-shift-feed-down
+ "M-<up>" #'newsticker-group-shift-feed-up
+ "M-S-<down>" #'newsticker-group-shift-group-down
+ "M-S-<up>" #'newsticker-group-shift-group-up)
(define-derived-mode newsticker-treeview-mode fundamental-mode "Newsticker TV"
"Major mode for Newsticker Treeview.
diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el
index 598a7da0712..61cae43a88a 100644
--- a/lisp/net/quickurl.el
+++ b/lisp/net/quickurl.el
@@ -163,19 +163,17 @@ in your init file (after loading/requiring quickurl).")
(defvar quickurl-urls nil
"URL alist for use with `quickurl' and `quickurl-ask'.")
-(defvar quickurl-list-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "a" #'quickurl-list-add-url)
- (define-key map [(control m)] #'quickurl-list-insert-url)
- (define-key map "u" #'quickurl-list-insert-naked-url)
- (define-key map " " #'quickurl-list-insert-with-lookup)
- (define-key map "l" #'quickurl-list-insert-lookup)
- (define-key map "d" #'quickurl-list-insert-with-desc)
- (define-key map [(control g)] #'quickurl-list-quit)
- (define-key map "q" #'quickurl-list-quit)
- (define-key map [mouse-2] #'quickurl-list-mouse-select)
- map)
- "Local keymap for a `quickurl-list-mode' buffer.")
+(defvar-keymap quickurl-list-mode-map
+ :doc "Local keymap for a `quickurl-list-mode' buffer."
+ "a" #'quickurl-list-add-url
+ "RET" #'quickurl-list-insert-url
+ "u" #'quickurl-list-insert-naked-url
+ "SPC" #'quickurl-list-insert-with-lookup
+ "l" #'quickurl-list-insert-lookup
+ "d" #'quickurl-list-insert-with-desc
+ "C-g" #'quickurl-list-quit
+ "q" #'quickurl-list-quit
+ "<mouse-2>" #'quickurl-list-mouse-select)
(defvar quickurl-list-buffer-name "*quickurl-list*"
"Name for the URL listing buffer.")
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 775cff97302..54d7861f445 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1346,33 +1346,30 @@ The list is updated automatically by `defun-rcirc-command'.")
'set-rcirc-encode-coding-system
"28.1")
-(defvar rcirc-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "RET") 'rcirc-send-input)
- (define-key map (kbd "M-p") 'rcirc-insert-prev-input)
- (define-key map (kbd "M-n") 'rcirc-insert-next-input)
- (define-key map (kbd "TAB") 'completion-at-point)
- (define-key map (kbd "C-c C-b") 'rcirc-browse-url)
- (define-key map (kbd "C-c C-c") 'rcirc-edit-multiline)
- (define-key map (kbd "C-c C-j") 'rcirc-cmd-join)
- (define-key map (kbd "C-c C-k") 'rcirc-cmd-kick)
- (define-key map (kbd "C-c C-l") 'rcirc-toggle-low-priority)
- (define-key map (kbd "C-c C-d") 'rcirc-cmd-mode)
- (define-key map (kbd "C-c C-m") 'rcirc-cmd-msg)
- (define-key map (kbd "C-c C-r") 'rcirc-cmd-nick) ; rename
- (define-key map (kbd "C-c C-o") 'rcirc-omit-mode)
- (define-key map (kbd "C-c C-p") 'rcirc-cmd-part)
- (define-key map (kbd "C-c C-q") 'rcirc-cmd-query)
- (define-key map (kbd "C-c C-t") 'rcirc-cmd-topic)
- (define-key map (kbd "C-c C-n") 'rcirc-cmd-names)
- (define-key map (kbd "C-c C-w") 'rcirc-cmd-whois)
- (define-key map (kbd "C-c C-x") 'rcirc-cmd-quit)
- (define-key map (kbd "C-c TAB") ; C-i
- 'rcirc-toggle-ignore-buffer-activity)
- (define-key map (kbd "C-c C-s") 'rcirc-switch-to-server-buffer)
- (define-key map (kbd "C-c C-a") 'rcirc-jump-to-first-unread-line)
- map)
- "Keymap for rcirc mode.")
+(defvar-keymap rcirc-mode-map
+ :doc "Keymap for rcirc mode."
+ "RET" #'rcirc-send-input
+ "M-p" #'rcirc-insert-prev-input
+ "M-n" #'rcirc-insert-next-input
+ "TAB" #'completion-at-point
+ "C-c C-b" #'rcirc-browse-url
+ "C-c C-c" #'rcirc-edit-multiline
+ "C-c C-j" #'rcirc-cmd-join
+ "C-c C-k" #'rcirc-cmd-kick
+ "C-c C-l" #'rcirc-toggle-low-priority
+ "C-c C-d" #'rcirc-cmd-mode
+ "C-c C-m" #'rcirc-cmd-msg
+ "C-c C-r" #'rcirc-cmd-nick ; rename
+ "C-c C-o" #'rcirc-omit-mode
+ "C-c C-p" #'rcirc-cmd-part
+ "C-c C-q" #'rcirc-cmd-query
+ "C-c C-t" #'rcirc-cmd-topic
+ "C-c C-n" #'rcirc-cmd-names
+ "C-c C-w" #'rcirc-cmd-whois
+ "C-c C-x" #'rcirc-cmd-quit
+ "C-c C-i" #'rcirc-toggle-ignore-buffer-activity
+ "C-c C-s" #'rcirc-switch-to-server-buffer
+ "C-c C-a" #'rcirc-jump-to-first-unread-line)
(defvar-local rcirc-short-buffer-name nil
"Generated abbreviation to use to indicate buffer activity.")
@@ -1714,14 +1711,12 @@ extracted."
parent
(substitute-command-keys "\\[rcirc-multiline-minor-cancel]")))))
-(defvar rcirc-multiline-minor-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-c C-c") 'rcirc-multiline-minor-submit)
- (define-key map (kbd "C-x C-s") 'rcirc-multiline-minor-submit)
- (define-key map (kbd "C-c C-k") 'rcirc-multiline-minor-cancel)
- (define-key map (kbd "ESC ESC ESC") 'rcirc-multiline-minor-cancel)
- map)
- "Keymap for multiline mode in rcirc.")
+(defvar-keymap rcirc-multiline-minor-mode-map
+ :doc "Keymap for multiline mode in rcirc."
+ "C-c C-c" #'rcirc-multiline-minor-submit
+ "C-x C-s" #'rcirc-multiline-minor-submit
+ "C-c C-k" #'rcirc-multiline-minor-cancel
+ "ESC ESC ESC" #'rcirc-multiline-minor-cancel)
(define-minor-mode rcirc-multiline-minor-mode
"Minor mode for editing multiple lines in rcirc."
@@ -2269,12 +2264,10 @@ This function does not alter the INPUT string."
(mapconcat rcirc-nick-filter sorted sep)))
;;; activity tracking
-(defvar rcirc-track-minor-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-c C-@") 'rcirc-next-active-buffer)
- (define-key map (kbd "C-c C-SPC") 'rcirc-next-active-buffer)
- map)
- "Keymap for rcirc track minor mode.")
+(defvar-keymap rcirc-track-minor-mode-map
+ :doc "Keymap for rcirc track minor mode."
+ "C-c C-@" #'rcirc-next-active-buffer
+ "C-c C-SPC" #'rcirc-next-active-buffer)
(defcustom rcirc-track-abbrevate-flag t
"Non-nil means `rcirc-track-minor-mode' should abbreviate names."
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index 98b660dcc43..a6d0edae072 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -1,7 +1,6 @@
;;; rlogin.el --- remote login interface -*- lexical-binding:t -*-
-;; Copyright (C) 1992-1995, 1997-1998, 2001-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1992-2022 Free Software Foundation, Inc.
;; Author: Noah Friedman <friedman@splode.com>
;; Keywords: unix, comm
@@ -118,19 +117,15 @@ this variable is set from that."
:type '(choice (const nil) string)
:group 'rlogin)
-(defvar rlogin-mode-map
- (let ((map (if (consp shell-mode-map)
- (cons 'keymap shell-mode-map)
- (copy-keymap shell-mode-map))))
- (define-key map "\C-c\C-c" 'rlogin-send-Ctrl-C)
- (define-key map "\C-c\C-d" 'rlogin-send-Ctrl-D)
- (define-key map "\C-c\C-z" 'rlogin-send-Ctrl-Z)
- (define-key map "\C-c\C-\\" 'rlogin-send-Ctrl-backslash)
- (define-key map "\C-d" 'rlogin-delchar-or-send-Ctrl-D)
- (define-key map "\C-i" 'rlogin-tab-or-complete)
- map)
- "Keymap for `rlogin-mode'.")
-
+(defvar-keymap rlogin-mode-map
+ :doc "Keymap for `rlogin-mode'."
+ :parent shell-mode-map
+ "C-c C-c" #'rlogin-send-Ctrl-C
+ "C-c C-d" #'rlogin-send-Ctrl-D
+ "C-c C-z" #'rlogin-send-Ctrl-Z
+ "C-c C-\\" #'rlogin-send-Ctrl-backslash
+ "C-d" #'rlogin-delchar-or-send-Ctrl-D
+ "TAB" #'rlogin-tab-or-complete)
(defvar rlogin-history nil)
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el
index d8341774e47..c4f97a92fb5 100644
--- a/lisp/net/secrets.el
+++ b/lisp/net/secrets.el
@@ -741,14 +741,13 @@ ITEM can also be an object path, which is used if contained in COLLECTION."
;;; Visualization.
-(defvar secrets-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map (make-composed-keymap special-mode-map widget-keymap))
- (define-key map "n" #'next-line)
- (define-key map "p" #'previous-line)
- (define-key map "z" #'kill-current-buffer)
- map)
- "Keymap used in `secrets-mode' buffers.")
+(defvar-keymap secrets-mode-map
+ :doc "Keymap used in `secrets-mode' buffers."
+ :parent (make-composed-keymap special-mode-map
+ widget-keymap)
+ "n" #'next-line
+ "p" #'previous-line
+ "z" #'kill-current-buffer)
(define-derived-mode secrets-mode special-mode "Secrets"
"Major mode for presenting password entries retrieved by Security Service.
diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el
index 58fd41d8995..f62af03534a 100644
--- a/lisp/net/sieve-mode.el
+++ b/lisp/net/sieve-mode.el
@@ -137,13 +137,11 @@
;; Key map definition
-(defvar sieve-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-l" #'sieve-upload)
- (define-key map "\C-c\C-c" #'sieve-upload-and-kill)
- (define-key map "\C-c\C-m" #'sieve-manage)
- map)
- "Key map used in sieve mode.")
+(defvar-keymap sieve-mode-map
+ :doc "Keymap used in sieve mode."
+ "C-c C-l" #'sieve-upload
+ "C-c C-c" #'sieve-upload-and-kill
+ "C-c RET" #'sieve-manage)
;; Menu
diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el
index 630ea04070b..3a6067ee10b 100644
--- a/lisp/net/sieve.el
+++ b/lisp/net/sieve.el
@@ -106,33 +106,31 @@ require \"fileinto\";
;; FIXME: This is arguably a bug/problem in `easy-menu-define'.
(declare-function sieve-manage-mode-menu "sieve")
-(defvar sieve-manage-mode-map
- (let ((map (make-sparse-keymap)))
- ;; various
- (define-key map "?" #'sieve-help)
- (define-key map "h" #'sieve-help)
- ;; activating
- (define-key map "m" #'sieve-activate)
- (define-key map "u" #'sieve-deactivate)
- (define-key map "\M-\C-?" #'sieve-deactivate-all)
- ;; navigation keys
- (define-key map "\C-p" #'sieve-prev-line)
- (define-key map [up] #'sieve-prev-line)
- (define-key map "\C-n" #'sieve-next-line)
- (define-key map [down] #'sieve-next-line)
- (define-key map " " #'sieve-next-line)
- (define-key map "n" #'sieve-next-line)
- (define-key map "p" #'sieve-prev-line)
- (define-key map "\C-m" #'sieve-edit-script)
- (define-key map "f" #'sieve-edit-script)
- ;; (define-key map "o" #'sieve-edit-script-other-window)
- (define-key map "r" #'sieve-remove)
- (define-key map "q" #'sieve-bury-buffer)
- (define-key map "Q" #'sieve-manage-quit)
- (define-key map [(down-mouse-2)] #'sieve-edit-script)
- (define-key map [(down-mouse-3)] #'sieve-manage-mode-menu)
- map)
- "Keymap for `sieve-manage-mode'.")
+(defvar-keymap sieve-manage-mode-map
+ :doc "Keymap for `sieve-manage-mode'."
+ ;; various
+ "?" #'sieve-help
+ "h" #'sieve-help
+ ;; activating
+ "m" #'sieve-activate
+ "u" #'sieve-deactivate
+ "M-DEL" #'sieve-deactivate-all
+ ;; navigation keys
+ "C-p" #'sieve-prev-line
+ "<up>" #'sieve-prev-line
+ "C-n" #'sieve-next-line
+ "<down>" #'sieve-next-line
+ "SPC" #'sieve-next-line
+ "n" #'sieve-next-line
+ "p" #'sieve-prev-line
+ "RET" #'sieve-edit-script
+ "f" #'sieve-edit-script
+ ;; "o" #'sieve-edit-script-other-window
+ "r" #'sieve-remove
+ "q" #'sieve-bury-buffer
+ "Q" #'sieve-manage-quit
+ "<down-mouse-2>" #'sieve-edit-script
+ "<down-mouse-3>" #'sieve-manage-mode-menu)
(easy-menu-define sieve-manage-mode-menu sieve-manage-mode-map
"Sieve Menu."
diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el
index de84b4f8dd1..394c4a9666d 100644
--- a/lisp/net/snmp-mode.el
+++ b/lisp/net/snmp-mode.el
@@ -248,14 +248,12 @@ This is used during Tempo template completion."
;; Set up our keymap
;;
-(defvar snmp-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\177" 'backward-delete-char-untabify)
- (define-key map "\C-c\C-i" 'tempo-complete-tag)
- (define-key map "\C-c\C-f" 'tempo-forward-mark)
- (define-key map "\C-c\C-b" 'tempo-backward-mark)
- map)
- "Keymap used in SNMP mode.")
+(defvar-keymap snmp-mode-map
+ :doc "Keymap used in SNMP mode."
+ "DEL" #'backward-delete-char-untabify
+ "C-c TAB" #'tempo-complete-tag
+ "C-c C-f" #'tempo-forward-mark
+ "C-c C-b" #'tempo-backward-mark)
;; Set up our syntax table
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index 0d54d2220b6..802e7bc0a28 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -1,7 +1,6 @@
;;; telnet.el --- run a telnet session from within an Emacs buffer -*- lexical-binding: t; -*-
-;; Copyright (C) 1985, 1988, 1992, 1994, 2001-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
;; Author: William F. Schelter
;; Maintainer: emacs-devel@gnu.org
@@ -61,14 +60,13 @@ PROGRAM says which program to run, to talk to that machine.
LOGIN-NAME, which is optional, says what to log in as on that machine.")
(defvar telnet-new-line "\r")
-(defvar telnet-mode-map
- (let ((map (nconc (make-sparse-keymap) comint-mode-map)))
- (define-key map "\C-m" #'telnet-send-input)
- ;; (define-key map "\C-j" #'telnet-send-input)
- (define-key map "\C-c\C-q" #'send-process-next-char)
- (define-key map "\C-c\C-c" #'telnet-interrupt-subjob)
- (define-key map "\C-c\C-z" #'telnet-c-z)
- map))
+(defvar-keymap telnet-mode-map
+ :parent comint-mode-map
+ "RET" #'telnet-send-input
+ ;; "C-j" #'telnet-send-input
+ "C-c C-q" #'send-process-next-char
+ "C-c C-c" #'telnet-interrupt-subjob
+ "C-c C-z" #'telnet-c-z)
(defvar telnet-prompt-pattern "^[^#$%>\n]*[#$%>] *")
(defvar telnet-replace-c-g nil)