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.devel Subject: Re: A whole lotta auto-saving going Date: Mon, 11 Jan 2021 17:04:58 +0200 Message-ID: <83k0sjfrad.fsf@gnu.org> References: <8735zdyly0.fsf@gnus.org> <87y2h1vyhq.fsf@gnus.org> <877dokq0fz.fsf@gnus.org> <83y2h0g0rk.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28271"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, aaronjensen@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 11 16:08:23 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 1kyynv-0007FP-Ax for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Jan 2021 16:08:23 +0100 Original-Received: from localhost ([::1]:34708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyynu-0000RX-A1 for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Jan 2021 10:08:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyykW-0004PP-KV for emacs-devel@gnu.org; Mon, 11 Jan 2021 10:04:53 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37779) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyykW-0001o2-Cw; Mon, 11 Jan 2021 10:04:52 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4893 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kyykS-0007ia-6J; Mon, 11 Jan 2021 10:04:49 -0500 In-Reply-To: (message from Stefan Monnier on Sun, 10 Jan 2021 23:23:23 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:262910 Archived-At: > From: Stefan Monnier > Cc: Lars Ingebrigtsen , aaronjensen@gmail.com, > emacs-devel@gnu.org > Date: Sun, 10 Jan 2021 23:23:23 -0500 > > Apparently, the early exit from `wait_reading_process_output` comes from > the following `break`: > > if (!process_skipped && got_some_output > 0 > && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) > { > if (!timespec_valid_p (got_output_end_time)) > break; > > Does someone here understanding something of what > `wait_reading_process_output` does and what it is expected to do? You mean, in general? or in this specific case? The latter is described by the comment above this fragment. > Why does it exit here before the end of the timeout? IIUC it is > supposed to exit as soon as we got some output from `wait_proc`, but in > this case `wait_proc` is NULL. Is it also supposed to exit when some > process output arrives? If so, shouldn't `sit_for` wrap the call to > `wait_reading_process_output` inside a loop to make sure we wait the > whole timeout? I think sitting for the entire period is undesirable, since receiving output from a process might require redisplay. In that case, waiting could make Emacs seem unresponsive or busy, whereas it really isn't. I think a simple solution to this would be to check the time passed after sit_for returns, and if some of the wait time is left, not call auto-save. This would mimic what happened before the offending changeset. We could, of course, add a loop inside sit_for, but that function is called in a few other places, and even in this place it isn't certain that we never want it to return early upon receiving process output. So, while adding a loop, and then dealing with whatever further breakage this will cause could be an exciting project, I'm not sure we are looking for such an excitement. One cleanup at a time, okay?