Subject: Re: bug#22287: 25.1.50; Sudden jumping point in buffer

From: David Engster <[email-masked]>
Date: Sun, 03 Jan 2016 16:47:29 +0100

Stefan-W. Hahn writes:
> With this I got (after starting and setting garbage-collection-messages t,
> and doing stuff as described in the bug-report):
>
> ,----
> | *** handle atimers [540 times]
> | *** sem start: buffer intervals.c 49722
> | *** sem: buffer intervals.c 49722
> | *** input: rc=nil 49722 49722
> | *** out: rc=nil 49722 49722
> | *** sem: buffer intervals.c 49722
> | *** input: rc=nil 49722 49722
> | *** out: rc=nil 49722 49722
> | *** sem: buffer intervals.c 49722
> | *** input: rc=nil 49722 49722
> | *** out: rc=nil 49722 49722
> | *** sem: buffer intervals.c 49722
> | *** input: rc=nil 49722 49722
> | *** out: rc=nil 49722 49722
> | *** sem: buffer intervals.c 49722
> | *** input: rc=nil 49722 49722
> | *** out: rc=nil 49722 49722
> | *** sem: buffer intervals.c 49722
> | *** input: rc=nil 49722 49722
> | *** out: rc=nil 49722 49722
> | *** handle atimers [10 times]

That's interesting. Why do timers run here at all? Since your
'out:'-Message comes before that, it is clear that this is not because
of `accept-process-output'.

I'm pretty sure now that this is something else than #15045. There, we
had the problem that Semantic itself was moving point during lexing and
called 'input-pending-p' as well as 'accept-process-output', which both
ran timers at the time. If one of the timers forced redisplay, this lead
to a sudden change of point in the buffer. We fixed that by making
`input-pending-p' not running timers by default, and restoring point
before calling `accept-process-output'. This here seems to be something
different, in that not Semantic is moving point but some timer (which
does not mean there isn't a bug in Semantic here).

> | *** sem end: buffer intervals.c 49392
> | Auto-saving...done
> | *** handle atimers [32 times]
> `----
>
> So a running timer is moving point!

This makes sense as I cannot reproduce it here with

  emacs -Q -f semantic-mode

I'd suggest that you also start with 'emacs -Q' and activate minor-modes
you're using until you see the bug. Reducing `auto-save-interval' might
make this less tedious. Also, look at 'timer-list' which of your
minor-modes put timers in there (not sure if `timer-idle-list' might be
involved as well).

-David