GNU bug report logs - #79573
[PATCH] New 'lua-mode' inferior process options

Previous Next

Package: emacs;

Reported by: john muhl <jm <at> pub.pink>

Date: Sat, 4 Oct 2025 20:42:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

To reply to this bug, email your comments to 79573 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79573; Package emacs. (Sat, 04 Oct 2025 20:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to john muhl <jm <at> pub.pink>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 04 Oct 2025 20:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] New 'lua-mode' inferior process options
Date: Sat, 04 Oct 2025 15:40:57 -0500
Tags: patch

This adds user options for customizing the buffer name, startfile
and history file of the inferior process in lua-mode.

I noticed that using submit-emacs-patch added that big list of
people in the Author: header to the X-Debbugs-Cc so I added
Maintainer: emacs-devel.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79573; Package emacs. (Sat, 04 Oct 2025 20:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 79573 <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: 79573 <at> debbugs.gnu.org
Subject: Re: bug#79573: [PATCH] New 'lua-mode' inferior process options
Date: Sat, 04 Oct 2025 15:46:54 -0500
[0001-New-lua-mode-inferior-process-options-Bug-79573.patch (text/x-patch, attachment)]
From 099a09e3c0d786b9fee6c8f294348d8729768699 Mon Sep 17 00:00:00 2001
From: john muhl <jm <at> pub.pink>
Date: Sat, 4 Oct 2025 12:29:11 -0500
Subject: [PATCH] New 'lua-mode' inferior process options (Bug#79573)

* lisp/progmodes/lua-mode.el (lua-process-history)
(lua-process-name, lua-process-startfile): New option.
(lua-start-process): Use new options.
---
 lisp/progmodes/lua-mode.el | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/lisp/progmodes/lua-mode.el b/lisp/progmodes/lua-mode.el
index d65154a38cd..f9e77b8ddb2 100644
--- a/lisp/progmodes/lua-mode.el
+++ b/lisp/progmodes/lua-mode.el
@@ -12,7 +12,7 @@
 ;;              with tons of assistance from
 ;;              Paul Du Bois <pld-lua <at> gelatinous.com> and
 ;;              Aaron Smith <aaron-lua <at> gelatinous.com>.
-;;
+;; Maintainer: emacs-devel <at> gnu.org
 ;; Keywords: languages, processes, tools
 
 ;; This file is part of GNU Emacs.
@@ -1824,6 +1824,24 @@ lua-make-lua-string
            str t t)
           "'"))
 
