comparison lisp/view.el @ 12390:598490dfbed5

(view-file-other-window): Re-add missing argument to switch-to-buffer-other-window. (view-mode-map): Leave C-c alone! (view-mode): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Mon, 26 Jun 1995 20:45:48 +0000
parents 7f70a4773d5e
children a5e07f2bdf83
comparison
equal deleted inserted replaced
12389:e2d27fbff935 12390:598490dfbed5
31 (defvar view-mode-map nil) 31 (defvar view-mode-map nil)
32 (if view-mode-map 32 (if view-mode-map
33 nil 33 nil
34 (setq view-mode-map (make-keymap)) 34 (setq view-mode-map (make-keymap))
35 (fillarray (nth 1 view-mode-map) 'View-undefined) 35 (fillarray (nth 1 view-mode-map) 'View-undefined)
36 (define-key view-mode-map "\C-c" 'view-exit) 36 (define-key view-mode-map "\C-c" (lookup-key global-map "\C-c"))
37 (define-key view-mode-map "q" 'view-exit) 37 (define-key view-mode-map "q" 'view-exit)
38 (define-key view-mode-map "-" 'negative-argument) 38 (define-key view-mode-map "-" 'negative-argument)
39 (define-key view-mode-map "0" 'digit-argument) 39 (define-key view-mode-map "0" 'digit-argument)
40 (define-key view-mode-map "1" 'digit-argument) 40 (define-key view-mode-map "1" 'digit-argument)
41 (define-key view-mode-map "2" 'digit-argument) 41 (define-key view-mode-map "2" 'digit-argument)
108 This command runs the normal hook `view-mode-hook'." 108 This command runs the normal hook `view-mode-hook'."
109 (interactive "fView file: ") 109 (interactive "fView file: ")
110 (let ((old-buf (current-buffer)) 110 (let ((old-buf (current-buffer))
111 (had-a-buf (get-file-buffer file-name)) 111 (had-a-buf (get-file-buffer file-name))
112 (buf-to-view (find-file-noselect file-name))) 112 (buf-to-view (find-file-noselect file-name)))
113 ;; This used to pass t as second argument,
114 ;; but then the buffer did not show up in the Buffers menu.
113 (switch-to-buffer buf-to-view had-a-buf) 115 (switch-to-buffer buf-to-view had-a-buf)
114 (view-mode old-buf 116 (view-mode old-buf
115 (and (not had-a-buf) (not (buffer-modified-p buf-to-view)) 117 (and (not had-a-buf) (not (buffer-modified-p buf-to-view))
116 'kill-buffer)))) 118 'kill-buffer))))
117 119
128 This command runs the normal hook `view-mode-hook'." 130 This command runs the normal hook `view-mode-hook'."
129 (interactive "fView file: ") 131 (interactive "fView file: ")
130 (let ((old-arrangement (current-window-configuration)) 132 (let ((old-arrangement (current-window-configuration))
131 (had-a-buf (get-file-buffer file-name)) 133 (had-a-buf (get-file-buffer file-name))
132 (buf-to-view (find-file-noselect file-name))) 134 (buf-to-view (find-file-noselect file-name)))
133 ;; This used to pass t as second argument, 135 (switch-to-buffer-other-window buf-to-view)
134 ;; but then the buffer did not show up in the Buffers menu.
135 (switch-to-buffer-other-window)
136 (view-mode old-arrangement 136 (view-mode old-arrangement
137 (and (not had-a-buf) (not (buffer-modified-p buf-to-view)) 137 (and (not had-a-buf) (not (buffer-modified-p buf-to-view))
138 'kill-buffer)))) 138 'kill-buffer))))
139 139
140 ;;;###autoload 140 ;;;###autoload
202 ? or h provide help message (list of commands). 202 ? or h provide help message (list of commands).
203 \\[Helper-help] provides help (list of commands or description of a command). 203 \\[Helper-help] provides help (list of commands or description of a command).
204 C-n moves down lines vertically. 204 C-n moves down lines vertically.
205 C-p moves upward lines vertically. 205 C-p moves upward lines vertically.
206 C-l recenters the screen. 206 C-l recenters the screen.
207 q or C-c exit view-mode and return to previous buffer. 207 q exit view-mode and return to previous buffer.
208 208
209 Entry to this mode runs the normal hook `view-mode-hook'. 209 Entry to this mode runs the normal hook `view-mode-hook'.
210 210
211 \\{view-mode-map}" 211 \\{view-mode-map}"
212 ; Not interactive because dangerous things happen 212 ; Not interactive because dangerous things happen