diff options
| author | Martin Rudalics | 2008-01-27 22:19:43 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2008-01-27 22:19:43 +0000 |
| commit | 5e613c0246a7b7e83a37982265309ed3ffb5ce0d (patch) | |
| tree | 9388a3c53b464a6d01594db54bb05e05abb4e6f4 | |
| parent | e8cbfb8dc7235ddbec9a43155fa604b2f349e31e (diff) | |
| download | emacs-5e613c0246a7b7e83a37982265309ed3ffb5ce0d.tar.gz emacs-5e613c0246a7b7e83a37982265309ed3ffb5ce0d.zip | |
(view-buffer): Explain in doc-string why exit-action
should not be set to kill-buffer.
| -rw-r--r-- | lisp/view.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/view.el b/lisp/view.el index 410b8ecc6a6..c7a8d3d54c9 100644 --- a/lisp/view.el +++ b/lisp/view.el | |||
| @@ -332,7 +332,12 @@ This command runs the normal hook `view-mode-hook'. | |||
| 332 | 332 | ||
| 333 | Optional argument EXIT-ACTION is either nil or a function with buffer as | 333 | Optional argument EXIT-ACTION is either nil or a function with buffer as |
| 334 | argument. This function is called when finished viewing buffer. Use | 334 | argument. This function is called when finished viewing buffer. Use |
| 335 | this argument instead of explicitly setting `view-exit-action'." | 335 | this argument instead of explicitly setting `view-exit-action'. |
| 336 | |||
| 337 | Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a | ||
| 338 | file: Users may suspend viewing in order to modify the buffer. | ||
| 339 | Exiting View mode will then discard the user's edits. Setting | ||
| 340 | EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." | ||
| 336 | (interactive "bView buffer: ") | 341 | (interactive "bView buffer: ") |
| 337 | (let ((undo-window (list (window-buffer) (window-start) (window-point)))) | 342 | (let ((undo-window (list (window-buffer) (window-start) (window-point)))) |
| 338 | (switch-to-buffer buffer) | 343 | (switch-to-buffer buffer) |