2001-07-16 12:23:00 +00:00
|
|
|
|
;;; view.el --- peruse file or buffer without editing
|
1992-05-30 20:24:49 +00:00
|
|
|
|
|
2018-01-01 08:21:42 +00:00
|
|
|
|
;; Copyright (C) 1985, 1989, 1994-1995, 1997, 2000-2018 Free Software
|
2013-01-01 09:11:05 +00:00
|
|
|
|
;; Foundation, Inc.
|
1992-07-22 02:58:21 +00:00
|
|
|
|
|
1992-07-16 21:47:34 +00:00
|
|
|
|
;; Author: K. Shane Hartman
|
2017-06-06 01:08:07 +00:00
|
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
2001-09-04 12:54:14 +00:00
|
|
|
|
;; Keywords: files
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1990-01-17 16:51:47 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
1993-03-22 22:44:33 +00:00
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
1995-08-15 01:49:17 +00:00
|
|
|
|
;; This package provides the `view' minor mode documented in the Emacs
|
1993-03-22 22:44:33 +00:00
|
|
|
|
;; user's manual.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
;; View mode entry and exit is done through the functions view-mode-enter
|
1997-06-25 07:03:48 +00:00
|
|
|
|
;; and view-mode-exit. Use these functions to enter or exit view-mode from
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
;; emacs lisp programs.
|
1997-06-25 07:03:48 +00:00
|
|
|
|
;; We use both view- and View- as prefix for symbols. View- is used as
|
1997-10-16 18:20:16 +00:00
|
|
|
|
;; prefix for commands that have a key binding. view- is used for commands
|
1997-06-25 07:03:48 +00:00
|
|
|
|
;; without key binding. The purpose of this is to make it easier for a
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
;; user to use command name completion.
|
|
|
|
|
|
|
|
|
|
;;; Suggested key bindings:
|
|
|
|
|
;;
|
|
|
|
|
;; (define-key ctl-x-4-map "v" 'view-file-other-window) ; ^x4v
|
|
|
|
|
;; (define-key ctl-x-5-map "v" 'view-file-other-frame) ; ^x5v
|
|
|
|
|
;;
|
|
|
|
|
;; You could also bind view-file, view-buffer, view-buffer-other-window and
|
|
|
|
|
;; view-buffer-other-frame to keys.
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
1992-07-16 21:47:34 +00:00
|
|
|
|
;;; Code:
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
1997-10-16 18:20:16 +00:00
|
|
|
|
(defgroup view nil
|
|
|
|
|
"Peruse file or buffer without editing."
|
|
|
|
|
:link '(function-link view-mode)
|
|
|
|
|
:link '(custom-manual "(emacs)Misc File Ops")
|
2016-10-08 13:37:42 +00:00
|
|
|
|
:group 'text)
|
1997-10-16 18:20:16 +00:00
|
|
|
|
|
|
|
|
|
(defcustom view-highlight-face 'highlight
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"The face used for highlighting the match found by View mode search."
|
1997-10-16 18:20:16 +00:00
|
|
|
|
:type 'face
|
|
|
|
|
:group 'view)
|
1995-10-09 19:42:19 +00:00
|
|
|
|
|
1997-10-16 18:20:16 +00:00
|
|
|
|
(defcustom view-scroll-auto-exit nil
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Non-nil means scrolling past the end of buffer exits View mode.
|
2007-05-16 11:31:39 +00:00
|
|
|
|
A value of nil means attempting to scroll past the end of the buffer,
|
1997-10-16 18:20:16 +00:00
|
|
|
|
only rings the bell and gives a message on how to leave."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'view)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
1997-10-16 18:20:16 +00:00
|
|
|
|
(defcustom view-try-extend-at-buffer-end nil
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Non-nil means try to load more of file when reaching end of buffer.
|
1997-06-25 07:03:48 +00:00
|
|
|
|
This variable is mainly intended to be temporarily set to non-nil by
|
|
|
|
|
the F command in view-mode, but you can set it to t if you want the action
|
1997-10-16 18:20:16 +00:00
|
|
|
|
for all scroll commands in view mode."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'view)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
2007-11-10 09:52:30 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defcustom view-remove-frame-by-deleting t
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Determine how View mode removes a frame no longer needed.
|
1997-10-16 18:20:16 +00:00
|
|
|
|
If nil, make an icon of the frame. If non-nil, delete the frame."
|
|
|
|
|
:type 'boolean
|
2007-11-10 09:52:30 +00:00
|
|
|
|
:group 'view
|
|
|
|
|
:version "23.1")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
1997-10-16 18:20:16 +00:00
|
|
|
|
(defcustom view-exits-all-viewing-windows nil
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Non-nil means restore all windows used to view buffer.
|
2011-06-13 13:14:42 +00:00
|
|
|
|
Commands that restore windows when finished viewing a buffer,
|
|
|
|
|
apply to all windows that display the buffer and have restore
|
|
|
|
|
information. If `view-exits-all-viewing-windows' is nil, only
|
|
|
|
|
the selected window is considered for restoring."
|
1997-10-16 18:20:16 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'view)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
2005-11-29 10:53:30 +00:00
|
|
|
|
(defcustom view-inhibit-help-message nil
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Non-nil inhibits the help message shown upon entering View mode."
|
2005-11-29 10:53:30 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'view
|
|
|
|
|
:version "22.1")
|
|
|
|
|
|
1997-06-19 11:19:24 +00:00
|
|
|
|
;;;###autoload
|
1997-10-16 18:20:16 +00:00
|
|
|
|
(defvar view-mode nil
|
|
|
|
|
"Non-nil if View mode is enabled.
|
|
|
|
|
Don't change this variable directly, you must change it by one of the
|
|
|
|
|
functions that enable or disable view mode.")
|
1997-06-19 11:19:24 +00:00
|
|
|
|
;;;###autoload
|
1995-08-15 01:49:17 +00:00
|
|
|
|
(make-variable-buffer-local 'view-mode)
|
|
|
|
|
|
1997-10-16 18:20:16 +00:00
|
|
|
|
(defcustom view-mode-hook nil
|
|
|
|
|
"Normal hook run when starting to view a buffer or file."
|
|
|
|
|
:type 'hook
|
|
|
|
|
:group 'view)
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
1995-09-25 18:36:32 +00:00
|
|
|
|
(defvar view-old-buffer-read-only nil)
|
|
|
|
|
(make-variable-buffer-local 'view-old-buffer-read-only)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
1995-09-25 18:36:32 +00:00
|
|
|
|
(defvar view-old-Helper-return-blurb)
|
|
|
|
|
(make-variable-buffer-local 'view-old-Helper-return-blurb)
|
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defvar view-page-size nil
|
|
|
|
|
"Default number of lines to scroll by View page commands.
|
2004-10-16 15:24:34 +00:00
|
|
|
|
If nil that means use the window size.")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(make-variable-buffer-local 'view-page-size)
|
1995-09-25 18:36:32 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defvar view-half-page-size nil
|
|
|
|
|
"Default number of lines to scroll by View half page commands.
|
2004-10-16 15:24:34 +00:00
|
|
|
|
If nil that means use half the window size.")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(make-variable-buffer-local 'view-half-page-size)
|
1995-09-25 18:36:32 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defvar view-last-regexp nil)
|
|
|
|
|
(make-variable-buffer-local 'view-last-regexp) ; Global is better???
|
|
|
|
|
|
|
|
|
|
(defvar view-return-to-alist nil
|
1997-06-25 07:03:48 +00:00
|
|
|
|
"What to do with used windows and where to go when finished viewing buffer.
|
|
|
|
|
This is local in each buffer being viewed.
|
1998-03-16 04:09:04 +00:00
|
|
|
|
It is added to by `view-mode-enter' when starting to view a buffer and
|
|
|
|
|
subtracted from by `view-mode-exit' when finished viewing the buffer.
|
1997-06-25 07:03:48 +00:00
|
|
|
|
|
|
|
|
|
See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of
|
1997-06-14 21:41:42 +00:00
|
|
|
|
`view-return-to-alist'.")
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(make-obsolete-variable
|
|
|
|
|
'view-return-to-alist "this variable is no more used." "24.1")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(make-variable-buffer-local 'view-return-to-alist)
|
2004-04-20 20:57:10 +00:00
|
|
|
|
(put 'view-return-to-alist 'permanent-local t)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defvar view-exit-action nil
|
2007-11-10 09:52:30 +00:00
|
|
|
|
"If non-nil, a function with one argument (a buffer) called when finished viewing.
|
|
|
|
|
Commands like \\[view-file] and \\[view-file-other-window] may
|
|
|
|
|
set this to bury or kill the viewed buffer.
|
|
|
|
|
Observe that the buffer viewed might not appear in any window at
|
|
|
|
|
the time this function is called.")
|
1995-09-25 18:36:32 +00:00
|
|
|
|
(make-variable-buffer-local 'view-exit-action)
|
|
|
|
|
|
1997-08-08 22:26:02 +00:00
|
|
|
|
(defvar view-no-disable-on-exit nil
|
|
|
|
|
"If non-nil, View mode \"exit\" commands don't actually disable View mode.
|
|
|
|
|
Instead, these commands just switch buffers or windows.
|
|
|
|
|
This is set in certain buffers by specialized features such as help commands
|
|
|
|
|
that use View mode automatically.")
|
|
|
|
|
|
1995-10-05 22:25:38 +00:00
|
|
|
|
(defvar view-overlay nil
|
1995-10-09 19:42:19 +00:00
|
|
|
|
"Overlay used to display where a search operation found its match.
|
|
|
|
|
This is local in each buffer, once it is used.")
|
1995-10-05 22:25:38 +00:00
|
|
|
|
(make-variable-buffer-local 'view-overlay)
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
;; Define keymap inside defvar to make it easier to load changes.
|
1997-10-16 18:20:16 +00:00
|
|
|
|
;; Some redundant "less"-like key bindings below have been commented out.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defvar view-mode-map
|
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
|
(define-key map "C" 'View-kill-and-leave)
|
|
|
|
|
(define-key map "c" 'View-leave)
|
|
|
|
|
(define-key map "Q" 'View-quit-all)
|
|
|
|
|
(define-key map "E" 'View-exit-and-edit)
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (define-key map "v" 'View-exit)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "e" 'View-exit)
|
|
|
|
|
(define-key map "q" 'View-quit)
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (define-key map "N" 'View-search-last-regexp-backward)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "p" 'View-search-last-regexp-backward)
|
|
|
|
|
(define-key map "n" 'View-search-last-regexp-forward)
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (define-key map "?" 'View-search-regexp-backward) ; Less does this.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "\\" 'View-search-regexp-backward)
|
|
|
|
|
(define-key map "/" 'View-search-regexp-forward)
|
|
|
|
|
(define-key map "r" 'isearch-backward)
|
|
|
|
|
(define-key map "s" 'isearch-forward)
|
|
|
|
|
(define-key map "m" 'point-to-register)
|
|
|
|
|
(define-key map "'" 'register-to-point)
|
|
|
|
|
(define-key map "x" 'exchange-point-and-mark)
|
2000-01-31 21:34:33 +00:00
|
|
|
|
(define-key map "@" 'View-back-to-mark)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "." 'set-mark-command)
|
|
|
|
|
(define-key map "%" 'View-goto-percent)
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (define-key map "G" 'View-goto-line-last)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "g" 'View-goto-line)
|
|
|
|
|
(define-key map "=" 'what-line)
|
|
|
|
|
(define-key map "F" 'View-revert-buffer-scroll-page-forward)
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (define-key map "k" 'View-scroll-line-backward)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "y" 'View-scroll-line-backward)
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (define-key map "j" 'View-scroll-line-forward)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "\n" 'View-scroll-line-forward)
|
|
|
|
|
(define-key map "\r" 'View-scroll-line-forward)
|
|
|
|
|
(define-key map "u" 'View-scroll-half-page-backward)
|
|
|
|
|
(define-key map "d" 'View-scroll-half-page-forward)
|
|
|
|
|
(define-key map "z" 'View-scroll-page-forward-set-page-size)
|
|
|
|
|
(define-key map "w" 'View-scroll-page-backward-set-page-size)
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (define-key map "b" 'View-scroll-page-backward)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "\C-?" 'View-scroll-page-backward)
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (define-key map "f" 'View-scroll-page-forward)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map " " 'View-scroll-page-forward)
|
2013-02-12 04:46:18 +00:00
|
|
|
|
(define-key map [?\S-\ ] 'View-scroll-page-backward)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "o" 'View-scroll-to-buffer-end)
|
|
|
|
|
(define-key map ">" 'end-of-buffer)
|
|
|
|
|
(define-key map "<" 'beginning-of-buffer)
|
|
|
|
|
(define-key map "-" 'negative-argument)
|
|
|
|
|
(define-key map "9" 'digit-argument)
|
|
|
|
|
(define-key map "8" 'digit-argument)
|
|
|
|
|
(define-key map "7" 'digit-argument)
|
|
|
|
|
(define-key map "6" 'digit-argument)
|
|
|
|
|
(define-key map "5" 'digit-argument)
|
|
|
|
|
(define-key map "4" 'digit-argument)
|
|
|
|
|
(define-key map "3" 'digit-argument)
|
|
|
|
|
(define-key map "2" 'digit-argument)
|
|
|
|
|
(define-key map "1" 'digit-argument)
|
|
|
|
|
(define-key map "0" 'digit-argument)
|
|
|
|
|
(define-key map "H" 'describe-mode)
|
2000-01-31 21:34:33 +00:00
|
|
|
|
(define-key map "?" 'describe-mode) ; Maybe do as less instead? See above.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(define-key map "h" 'describe-mode)
|
|
|
|
|
map))
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
;;; Commands that enter or exit view mode.
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
2008-01-19 14:04:35 +00:00
|
|
|
|
;; This is used when view mode is exited, to make sure we don't try to
|
|
|
|
|
;; kill a buffer modified by the user. A buffer in view mode can
|
|
|
|
|
;; become modified if the user types C-x C-q, edits the buffer, then
|
|
|
|
|
;; types C-x C-q again to return to view mode.
|
2008-02-02 16:07:47 +00:00
|
|
|
|
;;;###autoload
|
2008-01-12 17:17:41 +00:00
|
|
|
|
(defun kill-buffer-if-not-modified (buf)
|
|
|
|
|
"Like `kill-buffer', but does nothing if the buffer is modified."
|
2008-01-25 04:41:09 +00:00
|
|
|
|
(let ((buf (get-buffer buf)))
|
2008-01-12 17:17:41 +00:00
|
|
|
|
(and buf (not (buffer-modified-p buf))
|
|
|
|
|
(kill-buffer buf))))
|
|
|
|
|
|
1991-05-09 21:50:34 +00:00
|
|
|
|
;;;###autoload
|
2000-01-31 21:34:33 +00:00
|
|
|
|
(defun view-file (file)
|
1990-01-17 16:51:47 +00:00
|
|
|
|
"View FILE in View mode, returning to previous buffer when done.
|
2007-11-10 09:52:30 +00:00
|
|
|
|
Emacs commands editing the buffer contents are not available; instead, a
|
|
|
|
|
special set of commands (mostly letters and punctuation) are defined for
|
|
|
|
|
moving around in the buffer.
|
1990-01-17 16:51:47 +00:00
|
|
|
|
Space scrolls forward, Delete scrolls backward.
|
2007-11-10 09:52:30 +00:00
|
|
|
|
For a list of all View commands, type H or h while viewing.
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
1994-03-14 16:02:05 +00:00
|
|
|
|
This command runs the normal hook `view-mode-hook'."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "fView file: ")
|
2003-05-31 17:53:24 +00:00
|
|
|
|
(unless (file-exists-p file) (error "%s does not exist" file))
|
2003-07-09 16:16:54 +00:00
|
|
|
|
(let ((had-a-buf (get-file-buffer file))
|
|
|
|
|
(buffer (find-file-noselect file)))
|
2010-04-18 23:49:58 +00:00
|
|
|
|
(view-buffer buffer (and (not had-a-buf) 'kill-buffer-if-not-modified))))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
1991-07-25 20:25:57 +00:00
|
|
|
|
;;;###autoload
|
2000-01-31 21:34:33 +00:00
|
|
|
|
(defun view-file-other-window (file)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
"View FILE in View mode in another window.
|
2008-01-12 14:15:35 +00:00
|
|
|
|
When done, return that window to its previous buffer, and kill the
|
|
|
|
|
buffer visiting FILE if unmodified and if it wasn't visited before.
|
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
Emacs commands editing the buffer contents are not available; instead,
|
1991-07-25 20:25:57 +00:00
|
|
|
|
a special set of commands (mostly letters and punctuation)
|
|
|
|
|
are defined for moving around in the buffer.
|
|
|
|
|
Space scrolls forward, Delete scrolls backward.
|
2007-11-10 09:52:30 +00:00
|
|
|
|
For a list of all View commands, type H or h while viewing.
|
1991-07-25 20:25:57 +00:00
|
|
|
|
|
1994-03-14 16:02:05 +00:00
|
|
|
|
This command runs the normal hook `view-mode-hook'."
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(interactive "fIn other window view file: ")
|
2003-05-31 17:53:24 +00:00
|
|
|
|
(unless (file-exists-p file) (error "%s does not exist" file))
|
2008-01-12 14:15:35 +00:00
|
|
|
|
(let ((had-a-buf (get-file-buffer file))
|
|
|
|
|
(buf-to-view (find-file-noselect file)))
|
|
|
|
|
(view-buffer-other-window buf-to-view nil
|
|
|
|
|
(and (not had-a-buf)
|
2008-01-12 17:17:41 +00:00
|
|
|
|
'kill-buffer-if-not-modified))))
|
1991-07-25 20:25:57 +00:00
|
|
|
|
|
1991-05-09 21:50:34 +00:00
|
|
|
|
;;;###autoload
|
2000-01-31 21:34:33 +00:00
|
|
|
|
(defun view-file-other-frame (file)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
"View FILE in View mode in another frame.
|
2008-01-12 14:15:35 +00:00
|
|
|
|
When done, kill the buffer visiting FILE if unmodified and if it wasn't
|
|
|
|
|
visited before; also, maybe delete other frame and/or return to previous
|
|
|
|
|
buffer.
|
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
Emacs commands editing the buffer contents are not available; instead,
|
1990-01-17 16:51:47 +00:00
|
|
|
|
a special set of commands (mostly letters and punctuation)
|
|
|
|
|
are defined for moving around in the buffer.
|
|
|
|
|
Space scrolls forward, Delete scrolls backward.
|
2007-11-10 09:52:30 +00:00
|
|
|
|
For a list of all View commands, type H or h while viewing.
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
1994-03-14 16:02:05 +00:00
|
|
|
|
This command runs the normal hook `view-mode-hook'."
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(interactive "fIn other frame view file: ")
|
2003-05-31 17:53:24 +00:00
|
|
|
|
(unless (file-exists-p file) (error "%s does not exist" file))
|
2008-01-12 14:15:35 +00:00
|
|
|
|
(let ((had-a-buf (get-file-buffer file))
|
|
|
|
|
(buf-to-view (find-file-noselect file)))
|
|
|
|
|
(view-buffer-other-frame buf-to-view nil
|
|
|
|
|
(and (not had-a-buf)
|
2008-01-12 17:17:41 +00:00
|
|
|
|
'kill-buffer-if-not-modified))))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2000-01-31 21:34:33 +00:00
|
|
|
|
(defun view-buffer (buffer &optional exit-action)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
"View BUFFER in View mode, returning to previous buffer when done.
|
2007-11-10 09:52:30 +00:00
|
|
|
|
Emacs commands editing the buffer contents are not available; instead, a
|
|
|
|
|
special set of commands (mostly letters and punctuation) are defined for
|
|
|
|
|
moving around in the buffer.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
Space scrolls forward, Delete scrolls backward.
|
2007-11-10 09:52:30 +00:00
|
|
|
|
For a list of all View commands, type H or h while viewing.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
This command runs the normal hook `view-mode-hook'.
|
|
|
|
|
|
|
|
|
|
Optional argument EXIT-ACTION is either nil or a function with buffer as
|
2007-11-10 09:52:30 +00:00
|
|
|
|
argument. This function is called when finished viewing buffer. Use
|
2008-01-27 22:19:43 +00:00
|
|
|
|
this argument instead of explicitly setting `view-exit-action'.
|
|
|
|
|
|
|
|
|
|
Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a
|
|
|
|
|
file: Users may suspend viewing in order to modify the buffer.
|
|
|
|
|
Exiting View mode will then discard the user's edits. Setting
|
2012-03-16 01:40:20 +00:00
|
|
|
|
EXIT-ACTION to `kill-buffer-if-not-modified' avoids this.
|
|
|
|
|
|
|
|
|
|
This function does not enable View mode if the buffer's major-mode
|
|
|
|
|
has a `special' mode-class, because such modes usually have their
|
|
|
|
|
own View-like bindings."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "bView buffer: ")
|
2012-02-01 08:31:29 +00:00
|
|
|
|
(switch-to-buffer buffer)
|
|
|
|
|
(if (eq (get major-mode 'mode-class) 'special)
|
|
|
|
|
(message "Not using View mode because the major mode is special")
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(view-mode-enter nil exit-action)))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
1991-07-25 20:25:57 +00:00
|
|
|
|
;;;###autoload
|
2013-08-11 00:07:48 +00:00
|
|
|
|
(defun view-buffer-other-window (buffer &optional _not-return exit-action)
|
1995-08-15 01:49:17 +00:00
|
|
|
|
"View BUFFER in View mode in another window.
|
2011-06-13 13:14:42 +00:00
|
|
|
|
Emacs commands editing the buffer contents are not available;
|
|
|
|
|
instead, a special set of commands (mostly letters and
|
|
|
|
|
punctuation) are defined for moving around in the buffer.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
Space scrolls forward, Delete scrolls backward.
|
2007-11-10 09:52:30 +00:00
|
|
|
|
For a list of all View commands, type H or h while viewing.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
This command runs the normal hook `view-mode-hook'.
|
|
|
|
|
|
2011-06-13 13:14:42 +00:00
|
|
|
|
Optional argument NOT-RETURN is ignored.
|
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
Optional argument EXIT-ACTION is either nil or a function with buffer as
|
2007-11-10 09:52:30 +00:00
|
|
|
|
argument. This function is called when finished viewing buffer. Use
|
2012-03-16 01:40:20 +00:00
|
|
|
|
this argument instead of explicitly setting `view-exit-action'.
|
|
|
|
|
|
|
|
|
|
This function does not enable View mode if the buffer's major-mode
|
|
|
|
|
has a `special' mode-class, because such modes usually have their
|
|
|
|
|
own View-like bindings."
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(interactive "bIn other window view buffer:\nP")
|
2011-09-01 17:04:30 +00:00
|
|
|
|
(let ((pop-up-windows t))
|
|
|
|
|
(pop-to-buffer buffer t))
|
2012-02-01 08:31:29 +00:00
|
|
|
|
(if (eq (get major-mode 'mode-class) 'special)
|
|
|
|
|
(message "Not using View mode because the major mode is special")
|
|
|
|
|
(view-mode-enter nil exit-action)))
|
1993-07-17 19:06:12 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
;;;###autoload
|
2013-08-11 00:07:48 +00:00
|
|
|
|
(defun view-buffer-other-frame (buffer &optional _not-return exit-action)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
"View BUFFER in View mode in another frame.
|
2011-06-13 13:14:42 +00:00
|
|
|
|
Emacs commands editing the buffer contents are not available;
|
|
|
|
|
instead, a special set of commands (mostly letters and
|
|
|
|
|
punctuation) are defined for moving around in the buffer.
|
1991-07-25 20:25:57 +00:00
|
|
|
|
Space scrolls forward, Delete scrolls backward.
|
2007-11-10 09:52:30 +00:00
|
|
|
|
For a list of all View commands, type H or h while viewing.
|
1991-07-25 20:25:57 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
This command runs the normal hook `view-mode-hook'.
|
|
|
|
|
|
2011-06-13 13:14:42 +00:00
|
|
|
|
Optional argument NOT-RETURN is ignored.
|
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
Optional argument EXIT-ACTION is either nil or a function with buffer as
|
2007-11-10 09:52:30 +00:00
|
|
|
|
argument. This function is called when finished viewing buffer. Use
|
2012-03-16 01:40:20 +00:00
|
|
|
|
this argument instead of explicitly setting `view-exit-action'.
|
|
|
|
|
|
|
|
|
|
This function does not enable View mode if the buffer's major-mode
|
|
|
|
|
has a `special' mode-class, because such modes usually have their
|
|
|
|
|
own View-like bindings."
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(interactive "bView buffer in other frame: \nP")
|
2011-09-01 17:04:30 +00:00
|
|
|
|
(let ((pop-up-frames t))
|
|
|
|
|
(pop-to-buffer buffer t))
|
2012-02-01 08:31:29 +00:00
|
|
|
|
(if (eq (get major-mode 'mode-class) 'special)
|
|
|
|
|
(message "Not using View mode because the major mode is special")
|
|
|
|
|
(view-mode-enter nil exit-action)))
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
1991-05-09 21:50:34 +00:00
|
|
|
|
;;;###autoload
|
2010-05-03 02:29:46 +00:00
|
|
|
|
(define-minor-mode view-mode
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
;; In the following documentation string we have to use some explicit key
|
1997-06-14 21:41:42 +00:00
|
|
|
|
;; bindings instead of using the \\[] construction. The reason for this
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
;; is that most commands have more than one key binding.
|
|
|
|
|
"Toggle View mode, a minor mode for viewing text but not editing it.
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
With a prefix argument ARG, enable View mode if ARG is positive,
|
|
|
|
|
and disable it otherwise. If called from Lisp, enable View mode
|
|
|
|
|
if ARG is omitted or nil.
|
|
|
|
|
|
|
|
|
|
When View mode is enabled, commands that do not change the buffer
|
|
|
|
|
contents are available as usual. Kill commands insert text in
|
|
|
|
|
kill buffers but do not delete. Most other commands beep and
|
|
|
|
|
tell the user that the buffer is read-only.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
\\<view-mode-map>
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
|
|
|
|
|
The following additional commands are provided. Most commands
|
|
|
|
|
take prefix arguments. Page commands default to \"page size\"
|
|
|
|
|
lines which is almost a whole window, or number of lines set by
|
|
|
|
|
\\[View-scroll-page-forward-set-page-size] or \\[View-scroll-page-backward-set-page-size].
|
|
|
|
|
Half page commands default to and set \"half page size\" lines
|
|
|
|
|
which initially is half a window full. Search commands default
|
|
|
|
|
to a repeat count of one.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
H, h, ? This message.
|
|
|
|
|
Digits provide prefix arguments.
|
|
|
|
|
\\[negative-argument] negative prefix argument.
|
|
|
|
|
\\[beginning-of-buffer] move to the beginning of buffer.
|
|
|
|
|
> move to the end of buffer.
|
|
|
|
|
\\[View-scroll-to-buffer-end] scroll so that buffer end is at last line of window.
|
2000-01-31 21:34:33 +00:00
|
|
|
|
SPC scroll forward \"page size\" lines.
|
|
|
|
|
With prefix scroll forward prefix lines.
|
2013-02-12 04:46:18 +00:00
|
|
|
|
DEL, S-SPC scroll backward \"page size\" lines.
|
|
|
|
|
With prefix scroll backward prefix lines.
|
2000-01-31 21:34:33 +00:00
|
|
|
|
\\[View-scroll-page-forward-set-page-size] like \\[View-scroll-page-forward] but with prefix sets \"page size\" to prefix.
|
|
|
|
|
\\[View-scroll-page-backward-set-page-size] like \\[View-scroll-page-backward] but with prefix sets \"page size\" to prefix.
|
|
|
|
|
\\[View-scroll-half-page-forward] scroll forward \"half page size\" lines. With prefix, sets
|
|
|
|
|
\"half page size\" to prefix lines and scrolls forward that much.
|
|
|
|
|
\\[View-scroll-half-page-backward] scroll backward \"half page size\" lines. With prefix, sets
|
|
|
|
|
\"half page size\" to prefix lines and scrolls backward that much.
|
|
|
|
|
RET, LFD scroll forward one line. With prefix scroll forward prefix line(s).
|
|
|
|
|
y scroll backward one line. With prefix scroll backward prefix line(s).
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
\\[View-revert-buffer-scroll-page-forward] revert-buffer if necessary and scroll forward.
|
|
|
|
|
Use this to view a changing file.
|
|
|
|
|
\\[what-line] prints the current line number.
|
|
|
|
|
\\[View-goto-percent] goes prefix argument (default 100) percent into buffer.
|
|
|
|
|
\\[View-goto-line] goes to line given by prefix argument (default first line).
|
|
|
|
|
. set the mark.
|
|
|
|
|
x exchanges point and mark.
|
|
|
|
|
\\[View-back-to-mark] return to mark and pops mark ring.
|
|
|
|
|
Mark ring is pushed at start of every successful search and when
|
1997-06-14 21:41:42 +00:00
|
|
|
|
jump to line occurs. The mark is set on jump to buffer start or end.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
\\[point-to-register] save current position in character register.
|
2016-06-06 16:29:17 +00:00
|
|
|
|
\\=' go to position saved in character register.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
s do forward incremental search.
|
|
|
|
|
r do reverse incremental search.
|
|
|
|
|
\\[View-search-regexp-forward] searches forward for regular expression, starting after current page.
|
|
|
|
|
! and @ have a special meaning at the beginning of the regexp.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
! means search for a line with no match for regexp. @ means start
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
search at beginning (end for backward search) of buffer.
|
|
|
|
|
\\ searches backward for regular expression, starting before current page.
|
|
|
|
|
\\[View-search-last-regexp-forward] searches forward for last regular expression.
|
|
|
|
|
p searches backward for last regular expression.
|
2003-01-25 19:43:29 +00:00
|
|
|
|
\\[View-quit] quit View mode, restoring this window and buffer to previous state.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
\\[View-quit] is the normal way to leave view mode.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
\\[View-exit] exit View mode but stay in current buffer. Use this if you started
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
viewing a buffer (file) and find out you want to edit it.
|
2003-01-25 19:43:29 +00:00
|
|
|
|
This command restores the previous read-only status of the buffer.
|
|
|
|
|
\\[View-exit-and-edit] exit View mode, and make the current buffer editable
|
|
|
|
|
even if it was not editable before entry to View mode.
|
|
|
|
|
\\[View-quit-all] quit View mode, restoring all windows to previous state.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
\\[View-leave] quit View mode and maybe switch buffers, but don't kill this buffer.
|
|
|
|
|
\\[View-kill-and-leave] quit View mode, kill current buffer and go back to other buffer.
|
|
|
|
|
|
2007-03-28 09:16:41 +00:00
|
|
|
|
The effect of \\[View-leave], \\[View-quit] and \\[View-kill-and-leave] depends on how view-mode was entered. If it was
|
2005-12-03 14:35:38 +00:00
|
|
|
|
entered by view-file, view-file-other-window, view-file-other-frame, or
|
|
|
|
|
\\[dired-view-file] \(\\[view-file], \\[view-file-other-window],
|
|
|
|
|
\\[view-file-other-frame], or the Dired mode v command),
|
|
|
|
|
then \\[View-quit] will try to kill the current buffer.
|
|
|
|
|
If view-mode was entered from another buffer, by \\[view-buffer],
|
|
|
|
|
\\[view-buffer-other-window], \\[view-buffer-other frame], \\[view-file],
|
|
|
|
|
\\[view-file-other-window], or \\[view-file-other-frame],
|
2007-03-28 09:16:41 +00:00
|
|
|
|
then \\[View-leave], \\[View-quit] and \\[View-kill-and-leave] will return to that buffer.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
Entry to view-mode runs the normal hook `view-mode-hook'."
|
2010-05-03 02:29:46 +00:00
|
|
|
|
:lighter " View" :keymap view-mode-map
|
2013-01-04 02:53:48 +00:00
|
|
|
|
(if view-mode (view--enable) (view--disable)))
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
2013-01-04 02:53:48 +00:00
|
|
|
|
(defun view--enable ()
|
1997-06-16 06:55:37 +00:00
|
|
|
|
;; Always leave view mode before changing major mode.
|
|
|
|
|
;; This is to guarantee that the buffer-read-only variable is restored.
|
2013-01-04 02:53:48 +00:00
|
|
|
|
(add-hook 'change-major-mode-hook 'view--disable nil t)
|
|
|
|
|
(setq view-page-size nil
|
2004-10-16 15:24:34 +00:00
|
|
|
|
view-half-page-size nil
|
1997-06-14 21:41:42 +00:00
|
|
|
|
view-old-buffer-read-only buffer-read-only
|
2009-07-26 23:06:49 +00:00
|
|
|
|
buffer-read-only t)
|
|
|
|
|
(if (boundp 'Helper-return-blurb)
|
|
|
|
|
(setq view-old-Helper-return-blurb (and (boundp 'Helper-return-blurb)
|
|
|
|
|
Helper-return-blurb)
|
|
|
|
|
Helper-return-blurb
|
|
|
|
|
(format "continue viewing %s"
|
|
|
|
|
(if (buffer-file-name)
|
|
|
|
|
(file-name-nondirectory (buffer-file-name))
|
2013-01-04 02:53:48 +00:00
|
|
|
|
(buffer-name))))))
|
1997-06-14 21:41:42 +00:00
|
|
|
|
|
2013-01-04 02:53:48 +00:00
|
|
|
|
|
|
|
|
|
(define-obsolete-function-alias 'view-mode-enable 'view-mode "24.4")
|
1997-06-14 21:41:42 +00:00
|
|
|
|
(defun view-mode-disable ()
|
|
|
|
|
"Turn off View mode."
|
2013-01-04 02:53:48 +00:00
|
|
|
|
(declare (obsolete view-mode "24.4"))
|
|
|
|
|
(view-mode -1))
|
|
|
|
|
|
|
|
|
|
(defun view--disable ()
|
|
|
|
|
(remove-hook 'change-major-mode-hook 'view--disable t)
|
1997-06-14 21:41:42 +00:00
|
|
|
|
(and view-overlay (delete-overlay view-overlay))
|
2014-07-21 05:38:17 +00:00
|
|
|
|
;; Calling read-only-mode while View mode is enabled
|
2000-03-19 15:56:40 +00:00
|
|
|
|
;; sets view-read-only to t as a buffer-local variable
|
2014-07-21 05:38:17 +00:00
|
|
|
|
;; after exiting View mode. That arranges that the next read-only-mode
|
2000-03-19 15:56:40 +00:00
|
|
|
|
;; will reenable View mode.
|
2011-12-04 08:02:42 +00:00
|
|
|
|
;; Canceling View mode in any other way should cancel that, too,
|
2014-07-21 05:38:17 +00:00
|
|
|
|
;; so that View mode stays off if read-only-mode is called.
|
2000-03-19 15:56:40 +00:00
|
|
|
|
(if (local-variable-p 'view-read-only)
|
|
|
|
|
(kill-local-variable 'view-read-only))
|
2009-07-26 23:06:49 +00:00
|
|
|
|
(if (boundp 'Helper-return-blurb)
|
|
|
|
|
(setq Helper-return-blurb view-old-Helper-return-blurb))
|
1999-08-10 16:40:00 +00:00
|
|
|
|
(if buffer-read-only
|
|
|
|
|
(setq buffer-read-only view-old-buffer-read-only)))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2007-11-10 09:52:30 +00:00
|
|
|
|
(defun view-return-to-alist-update (buffer &optional item)
|
|
|
|
|
"Update `view-return-to-alist' of buffer BUFFER.
|
|
|
|
|
Remove from `view-return-to-alist' all entries referencing dead
|
|
|
|
|
windows. Optional argument ITEM non-nil means add ITEM to
|
2011-12-05 08:55:25 +00:00
|
|
|
|
`view-return-to-alist' after purging. For a description of items
|
2007-11-10 09:52:30 +00:00
|
|
|
|
that can be added see the RETURN-TO-ALIST argument of the
|
|
|
|
|
function `view-mode-exit'. If `view-return-to-alist' contains an
|
|
|
|
|
entry for the selected window, purge that entry from
|
|
|
|
|
`view-return-to-alist' before adding ITEM."
|
Use declare forms, where possible, to mark obsolete functions.
* lisp/allout.el (allout-passphrase-hint-string): Likewise.
(allout-init): Use a declare form to mark obsolete.
* lisp/calendar/calendar.el (calendar-version):
* lisp/calendar/icalendar.el (icalendar-extract-ical-from-buffer)
(icalendar-convert-diary-to-ical):
* lisp/cus-edit.el (custom-mode):
* lisp/ansi-color.el (ansi-color-unfontify-region):
* lisp/international/latin1-disp.el (latin1-char-displayable-p):
* lisp/progmodes/cwarn.el (turn-on-cwarn-mode):
* lisp/progmodes/which-func.el (which-func-update-1): Use
define-obsolete-function-alias.
* lisp/bookmark.el (bookmark-jump-noselect): Use a declare form to mark
this function obsolete.
* lisp/calendar/cal-x.el (calendar-two-frame-setup)
(calendar-only-one-frame-setup, calendar-one-frame-setup):
* lisp/calendar/calendar.el (american-calendar, european-calendar)
(calendar-for-loop):
* lisp/comint.el (comint-dynamic-simple-complete)
(comint-dynamic-complete-as-filename, comint-unquote-filename):
* lisp/desktop.el (desktop-load-default):
* lisp/dired-x.el (dired-omit-here-always)
(dired-hack-local-variables, dired-default-directory):
* lisp/emacs-lisp/derived.el (derived-mode-class):
* lisp/emacs-lisp/timer.el (timer-set-time-with-usecs):
* lisp/emacs-lock.el (toggle-emacs-lock):
* lisp/epa.el (epa-display-verify-result):
* lisp/epg.el (epg-sign-keys, epg-start-sign-keys)
(epg-passphrase-callback-function):
* lisp/eshell/esh-util.el (eshell-for):
* lisp/eshell/eshell.el (eshell-remove-from-window-buffer-names)
(eshell-add-to-window-buffer-names):
* lisp/files.el (locate-file-completion):
* lisp/imenu.el (imenu-example--create-c-index)
(imenu-example--create-lisp-index)
(imenu-example--lisp-extract-index-name)
(imenu-example--name-and-position):
* lisp/international/mule-cmds.el (princ-list):
* lisp/international/mule-diag.el (decode-codepage-char):
* lisp/international/mule-util.el (detect-coding-with-priority):
* lisp/iswitchb.el (iswitchb-read-buffer):
* lisp/mail/mailalias.el (mail-complete):
* lisp/mail/sendmail.el (mail-sent-via):
* lisp/mouse.el (mouse-popup-menubar-stuff, mouse-popup-menubar)
(mouse-major-mode-menu):
* lisp/password-cache.el (password-read-and-add):
* lisp/pcomplete.el (pcomplete-parse-comint-arguments):
* lisp/progmodes/sh-script.el (sh-maybe-here-document):
* lisp/replace.el (query-replace-regexp-eval):
* lisp/savehist.el (savehist-load):
* lisp/simple.el (choose-completion-delete-max-match):
* lisp/term.el (term-dynamic-simple-complete):
* lisp/vc/ediff-init.el (ediff-check-version):
* lisp/vc/ediff-wind.el (ediff-choose-window-setup-function-automatically):
* lisp/vc/vc.el (vc-diff-switches-list):
* lisp/view.el (view-return-to-alist-update): Likewise.
* lisp/iswitchb.el (iswitchb-read-buffer): Move code of
iswitchb-define-mode-map here, and delete that obsolete function.
* lisp/subr.el (eval-next-after-load, makehash, insert-string)
(assoc-ignore-representation, assoc-ignore-case): Use declare to
mark obsolete.
(mode-line-inverse-video): Variable deleted.
* lisp/emacs-lisp/byte-run.el (make-obsolete): Doc fix; emphasize that
this applies to functions.
* lisp/erc/erc.el (erc-send-command): Use define-obsolete-function-alias.
* lisp/international/mule-util.el (string-to-sequence): Remove.
* lisp/net/newst-backend.el (newsticker-cache-filename):
* lisp/net/newst-treeview.el (newsticker-groups-filename): Fix
incorrect obsolescence declaration.
* lisp/net/snmp-mode.el (snmp-font-lock-keywords-3): Don't use obsolete
font-lock-reference-face.
* lisp/url/url-parse.el (url-recreate-url-attributes):
* lisp/url/url-util.el (url-generate-unique-filename): Use declare to mark
obsolete.
* src/xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2012-09-25 04:13:02 +00:00
|
|
|
|
(declare (obsolete "this function has no effect." "24.1"))
|
2007-11-10 09:52:30 +00:00
|
|
|
|
(with-current-buffer buffer
|
|
|
|
|
(when view-return-to-alist
|
|
|
|
|
(let* ((list view-return-to-alist)
|
|
|
|
|
entry entry-window last)
|
|
|
|
|
(while list
|
|
|
|
|
(setq entry (car list))
|
|
|
|
|
(setq entry-window (car entry))
|
|
|
|
|
(if (and (windowp entry-window)
|
|
|
|
|
(or (and item (eq entry-window (selected-window)))
|
|
|
|
|
(not (window-live-p entry-window))))
|
|
|
|
|
;; Remove that entry.
|
|
|
|
|
(if last
|
|
|
|
|
(setcdr last (cdr list))
|
|
|
|
|
(setq view-return-to-alist
|
|
|
|
|
(cdr view-return-to-alist)))
|
|
|
|
|
;; Leave entry alone.
|
|
|
|
|
(setq last entry))
|
|
|
|
|
(setq list (cdr list)))))
|
|
|
|
|
;; Add ITEM.
|
|
|
|
|
(when item
|
|
|
|
|
(setq view-return-to-alist
|
|
|
|
|
(cons item view-return-to-alist)))))
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(defun view-mode-enter (&optional quit-restore exit-action)
|
2007-11-10 09:52:30 +00:00
|
|
|
|
"Enter View mode and set up exit from view mode depending on optional arguments.
|
2011-06-13 13:14:42 +00:00
|
|
|
|
Optional argument QUIT-RESTORE if non-nil must specify a valid
|
|
|
|
|
entry for quitting and restoring any window showing the current
|
|
|
|
|
buffer. This entry replaces any parameter installed by
|
|
|
|
|
`display-buffer' and is used by `view-mode-exit'.
|
|
|
|
|
|
|
|
|
|
Optional argument EXIT-ACTION, if non-nil, must specify a
|
2007-11-10 09:52:30 +00:00
|
|
|
|
function that takes a buffer as argument. This function will be
|
|
|
|
|
called by `view-mode-exit'.
|
|
|
|
|
|
|
|
|
|
For a list of all View commands, type H or h while viewing.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
This function runs the normal hook `view-mode-hook'."
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(when quit-restore
|
|
|
|
|
(dolist (window (get-buffer-window-list nil nil t))
|
|
|
|
|
(set-window-parameter window 'quit-restore quit-restore)))
|
|
|
|
|
|
2007-11-10 09:52:30 +00:00
|
|
|
|
(when exit-action
|
|
|
|
|
(setq view-exit-action exit-action))
|
|
|
|
|
|
|
|
|
|
(unless view-mode
|
2013-01-04 02:53:48 +00:00
|
|
|
|
(view-mode 1)
|
2005-11-29 10:53:30 +00:00
|
|
|
|
(unless view-inhibit-help-message
|
|
|
|
|
(message "%s"
|
|
|
|
|
(substitute-command-keys "\
|
|
|
|
|
View mode: type \\[help-command] for help, \\[describe-mode] for commands, \\[View-quit] to quit.")))))
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
2011-06-13 13:14:42 +00:00
|
|
|
|
;; This is awful because it assumes that the selected window shows the
|
|
|
|
|
;; current buffer when this is called.
|
|
|
|
|
(defun view-mode-exit (&optional exit-only exit-action all-windows)
|
|
|
|
|
"Exit View mode in various ways.
|
|
|
|
|
If all arguments are nil, remove the current buffer from the
|
|
|
|
|
selected window using the `quit-restore' information associated
|
|
|
|
|
with the selected window. If optional argument ALL-WINDOWS or
|
|
|
|
|
`view-exits-all-viewing-windows' are non-nil, remove the current
|
|
|
|
|
buffer from all windows showing it.
|
|
|
|
|
|
|
|
|
|
Optional argument EXIT-ONLY non-nil means just exit `view-mode'
|
|
|
|
|
\(unless `view-no-disable-on-exit' is non-nil) but do not change
|
|
|
|
|
the associations of any windows with the current buffer.
|
|
|
|
|
|
|
|
|
|
EXIT-ACTION, if non-nil, must specify a function that is called
|
|
|
|
|
with the current buffer as argument and is called after disabling
|
|
|
|
|
`view-mode' and removing any associations of windows with the
|
|
|
|
|
current buffer. "
|
|
|
|
|
(when view-mode
|
|
|
|
|
(let ((buffer (window-buffer)))
|
2007-11-10 09:52:30 +00:00
|
|
|
|
(unless view-no-disable-on-exit
|
2013-01-04 02:53:48 +00:00
|
|
|
|
(view-mode -1))
|
2011-06-13 13:14:42 +00:00
|
|
|
|
|
|
|
|
|
(unless exit-only
|
|
|
|
|
(cond
|
|
|
|
|
((or all-windows view-exits-all-viewing-windows)
|
|
|
|
|
(dolist (window (get-buffer-window-list))
|
2011-08-24 17:38:46 +00:00
|
|
|
|
(quit-window nil window)))
|
2011-06-13 13:14:42 +00:00
|
|
|
|
((eq (window-buffer) (current-buffer))
|
2011-08-24 17:38:46 +00:00
|
|
|
|
(quit-window)))
|
2011-06-13 13:14:42 +00:00
|
|
|
|
|
|
|
|
|
(when exit-action
|
2013-01-04 02:53:48 +00:00
|
|
|
|
(funcall exit-action buffer))))))
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun View-exit ()
|
|
|
|
|
"Exit View mode but stay in current buffer."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive)
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(view-mode-exit t))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
1997-06-19 11:19:24 +00:00
|
|
|
|
;;;###autoload
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun View-exit-and-edit ()
|
|
|
|
|
"Exit View mode and make the current buffer editable."
|
|
|
|
|
(interactive)
|
1998-06-03 14:35:38 +00:00
|
|
|
|
(let ((view-old-buffer-read-only nil)
|
|
|
|
|
(view-no-disable-on-exit nil))
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(view-mode-exit t)))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun View-leave ()
|
|
|
|
|
"Quit View mode and maybe switch buffers, but don't kill this buffer."
|
|
|
|
|
(interactive)
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(view-mode-exit))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun View-quit ()
|
|
|
|
|
"Quit View mode, trying to restore window and buffer to previous state.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
Maybe kill this buffer. Try to restore selected window to previous state
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
and go to previous buffer or window."
|
|
|
|
|
(interactive)
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(view-mode-exit nil view-exit-action))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun View-quit-all ()
|
1997-06-14 21:41:42 +00:00
|
|
|
|
"Quit View mode, trying to restore windows and buffers to previous state.
|
|
|
|
|
Maybe kill current buffer. Try to restore all windows viewing buffer to
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
previous state and go to previous buffer or window."
|
|
|
|
|
(interactive)
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(view-mode-exit nil view-exit-action t))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun View-kill-and-leave ()
|
|
|
|
|
"Quit View mode, kill current buffer and return to previous buffer."
|
|
|
|
|
(interactive)
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(view-mode-exit nil (or view-exit-action 'kill-buffer) t))
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
;;; Some help routines.
|
|
|
|
|
|
|
|
|
|
(defun view-window-size ()
|
2009-05-26 18:19:27 +00:00
|
|
|
|
;; Return the height of the current window, excluding the mode line.
|
|
|
|
|
;; Using `window-line-height' accounts for variable-height fonts.
|
|
|
|
|
(let ((h (window-line-height -1)))
|
|
|
|
|
(if h
|
|
|
|
|
(1+ (nth 1 h))
|
|
|
|
|
;; This should not happen, but if `window-line-height' returns
|
|
|
|
|
;; nil, fall back on `window-height'.
|
|
|
|
|
(1- (window-height)))))
|
1994-03-14 16:02:05 +00:00
|
|
|
|
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (defun view-last-command (&optional who what)
|
|
|
|
|
;; (setq view-last-command-entry this-command)
|
|
|
|
|
;; (setq view-last-command who)
|
|
|
|
|
;; (setq view-last-command-argument what))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (defun View-repeat-last-command ()
|
|
|
|
|
;; "Repeat last command issued in View mode."
|
|
|
|
|
;; (interactive)
|
|
|
|
|
;; (if (and view-last-command
|
|
|
|
|
;; (eq view-last-command-entry last-command))
|
|
|
|
|
;; (funcall view-last-command view-last-command-argument))
|
|
|
|
|
;; (setq this-command view-last-command-entry))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun view-recenter ()
|
2009-05-26 14:37:51 +00:00
|
|
|
|
;; Recenter point in window and redisplay normally.
|
|
|
|
|
(recenter '(1)))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun view-page-size-default (lines)
|
2009-05-26 18:19:27 +00:00
|
|
|
|
;; If LINES is nil, 0, or larger than `view-window-size', return nil.
|
|
|
|
|
;; Otherwise, return LINES.
|
|
|
|
|
(and lines
|
|
|
|
|
(not (zerop (setq lines (prefix-numeric-value lines))))
|
|
|
|
|
(<= (abs lines)
|
|
|
|
|
(abs (- (view-window-size) next-screen-context-lines)))
|
|
|
|
|
(abs lines)))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun view-set-half-page-size-default (lines)
|
|
|
|
|
;; Get and maybe set half page size.
|
2004-10-16 15:24:34 +00:00
|
|
|
|
(if (not lines) (or view-half-page-size
|
|
|
|
|
(/ (view-window-size) 2))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(setq view-half-page-size
|
|
|
|
|
(if (zerop (setq lines (prefix-numeric-value lines)))
|
|
|
|
|
(/ (view-window-size) 2)
|
|
|
|
|
(view-page-size-default lines)))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Commands for moving around in the buffer.
|
|
|
|
|
|
|
|
|
|
(defun View-goto-percent (&optional percent)
|
|
|
|
|
"Move to end (or prefix PERCENT) of buffer in View mode.
|
|
|
|
|
Display is centered at point.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
Also set the mark at the position where point was."
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(interactive "P")
|
|
|
|
|
(push-mark)
|
|
|
|
|
(goto-char
|
|
|
|
|
(if percent
|
|
|
|
|
(+ (point-min)
|
|
|
|
|
(floor (* (- (point-max) (point-min)) 0.01
|
|
|
|
|
(max 0 (min 100 (prefix-numeric-value percent))))))
|
|
|
|
|
(point-max)))
|
|
|
|
|
(view-recenter))
|
|
|
|
|
|
2008-06-24 13:29:28 +00:00
|
|
|
|
;; (defun View-goto-line-last (&optional line)
|
|
|
|
|
;; "Move to last (or prefix LINE) line in View mode.
|
|
|
|
|
;; Display is centered at LINE.
|
|
|
|
|
;; Sets mark at starting position and pushes mark ring."
|
|
|
|
|
;; (interactive "P")
|
|
|
|
|
;; (push-mark)
|
|
|
|
|
;; (if line (goto-line (prefix-numeric-value line))
|
|
|
|
|
;; (goto-char (point-max))
|
|
|
|
|
;; (beginning-of-line))
|
|
|
|
|
;; (view-recenter))
|
2003-02-04 12:29:42 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun View-goto-line (&optional line)
|
|
|
|
|
"Move to first (or prefix LINE) line in View mode.
|
|
|
|
|
Display is centered at LINE.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
Also set the mark at the position where point was."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "p")
|
|
|
|
|
(push-mark)
|
2009-08-22 19:29:18 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(forward-line (1- line))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-recenter))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
2011-04-19 13:44:55 +00:00
|
|
|
|
(defun View-back-to-mark (&optional _ignore)
|
2003-05-03 13:52:17 +00:00
|
|
|
|
"Return to last mark set in View mode, else beginning of file.
|
|
|
|
|
Display that line at the center of the window.
|
|
|
|
|
This command pops the mark ring, so that successive
|
|
|
|
|
invocations return to earlier marks."
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(interactive)
|
2003-05-03 13:52:17 +00:00
|
|
|
|
(goto-char (or (mark t) (point-min)))
|
|
|
|
|
(pop-mark)
|
|
|
|
|
(view-recenter))
|
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun view-scroll-lines (lines backward default maxdefault)
|
|
|
|
|
;; This function does the job for all the scrolling commands.
|
2009-05-26 18:19:27 +00:00
|
|
|
|
;; Scroll forward LINES lines. If BACKWARD is non-nil, scroll backwards.
|
|
|
|
|
;; If LINES is negative scroll in the other direction.
|
|
|
|
|
;; If LINES is 0 or nil, scroll DEFAULT lines (if DEFAULT is nil, scroll
|
2009-09-24 01:37:14 +00:00
|
|
|
|
;; by one page). If MAXDEFAULT is non-nil, scroll no more than a window.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(if (or (null lines) (zerop (setq lines (prefix-numeric-value lines))))
|
|
|
|
|
(setq lines default))
|
2009-05-26 18:19:27 +00:00
|
|
|
|
(when (and lines (< lines 0))
|
|
|
|
|
(setq backward (not backward) lines (- lines)))
|
|
|
|
|
(when (and maxdefault lines (> lines (view-window-size)))
|
|
|
|
|
(setq lines nil))
|
|
|
|
|
(cond (backward (scroll-down lines))
|
|
|
|
|
((view-really-at-end)
|
|
|
|
|
(if view-scroll-auto-exit
|
|
|
|
|
(View-quit)
|
|
|
|
|
(ding)
|
|
|
|
|
(view-end-message)))
|
|
|
|
|
(t (scroll-up lines)
|
|
|
|
|
(if (view-really-at-end) (view-end-message)))))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun view-really-at-end ()
|
1997-06-14 21:41:42 +00:00
|
|
|
|
;; Return true if buffer end visible. Maybe revert buffer and test.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(and (pos-visible-in-window-p (point-max))
|
|
|
|
|
(let ((buf (current-buffer))
|
|
|
|
|
(bufname (buffer-name))
|
|
|
|
|
(file (buffer-file-name)))
|
1998-04-20 09:37:18 +00:00
|
|
|
|
(or (not view-try-extend-at-buffer-end)
|
|
|
|
|
(null file)
|
|
|
|
|
(verify-visited-file-modtime buf)
|
|
|
|
|
(not (file-exists-p file))
|
|
|
|
|
(when (buffer-modified-p buf)
|
|
|
|
|
(setq file (file-name-nondirectory file))
|
|
|
|
|
(not (yes-or-no-p
|
|
|
|
|
(format
|
|
|
|
|
"File %s changed on disk. Discard your edits%s? "
|
|
|
|
|
file
|
|
|
|
|
(if (string= bufname file) ""
|
|
|
|
|
(concat " in " bufname))))))
|
|
|
|
|
(progn
|
|
|
|
|
(revert-buffer t t t)
|
|
|
|
|
(pos-visible-in-window-p (point-max)))))))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun view-end-message ()
|
|
|
|
|
;; Tell that we are at end of buffer.
|
|
|
|
|
(goto-char (point-max))
|
2011-06-13 13:14:42 +00:00
|
|
|
|
(if (window-parameter nil 'quit-restore)
|
1997-09-09 07:09:20 +00:00
|
|
|
|
(message "End of buffer. Type %s to quit viewing."
|
|
|
|
|
(substitute-command-keys
|
|
|
|
|
(if view-scroll-auto-exit "\\[View-scroll-page-forward]"
|
|
|
|
|
"\\[View-quit]")))
|
|
|
|
|
(message "End of buffer")))
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
|
|
|
|
(defun View-scroll-to-buffer-end ()
|
|
|
|
|
"Scroll backward or forward so that buffer end is at last line of window."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((p (if (pos-visible-in-window-p (point-max)) (point))))
|
|
|
|
|
(goto-char (point-max))
|
|
|
|
|
(recenter -1)
|
|
|
|
|
(and p (goto-char p))))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
|
|
|
|
(defun View-scroll-page-forward (&optional lines)
|
|
|
|
|
"Scroll \"page size\" or prefix LINES lines forward in View mode.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
Exit if end of text is visible and `view-scroll-auto-exit' is non-nil.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
\"page size\" is whole window full, or number of lines set by
|
|
|
|
|
\\[View-scroll-page-forward-set-page-size] or
|
|
|
|
|
\\[View-scroll-page-backward-set-page-size].
|
|
|
|
|
If LINES is more than a window-full, only the last window-full is shown."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "P")
|
2004-10-16 15:24:34 +00:00
|
|
|
|
(view-scroll-lines lines nil (view-page-size-default view-page-size) nil))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
2000-01-31 21:34:33 +00:00
|
|
|
|
(defun View-scroll-page-backward (&optional lines)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
"Scroll \"page size\" or prefix LINES lines backward in View mode.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
See also `View-scroll-page-forward'."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "P")
|
2004-10-16 15:24:34 +00:00
|
|
|
|
(view-scroll-lines lines t (view-page-size-default view-page-size) nil))
|
2003-02-04 12:29:42 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun View-scroll-page-forward-set-page-size (&optional lines)
|
1997-06-14 21:41:42 +00:00
|
|
|
|
"Scroll forward LINES lines in View mode, setting the \"page size\".
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
This is the number of lines which \\[View-scroll-page-forward] and
|
1997-06-25 07:03:48 +00:00
|
|
|
|
\\[View-scroll-page-backward] scroll by default.
|
|
|
|
|
If LINES is omitted or = 0, sets \"page size\" to window height and
|
|
|
|
|
scrolls forward that much, otherwise scrolls forward LINES lines and sets
|
|
|
|
|
\"page size\" to the minimum of window height and the absolute value of LINES.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
See also `View-scroll-page-forward'."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "P")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-scroll-lines lines nil
|
|
|
|
|
(setq view-page-size (view-page-size-default lines))
|
|
|
|
|
nil))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun View-scroll-page-backward-set-page-size (&optional lines)
|
|
|
|
|
"Scroll backward prefix LINES lines in View mode, setting the \"page size\".
|
1997-06-14 21:41:42 +00:00
|
|
|
|
See also `View-scroll-page-forward-set-page-size'."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "P")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-scroll-lines lines t
|
|
|
|
|
(setq view-page-size (view-page-size-default lines))
|
|
|
|
|
nil))
|
|
|
|
|
|
|
|
|
|
(defun View-scroll-line-forward (&optional lines)
|
|
|
|
|
"Scroll forward one line (or prefix LINES lines) in View mode.
|
2009-09-24 01:37:14 +00:00
|
|
|
|
See also `View-scroll-page-forward', but note that scrolling is limited
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
to minimum of LINES and one window-full."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(view-scroll-lines lines nil 1 t))
|
|
|
|
|
|
|
|
|
|
(defun View-scroll-line-backward (&optional lines)
|
|
|
|
|
"Scroll backward one line (or prefix LINES lines) in View mode.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
See also `View-scroll-line-forward'."
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(interactive "P")
|
|
|
|
|
(view-scroll-lines lines t 1 t))
|
|
|
|
|
|
|
|
|
|
(defun View-scroll-half-page-forward (&optional lines)
|
1997-06-14 21:41:42 +00:00
|
|
|
|
"Scroll forward a \"half page\" (or prefix LINES) lines in View mode.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
If LINES is not omitted, the \"half page size\" is set to the minimum of
|
|
|
|
|
window height and the absolute value of LINES.
|
|
|
|
|
LINES=0 resets \"half page size\" to half window height."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(view-scroll-lines lines nil (view-set-half-page-size-default lines) t))
|
|
|
|
|
|
|
|
|
|
(defun View-scroll-half-page-backward (&optional lines)
|
1997-06-14 21:41:42 +00:00
|
|
|
|
"Scroll backward a \"half page\" (or prefix LINES) lines in View mode.
|
|
|
|
|
See also `View-scroll-half-page-forward'."
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(interactive "P")
|
|
|
|
|
(view-scroll-lines lines t (view-set-half-page-size-default lines) t))
|
|
|
|
|
|
1997-06-14 21:41:42 +00:00
|
|
|
|
(defun View-revert-buffer-scroll-page-forward (&optional lines)
|
|
|
|
|
"Scroll forward, reverting buffer if needed, in View mode.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
If buffer has not been changed and the corresponding file is newer, first
|
|
|
|
|
revert the buffer, then scroll.
|
|
|
|
|
This command is useful if you are viewing a changing file.
|
1997-06-14 21:41:42 +00:00
|
|
|
|
|
|
|
|
|
The prefix argument LINES says how many lines to scroll.
|
|
|
|
|
If you don't specify a prefix argument, it uses the number of lines set by
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
\\[View-scroll-page-forward-set-page-size] or
|
|
|
|
|
\\[View-scroll-page-backward-set-page-size].
|
|
|
|
|
If LINES is more than a window-full, only the last window-full is shown."
|
|
|
|
|
(interactive "P")
|
1999-01-04 11:04:27 +00:00
|
|
|
|
(let ((view-scroll-auto-exit nil)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-try-extend-at-buffer-end t))
|
2005-10-28 09:43:01 +00:00
|
|
|
|
(view-scroll-lines lines nil (view-page-size-default view-page-size) nil)))
|
2003-05-03 13:52:17 +00:00
|
|
|
|
|
1993-07-17 19:06:12 +00:00
|
|
|
|
(defun View-search-regexp-forward (n regexp)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
"Search forward for first (or prefix Nth) occurrence of REGEXP in View mode.
|
1997-06-25 07:03:48 +00:00
|
|
|
|
|
|
|
|
|
Displays line found at center of window. Sets mark at starting position and
|
|
|
|
|
pushes mark ring.
|
|
|
|
|
|
|
|
|
|
Characters @ and ! are special at the beginning of REGEXP. They modify
|
|
|
|
|
the search rather than become part of the pattern searched for.
|
|
|
|
|
@ means search all the buffer i.e. start search at the beginning of buffer.
|
|
|
|
|
! means search for a line that contains no match for the pattern.
|
|
|
|
|
If REGEXP is empty or only consist of these control characters, then
|
|
|
|
|
an earlier remembered REGEXP is used, otherwise REGEXP is remembered
|
|
|
|
|
for use by later search commands.
|
1995-10-09 19:44:26 +00:00
|
|
|
|
|
|
|
|
|
The variable `view-highlight-face' controls the face that is used
|
|
|
|
|
for highlighting the match that is found."
|
2000-01-31 21:34:33 +00:00
|
|
|
|
(interactive "p\nsSearch forward (regexp): ")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-search n regexp))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
1993-07-17 19:06:12 +00:00
|
|
|
|
(defun View-search-regexp-backward (n regexp)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
"Search backward for first (or prefix Nth) occurrence of REGEXP in View mode.
|
1997-06-25 07:03:48 +00:00
|
|
|
|
|
|
|
|
|
Displays line found at center of window. Sets mark at starting position and
|
|
|
|
|
pushes mark ring.
|
|
|
|
|
|
|
|
|
|
Characters @ and ! are special at the beginning of REGEXP. They modify
|
|
|
|
|
the search rather than become part of the pattern searched for.
|
|
|
|
|
@ means search all the buffer i.e. start search at the end of buffer.
|
|
|
|
|
! means search for a line that contains no match for the pattern.
|
|
|
|
|
If REGEXP is empty or only consist of these control characters, then
|
|
|
|
|
an earlier remembered REGEXP is used, otherwise REGEXP is remembered
|
|
|
|
|
for use by later search commands.
|
1995-10-09 19:44:26 +00:00
|
|
|
|
|
|
|
|
|
The variable `view-highlight-face' controls the face that is used
|
|
|
|
|
for highlighting the match that is found."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "p\nsSearch backward (regexp): ")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-search (- n) regexp))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun View-search-last-regexp-forward (n) "\
|
|
|
|
|
Search forward for first (or prefix Nth) instance of last regexp in View mode.
|
|
|
|
|
Displays line found at center of window. Sets mark at starting position and
|
|
|
|
|
pushes mark ring.
|
1995-10-09 19:44:26 +00:00
|
|
|
|
|
|
|
|
|
The variable `view-highlight-face' controls the face that is used
|
|
|
|
|
for highlighting the match that is found."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "p")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-search n nil))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun View-search-last-regexp-backward (n) "\
|
|
|
|
|
Search backward for first (or prefix Nth) instance of last regexp in View mode.
|
1990-01-17 16:51:47 +00:00
|
|
|
|
Displays line found at center of window. Sets mark at starting position and
|
1995-10-09 19:44:26 +00:00
|
|
|
|
pushes mark ring.
|
|
|
|
|
|
|
|
|
|
The variable `view-highlight-face' controls the face that is used
|
|
|
|
|
for highlighting the match that is found."
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(interactive "p")
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-search (- n) nil))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
|
|
|
|
|
(defun view-search (times regexp)
|
1997-06-25 07:03:48 +00:00
|
|
|
|
;; This function does the job for all the View-search- commands.
|
2011-11-14 20:23:26 +00:00
|
|
|
|
;; Search for the TIMESth match for REGEXP. If TIMES is negative
|
2009-09-24 01:37:14 +00:00
|
|
|
|
;; search backwards. If REGEXP is nil use `view-last-regexp'.
|
2008-11-04 17:08:15 +00:00
|
|
|
|
;; Characters "!" and "@" have a special meaning at the beginning of
|
1997-10-16 18:20:16 +00:00
|
|
|
|
;; REGEXP and are removed from REGEXP before the search "!" means
|
|
|
|
|
;; search for lines with no match for REGEXP. "@" means search in
|
|
|
|
|
;; the whole buffer, don't start searching from the present point.
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(let (where no end ln)
|
|
|
|
|
(cond
|
|
|
|
|
((and regexp (> (length regexp) 0)
|
|
|
|
|
(or (not (memq (string-to-char regexp) '(?! ?@)))
|
|
|
|
|
(progn
|
|
|
|
|
(if (member (substring regexp 0 2) '("!@" "@!"))
|
|
|
|
|
(setq end t no t ln 2)
|
|
|
|
|
(setq no (not (setq end (eq ?@ (string-to-char regexp))))
|
|
|
|
|
ln 1))
|
|
|
|
|
(> (length (setq regexp (substring regexp ln))) 0))))
|
|
|
|
|
(setq view-last-regexp (if no (list regexp) regexp)))
|
|
|
|
|
((consp view-last-regexp)
|
|
|
|
|
(setq regexp (car view-last-regexp))
|
1997-10-16 18:20:16 +00:00
|
|
|
|
(unless (setq no (not no)) (setq view-last-regexp regexp)))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-last-regexp (setq regexp view-last-regexp)
|
|
|
|
|
(if no (setq view-last-regexp (list regexp))))
|
|
|
|
|
(t (error "No previous View-mode search")))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(save-excursion
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(if end (goto-char (if (< times 0) (point-max) (point-min)))
|
|
|
|
|
(move-to-window-line (if (< times 0) 0 -1)))
|
|
|
|
|
(if (if no (view-search-no-match-lines times regexp)
|
|
|
|
|
(re-search-forward regexp nil t times))
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(setq where (point))))
|
|
|
|
|
(if where
|
|
|
|
|
(progn
|
|
|
|
|
(push-mark)
|
|
|
|
|
(goto-char where)
|
1995-10-05 22:25:38 +00:00
|
|
|
|
(if view-overlay
|
|
|
|
|
(move-overlay view-overlay (match-beginning 0) (match-end 0))
|
|
|
|
|
(setq view-overlay
|
|
|
|
|
(make-overlay (match-beginning 0) (match-end 0))))
|
1995-10-09 19:42:19 +00:00
|
|
|
|
(overlay-put view-overlay 'face view-highlight-face)
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(beginning-of-line)
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(view-recenter))
|
|
|
|
|
(message "Can't find occurrence %d of %s%s"
|
|
|
|
|
times (if no "no " "") regexp)
|
1990-01-17 16:51:47 +00:00
|
|
|
|
(sit-for 4))))
|
|
|
|
|
|
2007-09-25 02:28:49 +00:00
|
|
|
|
;; This is the dumb approach, looking at each line. The original
|
|
|
|
|
;; version of this function looked like it might have been trying to
|
|
|
|
|
;; do something clever, but not succeeding:
|
2017-11-26 06:45:41 +00:00
|
|
|
|
;; https://lists.gnu.org/r/bug-gnu-emacs/2007-09/msg00073.html
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
(defun view-search-no-match-lines (times regexp)
|
2007-09-25 02:28:49 +00:00
|
|
|
|
"Search for the TIMESth occurrence of a line with no match for REGEXP.
|
|
|
|
|
If such a line is found, return non-nil and set the match-data to that line.
|
|
|
|
|
If TIMES is negative, search backwards."
|
2007-09-25 07:06:16 +00:00
|
|
|
|
(let ((step (if (>= times 0) 1
|
|
|
|
|
(setq times (- times))
|
|
|
|
|
-1)))
|
2007-09-25 02:28:49 +00:00
|
|
|
|
;; Note that we do not check the current line.
|
|
|
|
|
(while (and (> times 0)
|
|
|
|
|
(zerop (forward-line step)))
|
2007-09-25 07:06:16 +00:00
|
|
|
|
;; (forward-line 1) returns 0 on moving within the last line.
|
|
|
|
|
(if (eobp)
|
|
|
|
|
(setq times -1)
|
|
|
|
|
(or (re-search-forward regexp (line-end-position) t)
|
|
|
|
|
(setq times (1- times))))))
|
|
|
|
|
(and (zerop times)
|
|
|
|
|
(looking-at ".*")))
|
Make view mode more similar to `less'.
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.
1997-06-14 21:06:09 +00:00
|
|
|
|
|
1992-03-16 20:39:07 +00:00
|
|
|
|
(provide 'view)
|
|
|
|
|
|
1992-05-30 20:24:49 +00:00
|
|
|
|
;;; view.el ends here
|