* bug#73420: 30.0.90; Race condition in `ansi-osc-apply-on-region' with concurrent user input
@ 2024-09-22 7:37 Augusto Stoffel
2024-09-22 8:21 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Augusto Stoffel @ 2024-09-22 7:37 UTC (permalink / raw)
To: 73420
In the current implementation of `ansi-osc-apply-on-region', the
intention of the calls to `buffer-substring-no-properties' and
`delete-region' is to get the payload of the OSC control sequence
currently being parsed.
However, it is possible that the user typed some characters in the
buffer while the OSC payload is arriving (and I have actually observed
this happen if the payload is moderately large). So
`buffer-substring-no-properties' should be replaced with something that
gets the buffer text in that range, but restricted to the portions that
actually came from the subprocess.
PS: Is there already a version of `filter-buffer-substring' anywhere in
Emacs that filters based on the value of a given text property, or do
people bake their own every time?
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#73420: 30.0.90; Race condition in `ansi-osc-apply-on-region' with concurrent user input
2024-09-22 7:37 bug#73420: 30.0.90; Race condition in `ansi-osc-apply-on-region' with concurrent user input Augusto Stoffel
@ 2024-09-22 8:21 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2024-09-22 8:21 UTC (permalink / raw)
To: Augusto Stoffel; +Cc: Matthias Meulien, 73420
> From: Augusto Stoffel <arstoffel@gmail.com>
> Date: Sun, 22 Sep 2024 09:37:55 +0200
>
> In the current implementation of `ansi-osc-apply-on-region', the
> intention of the calls to `buffer-substring-no-properties' and
> `delete-region' is to get the payload of the OSC control sequence
> currently being parsed.
>
> However, it is possible that the user typed some characters in the
> buffer while the OSC payload is arriving (and I have actually observed
> this happen if the payload is moderately large). So
> `buffer-substring-no-properties' should be replaced with something that
> gets the buffer text in that range, but restricted to the portions that
> actually came from the subprocess.
Thanks. Since you (together with Matthias) are the author of
ansi-osc.el, would you like to propose a solution for this?
> PS: Is there already a version of `filter-buffer-substring' anywhere in
> Emacs that filters based on the value of a given text property, or do
> people bake their own every time?
Looks like the latter, see backtrace--filter-visible, for example.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-22 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 7:37 bug#73420: 30.0.90; Race condition in `ansi-osc-apply-on-region' with concurrent user input Augusto Stoffel
2024-09-22 8:21 ` 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).