Subject: bug#14616: 24.3.50; Excessive cursor movement on non-X Emacs

From: Lars Magne Ingebrigtsen <[email-masked]>
Date: Wed, 31 Jul 2013 12:03:48 +0200

Eli Zaretskii <[email-masked]> writes:

> The cursor is not redrawn on a TTY.  What you see is, I believe, an
> indication of Emacs constantly redrawing portions of the screen.  That
> includes turning cursor off and on and moving it.

Sounds likely.

> This says that we are constantly redrawing screen lines 23 and 24
> (zero-based), counting from top of the frame.  Can you tell what is
> (or was) displayed on those lines?  In particular, are these by chance
> the mode line and the echo area, or are those in the text area of some
> window?

23 and 24 are the mode lines and the echo area, if I'm counting
correctly.

But I've finally come up with an easy-to-execute test case.

With the following gdb commands:

set logging file /tmp/emacs.gdb
set logging redirect on
set logging on
set height 0
break update_frame_line
commands
p vpos
continue
end
run -nw

I put the following in the scratch buffer and eval it while tailing
/tmp/emacs.gdb:

(dotimes (i 10)
  (url-retrieve "http://cdn.arwrath.com/1/137744.gif"
                (lambda (&rest ignore)
                  (kill-buffer (current-buffer)))
                nil t t)
  (sleep-for 5))

Then every five seconds I get the output below, which seems to say that
it's repainting the entire window every time it does something
networkey.

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=0)
    at dispnew.c:4755
4755	{
$14314 = 0

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=1)
    at dispnew.c:4755
4755	{
$14315 = 1

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=2)
    at dispnew.c:4755
4755	{
$14316 = 2

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=3)
    at dispnew.c:4755
4755	{
$14317 = 3

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=4)
    at dispnew.c:4755
4755	{
$14318 = 4

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=5)
    at dispnew.c:4755
4755	{
$14319 = 5

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=6)
    at dispnew.c:4755
4755	{
$14320 = 6

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=7)
    at dispnew.c:4755
4755	{
$14321 = 7

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=8)
    at dispnew.c:4755
4755	{
$14322 = 8

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=9)
    at dispnew.c:4755
4755	{
$14323 = 9

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=10)
    at dispnew.c:4755
4755	{
$14324 = 10

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=11)
    at dispnew.c:4755
4755	{
$14325 = 11

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=12)
    at dispnew.c:4755
4755	{
$14326 = 12

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=13)
    at dispnew.c:4755
4755	{
$14327 = 13

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=14)
    at dispnew.c:4755
4755	{
$14328 = 14

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=15)
    at dispnew.c:4755
4755	{
$14329 = 15

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=16)
    at dispnew.c:4755
4755	{
$14330 = 16

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=17)
    at dispnew.c:4755
4755	{
$14331 = 17

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=18)
    at dispnew.c:4755
4755	{
$14332 = 18

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=19)
    at dispnew.c:4755
4755	{
$14333 = 19

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=20)
    at dispnew.c:4755
4755	{
$14334 = 20

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=21)
    at dispnew.c:4755
4755	{
$14335 = 21

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=22)
    at dispnew.c:4755
4755	{
$14336 = 22

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=vpos@entry=23)
    at dispnew.c:4755
4755	{
$14337 = 23

Breakpoint 3, update_frame_line (f=f@entry=0xb7fbe0, vpos=24) at dispnew.c:4755
4755	{
$14338 = 24

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/