emacs-devel
[Top][All Lists]
Advanced

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

delete-overlay causes recentering (was: address@hidden: a bug in global-


From: Johan Bockgård
Subject: delete-overlay causes recentering (was: address@hidden: a bug in global-hl-line-mode])
Date: Fri, 13 Apr 2007 15:22:01 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (gnu/linux)

Thread started at
http://lists.gnu.org/archive/html/emacs-devel/2007-03/msg00360.html


address@hidden (Kim F. Storm) writes:

> The cursor may seems to end up on the wrong line, but it should be
> placed on the BUFFER POSITION where you clicked with the mouse.
>
> This is because the screen may scroll a few lines as a result of the
> click in such a line, so it just looks wrong.
>
> Please double check!
>
>
> That scrolling is very hard to get rid of -- so that's for after the
> release.

It seems that in the situation above the scrolling is caused by
delete-overlay, not by the click.


Here's another example:

$ emacs -Q

Evaluate the code below. Then press f8, f9, f8, f9, ...

;;;;;;;;;;;;;;;;
(defvar ov nil)

(defun foo ()
  (interactive)
  (set-window-start (selected-window) 834)
  (goto-char 1237)
  (setq ov (make-overlay 1237 1242))
  (overlay-put ov 'face 'highlight))

(defun bar ()
  (interactive)
  (delete-overlay ov))

(global-set-key [f8] 'foo)
(global-set-key [f9] 'bar)

(progn
  (switch-to-buffer "*foo*")
  (dotimes (n 30)
    (insert "Emacs is the extensible, customizable, "
            "self-documenting real-time display editor. "))
  (goto-char (point-min))
  (insert " "))
;;;;;;;;;;;;;;;;


delete-overlay causes a recentering. (Actually, so do mouse clicks in
this case.)

There is no scrolling if the last edit was after the window start,
however (remove `(goto-char (point-min))' or make a change at the end
of the buffer)!

I can also see the "spurious scrolling bug" mentioned in FOR-RELEASE
in the *foo* buffer. Occasionally the text jumps while just looking at
it.

-- 
Johan Bockgård





reply via email to

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