unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: emacs-devel@gnu.org
Subject: delete-overlay causes recentering (was: [alinsoar@voila.fr: a bug in global-hl-line-mode])
Date: Fri, 13 Apr 2007 15:22:01 +0200	[thread overview]
Message-ID: <yoijd528o1dy.fsf_-_@gamma02.me.chalmers.se> (raw)
In-Reply-To: m3slc8m1gu.fsf@kfs-l.imdomain.dk


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


storm@cua.dk (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	other threads:[~2007-04-13 13:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-14 10:18 [alinsoar@voila.fr: a bug in global-hl-line-mode] A Soare
2007-03-14 12:52 ` Kim F. Storm
2007-04-13 13:22   ` Johan Bockgård [this message]
2007-04-14  9:13     ` delete-overlay causes recentering martin rudalics
2007-04-14 11:45       ` Johan Bockgård
2007-04-15  1:44     ` Chong Yidong
2007-04-15  1:50       ` Chong Yidong
2007-04-15 19:06         ` Chong Yidong
2007-04-15 20:13           ` Kim F. Storm
2007-04-23 13:57           ` Johan Bockgård
2007-04-23 14:11             ` Chong Yidong
2007-04-23 14:17               ` Chong Yidong
2007-04-23 15:42                 ` Stefan Monnier
2007-04-23 23:07             ` Richard Stallman
2007-04-24  1:35               ` Chong Yidong
2007-04-25 14:51                 ` Richard Stallman
2007-04-27 19:03                   ` Chong Yidong
2007-04-28  4:07                     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yoijd528o1dy.fsf_-_@gamma02.me.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).