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

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

bug#17787: 24.4.50; Making `linum-mode` more efficient -- no need to run


From: Stefan Monnier
Subject: bug#17787: 24.4.50; Making `linum-mode` more efficient -- no need to run multiple times.
Date: Mon, 16 Jun 2014 20:43:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

retitle 17787 Redundant runs of window-scroll-functions
thanks

> Here is a minor mode that can be used to test the `window-start` and
> `window-end` values.  A similar system can be used for `linum-mode` --
> i.e., use the `linum-update-window` from the `post-command-hook` when
> point stays within the visible window limits; and, when point moves
> outside those visible window limits, then use the
> `window-scroll-functions` hook -- however, limit `linum-update-window`
> so that it only runs when `(not (> (point) (window-end win t)))`.

As Eli explained, we're not very interested in improving linum-mode.
I'd rather focus on bringing nlinum-mode to feature-parity with linum-mode.
admittedly, for some uses of linum-mode, the technique used by
nlinum-mode has some inconvenients.

But your code sounds useful, indeed for uses of window-scroll-functions
which don't affect display very much (e.g. don't change window-start).
This said: even if (> (point) (window-end win t)) it may be that
window-scroll-functions won't be called again, because the current
window-scroll-functions may change something in the current buffer
(e.g. add `invisible' properties, shrink the margin, etc...) which cause
(window-end win t) to move past (point).


        Stefan





reply via email to

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