Subject: Re: bug#41984: 28.0.50; term.el's select-window call interacts badly with modeline

From: Herman, Géza <[email-masked]>
Date: Sun, 21 Jun 2020 21:03:51 +0200

What is suspicious to me: term-emulate-terminal uses 
save-selected-window. And save-selected-window uses "(select-window (car 
state) 'norecord)", when it restores the state. Note the 'norecord 
parameter. So it is very logical to me that the "(select-window win)" 
call in term-emulate-terminal should also have 'norecord.

Also, here's the help for select-window:

"Note that applications and internal routines often select a window 
temporarily for
various purposes; mostly, to simplify coding.  As a rule, such
selections should be not recorded and therefore will not pollute
buffer-list-update-hook.  Selections that "really count" are those
causing a visible change in the next redisplay of WINDOW's frame and
should be always recorded."

So this issue definitely seems a bug in term.el to me.