tags:

views:

212

answers:

4

I've done this before, years ago, so I know the answer is out there. However the google-space is heavily polluted with namespace collisions, especially new user guides.

This is what I'd like to do in Emacs 21:

Split the screen on a given file buffer (C-x 3). As I page through the first screen (C-v), the next page of the file is automatically displayed on the second.

To be clear, the next line in the file after the last line on the left screen should be the first line on the right screen, always.

Any help?

+3  A: 

You want scroll-all-mode

scroll-all-mode is an interactive compiled Lisp function in `scroll-all.el'.
(scroll-all-mode &optional arg)

Toggle Scroll-All minor mode.
With arg, turn Scroll-All minor mode on if arg is positive, off otherwise.
When Scroll-All mode is on, scrolling commands entered in one window
apply to all visible windows in the same frame.

Set up the windows appropriately, and then turn on scroll-all-mode, and from then on all windows scroll together

Beano
Thanks! This works until I do a M-< at which point it breaks the assocation, or I page down to the bottom of the buffer and then page down once more. *SL* is still indicated but they no longer scroll together. Is my Emacs 21.4.1 broken or my .emacs or is this just the way it works?
kmarsh
+4  A: 

This question appears to be a duplicate: http://stackoverflow.com/questions/970292/emacs-multiple-columns-one-buffer

Allen
Thanks. My (old) emacs installation does not have follow.el, I'll see if I can add it or if I have to upgrade.
kmarsh
+2  A: 

You might be looking for follow-mode

It is minor mode that combines windows into one tall virtual window.

aartist
A: 

If follow-mode doesn't work, you could define your own macro, something like

(defun align-windows ()
  (set-window-start (other-window) (window-start))
  (scroll-other-window))

Then either use this (along with scroll-down) instead of C-v, or rebind C-v to that, or add advice to scroll-down.

Beta