From: "João Távora" <joaotavora@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "F. Jason Park" <jp@neverwas.me>, emacs-devel@gnu.org
Subject: Re: emacs-29 8bf4cdcf79: Avoid recursive process filters in lisp/jsonrpc.el (bug#60088)
Date: Sun, 18 Dec 2022 04:08:42 +0000 [thread overview]
Message-ID: <CALDnm50gyY7jnAs+77TDgYob2Ah2TRq3S+0PugVe3HRk=ZcJ4Q@mail.gmail.com> (raw)
In-Reply-To: <jwv5ye9zmic.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1851 bytes --]
On Sun, Dec 18, 2022 at 1:57 AM Stefan Monnier <monnier@iro.umontreal.ca>
wrote:
> I guess you can see it that way too. So there are two ways to solve
> > this:
> >
> > * only process-send-input in process filters makes sense
> > * all but process-send-input in process filters makes sense
>
> I assume you meant to write `process-send-string`, but I don't know what
> you mean by the above (I understand neither bullets).
>
Yes, it's process-send-string. I talked earlier about how I think sit-for
and
accept-process-output are two primitives that could just error when
called from within a process filter, because there's no possible reasonable
use for them, because they lead to recursive filters and recursive filters
are arguably "unreasonable". But process-send-string (without
output-acceptance) in a filter makes sense. That's the first bullet.
The other bullet is that a-p-output and sit-for and even recursive filters
may
make sense (if you know what you are doing, i suppose), but the common
case of sending a follow up message to a process (as a direct consequence
of the output just received) should _not_ be handled with an in-filter
p-s-string,
but with something else, like the run-at-timer idea. In that case we can
keep
process-send-string's output acceptance.
> > I'm more into of the first persuasion, but I think it shouldn't allow
> > output to be accepted when called from within a process filter.
>
> Indeed, as a general rule doing a "blocking wait", such as
> `accept-process-output` from within async code (process filter, timer,
> etc..) is generally undesirable.
>
I agree, but process-send-string is never blocking, is it? And anyway
if we go your 'spawn' or 'run-asap' way, we don't need to change
process-send-string's output-acceptance semantics at all.
João
[-- Attachment #2: Type: text/html, Size: 2681 bytes --]
next prev parent reply other threads:[~2022-12-18 4:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <167118072395.30479.8819833637573037468@vcs2.savannah.gnu.org>
[not found] ` <20221216085204.43B07C04961@vcs2.savannah.gnu.org>
2022-12-16 14:36 ` emacs-29 8bf4cdcf79: Avoid recursive process filters in lisp/jsonrpc.el (bug#60088) Stefan Monnier
2022-12-16 14:46 ` João Távora
2022-12-16 14:56 ` Stefan Monnier
2022-12-17 5:37 ` F. Jason Park
2022-12-17 15:37 ` Stefan Monnier
2022-12-17 21:39 ` João Távora
2022-12-18 1:57 ` Stefan Monnier
2022-12-18 4:08 ` João Távora [this message]
2022-12-18 14:32 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALDnm50gyY7jnAs+77TDgYob2Ah2TRq3S+0PugVe3HRk=ZcJ4Q@mail.gmail.com' \
--to=joaotavora@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=jp@neverwas.me \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).