all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: accept-process-output throws
Date: Sat, 27 Nov 2021 09:31:09 -0500	[thread overview]
Message-ID: <AABFE6B8-1D23-4AE7-AC53-DC8C08281B3A@gmail.com> (raw)
In-Reply-To: <834k81afv2.fsf@gnu.org>


> In this kind of complicated situations, I usually find it much simpler
> and more efficient to run under GDB with a breakpoint on Fsignal and
> Fthrow.  Then, when one of these breaks, examine the backtrace to find
> out which code exited non-locally.

Thanks Eli.  I believe I have figured it out (without GDB’s help) — the UI I was using with the small timer delay was effectively wrapping my function in while-no-input.  The fix could have been as easy as (let (throw-on-input) ….).  I mention this in the hopes it saves someone else a day of debugging!  

What this does make clear is that async process output and while-no-input are like oil and water.  It also points to the value of cancellable futures as a kinder way to tell a process-awaiting function “stop what you are doing, I’ve got more input here”.  I suppose this would require accept-process-output to have such a matching cancellation function, and to then signal a specific “I was cancelled" error.


      reply	other threads:[~2021-11-27 14:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 20:36 accept-process-output throws JD Smith
2021-11-24  3:25 ` Eli Zaretskii
2021-11-24  5:14   ` JD Smith
2021-11-24 12:38     ` Eli Zaretskii
2021-11-27 14:31       ` JD Smith [this message]

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=AABFE6B8-1D23-4AE7-AC53-DC8C08281B3A@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.