all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "João Távora" <joaotavora@gmail.com>
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: Sat, 17 Dec 2022 20:57:04 -0500	[thread overview]
Message-ID: <jwv5ye9zmic.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <877cypbth9.fsf@gmail.com> ("João Távora"'s message of "Sat, 17 Dec 2022 21:39:14 +0000")

>> Indeed.  I think this points to the need to "spawn" a piece of code to
>> be executed "ASAP" but not necessarily immediately.
>
> Would that be sth like
>
>   (if in-process-filter (run-at-time 0 nil #'piece-of-code) (piece-of-code))
>
> ? ... supposing in-process-filter existed, of course.

I was thinking of something more like unconditonally

    (run-at-time 0 nil #'piece-of-code)

tho abstracted behind a function.

>> This way when a process filter needs to send something in response to
>> what it received, it can just "spawn" the send, so we can return from
>> the process filter before the send finishes.
>
> 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).

> 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.


        Stefan




  reply	other threads:[~2022-12-18  1:57 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 [this message]
2022-12-18  4:08             ` João Távora
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv5ye9zmic.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=jp@neverwas.me \
    /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 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.