]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer defvar-keymap in some additional Gnus libraries
authorStefan Kangas <stefankangas@gmail.com>
Mon, 10 Mar 2025 23:51:43 +0000 (00:51 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 12 Mar 2025 18:56:01 +0000 (19:56 +0100)
* lisp/gnus/gnus-sum.el (gnus-dead-summary-mode-map):
* lisp/gnus/gnus.el (gnus-article-mode-map)
(gnus-summary-mode-map, gnus-group-mode-map):
* lisp/gnus/mm-decode.el (mm-viewer-completion-map): Prefer
defvar-keymap.
* lisp/gnus/gnus.el (gnus-suppress-keymap): Declare obsolete.

(cherry picked from commit 1393b71c2ce05128200350a0b6e4da930794f438)

lisp/gnus/gnus-sum.el
lisp/gnus/gnus.el

index 393a8393b807c3515de4b2dd45f2345454f9acdb..8c3312d8f4b7e9a3f6f9108b4dc860c12c701c4f 100644 (file)
@@ -7322,15 +7322,17 @@ The state which existed when entering the ephemeral is reset."
 
 ;;; Dead summaries.
 
-(defvar gnus-dead-summary-mode-map
-  (let ((map (make-keymap)))
-    (suppress-keymap map)
-    (substitute-key-definition 'undefined 'gnus-summary-wake-up-the-dead map)
-    (dolist (key '("\C-d" "\r" "\177" [delete]))
-      (define-key map key 'gnus-summary-wake-up-the-dead))
-    (dolist (key '("q" "Q"))
-      (define-key map key 'bury-buffer))
-    map))
+(defvar-keymap gnus-dead-summary-mode-map
+  :full t :suppress t
+  "C-d"      #'gnus-summary-wake-up-the-dead
+  "RET"      #'gnus-summary-wake-up-the-dead
+  "DEL"      #'gnus-summary-wake-up-the-dead
+  "<delete>" #'gnus-summary-wake-up-the-dead
+  "q"        #'bury-buffer
+  "Q"        #'bury-buffer)
+
+(keymap-substitute gnus-dead-summary-mode-map
+                   'undefined 'gnus-summary-wake-up-the-dead)
 
 (define-minor-mode gnus-dead-summary-mode
   "Minor mode for Gnus summary buffers."
index 8116809cc063df909a6579e8e0303ee7228fde86..d8d47d6b4dfffa50250f302d891fe3d172d2eb6a 100644 (file)
@@ -2803,23 +2803,27 @@ See Info node `(gnus)Formatting Variables'."
 ;;;
 
 (defun gnus-suppress-keymap (keymap)
+  (declare (obsolete nil "31.1"))
   (suppress-keymap keymap)
   (let ((keys '([delete] "\177" "\M-u"))) ;[mouse-2]
     (while keys
       (define-key keymap (pop keys) 'undefined))))
 
-(defvar gnus-article-mode-map
-  (let ((keymap (make-sparse-keymap)))
-    (gnus-suppress-keymap keymap)
-    keymap))
-(defvar gnus-summary-mode-map
-  (let ((keymap (make-keymap)))
-    (gnus-suppress-keymap keymap)
-    keymap))
-(defvar gnus-group-mode-map
-  (let ((keymap (make-keymap)))
-    (gnus-suppress-keymap keymap)
-    keymap))
+(defvar-keymap gnus-article-mode-map
+  :suppress t
+  "<delete>" #'undefined
+  "DEL"      #'undefined
+  "M-u"      #'undefined)
+(defvar-keymap gnus-summary-mode-map
+  :full t :suppress t
+  "<delete>" #'undefined
+  "DEL"      #'undefined
+  "M-u"      #'undefined)
+(defvar-keymap gnus-group-mode-map
+  :full t :suppress t
+  "<delete>" #'undefined
+  "DEL"      #'undefined
+  "M-u"      #'undefined)
 
 \f