+
+(defvar mime-acting-situation-examples nil)
+
+(defun mime-save-acting-situation-examples ()
+ (let* ((file mime-acting-situation-examples-file)
+ (buffer (get-buffer-create " *mime-example*")))
+ (unwind-protect
+ (save-excursion
+ (set-buffer buffer)
+ (setq buffer-file-name file)
+ (erase-buffer)
+ (insert ";;; " (file-name-nondirectory file) "\n")
+ (insert "\n;; This file is generated automatically by "
+ mime-view-version-string "\n\n")
+ (insert ";;; Code:\n\n")
+ (pp `(setq mime-acting-situation-examples
+ ',mime-acting-situation-examples)
+ (current-buffer))
+ (insert "\n;;; "
+ (file-name-nondirectory file)
+ " ends here.\n")
+ (save-buffer))
+ (kill-buffer buffer))))
+
+(add-hook 'kill-emacs-hook 'mime-save-acting-situation-examples)
+