Subject: bug#77197: 31.0.50; forward-word fails after yanking into summary line of *vc-log*

From: Juri Linkov <[email-masked]>
Date: Sun, 23 Mar 2025 09:55:44 +0200

>> If we yank text into the summary line of a *vc-log* buffer, then with
>> point at beginning of line, forward-word fails.
>>
>> To reproduce, use vc-next-action (C-x v v) to arrive at a *vc-log*
>> buffer.  With point after "Summary:", evaluate
>>
>> (progn
>>   (insert "text")
>>   (log-edit-beginning-of-line)
>>   (forward-word))
>>
>> This leaves point before "text".  It should instead be after.
>>
>> There is no issue if we manually type "text".
>
> I've been running into this lately too.  I intend to look into it,
> though any further investigation from you would be much appreciated.

I run Emacs with the enabled option 'backtrace-on-redisplay-error',
so I see such backtrace in *vc-log* buffers:

Error: end-of-buffer nil
  font-lock-fontify-keywords-region(1 10 nil)
  font-lock-default-fontify-region(1 10 nil)
  font-lock-fontify-region(1 10)
  #f(compiled-function (fun) #<bytecode ...>)(font-lock-fontify-region)
  run-hook-wrapped(#f(compiled-function (fun) #<bytecode ...>) font-lock-fontify-region)
  jit-lock--run-functions(1 10)
  jit-lock-fontify-now(1 10)
  jit-lock-function(1)
  redisplay_internal\ \(C\ function\)()