all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
@ 2024-11-23 23:06 john muhl
  2024-11-23 23:08 ` john muhl
  0 siblings, 1 reply; 7+ messages in thread
From: john muhl @ 2024-11-23 23:06 UTC (permalink / raw)
  To: 74499; +Cc: philipk

Tags: patch

Philip mentioned changing these rx-to-string forms to use literal
over in bug#74235. I meant to include them there but guess it
slipped my mind.





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

* bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
  2024-11-23 23:06 bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode' john muhl
@ 2024-11-23 23:08 ` john muhl
  2024-11-24  1:21   ` Stefan Kangas
  2024-11-24 19:37   ` Philip Kaludercic
  0 siblings, 2 replies; 7+ messages in thread
From: john muhl @ 2024-11-23 23:08 UTC (permalink / raw)
  To: 74499; +Cc: philipk

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Avoid-loading-rx-at-runtime-in-lua-ts-mode.patch --]
[-- Type: text/x-patch, Size: 2327 bytes --]

From 309e80a336bce5c4a9191c87af636b8adfc04b97 Mon Sep 17 00:00:00 2001
From: john muhl <jm@pub.pink>
Date: Sat, 23 Nov 2024 14:08:21 -0600
Subject: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'

* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua):
Replace 'rx-to-string' and substitution with 'rx' and 'literal'.

(Bug#74499)
---
 lisp/progmodes/lua-ts-mode.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index f88fe0e49af..828636f359d 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -659,9 +659,9 @@ lua-ts-inferior-lua
         (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 @@ lua-ts-inferior-lua
                        ;; 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 " ")))
-- 
2.47.0


[-- Attachment #2: Type: text/plain, Size: 202 bytes --]



john muhl <jm@pub.pink> writes:

> Tags: patch
>
> Philip mentioned changing these rx-to-string forms to use literal
> over in bug#74235. I meant to include them there but guess it
> slipped my mind.

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

* bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
  2024-11-23 23:08 ` john muhl
@ 2024-11-24  1:21   ` Stefan Kangas
  2024-11-24  8:42     ` Eli Zaretskii
  2024-11-24 19:37   ` Philip Kaludercic
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2024-11-24  1:21 UTC (permalink / raw)
  To: john muhl, 74499-done; +Cc: philipk

john muhl <jm@pub.pink> writes:

> From 309e80a336bce5c4a9191c87af636b8adfc04b97 Mon Sep 17 00:00:00 2001
> From: john muhl <jm@pub.pink>
> Date: Sat, 23 Nov 2024 14:08:21 -0600
> Subject: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
>
> * lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua):
> Replace 'rx-to-string' and substitution with 'rx' and 'literal'.
>
> (Bug#74499)

Thanks for the patch, now installed on master as commit e71d714a815.

I'm therefore closing this bug report.





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

* bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
  2024-11-24  1:21   ` Stefan Kangas
@ 2024-11-24  8:42     ` Eli Zaretskii
  2024-11-24 10:37       ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-11-24  8:42 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 74499, jm

> Resent-To: bug-gnu-emacs@gnu.org
> Cc: philipk@posteo.net
> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Sat, 23 Nov 2024 20:21:22 -0500
> 
> john muhl <jm@pub.pink> writes:
> 
> > From 309e80a336bce5c4a9191c87af636b8adfc04b97 Mon Sep 17 00:00:00 2001
> > From: john muhl <jm@pub.pink>
> > Date: Sat, 23 Nov 2024 14:08:21 -0600
> > Subject: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
> >
> > * lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua):
> > Replace 'rx-to-string' and substitution with 'rx' and 'literal'.
> >
> > (Bug#74499)
> 
> Thanks for the patch, now installed on master as commit e71d714a815.

lua-ts-mode is new in Emacs 30, so changes in it should generally be
installed on the emacs-30 branch, unless they are dangerous or depend
on functionality we only have on master.  So I've now cherry-picked
this change to the emacs-30 branch.

Thanks.





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

* bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
  2024-11-24  8:42     ` Eli Zaretskii
@ 2024-11-24 10:37       ` Stefan Kangas
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Kangas @ 2024-11-24 10:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74499, jm

Eli Zaretskii <eliz@gnu.org> writes:

> lua-ts-mode is new in Emacs 30, so changes in it should generally be
> installed on the emacs-30 branch, unless they are dangerous or depend
> on functionality we only have on master.  So I've now cherry-picked
> this change to the emacs-30 branch.

Thanks for doing that.





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

* bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
  2024-11-23 23:08 ` john muhl
  2024-11-24  1:21   ` Stefan Kangas
@ 2024-11-24 19:37   ` Philip Kaludercic
  2024-11-26  2:04     ` john muhl
  1 sibling, 1 reply; 7+ messages in thread
From: Philip Kaludercic @ 2024-11-24 19:37 UTC (permalink / raw)
  To: john muhl; +Cc: 74499

john muhl <jm@pub.pink> writes:

> From 309e80a336bce5c4a9191c87af636b8adfc04b97 Mon Sep 17 00:00:00 2001
> From: john muhl <jm@pub.pink>
> Date: Sat, 23 Nov 2024 14:08:21 -0600
> Subject: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
>
> * lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua):
> Replace 'rx-to-string' and substitution with 'rx' and 'literal'.
>
> (Bug#74499)
> ---
>  lisp/progmodes/lua-ts-mode.el | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
> index f88fe0e49af..828636f359d 100644
> --- a/lisp/progmodes/lua-ts-mode.el
> +++ b/lisp/progmodes/lua-ts-mode.el
> @@ -659,9 +659,9 @@ lua-ts-inferior-lua
>          (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)))

