bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#36421: Having some text with face height > 1.0 causes scroll-step to


From: Noam Postavsky
Subject: bug#36421: Having some text with face height > 1.0 causes scroll-step to be ignored
Date: Thu, 04 Jul 2019 16:11:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt)

Andrea Cardaci <address@hidden> writes:

>> If you have a lot of higher-than-default lines, and you don't like the
>> effect of scroll-conservatively, then my suggestion is to set
>> scroll-conservatively to 2 or 3.
>
> It's much better this way (set to 2), there are still some
> *unpleasant* moments where the point is not exactly on the bottom (by
> a fraction of line height) and some others where the point is scrolled
> up by one entire line. But I guess this unavoidable, maybe I should
> just stop worrying and love the recentering...

It looks like scroll-down-line does the right thing, maybe a wrapping
command like this would work for you:

    (defun previous-and-maybe-scroll-line (&optional arg)
      (interactive "^p")
      (when (< (line-beginning-position 0) (window-start))
        (condition-case ()
            (scroll-down-line arg)
          (beginning-of-buffer nil))) 
      (previous-line arg))

    (define-key global-map [up] 'previous-and-maybe-scroll-line)

    ;; Corresponding [down] command left as exercise for reader





reply via email to

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