unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: larsi@gnus.org, aaronjensen@gmail.com, emacs-devel@gnu.org
Subject: Re: A whole lotta auto-saving going
Date: Mon, 11 Jan 2021 17:04:58 +0200	[thread overview]
Message-ID: <83k0sjfrad.fsf@gnu.org> (raw)
In-Reply-To: <jwv8s90861i.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Sun, 10 Jan 2021 23:23:23 -0500)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>,  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?



  reply	other threads:[~2021-01-11 15:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 22:05 A whole lotta auto-saving going Aaron Jensen
2021-01-07 12:24 ` Lars Ingebrigtsen
2021-01-07 15:21   ` Stefan Monnier
2021-01-08 14:05     ` Aaron Jensen
2021-01-08 14:19       ` Aaron Jensen
2021-01-10 11:10         ` Lars Ingebrigtsen
2021-01-10 15:08           ` Aaron Jensen
2021-01-10 15:24             ` Lars Ingebrigtsen
2021-01-10 17:27               ` Eli Zaretskii
2021-01-10 17:38                 ` Stefan Monnier
2021-01-11  4:23                   ` Stefan Monnier
2021-01-11 15:04                     ` Eli Zaretskii [this message]
2021-01-11 16:00                       ` Stefan Monnier
2021-01-11 16:54                         ` Eli Zaretskii
2021-01-11 18:00                           ` Stefan Monnier
2021-01-12 14:58                             ` Eli Zaretskii
2021-01-12 15:18                               ` Stefan Monnier
2021-01-13 22:25                             ` Stefan Monnier
2021-01-18 16:06                               ` Lars Ingebrigtsen
2021-01-10 17:18           ` Stefan Monnier
2021-01-10 18:34             ` T.V Raman
2021-01-10 18:54               ` Aaron Jensen
2021-01-12 16:02                 ` T.V Raman via Emacs development discussions.
2021-01-07 14:55 ` Eli Zaretskii
2021-01-10 11:09   ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83k0sjfrad.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aaronjensen@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).