Subject: bug#71736: Small cleanup patches for lua-ts-mode

From: john muhl <[email-masked]>
Date: Sun, 23 Jun 2024 09:58:59 -0500

john muhl <[email-masked]> writes:

>From ffb8a2be042c887a77b7fa2ff2640e5f68925c9d Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Wed, 15 Nov 2023 12:45:18 -0600
Subject: [PATCH 1/4] ; Add 'eglot-ensure' option to 'lua-ts-mode-hook'

* lisp/progmodes/lua-ts-mode.el (lua-ts-mode-hook): Add an option
to enable Eglot from the lua-ts-mode-hook.  (bug#71736)
---
 lisp/progmodes/lua-ts-mode.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 57dba5e5568..9801f339fdf 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -58,7 +58,8 @@ lua-ts
 (defcustom lua-ts-mode-hook nil
   "Hook run after entering `lua-ts-mode'."
   :type 'hook
-  :options '(flymake-mode
+  :options '(eglot-ensure
+             flymake-mode
              hs-minor-mode
              outline-minor-mode)
   :version "30.1")
-- 
2.45.2

>From 1d627c785ca84498b7616a498b6d9f899915cf7b Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Wed, 22 May 2024 12:23:19 -0500
Subject: [PATCH 2/4] ; Use 'keymap-set' in 'lua-ts-mode' (bug#71736)

* lisp/progmodes/lua-ts-mode.el (lua-ts-mode-map): Replace
'define-key' with 'keymap-set'.
---
 lisp/progmodes/lua-ts-mode.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 9801f339fdf..1d995e20df4 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -740,11 +740,11 @@ lua-ts-inferior--write-history
 
 (defvar lua-ts-mode-map
   (let ((map (make-sparse-keymap "Lua")))
-    (define-key map "\C-c\C-n" 'lua-ts-inferior-lua)
-    (define-key map "\C-c\C-c" 'lua-ts-send-buffer)
-    (define-key map "\C-c\C-l" 'lua-ts-send-file)
-    (define-key map "\C-c\C-r" 'lua-ts-send-region)
-    (define-key map "\C-c\C-t" 'lua-ts-send-thing)
+    (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)
+    (keymap-set map "C-c C-t" 'lua-ts-send-thing)
     map)
   "Keymap for `lua-ts-mode' buffers.")
 
-- 
2.45.2

>From ebb8f0f29a13034e6626dfd23f50945cd5dcbd0e Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Wed, 12 Jun 2024 10:41:03 -0500
Subject: [PATCH 3/4] ; * lua-ts-mode.el: Reword doc.  (bug#71736)

---
 lisp/progmodes/lua-ts-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 1d995e20df4..79fbde1f2d4 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -117,7 +117,7 @@ lua-ts-inferior-history
 (defcustom lua-ts-indent-continuation-lines t
   "Controls how multi-line if/else statements are aligned.
 
-If t, then continuation lines are indented by `lua-ts-indent-offset':
+If non-nil, then continuation lines are indented by `lua-ts-indent-offset':
 
   if a
       and b then
-- 
2.45.2

>From abecae7d631f4b313fe8510f47e480f1a82bb4ad Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Thu, 13 Jun 2024 15:19:04 -0500
Subject: [PATCH 4/4] ; Remove useless require of 'rx' in 'lua-ts-mode'

* lisp/progmodes/lua-ts-mode.el: No need to require 'rx' since it
is preloaded.  (bug#71736)
---
 lisp/progmodes/lua-ts-mode.el | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 79fbde1f2d4..5a73a9fc01c 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -34,9 +34,6 @@
 (require 'comint)
 (require 'treesit)
 
-(eval-when-compile
-  (require 'rx))
-
 (declare-function treesit-induce-sparse-tree "treesit.c")
 (declare-function treesit-node-child-by-field-name "treesit.c")
 (declare-function treesit-node-child-count "treesit.c")
-- 
2.45.2

> Tags: patch
>
> Following up with a few trivial cleanups in lua-ts-mode.