> From: Michael Heerdegen > Sent: Saturday, December 28, 2024 05:49 PM > > +(defun ediff--delete-temp-files-on-kill-emacs () > > +  "Delete the temp-files associated with the ediff buffers." > > +  (ignore-errors > > +    (let ((inhibit-interaction t)) > > +      (dolist (b (buffer-list)) > > +        (with-current-buffer b > > +          (when (eq major-mode 'ediff-mode) > > +            (ediff-delete-temp-files))))))) > I think this is the same as mapping over `ediff-session-registry' which >  should hold exactly the list of buffers we want. >  Second: Can we move the `ignore-errors' inwards so that an error in one > case doesn't abort the complete loop? Sure, I had attached the modified one towards your comments. > >  ;;; Setup functions > > > > @@ -488,6 +496,7 @@ ediff-setup > >        (if (ediff-buffer-live-p ediff-meta-buffer) > >          (ediff-update-meta-buffer > >           ediff-meta-buffer nil ediff-meta-session-number)) > > +      (add-hook 'kill-emacs-hook #'ediff--delete-temp-files-on-kill-emacs) > Would it be ok to avoid the above loop completely by using the buffer >  local version of `kill-emacs-hook' instead? I didn't found a local version of `kill-emacs-hook` example in emacs git repo. Current version also work for the killing from command line, for example executing a "pkill emacs" during ediff session.