# HG changeset patch # User Martin Rudalics # Date 1201472383 0 # Node ID e75f63aebb2b78dbf699f5b084a4cbc8d3a96c05 # Parent 35cce79c1900afd4ef7311d27d653994618fe9e1 (view-buffer): Explain in doc-string why exit-action should not be set to kill-buffer. diff -r 35cce79c1900 -r e75f63aebb2b lisp/view.el --- 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)