From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: accept-process-output throws Date: Sat, 27 Nov 2021 09:31:09 -0500 Message-ID: References: <29A79E00-3117-4F18-BB4F-3ADD2DBB0806@gmail.com> <838rxe9quw.fsf@gnu.org> <834k81afv2.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37569"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 27 15:31:55 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqyk7-0009fw-0k for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 15:31:55 +0100 Original-Received: from localhost ([::1]:44392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqyk5-0006dp-JE for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 09:31:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqyjW-0005ww-39 for emacs-devel@gnu.org; Sat, 27 Nov 2021 09:31:18 -0500 Original-Received: from [2607:f8b0:4864:20::82a] (port=34575 helo=mail-qt1-x82a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqyjU-0007NB-7u; Sat, 27 Nov 2021 09:31:17 -0500 Original-Received: by mail-qt1-x82a.google.com with SMTP id o17so11679729qtk.1; Sat, 27 Nov 2021 06:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UqIh/ZlwmHTounj79Q1sIwmZmM/FOVVaYab2CWnOCqI=; b=KlgfssknQy0vlUPGtgzg+I4UsYeAb07S9/ZQEhiVEKwRhu2dnRfgTZTY1gg/qT/eee 3x0D76P/QJoZm3UcjeEhiGwlM1vkipi/saDsqyCyNxoMCbqpcQ/maLAWYl7cEsCIvDLY AS0mcai5H+cDl6aecH3YRH7SAPcUX1sbnNlJBwz5yxnCXrY/kInULmgwCxBboRn6qjG8 vxzagoCzk5qBHTDjUDhuveSZAXKoMxGhy6EtVpX4rnZYfLnvYf14qLJGJthej8+81LTm AUVkxpcQsvPkK0QFRjCjZGXLN+iyqjv0NcefhZe6VecfTis6teJGGOLQPVWS6AMLpF3c xxVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UqIh/ZlwmHTounj79Q1sIwmZmM/FOVVaYab2CWnOCqI=; b=swx+4odkYKLDQ55Dzr30pnVXIMJp0K71VJLqCevoHwf+nEifAMx4kg3+Bg+Tdl2mSB 0P8Xm8nQ68glsRKqpxg+txPc6oMeibAMALSMGC3N0YUt//l94Th5fh86uajfDBhzZEn8 HyBU7EWqyyaUPQPgCUhex3Yiem1yBa7EVnXZTz03tDU1PdRrqirVD82R4VI+dwDm1bgy QmnpOylRDT6zQ0xWBZm+WCszHriU9QWMy3cVesjOStA6xZ2pFUf2e5TSEEkqHc+iPWgg nE4RA1kSpeRUHQ6jEXjIEPuedrvBtit/TnSOfzWlkVpN7Jxr/uqnNPjVSVRZYHT83Ojl MjRA== X-Gm-Message-State: AOAM530O1mNkz/iGjyX8TwDcLnkFWG4A8v36KiVDc3iov4l6LWD1lBfA XkMYi+ZoMz38/bMZhSdIM660ivNrDDY= X-Google-Smtp-Source: ABdhPJxQ0z1p8MzwQ9mW3dIKwringV3Br+ycovXqpRgJeI7Sv2878cQCH5QREQl/h3U4Hut4pLf7DQ== X-Received: by 2002:ac8:4d87:: with SMTP id a7mr31783362qtw.410.1638023473438; Sat, 27 Nov 2021 06:31:13 -0800 (PST) Original-Received: from smtpclient.apple (cm-134-228-57-173.buckeyecom.net. [134.228.57.173]) by smtp.gmail.com with ESMTPSA id a38sm4983592qkp.80.2021.11.27.06.31.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Nov 2021 06:31:12 -0800 (PST) In-Reply-To: <834k81afv2.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.80.0.2.43) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::82a (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=jdtsmith@gmail.com; helo=mail-qt1-x82a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:280342 Archived-At: > 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=E2=80=99s = help) =E2=80=94 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) =E2=80=A6.). I mention this in = the hopes it saves someone else a day of debugging! =20 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 = =E2=80=9Cstop what you are doing, I=E2=80=99ve got more input here=E2=80=9D= . I suppose this would require accept-process-output to have such a = matching cancellation function, and to then signal a specific =E2=80=9CI = was cancelled" error.=