View mode hooked into the customize tree.
(view): New custom group.
(view-highlight-face, view-scroll-auto-exit)
(view-try-extend-at-buffer-end)
(view-remove-frame-by-deleting, view-mode-hook):
Defined by defcustom instead of by defvar.
(view-mode-enter): Install exit-action also when view-mode is
already on. Small rewrite using unless.
(view-mode, view-mode-exit, view-scroll-lines, view-really-at-end)
(view-search): Small rewrite using when or unless.
(view-exits-all-viewing-windows): Nev variable
replaces view-exit-all-windows-at-exit.
(view-exit-all-windows-at-exit): Variable deleted.
(view-mode-enter): Doesn't set view-exit-action if
argument exit-action is nil.
(view-mode-exit): Only restored windows are removed
from view-return-to-alist. Follow chains of old-windows.
Do not call replace-buffer-in-windows.
Call exit-action also when a window displays buffer.
(View-exit-and-edit): Now sets read-only by binding
view-old-buffer-read-only.
(view-mode-enable): New function, split from view-mode-enter.
(view-mode-enter): Use view-mode-enable.
(view-mode-disable): New function, split from view-mode-exit.
(view-mode-exit): Use view-mode-disable.
(view-mode): Use view-mode-enable and view-mode-disable;
don't do all of what view-mode-enter and view-mode-exit do.
(change-major-mode-hook): Use view-mode-disable, not view-mode-exit.
Changed documentation for most commands.
(view-scroll-auto-exit): New variable, replaces view-mode-auto-exit.
(view-mode-auto-exit): Variable deleted.
(view-mode): Doesn't only toggle `view-mode', it also calls
view-mode-enter or view-mode-exit.
(view-buffer, view-buffer-other-window): New argument exit-action.
(view-file, view-file-other-window, view-buffer-other-window)
(view-buffer, view-mode-enter): Changed method used to restore
windows when leaving view mode.
(view-mode-exit): New function.
(view-return-to-alist): New variable.
(view-return-here, view-exit-position): Variables deleted.
(view-remove-frame-by-deleting, view-exit-all-windows-at-exit):
New option variables.
(view-page-size, view-half-page-size): New variables.
(view-scroll-size): Var deleted; replaced by the previous two.
(view-mode-map): Make the bindings inside defvar.
Added new commands and new key bindings.
Added view-mode-exit to `change-major-mode-hook' to always leave
view mode when changing major mode.
(view-file-other-frame, view-buffer-other-frame): New commands.
(View-leave, View-kill-and-leave, View-exit, View-exit-and-edit)
(View-quit, View-quit-all): new commands for leaving view mode.
(view-exit): Function deleted.
(View-goto-percent, View-scroll-to-buffer-end): New commands.
(view-try-extend-at-buffer-end): New option variable.
(View-scroll-page-forward, View-scroll-page-backward)
(View-scroll-page-forward-set-page-size)
(View-scroll-page-backward-set-page-size, View-scroll-line-forward)
(View-scroll-line-backward, View-scroll-half-page-forward)
(View-scroll-half-page-backward)
(View-revert-buffer-scroll-page-forward): New commands.
(View-scroll-lines-forward, View-scroll-lines-backward)
(View-scroll-lines-forward-set-scroll-size)
(View-scroll-one-more-line): Commands deleted.
(view-scroll-lines, view-end-message, view-page-size-default)
(view-set-half-page-size-default, view-really-at-end)
(view-recenter): New functions.
(view-scroll-size): Variable deleted.
(View-search-regexp-forward, View-search-regexp-backward)
(View-search-last-regexp-forward, View-search-last-regexp-backward)
(view-search): ! and @ are special at beginning of regexp.
(view-search-no-match-lines): New function.
If arg is empty, use view-last-regexp.
(view-overlay): New variable, local in all buffers.
(view-search): Highlight the match using view-overlay.
(view-exit): Delete view-overlay.
Don't create local vars here. Set view-mode-auto-exit.
Don't change local map--just set view-mode.
(view-mode): New function toggles minor mode in the usual way.
(view-mode-map): Put this on minor-mode-map-alist.
(view-mode-exit): Do the exit actions only if view-mode-auto-exit.
(View-scroll-lines-forward): Exit only if view-scroll-lines-forward.
(view-mode-auto-exit, view-old-buffer-read-only)
(view-old-Helper-return-blurb, view-scroll-size, view-last-regexp)
(view-exit-action, view-return-here, view-exit-position):
Defvar them and make them always-local.