[Top][All Lists]

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

Scrolling jumpy when line-spacing > 0

From: Yuri Khan
Subject: Scrolling jumpy when line-spacing > 0
Date: Fri, 21 Apr 2017 17:13:32 +0700

Hello everybody,

I am trying to configure line-wise scrolling. Basically, I want to
press Ctrl+Up and Ctrl+Down and have Emacs scroll the current window
in the corresponding direction, with point remaining stationary wrt
buffer content.

(defun yk-scroll-up ()
  (scroll-up 1))
(defun yk-scroll-down ()
  (scroll-down 1))
(global-set-key (kbd "C-<up>") 'yk-scroll-down)
(global-set-key (kbd "C-<down>") 'yk-scroll-up)

This works so far.

Next, I also want my lines spaced a bit more widely.

(setq line-spacing 0.5)

And this is where I have a problem.

When the window displays what I perceive as an integer number of
lines, and the point is on the bottommost visible line, and I press
C-<down>, I expect the buffer content to scroll one line, and the
point to move one line up wrt the window. However I observe that the
buffer content scrolls almost a whole page, so the point is now on the
topmost visible line.

Minimized recipe:

$ emacs -Q
M-x emacs-version RET
GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of
2016-04-17 on lgw01-04, modified by Debian
M-x view-emacs-news RET
M-x set-variable RET line-spacing RET 0.5 RET
M-x split-window-vertically

Use the mouse to drag the top window’s modeline so that it is
immediately (two pixels or so) after the line, “See files NEWS.23,
NEWS.22, NEWS.21, NEWS.20, NEWS.19, NEWS.18,”.

Position the point on that line, using a mouse click.

M-: (scroll-up 1)

Observed behavior: Point is on the same line and the line is at the
top of window.

Expected behavior: Point is on the same line and the line is second
from the bottom of window. The next line, “and NEWS.1-17 for changes
in older Emacs versions.”, is visible.

The issue is easier to reproduce with larger values of line-spacing.
Basically, as long as the additional spacing of the current line spans
beyond the window, the jump happens.

Does anybody else see this? Is there an easy workaround?

reply via email to

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