changeset 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 35cce79c1900
children e74ef2442a4a
files lisp/view.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
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)