Subject: bug#11417: 24.0.96; infinite looping in xdisp.c

From: Eli Zaretskii <[email-masked]>
Date: Thu, 10 May 2012 20:43:26 +0300

> From:  Leo <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>, [email-masked]
> Date: Thu, 10 May 2012 17:15:40 +0800
> 
> 
> [1:text/plain Hide]
> 
> On 2012-05-08 11:37 +0800, Chong Yidong wrote:
> > I also am puzzled by where the display string "!" causing the problem
> > comes from.  The only appearance of a "!" in Flymake is applied to the
> > mode-line, not as a display string within the buffer text.  Neither
> > Flymake nor Python mode seem to use overlay display strings.
> >
> > Do you have any idea what "!" is used for in your buffer?
> 
> Just realised this was triggered by me patching flymake to support
> fringe indicator.

That was the crucial missing link in this mystery.

> OK, I have prepared a test case. It requires python and the package
> pyflakes¹ which is used by flymake. Normally one can install pyflakes by
> using:
> 
>     pip install pyflakes
> OR
>     easy_install pyflakes
> 
> in a terminal.
> 
> Decompress the attached tar ball and go into the directory 11417/ in a
> terminal and launch emacs like this:
> 
>  emacs -nw -q -L . -l bug.el setup.py
> 
> You should see a buffer with contents partially displayed. Move around
> in that buffer by typing C-v, M-v, C-n or C-p until it freezes (it
> usually takes me no more than 3 key strokes).

Thanks.  Now that I know how you patched flymake, I can reproduce this
with a much simpler recipe:

  emacs -Q -nw
  C-x C-f xdisp.c RET
  M-: (let ((ov (make-overlay 4928 4933 nil t t)) (fringe (propertize "!" 'display (list 'left-fringe 'question-mark)))) (overlay-put ov 'before-string fringe)) RET

(The last one is a single long line to type into the minibuffer.)

Redisplay only shows part of the screen after that, but Emacs doesn't
yet infloop.  Move a cursor a bit, and it will.

Of course, the choice of the file (xdisp.c) and the position where to
put the overlay are arbitrary.

This only happens in 'emacs -nw", a GUI session (which can actually
display the fringe bitmap) doesn't have any problems with this recipe.

I will work on fixing this.