unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67616: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua
@ 2023-12-04  3:26 Noah Peart
  2023-12-04  4:18 ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 5+ messages in thread
From: Noah Peart @ 2023-12-04  3:26 UTC (permalink / raw)
  To: 67616


[-- Attachment #1.1: Type: text/plain, Size: 734 bytes --]

Tags: patch


Bug: In `lua-ts-inferior-lua`, `comint-preoutput-filter-functions` hook
isn't added locally.


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2023-12-03 built on noah-X580VD
Repository revision: 9c1f24d7a497ee8b9c1ec3f1161a3ed7d6e34bd0
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.3 LTS

Configured using:
 'configure --prefix=/usr/local --with-modules --with-tree-sitter
--with-threads --with-x-toolkit=gtk3 --with-xwidgets --with-gnutls
--with-json --with-mailutils --with-jpeg --with-png --with-rsvg
--with-tiff --with-xml2 --with-xpm --with-imagemagick CC=gcc-12
CXX=gcc-12'

[-- Attachment #1.2: Type: text/html, Size: 842 bytes --]

[-- Attachment #2: lua-ts-inferior-hook.patch --]
[-- Type: text/x-patch, Size: 1168 bytes --]

From f5a8ea39731c32755d6c3d76bbdf3d621a0f5388 Mon Sep 17 00:00:00 2001
From: nverno <noah.v.peart@gmail.com>
Date: Sun, 3 Dec 2023 19:21:04 -0800
Subject: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua

* lisp/progmodes/lua-ts-mode.el(lua-ts-inferior-lua): Add
comint-preoutput-filter-functions hook locally.
---
 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 7307a5b13f1..13b6faa2950 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -576,7 +576,8 @@ lua-ts-inferior-lua
                                                     (group (* nonl))))
                                                "\\1" string)
                      ;; Re-add the prompt for the next line.
