[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: email@example.com, firstname.lastname@example.org
- Subject: window scrolling
- From: "Roland Zito-wolf" <email@example.com>
- Date: Fri, 30 Nov 90 17:30:41 est
Date: Thu, 29 Nov 90 18:01:49 est
From: "Roland Zito-wolf" <firstname.lastname@example.org>
Question: i am doing output simultaneously to several windows and
i want them all to continually update as text arrives, just as the listener does
(but they're not listeners, they're fred-windows).
Is there a function I can call that will reposition the display-mark
so that the last line of the bufer is displayed in the last line of the
See the description of window-start-mark, on page 289 of the 1.3
manual. You'll also have to force a redisplay once you've changed
the position of the mark.
and From: email@example.com (Kemi Jona)
I do something similar, the following is the best I could come up with. If
you hear of a better way please let me know. Basically this code acts just
like format, except it sends output to a fred-window bound to
*debug-window*. After outputting the text it checks to see if
(window-cursor-mark) is not visible and if so moves the window-start-mark
to 80 characters less than the length of the buffer. This doesn't keep the
last line of the buffer as the last line in the window, but it does make
sure that the most recent output is always visible. THe important part is
to call (window-update) so everything will become visible.
(defmacro comment (format-string &rest args)
(format *debug-window* ,format-string ,@args)
(if (minusp (window-vpos))
(if (< (buffer-size (window-buffer)) 80) 0
(- (buffer-size (window-buffer)) 80))))
(t (format t ,format-string ,@args)))
Kemi's code is helpful in using WINDOW-VPOS to avoid repositioning
until output extends below the bottom of the window.
What I'm looking for is a way to scroll the buffer up some
integral number of lines, say 5, when this happens.
All the buffer commands seem to work in terms of character positions.