emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1393b71c2ce 1/2: Prefer defvar-keymap in some additional Gnus lib


From: Stefan Kangas
Subject: master 1393b71c2ce 1/2: Prefer defvar-keymap in some additional Gnus libraries
Date: Mon, 10 Mar 2025 20:07:07 -0400 (EDT)

branch: master
commit 1393b71c2ce05128200350a0b6e4da930794f438
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Prefer defvar-keymap in some additional Gnus libraries
    
    * 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.
---
 lisp/gnus/gnus-sum.el  | 20 +++++++++++---------
 lisp/gnus/gnus.el      | 28 ++++++++++++++++------------
 lisp/gnus/mm-decode.el | 12 +++++-------
 3 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index d484d16ba95..fa909cc93f4 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -7323,15 +7323,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."
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 6fad088a6c9..53b7c332ded 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -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)
 
 
 
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 8273c48ff97..87acd4dd515 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -536,13 +536,11 @@ result of the verification."
                 (item :tag "ask" nil))
   :group 'mime-security)
 
-(defvar mm-viewer-completion-map
-  (let ((map (make-sparse-keymap 'mm-viewer-completion-map)))
-    (set-keymap-parent map minibuffer-local-completion-map)
-    ;; Should we bind other key to minibuffer-complete-word?
-    (define-key map " " 'self-insert-command)
-    map)
-  "Keymap for input viewer with completion.")
+(defvar-keymap mm-viewer-completion-map
+  :doc "Keymap for input viewer with completion."
+  :parent minibuffer-local-completion-map
+  ;; Should we bind other key to minibuffer-complete-word?
+  "SPC" #'self-insert-command)
 
 ;;; The functions.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]