Subject: Re: bug#73585: [PATCH] Use 'defvar-keymap' in 'lua-ts-mode'

From: john muhl <[email-masked]>
Date: Tue, 01 Oct 2024 13:37:16 -0500

>From 5de56587ac3d43ad6bf06cf39ba4604d6ef3e249 Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Mon, 8 Jul 2024 15:54:02 -0500
Subject: [PATCH] Use 'defvar-keymap' in 'lua-ts-mode' (bug#73585)

* lisp/progmodes/lua-ts-mode.el (lua-ts-mode-map): Replace
'defvar' with 'defvar-keymap'.
---
 lisp/progmodes/lua-ts-mode.el | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 06daadbc1fd..dd04a9e7569 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -720,14 +720,11 @@ lua-ts-inferior--write-history
               ((buffer-live-p (process-buffer process))))
     (with-current-buffer buffer (comint-write-input-ring))))
 
-(defvar lua-ts-mode-map
-  (let ((map (make-sparse-keymap "Lua")))
-    (keymap-set map "C-c C-n" 'lua-ts-inferior-lua)
-    (keymap-set map "C-c C-c" 'lua-ts-send-buffer)
-    (keymap-set map "C-c C-l" 'lua-ts-send-file)
-    (keymap-set map "C-c C-r" 'lua-ts-send-region)
-    map)
-  "Keymap for `lua-ts-mode' buffers.")
+(defvar-keymap lua-ts-mode-map
+  "C-c C-n" #'lua-ts-inferior-lua
+  "C-c C-c" #'lua-ts-send-buffer
+  "C-c C-l" #'lua-ts-send-file
+  "C-c C-r" #'lua-ts-send-region)
 
 (easy-menu-define lua-ts-mode-menu lua-ts-mode-map
   "Menu bar entry for `lua-ts-mode'."
-- 
2.46.2

john muhl <[email-masked]> writes:

> Tags: patch
>
> Switch to defvar-keymap as previously suggested by Stefan Kangas.