Strictly speaking this could have introduced a regression, since literal
quotes the string, and it might be that someone has set
`lua-ts-inferior-prompt' to a quoted regular expression that is now
double-quoted, but I assume that this is an acceptable edge-case?

>          (comint-read-input-ring t)
>          (add-hook 'comint-preoutput-filter-functions
>                    (lambda (string)
> @@ -672,11 +672,11 @@ lua-ts-inferior-lua
>                         ;; 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 " ")))





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

* bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
  2024-11-24 19:37   ` Philip Kaludercic
@ 2024-11-26  2:04     ` john muhl
  0 siblings, 0 replies; 7+ messages in thread
From: john muhl @ 2024-11-26  2:04 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 74499

Philip Kaludercic <philipk@posteo.net> writes:

> john muhl <jm@pub.pink> writes:
>
>> From 309e80a336bce5c4a9191c87af636b8adfc04b97 Mon Sep 17 00:00:00 2001
>> From: john muhl <jm@pub.pink>
>> Date: Sat, 23 Nov 2024 14:08:21 -0600
>> Subject: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode'
>>
>> * lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua):
>> Replace 'rx-to-string' and substitution with 'rx' and 'literal'.
>>
>> (Bug#74499)
>> ---
>>  lisp/progmodes/lua-ts-mode.el | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
>> index f88fe0e49af..828636f359d 100644
>> --- a/lisp/progmodes/lua-ts-mode.el
>> +++ b/lisp/progmodes/lua-ts-mode.el
>> @@ -659,9 +659,9 @@ lua-ts-inferior-lua
>>          (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)))
>
> Strictly speaking this could have introduced a regression, since literal
> quotes the string, and it might be that someone has set
> `lua-ts-inferior-prompt' to a quoted regular expression that is now
> double-quoted, but I assume that this is an acceptable edge-case?

It doesn’t strike me as a significant issue but I don’t customize
prompts so maybe it’s in my blind spot. Feel free to revert it or
not as you see fit.





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

end of thread, other threads:[~2024-11-26  2:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-23 23:06 bug#74499: [PATCH] Avoid loading 'rx' at runtime in 'lua-ts-mode' john muhl
2024-11-23 23:08 ` john muhl
2024-11-24  1:21   ` Stefan Kangas
2024-11-24  8:42     ` Eli Zaretskii
2024-11-24 10:37       ` Stefan Kangas
2024-11-24 19:37   ` Philip Kaludercic
2024-11-26  2:04     ` john muhl

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.