From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: window-scroll-functions called too often
Date: Sun, 03 Sep 2006 11:17:19 -0400 [thread overview]
Message-ID: <E1GJtip-0003aw-8Q@fencepost.gnu.org> (raw)
In-Reply-To: <871wqzqxxp.fsf@cut.bc.hsia.telus.net> (message from Ryan Yeske on Tue, 29 Aug 2006 10:00:34 -0700)
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?
next parent reply other threads:[~2006-09-03 15:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <871wqzqxxp.fsf@cut.bc.hsia.telus.net>
2006-09-03 15:17 ` Richard Stallman [this message]
2006-09-03 19:41 ` window-scroll-functions called too often Ryan Yeske
2006-09-04 17:17 ` Richard Stallman
2006-09-05 1:34 ` Miles Bader
2006-09-08 0:19 ` Ryan Yeske
2006-09-08 15:11 ` Richard Stallman
2006-09-09 18:46 ` Ryan Yeske
2006-09-10 13:04 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1GJtip-0003aw-8Q@fencepost.gnu.org \
--to=rms@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.