Variable: follow-mode
follow-mode is a buffer-local variable defined in follow.el.gz.
Documentation
Non-nil if Follow mode is enabled.
Use the command follow-mode(var)/follow-mode(fun) to change this variable.
Probably introduced at or before Emacs version 19.31.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/follow.el.gz
;;;###autoload
(define-minor-mode follow-mode
"Toggle Follow mode.
Follow mode is a minor mode that combines windows into one tall
virtual window. This is accomplished by two main techniques:
* The windows always displays adjacent sections of the buffer.
This means that whenever one window is moved, all the
others will follow. (Hence the name Follow mode.)
* Should point (cursor) end up outside a window, another
window displaying that point is selected, if possible. This
makes it possible to walk between windows using normal cursor
movement commands.
Follow mode comes to its prime when used on a large screen and two or
more side-by-side windows are used. The user can, with the help of
Follow mode, use these full-height windows as though they were one.
Imagine yourself editing a large function, or section of text, and
being able to use 144 or 216 lines instead of the normal 72... (your
mileage may vary).
To split one large window into two side-by-side windows, the commands
`\\[split-window-right]' or \
`\\[follow-delete-other-windows-and-split]' can be used.
Only windows displayed in the same frame follow each other.
This command runs the normal hook `follow-mode-hook'.
Keys specific to Follow mode:
\\{follow-mode-map}"
:lighter follow-mode-line-text
:keymap follow-mode-map
(if follow-mode
(progn
(add-hook 'compilation-filter-hook 'follow-align-compilation-windows t t)
(add-function :before pre-redisplay-function 'follow-pre-redisplay-function)
(add-hook 'window-size-change-functions 'follow-window-size-change t)
(add-hook 'after-change-functions 'follow-after-change nil t)
(add-hook 'isearch-update-post-hook 'follow-post-command-hook nil t)
(add-hook 'replace-update-post-hook 'follow-post-command-hook nil t)
(add-hook 'ispell-update-post-hook 'follow-post-command-hook nil t)
(when isearch-lazy-highlight
(setq-local isearch-lazy-highlight 'all-windows))
(when follow-hide-ghost-cursors
(setq-local cursor-in-non-selected-windows nil))
(setq window-group-start-function 'follow-window-start)
(setq window-group-end-function 'follow-window-end)
(setq set-window-group-start-function 'follow-set-window-start)
(setq recenter-window-group-function 'follow-recenter)
(setq pos-visible-in-window-group-p-function
'follow-pos-visible-in-window-p)
(setq selected-window-group-function 'follow-all-followers)
(setq move-to-window-group-line-function 'follow-move-to-window-line))
;; Remove globally-installed hook functions only if there is no
;; other Follow mode buffer.
(let ((buffers (buffer-list))
following)
(while (and (not following) buffers)
(setq following (buffer-local-value 'follow-mode (car buffers))
buffers (cdr buffers)))
(unless following
(remove-function pre-redisplay-function 'follow-pre-redisplay-function)
(remove-hook 'window-size-change-functions 'follow-window-size-change)))
(kill-local-variable 'move-to-window-group-line-function)
(kill-local-variable 'selected-window-group-function)
(kill-local-variable 'pos-visible-in-window-group-p-function)
(kill-local-variable 'recenter-window-group-function)
(kill-local-variable 'set-window-group-start-function)
(kill-local-variable 'window-group-end-function)
(kill-local-variable 'window-group-start-function)
(kill-local-variable 'cursor-in-non-selected-windows)
(remove-hook 'ispell-update-post-hook 'follow-post-command-hook t)
(remove-hook 'replace-update-post-hook 'follow-post-command-hook t)
(remove-hook 'isearch-update-post-hook 'follow-post-command-hook t)
(remove-hook 'after-change-functions 'follow-after-change t)
(remove-hook 'compilation-filter-hook 'follow-align-compilation-windows t)))