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: Richard Stallman
Subject: Re: Overlays disappearing during line-by-line scrolling
Date: Fri, 17 Jun 2005 14:46:15 -0400

    > 2005-04-26  Richard M. Stallman  <address@hidden>
    >
    >   * simple.el (line-move-1): Avoid using vertical-motion in easy cases.

    I already fixed one or two other bugs related to that change....

    I guess there are no "easy cases" when it comes to line-move :-|

Although it is possible that there is a bug in line-move-1,
the worst thing it could do is move point to the wrong place.
If the overlays disappear, that must be a bug in redisplay.

I verified this by typing C-l and saw that the overlays came back.

I wrote this patch which makes line-move-1 use vertical motion when
overlays are around.  It fixes the reported bug, but the display bug
is still there: using goto-char to move to position 3011 (when that
was above the screen) makes the overlays disappear.

Kim, could you look at the display bug?

*** simple.el   17 Jun 2005 09:37:17 -0400      1.730
--- simple.el   17 Jun 2005 14:28:01 -0400      
***************
*** 3433,3450 ****
                ;; Now move a line.
                (end-of-line)
                ;; If there's no invisibility here, move over the newline.
!               (if (and (not (integerp selective-display))
!                        (not (line-move-invisible-p (point))))
                    ;; We avoid vertical-motion when possible
                    ;; because that has to fontify.
!                   (if (eobp)
!                       (if (not noerror)
!                           (signal 'end-of-buffer nil)
!                         (setq done t))
!                     (forward-line 1))
                  ;; Otherwise move a more sophisticated way.
                  ;; (What's the logic behind this code?)
!                 (and (zerop (vertical-motion 1))
                       (if (not noerror)
                           (signal 'end-of-buffer nil)
                         (setq done t))))
--- 3433,3460 ----
                ;; Now move a line.
                (end-of-line)
                ;; If there's no invisibility here, move over the newline.
!               (let ((pos-before (point))
!                     line-done)
!                 (if (eobp)
!                     (if (not noerror)
!                         (signal 'end-of-buffer nil)
!                       (setq done t)))
!                 (when (and (not done)
!                            (not (integerp selective-display))
!                            (not (line-move-invisible-p (point))))
                    ;; We avoid vertical-motion when possible
                    ;; because that has to fontify.
!                   (forward-line 1)
!                   ;; If there are overlays in and around
!                   ;; the text we moved over, we need to be
!                   ;; sophisticated.
!                   (unless (overlays-in (max (1- pos-before) (point-min))
!                                        (min (1+ (point)) (point-max)))
!                     (setq line-done t)))
                  ;; Otherwise move a more sophisticated way.
                  ;; (What's the logic behind this code?)
!                 (and (not done) (not line-done)
!                      (zerop (vertical-motion 1))
                       (if (not noerror)
                           (signal 'end-of-buffer nil)
                         (setq done t))))
***************
*** 3454,3471 ****
              ;; it just goes in the other direction.
              (while (and (< arg 0) (not done))
                (beginning-of-line)
!               (if (or (bobp)
!                       (and (not (integerp selective-display))
!                            (not (line-move-invisible-p (1- (point))))))
!                   (if (bobp)
!                       (if (not noerror)
!                           (signal 'beginning-of-buffer nil)
!                         (setq done t))
!                     (forward-line -1))
!                 (if (zerop (vertical-motion -1))
                      (if (not noerror)
                          (signal 'beginning-of-buffer nil)
!                       (setq done t))))
                (unless done
                  (setq arg (1+ arg))
                  (while (and ;; Don't move over previous invis lines
--- 3464,3487 ----
              ;; it just goes in the other direction.
              (while (and (< arg 0) (not done))
                (beginning-of-line)
!               (let ((pos-before (point))
!                     line-done)
!                 (if (bobp)
                      (if (not noerror)
                          (signal 'beginning-of-buffer nil)
!                       (setq done t)))
!                 (when (and (not done)
!                            (not (integerp selective-display))
!                            (not (line-move-invisible-p (1- (point)))))
!                   (forward-line -1)
!                   (unless (overlays-in (max (1- (point)) (point-min))
!                                        (min (1+ pos-before) (point-max)))
!                     (setq line-done t)))
!                 (and (not done) (not line-done)
!                      (zerop (vertical-motion -1))
!                      (if (not noerror)
!                          (signal 'beginning-of-buffer nil)
!                        (setq done t))))
                (unless done
                  (setq arg (1+ arg))
                  (while (and ;; Don't move over previous invis lines




reply via email to

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