GNU bug report logs -
#22404
25.1.50; Forcing `window-scroll-functions` to run.
Previous Next
Full log
View this message in rfc822 format
The following example uses `pos-visible-in-window-p` to guess as to whether the WSF will run more than one time -- i.e., if point is not fully visible, then WSF will run again. [The last call to WSF is the most important so that the values of window-start and window-end are truly accurate.] In addition to the WSF trigger feature request, a more sophisticated C-source solution to ascertain whether the WSF will run more than one time would be helpful.
(setq scroll-conservatively 101)
(defun pch-fn ()
(let ((window-configuration-change-hook nil))
(set-window-buffer (selected-window) (current-buffer) 'keep-margins)))
(add-hook 'post-command-hook 'pch-fn nil 'local)
(defun wsf-fn (win start)
(message "point: %s | win: %s | start: %s | end: %s"
(if (pos-visible-in-window-p nil nil nil)
"visible"
"NOT visible")
win start (window-end win t)))
(add-hook 'window-scroll-functions 'wsf-fn nil 'local)
This bug report was last modified 9 years and 98 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.