1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

Fix some 'lua-ts-mode' options (Bug#74235)

* lisp/progmodes/lua-ts-mode.el (lua-ts-luacheck-program):
(lua-ts-inferior-program): Switch to 'file' type and remove 'nil'
as a choice.
(lua-ts-inferior-lua): Ensure 'lua-ts-inferior-program' is set.
This commit is contained in:
john muhl 2024-11-09 11:01:45 -06:00 committed by Eli Zaretskii
parent a0613372a7
commit 27aacbd172

View File

@ -72,7 +72,7 @@
(defcustom lua-ts-luacheck-program "luacheck"
"Location of the Luacheck program."
:type '(choice (const :tag "None" nil) string)
:type 'file
:version "30.1")
(defcustom lua-ts-inferior-buffer "*Lua*"
@ -83,7 +83,7 @@
(defcustom lua-ts-inferior-program "lua"
"Program to run in the inferior Lua process."
:type '(choice (const :tag "None" nil) string)
:type 'file
:version "30.1")
(defcustom lua-ts-inferior-options '("-i")
@ -643,6 +643,8 @@ Calls REPORT-FN directly."
(defun lua-ts-inferior-lua ()
"Run a Lua interpreter in an inferior process."
(interactive)
(if (not lua-ts-inferior-program)
(user-error "You must set `lua-ts-inferior-program' to use this command")
(unless (comint-check-proc lua-ts-inferior-buffer)
(apply #'make-comint-in-buffer
(string-replace "*" "" lua-ts-inferior-buffer)
@ -669,8 +671,8 @@ Calls REPORT-FN directly."
;; Filter out the extra prompt characters that
;; accumulate in the output when sending regions
;; to the inferior process.
(replace-regexp-in-string (rx-to-string
`(: bol
(replace-regexp-in-string
(rx-to-string `(: bol
(* ,lua-ts-inferior-prompt
(? ,lua-ts-inferior-prompt)
(1+ space))
@ -683,7 +685,7 @@ Calls REPORT-FN directly."
'((display-buffer-reuse-window
display-buffer-pop-up-window)
(reusable-frames . t))))
(get-buffer-process (current-buffer)))
(get-buffer-process (current-buffer))))
(defun lua-ts-send-buffer ()
"Send current buffer to the inferior Lua process."