Variable: view-exit-action

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.