Mercurial > emacs
comparison lisp/view.el @ 256:7e4c7ef44243
*** empty log message ***
author | Roland McGrath <roland@gnu.org> |
---|---|
date | Thu, 09 May 1991 21:50:34 +0000 |
parents | a25bf36b0410 |
children | 5d45fc2b81e9 |
comparison
equal
deleted
inserted
replaced
255:cdf87250ed27 | 256:7e4c7ef44243 |
---|---|
88 (define-key view-mode-map "n" 'View-search-last-regexp-forward) | 88 (define-key view-mode-map "n" 'View-search-last-regexp-forward) |
89 (define-key view-mode-map "p" 'View-search-last-regexp-backward) | 89 (define-key view-mode-map "p" 'View-search-last-regexp-backward) |
90 ) | 90 ) |
91 | 91 |
92 | 92 |
93 ;;;###autoload | |
93 (defun view-file (file-name) | 94 (defun view-file (file-name) |
94 "View FILE in View mode, returning to previous buffer when done. | 95 "View FILE in View mode, returning to previous buffer when done. |
95 The usual Emacs commands are not available; instead, | 96 The usual Emacs commands are not available; instead, |
96 a special set of commands (mostly letters and punctuation) | 97 a special set of commands (mostly letters and punctuation) |
97 are defined for moving around in the buffer. | 98 are defined for moving around in the buffer. |
106 (switch-to-buffer buf-to-view t) | 107 (switch-to-buffer buf-to-view t) |
107 (view-mode old-buf | 108 (view-mode old-buf |
108 (and (not had-a-buf) (not (buffer-modified-p buf-to-view)) | 109 (and (not had-a-buf) (not (buffer-modified-p buf-to-view)) |
109 'kill-buffer)))) | 110 'kill-buffer)))) |
110 | 111 |
112 ;;;###autoload | |
111 (defun view-buffer (buffer-name) | 113 (defun view-buffer (buffer-name) |
112 "View BUFFER in View mode, returning to previous buffer when done. | 114 "View BUFFER in View mode, returning to previous buffer when done. |
113 The usual Emacs commands are not available; instead, | 115 The usual Emacs commands are not available; instead, |
114 a special set of commands (mostly letters and punctuation) | 116 a special set of commands (mostly letters and punctuation) |
115 are defined for moving around in the buffer. | 117 are defined for moving around in the buffer. |
120 (interactive "bView buffer: ") | 122 (interactive "bView buffer: ") |
121 (let ((old-buf (current-buffer))) | 123 (let ((old-buf (current-buffer))) |
122 (switch-to-buffer buffer-name t) | 124 (switch-to-buffer buffer-name t) |
123 (view-mode old-buf nil))) | 125 (view-mode old-buf nil))) |
124 | 126 |
127 ;;;###autoload | |
125 (defun view-mode (&optional prev-buffer action) | 128 (defun view-mode (&optional prev-buffer action) |
126 "Major mode for viewing text but not editing it. | 129 "Major mode for viewing text but not editing it. |
127 Letters do not insert themselves. Instead these commands are provided. | 130 Letters do not insert themselves. Instead these commands are provided. |
128 Most commands take prefix arguments. Commands dealing with lines | 131 Most commands take prefix arguments. Commands dealing with lines |
129 default to \"scroll size\" lines (initially size of window). | 132 default to \"scroll size\" lines (initially size of window). |