From: Martin Rudalics Date: Sun, 27 Jan 2008 22:19:43 +0000 (+0000) Subject: (view-buffer): Explain in doc-string why exit-action X-Git-Tag: emacs-pretest-23.0.90~8359 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5e613c0246a7b7e83a37982265309ed3ffb5ce0d;p=emacs.git (view-buffer): Explain in doc-string why exit-action should not be set to kill-buffer. --- 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'. 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)