Variable: view-exit-action

view-exit-action is a buffer-local variable defined in view.el.gz.

Documentation

If non-nil, a function called when finished viewing.

The function should take one argument (a buffer). Commands like M-x view-file (view-file) and M-x view-file-other-window (view-file-other-window) may set this to bury or kill the viewed buffer. Observe that the buffer viewed might not appear in any window at the time this function is called.

Source Code

;; Defined in /usr/src/emacs/lisp/view.el.gz
(defvar-local view-last-regexp nil) ; Global is better???

(defvar-local view-exit-action nil
  "If non-nil, a function called when finished viewing.
The function should take one argument (a buffer).
Commands like \\[view-file] and \\[view-file-other-window] may
set this to bury or kill the viewed buffer.
Observe that the buffer viewed might not appear in any window at
the time this function is called.")