Subject: Re: bug#39967: 27.0.90; how to debug point moving erratically?

From: Eli Zaretskii <[email-masked]>
Date: Sat, 07 Mar 2020 17:32:55 +0200

> From: William Rankin <[email-masked]>
> Date: Sat, 7 Mar 2020 23:47:24 +1000
> Cc: [email-masked]
> 
> 
>            0.37     0.01 blink-cursor-timer-function
>            6.59        - undo-auto--boundary-timer
>           47.03     1.00 display-time-event-handler
>    *       0.00        t show-paren-function
>    *       0.50        t #f(compiled-function () #<bytecode 0x41903951> [jit-lock--antiblink-grace-timer jit-lock-context-fontify])
>    *       0.50  :repeat blink-cursor-start
>    *       1.00        t which-key--update
>    *       5.00        t jit-lock-stealth-fontify
> 
> Could the sporadic nature hint at the byte-compiled function that calls 
> jit-lock-context-fontify? (Also I see jit-lock-antiblink-grace is new 
> in 27.)

How about changing jit-lock-context-time to something like 1.5, and
checking whether this affects the frequency of the jumps in any way?

I looked at the code of the involved functions, and couldn't spot any
place where they move point without wrapping that in save-excursion.
But maybe I'm missing something -- can you see any suspects?

Also, do you have any features enabled which could perform a redisplay
triggered by point movement?  If you do, perhaps they cause point to
be displayed when Emacs doesn't expect that.

Btw, in your original description you said when point jumps, it's
outside of the current window -- but if so, how do you see that it
jumps, when the cursor is not shown?

And finally, what happens if you disable the blink-cursor-mode?