view-exit-action

view-exit-action is a variable defined in `view.el'.
Its value is
nil

  • Automatically becomes buffer-local when set.

Documentation:
If non-nil, a function with one argument (a buffer) called when finished viewing.
Commands like M-x view-file and M-x 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.