unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Scrolling in buffers with inline images / point outside viewport
Date: Mon, 10 Jun 2013 20:01:00 +0300	[thread overview]
Message-ID: <83a9mxnbn7.fsf@gnu.org> (raw)
In-Reply-To: <878v2iq7vz.fsf@arcor.de>

> From: David Engster <deng@randomsample.de>
> Date: Mon, 10 Jun 2013 17:53:52 +0200
> 
> (with-selected-window (get-buffer-window ".emacs")
>   (setq times-to-vscroll nil)
>   (let (newval oldval)
>     (setq oldval (float-time (current-time)))
>     (dotimes (i 500)
>       (setq newval (float-time (current-time)))
>       (push (- newval oldval) times-to-vscroll)
>       (setq oldval newval)
>       (set-window-vscroll nil (+ (window-vscroll) 1))
>       (redisplay t))))
> 
> I remember that this started quite fast with times well under a second
> per scroll, but then grew up to 2 seconds or more at the end.
> 
> However, when I try this now, this code simply does not work; as soon as
> the cursor leaves the viewport, it somehow resets back to the original
> position. I have no idea what's going on.

Emacs won't let you use vscroll if the line with the cursor isn't at
least partially visible -- it will reset the vscroll to bring point
into view.

Try making the window with .emacs as tall as you can, and put the
cursor on its last line, before invoking the code above.  It works.



  reply	other threads:[~2013-06-10 17:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 16:56 Scrolling in buffers with inline images / point outside viewport Klaus-Dieter Bauer
2013-06-09 17:19 ` Eli Zaretskii
2013-06-09 19:12   ` David Engster
2013-06-09 19:00 ` David Engster
2013-06-09 21:57   ` Eli Zaretskii
2013-06-10 15:53     ` David Engster
2013-06-10 17:01       ` Eli Zaretskii [this message]
2013-06-11 19:40         ` David Engster

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=83a9mxnbn7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@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.
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).