diff options
| author | Richard M. Stallman | 1994-03-14 16:02:05 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-03-14 16:02:05 +0000 |
| commit | bd0d2c58e1b6ed25aed108e820abd9e60256cf13 (patch) | |
| tree | 91b3df988dcd01275b6631facc0b0ffccd60a561 | |
| parent | a1ba17616db0131c4e7d7eca746532fe03b86620 (diff) | |
| download | emacs-bd0d2c58e1b6ed25aed108e820abd9e60256cf13.tar.gz emacs-bd0d2c58e1b6ed25aed108e820abd9e60256cf13.zip | |
(view-mode): Run view-mode-hook as well as view-hook.
(view-mode-hook): New defvar.
| -rw-r--r-- | lisp/view.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/view.el b/lisp/view.el index 1ecd68728dd..35e6223875d 100644 --- a/lisp/view.el +++ b/lisp/view.el | |||
| @@ -106,7 +106,7 @@ are defined for moving around in the buffer. | |||
| 106 | Space scrolls forward, Delete scrolls backward. | 106 | Space scrolls forward, Delete scrolls backward. |
| 107 | For list of all View commands, type ? or h while viewing. | 107 | For list of all View commands, type ? or h while viewing. |
| 108 | 108 | ||
| 109 | This command runs the normal hook `view-hook'." | 109 | This command runs the normal hook `view-mode-hook'." |
| 110 | (interactive "fView file: ") | 110 | (interactive "fView file: ") |
| 111 | (let ((old-buf (current-buffer)) | 111 | (let ((old-buf (current-buffer)) |
| 112 | (had-a-buf (get-file-buffer file-name)) | 112 | (had-a-buf (get-file-buffer file-name)) |
| @@ -126,7 +126,7 @@ are defined for moving around in the buffer. | |||
| 126 | Space scrolls forward, Delete scrolls backward. | 126 | Space scrolls forward, Delete scrolls backward. |
| 127 | For list of all View commands, type ? or h while viewing. | 127 | For list of all View commands, type ? or h while viewing. |
| 128 | 128 | ||
| 129 | This command runs the normal hook `view-hook'." | 129 | This command runs the normal hook `view-mode-hook'." |
| 130 | (interactive "fView file: ") | 130 | (interactive "fView file: ") |
| 131 | (let ((old-arrangement (current-window-configuration)) | 131 | (let ((old-arrangement (current-window-configuration)) |
| 132 | (had-a-buf (get-file-buffer file-name)) | 132 | (had-a-buf (get-file-buffer file-name)) |
| @@ -145,7 +145,7 @@ are defined for moving around in the buffer. | |||
| 145 | Space scrolls forward, Delete scrolls backward. | 145 | Space scrolls forward, Delete scrolls backward. |
| 146 | For list of all View commands, type ? or h while viewing. | 146 | For list of all View commands, type ? or h while viewing. |
| 147 | 147 | ||
| 148 | This command runs the normal hook `view-hook'." | 148 | This command runs the normal hook `view-mode-hook'." |
| 149 | (interactive "bView buffer: ") | 149 | (interactive "bView buffer: ") |
| 150 | (let ((old-buf (current-buffer))) | 150 | (let ((old-buf (current-buffer))) |
| 151 | (switch-to-buffer buffer-name t) | 151 | (switch-to-buffer buffer-name t) |
| @@ -163,7 +163,7 @@ are defined for moving around in the buffer. | |||
| 163 | Space scrolls forward, Delete scrolls backward. | 163 | Space scrolls forward, Delete scrolls backward. |
| 164 | For list of all View commands, type ? or h while viewing. | 164 | For list of all View commands, type ? or h while viewing. |
| 165 | 165 | ||
| 166 | This command runs the normal hook `view-hook'." | 166 | This command runs the normal hook `view-mode-hook'." |
| 167 | (interactive "bView buffer:\nP") | 167 | (interactive "bView buffer:\nP") |
| 168 | (let ((return-to (and not-return (current-window-configuration)))) | 168 | (let ((return-to (and not-return (current-window-configuration)))) |
| 169 | (switch-to-buffer-other-window buffer-name) | 169 | (switch-to-buffer-other-window buffer-name) |
| @@ -205,7 +205,7 @@ C-p moves upward lines vertically. | |||
| 205 | C-l recenters the screen. | 205 | C-l recenters the screen. |
| 206 | q or C-c exit view-mode and return to previous buffer. | 206 | q or C-c exit view-mode and return to previous buffer. |
| 207 | 207 | ||
| 208 | Entry to this mode runs the normal hook `view-hook'. | 208 | Entry to this mode runs the normal hook `view-mode-hook'. |
| 209 | 209 | ||
| 210 | \\{view-mode-map}" | 210 | \\{view-mode-map}" |
| 211 | ; Not interactive because dangerous things happen | 211 | ; Not interactive because dangerous things happen |
| @@ -257,7 +257,7 @@ Entry to this mode runs the normal hook `view-hook'. | |||
| 257 | (setq goal-column nil) | 257 | (setq goal-column nil) |
| 258 | 258 | ||
| 259 | (use-local-map view-mode-map) | 259 | (use-local-map view-mode-map) |
| 260 | (run-hooks 'view-hook) | 260 | (run-hooks 'view-hook 'view-mode-hook) |
| 261 | (view-helpful-message)) | 261 | (view-helpful-message)) |
| 262 | 262 | ||
| 263 | 263 | ||
| @@ -305,6 +305,9 @@ If you viewed a file that was not present in Emacs, its buffer is killed." | |||
| 305 | (defvar view-hook nil | 305 | (defvar view-hook nil |
| 306 | "Normal hook run when starting to view a buffer or file.") | 306 | "Normal hook run when starting to view a buffer or file.") |
| 307 | 307 | ||
| 308 | (defvar view-mode-hook nil | ||
| 309 | "Normal hook run when starting to view a buffer or file.") | ||
| 310 | |||
| 308 | ;(defun view-last-command (&optional who what) | 311 | ;(defun view-last-command (&optional who what) |
| 309 | ; (setq view-last-command-entry this-command) | 312 | ; (setq view-last-command-entry this-command) |
| 310 | ; (setq view-last-command who) | 313 | ; (setq view-last-command who) |