Avoid loading 'rx' at runtime in 'lua-ts-mode'
authorjohn muhl <jm@pub.pink>
Sat, 23 Nov 2024 20:08:21 +0000 (14:08 -0600)
committerEli Zaretskii <eliz@gnu.org>
Sun, 24 Nov 2024 08:37:22 +0000 (10:37 +0200)
* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua):
Replace 'rx-to-string' and substitution with 'rx' and 'literal'.
(Bug#74499)

(cherry picked from commit e71d714a815e1088f8cfe946b1e431356ec85b24)

lisp/progmodes/lua-ts-mode.el

index e5a2fafd27992846827a342f1db923a00bdcce03..d2ac67a923004007f12907cd21d1dea0eb32cf98 100644 (file)
@@ -659,9 +659,9 @@ Calls REPORT-FN directly."
         (setq-local comint-input-ignoredups t
                     comint-input-ring-file-name lua-ts-inferior-history
                     comint-prompt-read-only t
-                    comint-prompt-regexp (rx-to-string `(: bol
-                                                           ,lua-ts-inferior-prompt
-                                                           (1+ space))))
+                    comint-prompt-regexp (rx bol
+                                             (literal lua-ts-inferior-prompt)
+                                             (1+ space)))
         (comint-read-input-ring t)
         (add-hook 'comint-preoutput-filter-functions
                   (lambda (string)
@@ -672,11 +672,11 @@ Calls REPORT-FN directly."
                        ;; accumulate in the output when sending regions
                        ;; to the inferior process.
                        (replace-regexp-in-string
-                        (rx-to-string `(: bol
-                                          (* ,lua-ts-inferior-prompt
-                                             (? ,lua-ts-inferior-prompt)
-                                             (1+ space))
-                                          (group (* nonl))))
+                        (rx bol
+                            (* (literal lua-ts-inferior-prompt)
+                               (? (literal lua-ts-inferior-prompt))
+                               (1+ space))
+                            (group (* nonl)))
                         "\\1" string)
                        ;; Re-add the prompt for the next line.
                        lua-ts-inferior-prompt " ")))