all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Scrolling jumpy when line-spacing > 0
@ 2017-04-21 10:13 Yuri Khan
  2017-04-21 11:03 ` Yuri Khan
  2017-04-21 14:40 ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Yuri Khan @ 2017-04-21 10:13 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

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 ()
  (interactive)
  (scroll-up 1))
(defun yk-scroll-down ()
  (interactive)
  (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?



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-22  7:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-21 10:13 Scrolling jumpy when line-spacing > 0 Yuri Khan
2017-04-21 11:03 ` Yuri Khan
2017-04-21 14:44   ` Eli Zaretskii
2017-04-21 14:40 ` Eli Zaretskii
2017-04-21 17:58   ` Yuri Khan
2017-04-21 18:56     ` Eli Zaretskii
2017-04-21 19:30       ` Yuri Khan
2017-04-22  7:38         ` Eli Zaretskii

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.