unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ryan Yeske <rcyeske@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: window-scroll-functions called too often
Date: Sun, 03 Sep 2006 12:41:53 -0700	[thread overview]
Message-ID: <87r6ysyby6.fsf@cut.bc.hsia.telus.net> (raw)
In-Reply-To: <E1GJtip-0003aw-8Q@fencepost.gnu.org> (Richard Stallman's message of "Sun, 03 Sep 2006 11:17:19 -0400")

Richard Stallman <rms@gnu.org> 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

  reply	other threads:[~2006-09-03 19:41 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 ` window-scroll-functions called too often Richard Stallman
2006-09-03 19:41   ` Ryan Yeske [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r6ysyby6.fsf@cut.bc.hsia.telus.net \
    --to=rcyeske@gmail.com \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).