emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overlays disappearing during line-by-line scrolling


From: Kim F. Storm
Subject: Re: Overlays disappearing during line-by-line scrolling
Date: Mon, 27 Jun 2005 23:49:01 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Ralf Angeli <address@hidden> writes:

> It seems that Emacs has problems keeping the display of multi-line
> overlays correct when scrolling line by line.  Here is an example you
> can use in an Emacs started with `emacs -Q':
>
> (progn
>   (switch-to-buffer (get-buffer-create "*test*"))
>   (set (make-local-variable 'scroll-conservatively) 1000)
>   (dotimes (i 100)
>     (insert "..........................................................\n"))
>   (goto-char (point-min))
>   (let ((i 2))
>   (while (<= i 98)
>     (let ((ov (make-overlay (1+ (line-beginning-position i))
>                           (line-beginning-position (+ i 2)))))
>       (overlay-put ov 'display "XXX\nXXX"))
>     (setq i (+ i 6))))
>   (goto-char (point-max)))
>
> After executing the code move point upwards with `C-p'.  After point
> hit the top of the window further movement will scroll the buffer line
> by line.  This will make the overlays disappear occasionally,
> i.e. instead of the "XXX\nXXX" strings one will see the "...." strings
> again.
>
> Note that this happens only if the overlays start and stop within a
> line.  That means if you remove the `1+' call in the code above the
> effect does not occur.
>

This is not a proper patch to fix the problem, but it may help.


*** xdisp.c     26 Jun 2005 23:25:32 +0200      1.1028
--- xdisp.c     27 Jun 2005 23:35:53 +0200      
***************
*** 2408,2414 ****
    init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID);
    it->first_vpos = first_vpos;
  
!   if (!it->truncate_lines_p)
      {
        int start_at_line_beg_p;
        int first_y = it->current_y;
--- 2408,2414 ----
    init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID);
    it->first_vpos = first_vpos;
  
!   if (it->method == GET_FROM_BUFFER && !it->truncate_lines_p)
      {
        int start_at_line_beg_p;
        int first_y = it->current_y;


However, when I try it with the code above, it beeps in line-move-1
when I move backwards with C-p (for every 4th C-p or so).  This is
because (one of the instances of) the following code is triggered.

                  (unless noerror
                    (signal (if (< arg 0)
                                'beginning-of-buffer
                              'end-of-buffer)
                            nil)))

But I don't see how (bobp) would normally return true in the middle of
a buffer.  Can anybody see why?

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]