[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: window-scroll-functions called too often
From: |
Richard Stallman |
Subject: |
Re: window-scroll-functions called too often |
Date: |
Sun, 03 Sep 2006 11:17:19 -0400 |
It seems unreasonable to put a hook on window-scroll-functions which
scrolls the window differently. The intended use of that hook is to
to whatever is necessary to support the scrolling that the user wants
to do, not override it. So I am not really surprised that this does
not work.
What problem are you trying to solve?
You wrote:
(defun foo-scroll (window display-start)
(message "foo-scroll %S %S" window (current-time))
(when (and window (window-live-p window))
(with-selected-window window
(when (>= (window-point) (mark))
(save-excursion
(recenter -1))))))
(add-hook 'window-scroll-functions 'foo-scroll nil t)
;;; 1 - hit C-SPC to set the mark on this line somewhere
;;
;;; 2 - hit C-l here to force a call to `foo-scroll'
;;
;;; 3 - C-n, C-p, C-a will all result in `foo-scroll' being called now
;;
;;; 4 - C-p until you are above line 1 and back down and notice C-a
;;; doesnt trigger `foo-scroll', even when you move below line 1
;;; again
In rcirc, I am using a scroll-function, like the one above, and it is
being called on every keypress once recenter has been called once. Is
this an emacs bug? If not, how do I suppress those subsequent calls
cleanly?