emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: window-scroll-functions called too often


From: Ryan Yeske
Subject: Re: window-scroll-functions called too often
Date: Sun, 03 Sep 2006 12:41:53 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix)

Richard Stallman <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]