-;; scroll-all.el -- scroll all buffers together minor mode
+;;; scroll-all.el --- scroll all buffers together minor mode
;; Copyright (C) 1997 Free Software Foundation, Inc.
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
-;; Commentary
+;;; Commentary:
;; This mode allows multiple buffers to be 'locked' so that scrolling
;; up or down lines in any buffer causes all the buffers to mirror
;; the scrolling. It hooks into the post-command-hook to check for
;; Rick Macdonald <rickm@vsl.com>
;; Anders Lindgren <andersl@csd.uu.se>
+;;; Code:
+
(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
-(defvar scroll-all-mode nil
- "Track status of scroll locking.")
+
+;;;###autoload
+(defcustom scroll-all-mode nil
+ "Control/track scroll locking.
+
+Setting this variable directly does not take effect;
+use either M-x customize or the function `scroll-all-mode'."
+ :set (lambda (symbol value) (scroll-all-mode (if value 1 0)))
+ :initialize 'custom-initialize-default
+ :require 'scroll-all
+ :type 'boolean
+ :group 'windows)
+
(if running-xemacs
(add-minor-mode 'scroll-all-mode " *SL*")
(or (assq 'scroll-all-mode-mode minor-mode-alist)
(if (eq this-command 'fkey-scroll-down)
(call-interactively 'scroll-all-page-up-all)))
-
+;;;###autoload
(defun scroll-all-mode (arg)
"Toggle Scroll-All minor mode."
(interactive "P")
(provide 'scroll-all)
-;; scroll-all.el ends here
+;;; scroll-all.el ends here