+(defcustom lua-process-name nil
+  "Name of the inferior Lua buffer.
+If the value is nil then `lua-default-application' is used."
+  :type 'string
+  :safe 'stringp
+  :version "31.1")
+
+(defcustom lua-process-history nil
+  "File used to save command history of the inferior Lua process."
+  :type '(choice (const :tag "None" nil) file)
+  :safe 'string-or-null-p
+  :version "31.1")
+
+(defcustom lua-process-startfile nil
+  "File to load into the inferior Lua process at startup."
+  :type '(choice (const :tag "None" nil) (file :must-match t))
+  :version "31.1")
+
 ;;;###autoload
 (defalias 'run-lua #'lua-start-process)
 
@@ -1838,20 +1856,25 @@ lua-start-process
 
 SWITCHES is a list of strings passed as arguments to PROGRAM."
   (interactive)
-  (setq name (or name (if (consp lua-default-application)
-                          (car lua-default-application)
-                        lua-default-application)))
+  (setq name (or name lua-process-name (if (consp lua-default-application)
+                                           (car lua-default-application)
+                                         lua-default-application)))
   (setq program (or program lua-default-application))
   ;; Don't re-initialize if there already is a lua process
   (unless (comint-check-proc (format "*%s*" name))
-    (setq lua-process-buffer (apply #'make-comint name program startfile
-                                    (or switches lua-default-command-switches)))
+    (setq lua-process-buffer
+          (apply #'make-comint name program
+                 (or startfile lua-process-startfile)
+                 (or switches lua-default-command-switches)))
     (setq lua-process (get-buffer-process lua-process-buffer))
     (set-process-query-on-exit-flag lua-process nil)
     (with-current-buffer lua-process-buffer
       (setq lua--repl-buffer-p t)
       (compilation-shell-minor-mode 1)
-      (setq-local comint-prompt-regexp lua-prompt-regexp)
+      (setq-local comint-prompt-regexp lua-prompt-regexp
+                  comint-input-ring-file-name lua-process-history)
+      (add-hook 'kill-buffer-hook #'comint-write-input-ring nil t)
+      (comint-read-input-ring t)
 
       ;; Don't send initialization code until seeing the prompt to
       ;; ensure that the interpreter is ready.
-- 
2.51.0





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79573; Package emacs. (Sat, 04 Oct 2025 21:17:02 GMT) Full text and rfc822 format available.

Message #11 received at 79573 <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: 79573 <at> debbugs.gnu.org
Subject: Re: bug#79573: [PATCH] New 'lua-mode' inferior process options
Date: Sat, 04 Oct 2025 16:15:58 -0500
[Message part 1 (text/plain, inline)]
Whoops previous patch was an old version with a busted defcustom
definition. This one should be better.

[0001-New-lua-mode-inferior-process-options-Bug-79573.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79573; Package emacs. (Sun, 05 Oct 2025 05:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 79573 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: john muhl <jm <at> pub.pink>
Cc: 79573 <at> debbugs.gnu.org
Subject: Re: bug#79573: [PATCH] New 'lua-mode' inferior process options
Date: Sun, 05 Oct 2025 08:39:10 +0300
> From: john muhl <jm <at> pub.pink>
> Date: Sat, 04 Oct 2025 16:15:58 -0500
> 
> >From debb980fb816f5d0b689ba974be025ccde576213 Mon Sep 17 00:00:00 2001
> From: john muhl <jm <at> pub.pink>
> Date: Sat, 4 Oct 2025 12:29:11 -0500
> Subject: [PATCH] New 'lua-mode' inferior process options (Bug#79573)
> 
> * lisp/progmodes/lua-mode.el (lua-process-history)
> (lua-process-name, lua-process-startfile): New option.
                                                 ^^^^^^
"options", I guess?

> +(defcustom lua-process-name nil
> +  "Name of the inferior Lua buffer.

Is this the name of the process buffer?  If so, I suggest to call the
variable "lua-process-buffer-name".

> +If the value is nil then `lua-default-application' is used."

I suggest

  The value nil means use the same name as `lua-default-application'.

> +(defcustom lua-process-history nil
> +  "File used to save command history of the inferior Lua process."

How about naming the variable lua-process-history-file instead?

Also, the doc string should explain what happens when the value is
nil.

> +(defcustom lua-process-startfile nil
> +  "File to load into the inferior Lua process at startup."

How about

  Start file to load into the inferior Lua process at startup.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79573; Package emacs. (Sun, 05 Oct 2025 17:15:02 GMT) Full text and rfc822 format available.

Message #17 received at 79573 <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79573 <at> debbugs.gnu.org
Subject: Re: bug#79573: [PATCH] New 'lua-mode' inferior process options
Date: Sun, 05 Oct 2025 12:14:27 -0500
[Message part 1 (text/plain, inline)]
New patch with the improved names and docstrings. I also added a
user-error like the one you asked to be added in lua-ts-mode and
did a little cleanup to get rid of an unused internal variable and
replace setq with let.

Thanks.

[0001-New-lua-mode-inferior-process-options-Bug-79573.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: john muhl <jm <at> pub.pink>
>> Date: Sat, 04 Oct 2025 16:15:58 -0500
>> 
>> >From debb980fb816f5d0b689ba974be025ccde576213 Mon Sep 17 00:00:00 2001
>> From: john muhl <jm <at> pub.pink>
>> Date: Sat, 4 Oct 2025 12:29:11 -0500
>> Subject: [PATCH] New 'lua-mode' inferior process options (Bug#79573)
>> 
>> * lisp/progmodes/lua-mode.el (lua-process-history)
>> (lua-process-name, lua-process-startfile): New option.
>                                                  ^^^^^^
> "options", I guess?
>
>> +(defcustom lua-process-name nil
>> +  "Name of the inferior Lua buffer.
>
> Is this the name of the process buffer?  If so, I suggest to call the
> variable "lua-process-buffer-name".
>
>> +If the value is nil then `lua-default-application' is used."
>
> I suggest
>
>   The value nil means use the same name as `lua-default-application'.
>
>> +(defcustom lua-process-history nil
>> +  "File used to save command history of the inferior Lua process."
>
> How about naming the variable lua-process-history-file instead?
>
> Also, the doc string should explain what happens when the value is
> nil.
>
>> +(defcustom lua-process-startfile nil
>> +  "File to load into the inferior Lua process at startup."
>
> How about
>
>   Start file to load into the inferior Lua process at startup.
>
> Thanks.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79573; Package emacs. (Mon, 06 Oct 2025 21:02:01 GMT) Full text and rfc822 format available.

Message #20 received at 79573 <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79573 <at> debbugs.gnu.org
Subject: Re: bug#79573: [PATCH] New 'lua-mode' inferior process options
Date: Mon, 06 Oct 2025 16:01:36 -0500
Oops. Don’t commit that version it’s no good. Will get a fixed
version sent soon.

john muhl <jm <at> pub.pink> writes:

> New patch with the improved names and docstrings. I also added a
> user-error like the one you asked to be added in lua-ts-mode and
> did a little cleanup to get rid of an unused internal variable and
> replace setq with let.
>
> Thanks.
>
>
>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: john muhl <jm <at> pub.pink>
>>> Date: Sat, 04 Oct 2025 16:15:58 -0500
>>> 
>>> >From debb980fb816f5d0b689ba974be025ccde576213 Mon Sep 17 00:00:00 2001
>>> From: john muhl <jm <at> pub.pink>
>>> Date: Sat, 4 Oct 2025 12:29:11 -0500
>>> Subject: [PATCH] New 'lua-mode' inferior process options (Bug#79573)
>>> 
>>> * lisp/progmodes/lua-mode.el (lua-process-history)
>>> (lua-process-name, lua-process-startfile): New option.
>>                                                  ^^^^^^
>> "options", I guess?
>>
>>> +(defcustom lua-process-name nil
>>> +  "Name of the inferior Lua buffer.
>>
>> Is this the name of the process buffer?  If so, I suggest to call the
>> variable "lua-process-buffer-name".
>>
>>> +If the value is nil then `lua-default-application' is used."
>>
>> I suggest
>>
>>   The value nil means use the same name as `lua-default-application'.
>>
>>> +(defcustom lua-process-history nil
>>> +  "File used to save command history of the inferior Lua process."
>>
>> How about naming the variable lua-process-history-file instead?
>>
>> Also, the doc string should explain what happens when the value is
>> nil.
>>
>>> +(defcustom lua-process-startfile nil
>>> +  "File to load into the inferior Lua process at startup."
>>
>> How about
>>
>>   Start file to load into the inferior Lua process at startup.
>>
>> Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79573; Package emacs. (Tue, 07 Oct 2025 23:54:02 GMT) Full text and rfc822 format available.

Message #23 received at 79573 <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79573 <at> debbugs.gnu.org
Subject: Re: bug#79573: [PATCH] New 'lua-mode' inferior process options
Date: Tue, 07 Oct 2025 18:52:48 -0500
[Message part 1 (text/plain, inline)]
Here’s the fixed patch.

[0001-New-lua-mode-inferior-process-command-options.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

john muhl <jm <at> pub.pink> writes:

> Oops. Don’t commit that version it’s no good. Will get a fixed
> version sent soon.
>
> john muhl <jm <at> pub.pink> writes:
>
>> New patch with the improved names and docstrings. I also added a
>> user-error like the one you asked to be added in lua-ts-mode and
>> did a little cleanup to get rid of an unused internal variable and
>> replace setq with let.
>>
>> Thanks.
>>
>>
>>
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>>>> From: john muhl <jm <at> pub.pink>
>>>> Date: Sat, 04 Oct 2025 16:15:58 -0500
>>>> 
>>>> >From debb980fb816f5d0b689ba974be025ccde576213 Mon Sep 17 00:00:00 2001
>>>> From: john muhl <jm <at> pub.pink>
>>>> Date: Sat, 4 Oct 2025 12:29:11 -0500
>>>> Subject: [PATCH] New 'lua-mode' inferior process options (Bug#79573)
>>>> 
>>>> * lisp/progmodes/lua-mode.el (lua-process-history)
>>>> (lua-process-name, lua-process-startfile): New option.
>>>                                                  ^^^^^^
>>> "options", I guess?
>>>
>>>> +(defcustom lua-process-name nil
>>>> +  "Name of the inferior Lua buffer.
>>>
>>> Is this the name of the process buffer?  If so, I suggest to call the
>>> variable "lua-process-buffer-name".
>>>
>>>> +If the value is nil then `lua-default-application' is used."
>>>
>>> I suggest
>>>
>>>   The value nil means use the same name as `lua-default-application'.
>>>
>>>> +(defcustom lua-process-history nil
>>>> +  "File used to save command history of the inferior Lua process."
>>>
>>> How about naming the variable lua-process-history-file instead?
>>>
>>> Also, the doc string should explain what happens when the value is
>>> nil.
>>>
>>>> +(defcustom lua-process-startfile nil
>>>> +  "File to load into the inferior Lua process at startup."
>>>
>>> How about
>>>
>>>   Start file to load into the inferior Lua process at startup.
>>>
>>> Thanks.

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 18 Oct 2025 08:24:02 GMT) Full text and rfc822 format available.

Notification sent to john muhl <jm <at> pub.pink>:
bug acknowledged by developer. (Sat, 18 Oct 2025 08:24:02 GMT) Full text and rfc822 format available.

Message #28 received at 79573-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: john muhl <jm <at> pub.pink>
Cc: 79573-done <at> debbugs.gnu.org
Subject: Re: bug#79573: [PATCH] New 'lua-mode' inferior process options
Date: Sat, 18 Oct 2025 11:23:39 +0300
> From: john muhl <jm <at> pub.pink>
> Cc: 79573 <at> debbugs.gnu.org
> Date: Tue, 07 Oct 2025 18:52:48 -0500
> 
> Here’s the fixed patch.

Thanks, now installed on the master branch, and closing the bug.




This bug report was last modified 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.