emacs-devel
[Top][All Lists]
Advanced

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

Re: scroll-down with pixel transition


From: Yuri Khan
Subject: Re: scroll-down with pixel transition
Date: Thu, 13 Apr 2017 15:35:51 +0700

On Thu, Apr 13, 2017 at 2:21 PM, Eli Zaretskii <address@hidden> wrote:
>> From: Tak Kunihiro <address@hidden>
>> I think before pixel-level vertical scrolling up or down,
>> scrolling single line up or down `with pixel transition' should be
>> implemented.  It ends up (window-vscroll nil t) to be zero.
>> This may be good enough to give modern feel.
>>
>> I assign the snippet to mwheel-scroll-up-function and it works
>> OK so far.
>
> Sorry, I don't understand your proposal.  Can you show some code?

I think I do, and can translate.

To reproduce: Scroll a window up or down by one line, e.g. by
(scroll-up 1) or (scroll-down 1).

Current behavior: The display is updated once, with the window
scrolled a whole line.

Desired behavior: The display is updated n times, with the window
scrolled 1 pixel, then 2 pixels, …, then n-1 pixels, then n pixels,
where n is the height of a line in pixels.

Attempted implementation:

(defun my-scroll-down-line ()
  (interactive)
  (scroll-down 1) ;; Undesired redraw happens here
  (set-window-vscroll nil (1- (frame-char-height)) t)
  (sit-for 0.001)
  (dolist (vs (reverse (number-sequence 0 (- (frame-char-height) 2))))
    (set-window-vscroll nil vs t)
    (sit-for 0.001)))

Observed behavior: The display is updated n+1 times, first with the
window scrolled a whole line, then 1 pixel, 2 pixels, …, n-1 pixels,
finally a whole line again.



reply via email to

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