Mercurial > emacs
diff lisp/view.el @ 88038:e75f63aebb2b
(view-buffer): Explain in doc-string why exit-action
should not be set to kill-buffer.
| author | Martin Rudalics <rudalics@gmx.at> |
|---|---|
| date | Sun, 27 Jan 2008 22:19:43 +0000 |
| parents | eeb928a40b37 |
| children | c70e45a7acfd 3e380c491c96 |
line wrap: on
line diff
--- a/lisp/view.el Sun Jan 27 19:58:42 2008 +0000 +++ b/lisp/view.el Sun Jan 27 22:19:43 2008 +0000 @@ -332,7 +332,12 @@ Optional argument EXIT-ACTION is either nil or a function with buffer as argument. This function is called when finished viewing buffer. Use -this argument instead of explicitly setting `view-exit-action'." +this argument instead of explicitly setting `view-exit-action'. + +Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a +file: Users may suspend viewing in order to modify the buffer. +Exiting View mode will then discard the user's edits. Setting +EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." (interactive "bView buffer: ") (let ((undo-window (list (window-buffer) (window-start) (window-point)))) (switch-to-buffer buffer)