-                     lua-ts-inferior-prompt " "))))))
+                     lua-ts-inferior-prompt " ")))
+                nil t)))
   (select-window (display-buffer lua-ts-inferior-buffer
                                  '((display-buffer-reuse-window
                                     display-buffer-pop-up-frame)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#67616: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua
  2023-12-04  3:26 bug#67616: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua Noah Peart
@ 2023-12-04  4:18 ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-04  7:58   ` Noah Peart
  0 siblings, 1 reply; 5+ messages in thread
From: john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-04  4:18 UTC (permalink / raw)
  To: Noah Peart; +Cc: 67616

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

Noah Peart <noah.v.peart@gmail.com> writes:

> Tags: patch
>
> Bug: In `lua-ts-inferior-lua`, `comint-preoutput-filter-functions` hook
> isn't added locally.

Thanks. I think that obsoletes the buffer-name check at the
beginning. A quick test looks that way to me. Could you give a try?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-add-comint-hook-locally-in-lua-ts-inferior-lua.patch --]
[-- Type: text/x-patch, Size: 1745 bytes --]

From 077258d0f95d6597108a5cab8b73833deba05339 Mon Sep 17 00:00:00 2001
From: nverno <noah.v.peart@gmail.com>
Date: Sun, 3 Dec 2023 19:21:04 -0800
Subject: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua

* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Add
comint-preoutput-filter-functions hook locally.
---
 lisp/progmodes/lua-ts-mode.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 7307a5b13f1..5318144a057 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -560,9 +560,7 @@ lua-ts-inferior-lua
       (comint-read-input-ring t)
       (add-hook 'comint-preoutput-filter-functions
                 (lambda (string)
-                  (if (or (not (equal (buffer-name) lua-ts-inferior-buffer))
-                          (equal string
-                                 (concat lua-ts-inferior-prompt-continue " ")))
+                  (if (equal string (concat lua-ts-inferior-prompt-continue " "))
                       string
                     (concat
                      ;; Filter out the extra prompt characters that
@@ -576,7 +574,8 @@ lua-ts-inferior-lua
                                                     (group (* nonl))))
                                                "\\1" string)
                      ;; Re-add the prompt for the next line.
-                     lua-ts-inferior-prompt " "))))))
+                     lua-ts-inferior-prompt " ")))
+                nil t)))
   (select-window (display-buffer lua-ts-inferior-buffer
                                  '((display-buffer-reuse-window
                                     display-buffer-pop-up-frame)
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#67616: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua
  2023-12-04  4:18 ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-04  7:58   ` Noah Peart
  2023-12-04 18:17     ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 5+ messages in thread
From: Noah Peart @ 2023-12-04  7:58 UTC (permalink / raw)
  To: john muhl; +Cc: 67616

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

Yea, that looks good to me.  Is it necessary to set
`comint-use-prompt-regexp` to `t`?
The behaviour of `comint-previous/next-prompt` seems better when that is
nil.
Thanks!

On Sun, Dec 3, 2023 at 8:30 PM john muhl <jm@pub.pink> wrote:

> Noah Peart <noah.v.peart@gmail.com> writes:
>
> > Tags: patch
> >
> > Bug: In `lua-ts-inferior-lua`, `comint-preoutput-filter-functions` hook
> > isn't added locally.
>
> Thanks. I think that obsoletes the buffer-name check at the
> beginning. A quick test looks that way to me. Could you give a try?
>
>

[-- Attachment #2: Type: text/html, Size: 918 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#67616: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua
  2023-12-04  7:58   ` Noah Peart
@ 2023-12-04 18:17     ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-16  9:39       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-04 18:17 UTC (permalink / raw)
  To: Noah Peart; +Cc: 67616

[-- Attachment #1: Type: text/plain, Size: 351 bytes --]

Noah Peart <noah.v.peart@gmail.com> writes:

> Yea, that looks good to me.  Is it necessary to set
> `comint-use-prompt-regexp` to `t`?
> The behaviour of `comint-previous/next-prompt` seems better when
> that is nil.
> Thanks!

You’re right. I wasn’t able to get creative enough to merge them
into a single commit so it’s separate.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-add-comint-hook-locally-in-lua-ts-inferior-lua.patch --]
[-- Type: text/x-patch, Size: 1758 bytes --]

From a354925d561725b1df310ca036519c26fb7f081a Mon Sep 17 00:00:00 2001
From: nverno <noah.v.peart@gmail.com>
Date: Sun, 3 Dec 2023 19:21:04 -0800
Subject: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua

* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Add
comint-preoutput-filter-functions hook locally.  (bug#67616)
---
 lisp/progmodes/lua-ts-mode.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 7307a5b13f1..5318144a057 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -560,9 +560,7 @@ lua-ts-inferior-lua
       (comint-read-input-ring t)
       (add-hook 'comint-preoutput-filter-functions
                 (lambda (string)
-                  (if (or (not (equal (buffer-name) lua-ts-inferior-buffer))
-                          (equal string
-                                 (concat lua-ts-inferior-prompt-continue " ")))
+                  (if (equal string (concat lua-ts-inferior-prompt-continue " "))
                       string
                     (concat
                      ;; Filter out the extra prompt characters that
@@ -576,7 +574,8 @@ lua-ts-inferior-lua
                                                     (group (* nonl))))
                                                "\\1" string)
                      ;; Re-add the prompt for the next line.
-                     lua-ts-inferior-prompt " "))))))
+                     lua-ts-inferior-prompt " ")))
+                nil t)))
   (select-window (display-buffer lua-ts-inferior-buffer
                                  '((display-buffer-reuse-window
                                     display-buffer-pop-up-frame)
-- 
2.41.0


[-- Attachment #3: 0001-Fix-comint-next-previous-prompt-in-lua-ts-mode.patch --]
[-- Type: text/x-patch, Size: 1140 bytes --]

From 939c0d0144551b664f03ea5ac9486c2f02f295e1 Mon Sep 17 00:00:00 2001
From: john muhl <jm@pub.pink>
Date: Mon, 4 Dec 2023 12:03:34 -0600
Subject: [PATCH] Fix comint-next/previous-prompt in lua-ts-mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Don’t set
`comint-use-prompt-regexp'.  (bug#67616)
---
 lisp/progmodes/lua-ts-mode.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 5318144a057..cbf0e573e37 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -552,7 +552,6 @@ lua-ts-inferior-lua
     (with-current-buffer lua-ts-inferior-buffer
       (setq-local comint-input-ignoredups t
                   comint-input-ring-file-name lua-ts-inferior-history
-                  comint-use-prompt-regexp t
                   comint-prompt-read-only t
                   comint-prompt-regexp (rx-to-string `(: bol
                                                          ,lua-ts-inferior-prompt
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#67616: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua
  2023-12-04 18:17     ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-16  9:39       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2023-12-16  9:39 UTC (permalink / raw)
  To: john muhl; +Cc: noah.v.peart, 67616-done

> Cc: 67616@debbugs.gnu.org
> Date: Mon, 04 Dec 2023 12:17:27 -0600
> From:  john muhl via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Noah Peart <noah.v.peart@gmail.com> writes:
> 
> > Yea, that looks good to me.  Is it necessary to set
> > `comint-use-prompt-regexp` to `t`?
> > The behaviour of `comint-previous/next-prompt` seems better when
> > that is nil.
> > Thanks!
> 
> You’re right. I wasn’t able to get creative enough to merge them
> into a single commit so it’s separate.

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

P.S. Please both of you see how I edited the commit log messages in
minor ways, and try to follow this in the future.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-16  9:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04  3:26 bug#67616: [PATCH] Fix: add comint hook locally in lua-ts-inferior-lua Noah Peart
2023-12-04  4:18 ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-04  7:58   ` Noah Peart
2023-12-04 18:17     ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-16  9:39       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).