Subject: bug#73675: [PATCH] Clean up tmm.el

From: Manuel Giraud <[email-masked]>
Date: Mon, 07 Oct 2024 14:05:24 +0200

Eli Zaretskii <[email-masked]> writes:

>> Date: Mon, 07 Oct 2024 10:59:16 +0200
>> From:  Manuel Giraud via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>> 
>> Here is a patch with some clean up in "tmm.el".
>
> Thanks, but these are public symbols, how do we know no one out there
> uses them?  I'd leave them alone, TBH.

Ok.  What about the following one?  `tmm-mb-map' is not even set
anywhere.

>From dc27a84ef0f387566966fbbe2c9ccc41d1f639cd Mon Sep 17 00:00:00 2001
From: Manuel Giraud <[email-masked]>
Date: Mon, 7 Oct 2024 10:52:03 +0200
Subject: [PATCH] Clean up tmm.el

* lisp/tmm.el (tmm-mb-map): Remove unused keymap variable.
---
 lisp/tmm.el | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/lisp/tmm.el b/lisp/tmm.el
index ed74c307009..582551cfb87 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -82,9 +82,6 @@ tmm-mid-prompt
   :type '(choice (const :tag "No shortcuts" nil)
                  string))
 
-(defvar tmm-mb-map nil
-  "A place to store minibuffer map.")
-
 (defcustom tmm-completion-prompt
   "Press PageUp key to reach this buffer from the minibuffer.
 Alternatively, you can use Up/Down keys (or your History keys) to change
@@ -325,14 +322,14 @@ tmm-define-keys
         ;; downcase input to the same
         (define-key map (char-to-string (downcase c)) 'tmm-shortcut)
         (define-key map (char-to-string (upcase c)) 'tmm-shortcut)))
-    (if minibuffer
-	(progn
-          (define-key map [pageup] 'tmm-goto-completions)
-          (define-key map [prior] 'tmm-goto-completions)
-          (define-key map "\ev" 'tmm-goto-completions)
-          (define-key map "\C-n" 'next-history-element)
-          (define-key map "\C-p" 'previous-history-element)
-          (define-key map "^" 'self-insert-and-exit)))
+    (when minibuffer
+      (define-key map [pageup] 'tmm-goto-completions)
+      (define-key map [prior] 'tmm-goto-completions)
+      (define-key map "\ev" 'tmm-goto-completions)
+      (define-key map "\C-n" 'next-history-element)
+      (define-key map "\C-p" 'previous-history-element)
+      ;; Previous menu shortcut (see `tmm-prompt')
+      (define-key map "^" 'self-insert-and-exit))
     (prog1 (current-local-map)
       (use-local-map (append map (current-local-map))))))
 
-- 
2.46.1

-- 
Manuel Giraud