From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Yeske Newsgroups: gmane.emacs.devel Subject: Re: window-scroll-functions called too often Date: Sun, 03 Sep 2006 12:41:53 -0700 Message-ID: <87r6ysyby6.fsf@cut.bc.hsia.telus.net> References: <871wqzqxxp.fsf@cut.bc.hsia.telus.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1157312543 16092 80.91.229.2 (3 Sep 2006 19:42:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 3 Sep 2006 19:42:23 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 03 21:42:20 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GJxrA-00012Y-NB for ged-emacs-devel@m.gmane.org; Sun, 03 Sep 2006 21:42:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GJxrA-0004Mn-96 for ged-emacs-devel@m.gmane.org; Sun, 03 Sep 2006 15:42:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GJxqz-0004MH-3B for emacs-devel@gnu.org; Sun, 03 Sep 2006 15:42:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GJxqx-0004Ls-EK for emacs-devel@gnu.org; Sun, 03 Sep 2006 15:42:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GJxqx-0004Lp-Bg for emacs-devel@gnu.org; Sun, 03 Sep 2006 15:41:59 -0400 Original-Received: from [199.185.220.240] (helo=defout.telus.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GJy1H-0005uk-II; Sun, 03 Sep 2006 15:52:39 -0400 Original-Received: from priv-edtnaa05.telusplanet.net ([207.6.239.189]) by priv-edtnes86.telusplanet.net (InterMail vM.7.05.01.01 201-2174-106-103-20060222) with ESMTP id <20060903194155.STWB22002.priv-edtnes86.telusplanet.net@priv-edtnaa05.telusplanet.net>; Sun, 3 Sep 2006 13:41:55 -0600 Original-Received: from cut.bc.hsia.telus.net (d207-6-239-189.bchsia.telus.net [207.6.239.189]) by priv-edtnaa05.telusplanet.net (BorderWare MXtreme Infinity Mail Firewall) with ESMTP id FEXPFRM8MW; Sun, 3 Sep 2006 13:41:54 -0600 (MDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sun, 03 Sep 2006 11:17:19 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59292 Archived-At: Richard Stallman writes: > 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? A simple way to keep the point at the bottom of the window in rcirc buffers when messages come in, on user input, when splitting windows, and when resizing the minibuffer. Using window-scroll-functions is the only way I've been able to have it work the way I like (and how I think users expect). In `rcirc-mode' I have: (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom nil t) And the function: (defun rcirc-scroll-to-bottom (window display-start) "Scroll window to show maximum output if `rcirc-show-maximum-output' is non-nil." (when rcirc-show-maximum-output (with-selected-window window (when (>= (window-point) rcirc-prompt-end-marker) (recenter -1))))) The above is adapted from similar code in erc-goodies.el. Ryan