From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43834: 27.1; [PATCH] Sentinels under X and command line Date: Tue, 06 Oct 2020 21:57:49 +0300 Message-ID: <83mu0z9o7m.fsf@gnu.org> References: <87y2kjgqj5.fsf@dick> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10002"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43834@debbugs.gnu.org To: dick Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 06 20:58:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kPsA6-0002Th-EE for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Oct 2020 20:58:10 +0200 Original-Received: from localhost ([::1]:56252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPsA5-0007Ms-FT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Oct 2020 14:58:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPs9y-0007MP-PM for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2020 14:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPs9y-0001EX-Fw for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2020 14:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kPs9y-00075Q-FT for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2020 14:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Oct 2020 18:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43834 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 43834-submit@debbugs.gnu.org id=B43834.160201067327224 (code B ref 43834); Tue, 06 Oct 2020 18:58:02 +0000 Original-Received: (at 43834) by debbugs.gnu.org; 6 Oct 2020 18:57:53 +0000 Original-Received: from localhost ([127.0.0.1]:54172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPs9p-000752-Cb for submit@debbugs.gnu.org; Tue, 06 Oct 2020 14:57:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPs9n-00074p-Qp for 43834@debbugs.gnu.org; Tue, 06 Oct 2020 14:57:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57504) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPs9i-0001DT-GL; Tue, 06 Oct 2020 14:57:46 -0400 Original-Received: from [176.228.60.248] (port=1612 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kPs9h-00082M-Bq; Tue, 06 Oct 2020 14:57:46 -0400 In-Reply-To: <87y2kjgqj5.fsf@dick> (message from dick on Tue, 06 Oct 2020 14:25:50 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189931 Archived-At: > From: dick > Date: Tue, 06 Oct 2020 14:25:50 -0400 > > emacs -Q -l cl-lib \ > --eval "(let* (flag \ > (proc (apply (function start-process) \"test\" nil \"sleep\" (list \"3\")))) \ > (set-process-sentinel proc (lambda (&rest _args) (setq flag t))) \ > (cl-assert (cl-loop repeat 10 \ > until flag \ > do (accept-process-output nil 0.5) \ > finally return flag)) \ > (message \"good!\"))" > > >From cd25ae2e9f8cf1d155084c125dae4058fccb6544 Mon Sep 17 00:00:00 2001 > From: dickmao > Date: Tue, 6 Oct 2020 14:21:03 -0400 > Subject: [PATCH] Process sentinels need to work under X and commandline > > This is also noted in > https://emacs.stackexchange.com/questions/60408/\ > process-sentinels-dont-run-during-init-in-gui-emacs > > * src/process.c (add_non_keyboard_read_fd): Make this a public function. > (add_process_read_fd): Fold old, static add_non_keyboard_read_fd guts > into here. > * src/xsmfns.c (ice_conn_watch_CB): Call add_non_keyboard_read_fd. I'm probably missing something, because I don't understand the rationale for your changes. Can you please elaborate on the rationale? Also, are your changes supposed to fix the problem reported at stackexchange, and if so, please also elaborate on that. Thanks. P.S. I'd prefer not to change the add_*_fd unless strictly necessary. It's okay to make a static function be extern, but can we please avoid other reshuffling? If necessary (but I'd like to understand why), I'd even prefer introducing a new function, rather than changing the existing ones. Specifically, I'd like to avoid the change of the semantics of add_non_keyboard_read_fd.