From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: set-window-vscroll causes infinite loop in redisplay
Date: 26 Feb 2003 01:20:51 +0100 [thread overview]
Message-ID: <5xptpfsxi4.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <87u1et7mf2.fsf@computer.localdomain>
"D. Goel" <deego@gnufans.org> writes:
> hello
>
> I can get set-window-vscroll to work from M-: or from inside functions
> containing that one single command.
>
> Example:
>
> (defun vel-scroll-up-fractional (acc)
> (set-window-vscroll nil acc))
>
> works just fine when acc is 0.5
>
> However,
> try
>
> (defun vel-scroll-up (amount acc)
> (scroll-up amount)
> (set-window-vscroll nil acc))
>
> where amount is 0 and acc is 0.5. (the first one is a dummy line
> supposed to do nothing here..)
>
> And the second line seems to have no effect at all.
>
I can confirm this (not) happening here too.
The problem seems to that after a scroll (even a zero scroll), the
function window_scroll_pixel_based sets w->force_start = Qt, which
later causes the redisplay engine to set w->vscroll to 0.
Since this happens during redisplay, the set-window-vscroll
function has already been called, and the explicit setting of
w->vscroll is lost.
The following version is one way to work-around this problem:
(defun vel-scroll-up (amount acc)
(scroll-up amount)
(sit-for 0)
(set-window-vscroll nil acc))
I think the proper fix is to define a separate w->vscroll_extra member
(controlled via set-window-vscroll) which specifies the smooth scroll
offset the user wants ... and let the automatic vscroll adjustment
take this into account (except at the top and bottom of the buffer).
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
next prev parent reply other threads:[~2003-02-26 0:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-24 1:31 set-window-vscroll causes infinite loop in redisplay Kim F. Storm
2003-02-24 15:47 ` Kim F. Storm
2003-02-25 13:34 ` Kim F. Storm
[not found] ` <87u1et7mf2.fsf@computer.localdomain>
2003-02-26 0:20 ` Kim F. Storm [this message]
2003-02-26 9:47 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5xptpfsxi4.fsf@kfs2.cua.dk \
--to=storm@cua.dk \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.