comparison lisp/view.el @ 13640:ee453099e188

(view-mode, view-mode-enter): Doc changes. (view-mode-map): Change h and ? to use describe-mode. Delete binding of help char. (view-mode-enter): Use describe-mode in message.
author Richard M. Stallman <rms@gnu.org>
date Fri, 24 Nov 1995 23:18:22 +0000
parents 50d31efc8e72
children 83f275dcd93a
comparison
equal deleted inserted replaced
13639:50d31efc8e72 13640:ee453099e188
85 (define-key view-mode-map "=" 'what-line) 85 (define-key view-mode-map "=" 'what-line)
86 (define-key view-mode-map "." 'set-mark-command) 86 (define-key view-mode-map "." 'set-mark-command)
87 (define-key view-mode-map "'" 'View-back-to-mark) 87 (define-key view-mode-map "'" 'View-back-to-mark)
88 (define-key view-mode-map "@" 'View-back-to-mark) 88 (define-key view-mode-map "@" 'View-back-to-mark)
89 (define-key view-mode-map "x" 'exchange-point-and-mark) 89 (define-key view-mode-map "x" 'exchange-point-and-mark)
90 (define-key view-mode-map "h" 'Helper-describe-bindings) 90 (define-key view-mode-map "h" 'describe-mode)
91 (define-key view-mode-map "?" 'Helper-describe-bindings) 91 (define-key view-mode-map "?" 'describe-mode)
92 (define-key view-mode-map (char-to-string help-char) 'help-command)
93 (define-key view-mode-map "s" 'isearch-forward) 92 (define-key view-mode-map "s" 'isearch-forward)
94 (define-key view-mode-map "r" 'isearch-backward) 93 (define-key view-mode-map "r" 'isearch-backward)
95 (define-key view-mode-map "/" 'View-search-regexp-forward) 94 (define-key view-mode-map "/" 'View-search-regexp-forward)
96 (define-key view-mode-map "\\" 'View-search-regexp-backward) 95 (define-key view-mode-map "\\" 'View-search-regexp-backward)
97 ;; This conflicts with the standard binding of isearch-regexp-forward 96 ;; This conflicts with the standard binding of isearch-regexp-forward
183 (defun view-mode (&optional arg) 182 (defun view-mode (&optional arg)
184 "Toggle View mode. 183 "Toggle View mode.
185 If you use this function to turn on View mode, 184 If you use this function to turn on View mode,
186 \"exiting\" View mode does nothing except turn View mode off. 185 \"exiting\" View mode does nothing except turn View mode off.
187 The other way to turn View mode on is by calling 186 The other way to turn View mode on is by calling
188 `view-mode-enter'." 187 `view-mode-enter'.
189 (interactive "P") 188
190 (setq view-mode
191 (if (null arg)
192 (not view-mode)
193 (> (prefix-numeric-value arg) 0)))
194 (force-mode-line-update))
195
196 (defun view-mode-enter (&optional prev-buffer action)
197 "Minor mode for viewing text but not editing it.
198 Letters do not insert themselves. Instead these commands are provided. 189 Letters do not insert themselves. Instead these commands are provided.
199 Most commands take prefix arguments. Commands dealing with lines 190 Most commands take prefix arguments. Commands dealing with lines
200 default to \"scroll size\" lines (initially size of window). 191 default to \"scroll size\" lines (initially size of window).
201 Search commands default to a repeat count of one. 192 Search commands default to a repeat count of one.
193
202 M-< or < move to beginning of buffer. 194 M-< or < move to beginning of buffer.
203 M-> or > move to end of buffer. 195 M-> or > move to end of buffer.
204 C-v or Space scroll forward lines. 196 C-v or Space scroll forward lines.
205 M-v or DEL scroll backward lines. 197 M-v or DEL scroll backward lines.
206 CR or LF scroll forward one line (backward with prefix argument). 198 CR or LF scroll forward one line (backward with prefix argument).
224 ? or h provide help message (list of commands). 216 ? or h provide help message (list of commands).
225 \\[help-command] provides help (list of commands or description of a command). 217 \\[help-command] provides help (list of commands or description of a command).
226 C-n moves down lines vertically. 218 C-n moves down lines vertically.
227 C-p moves upward lines vertically. 219 C-p moves upward lines vertically.
228 C-l recenters the screen. 220 C-l recenters the screen.
229 q exit view-mode and return to previous buffer. 221 q exit view-mode and return to previous buffer."
222 (interactive "P")
223 (setq view-mode
224 (if (null arg)
225 (not view-mode)
226 (> (prefix-numeric-value arg) 0)))
227 (force-mode-line-update))
228
229 (defun view-mode-enter (&optional prev-buffer action)
230 "Enter View mode, a Minor mode for viewing text but not editing it.
231 See the function `view-mode' for more details.
230 232
231 This function runs the normal hook `view-mode-hook'. 233 This function runs the normal hook `view-mode-hook'.
232 234
233 \\{view-mode-map}" 235 \\{view-mode-map}"
234 ; Not interactive because dangerous things happen 236 ; Not interactive because dangerous things happen
259 (setq goal-column nil) 261 (setq goal-column nil)
260 262
261 (run-hooks 'view-mode-hook) 263 (run-hooks 'view-mode-hook)
262 (message 264 (message
263 (substitute-command-keys 265 (substitute-command-keys
264 "Type \\[help-command] for help, \\[Helper-describe-bindings] for commands, \\[view-exit] to quit."))) 266 "Type \\[help-command] for help, \\[describe-mode] for commands, \\[view-exit] to quit.")))
265 267
266 (defun view-exit () 268 (defun view-exit ()
267 "Exit from view-mode. 269 "Exit from view-mode.
268 If you viewed an existing buffer, that buffer returns to its previous mode. 270 If you viewed an existing buffer, that buffer returns to its previous mode.
269 If you viewed a file that was not present in Emacs, its buffer is killed." 271 If you viewed a file that was not present in Emacs, its buffer is killed."