GNU bug report logs - #15045
Point jumps inappropriately around time of Semantic lexing

Previous Next

Package: emacs;

Reported by: Barry OReilly <gundaetiapo <at> gmail.com>

Date: Wed, 7 Aug 2013 18:00:02 UTC

Severity: normal

Done: Barry OReilly <gundaetiapo <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #161 received at 15045 <at> debbugs.gnu.org (full text, mbox):

From: Barry OReilly <gundaetiapo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15045 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 David Engster <deng <at> randomsample.de>, Eric Ludlam <eric <at> siege-engine.com>
Subject: Re: bug#15045: Point jumps inappropriately around time of Semantic
 lexing
Date: Mon, 14 Oct 2013 15:32:40 -0400
[Message part 1 (text/plain, inline)]
> >> >> That sounds wrong.
> >> > Are you saying that using the READABLE_EVENTS_DO_TIMERS_NOW flag
above
> >> > is wrong?
> >> I think so: input-pending-p is not expected to wait, so I don't see any
> >> reason to run timers.
> > I think the only reason, as with all the other places where we run
> > timers, is to make Emacs look appear more responsive, notwithstanding
> > the on-going processing.
>
> I suspect that the users of input-pending-p which care about running
> timers would be better served by (sit-for 0 t).  Currently, it's 100%
> equivalent, but the intention is a lot more clear.

Given this has come up again separately in bug 15567, may I make the
change to input-pending-p?

diff --git a/src/keyboard.c b/src/keyboard.c
index e0cd4d4..fdb7c7d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -9962,8 +9962,7 @@ if there is a doubt, the value is t.  */)
   /* Process non-user-visible events (Bug#10195).  */
   process_special_events ();

-  return (get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW
-                            | READABLE_EVENTS_FILTER_EVENTS)
+  return (get_input_pending (READABLE_EVENTS_FILTER_EVENTS)
          ? Qt : Qnil);
 }

'make check' passes.

Eli Zaretskii:
> What if input arrives because of a timer?

If this is an issue, I propose input-pending-p return t if a timer is
ready to run. Then the long running task would exit, unwind its
save-excursion, then allow the timer to run. Perhaps this contorts the
meaning of "input", but OTOH the documentation for input-pending-p
already states that a false positive return can happen:

  Return t if command input is currently available with no wait.
  Actually, the value is nil only if we can be sure that no input is
  available; if there is a doubt, the value is t.

Would you want this in the same changeset as the patch above? Or not
worry about it until "someone screams"?
[Message part 2 (text/html, inline)]

This bug report was last modified 11 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.