SiteMap Search ElispArea HowTo Glossary RecentChanges News Problems Suggestions
Yemen, National Day

ScrollAllMode

Last edit

Changed:

< (defadvice scroll-all-check-to-scroll (after mwheel-scroll-all () activate)
< (when (eq this-command 'mwheel-scroll)
< (let ((original-window (selected-window)))
< (walk-windows
< (lambda (win)
< (let ((ignore-window (if mouse-wheel-follow-mouse
< (mwheel-event-window last-input-event)
< original
-window)))
< (if
(not (eq win ignore-window))
< (let* ((event last-input-event)
< (mouse
-wheel-follow-mouse t)
< (e `(,(car event) (,win) ,@(cddr event))))
< (condition-case nil
< (mwheel-scroll e)
< (error nil))))))))))

to

> (defun mwheel-scroll-all-function-all (func arg)
> (if scroll-all-mode
> (save-selected-window
> (walk-windows
> (lambda (win)
> (select-window win)
> (condition-case nil
> (funcall func arg)
> (error nil)))))
> (funcall func arg)))
> (defun
mwheel-scroll-all-scroll-up-all (arg)
> (mwheel-scroll-all-function-all 'scroll-up arg))
> (defun mwheel-scroll-all-scroll-down-all (arg)
> (mwheel-scroll-all-function-all 'scroll-down arg))
> (setq mwheel-scroll-up-function 'mwheel-scroll-all-scroll-up-all)
> (setq mwheel-scroll-down-function 'mwheel-scroll-all-scroll-down-all)


Use M-x scroll-all-mode to scroll multiple buffers together.

Very useful for visually comparing two files which are hard to diff because of lots of trivial changes amongst the changes you are looking for.

Limitations

It doesn’t work with the mouse wheel or scroll-bar (tested on both GNU Emacs 21.3 and 24.2.1).

Possible workaround for the mouse wheel issue:

(defun mwheel-scroll-all-function-all (func arg)
  (if scroll-all-mode
      (save-selected-window
        (walk-windows 
         (lambda (win)
           (select-window win)
           (condition-case nil
               (funcall func arg)
             (error nil)))))
    (funcall func arg)))

(defun mwheel-scroll-all-scroll-up-all (arg)
  (mwheel-scroll-all-function-all 'scroll-up arg))

(defun mwheel-scroll-all-scroll-down-all (arg)
  (mwheel-scroll-all-function-all 'scroll-down arg))

(setq mwheel-scroll-up-function 'mwheel-scroll-all-scroll-up-all)
(setq mwheel-scroll-down-function 'mwheel-scroll-all-scroll-down-all)

(tested with Emacs 24.2.1)

In emacs before 2002, scrolling by full pages was buggy.

See also


CategoryDisplay CategoryModes