unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@gnu.org>
To: Jim Paris <jim@jtan.com>
Cc: 11536@debbugs.gnu.org
Subject: bug#11536: 23.4; frequent spurious auto-save while typing
Date: Sat, 03 Nov 2012 23:46:36 +0800	[thread overview]
Message-ID: <87d2zupu3n.fsf@gnu.org> (raw)
In-Reply-To: <20120521212217.GA29282@psychosis.jim.sh> (Jim Paris's message of "Mon, 21 May 2012 17:22:17 -0400")

Jim Paris <jim@jtan.com> writes:

> The call to keyboard.c:set_waiting_for_input is essentially telling the
> keyboard.c:input_available_signal handler to reset &timeout to zero in
> the case of SIGIO.  However, consider what happens if a key is pressed
> and SIGIO is received between set_waiting_for_input and select.
> Then timeout will have been set to zero, and select will return
> immediately with nfds == 0.  The check in 5007 will then break the
> while loop, causing wait_reading_process_output to return immediately
> without any data having been read -- triggering the auto-save back
> in keyboard.c:read_char.
>
> It seems the fix is simple: remove lines 5007-5009.  It's a small
> optimization that isn't necessary, because the later check at line 5129
> already covers the case where nfds == 0.  Continuing the loop is fine,
> because the top of the loop checks for an expired timeout and returns.

Thanks for the bug report and the analysis.  I couldn't reproduce the
problem, but off the top of my head the analysis is correct, so I've
made the change you suggested in trunk.





  reply	other threads:[~2012-11-03 15:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21 21:22 bug#11536: 23.4; frequent spurious auto-save while typing Jim Paris
2012-11-03 15:46 ` Chong Yidong [this message]
2021-08-23 15:04 ` Lars Ingebrigtsen
2021-09-21  5:40   ` 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=87d2zupu3n.fsf@gnu.org \
    --to=cyd@gnu.org \
    --cc=11536@debbugs.gnu.org \
    --cc=jim@jtan.com \
    /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).