Subject: Re: bug#74881: 31.0.50; [PATCH] * lisp/vc/ediff-util.el: Remove temp files on kill-emacs

From: Eli Zaretskii <[email-masked]>
Date: Sun, 29 Dec 2024 09:04:47 +0200

> From: Michael Heerdegen <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  "[email-masked]"
>  <[email-masked]>
> Date: Sun, 29 Dec 2024 02:49:14 +0100
> 
> Second: Can we move the `ignore-errors' inwards so that an error in one
> case doesn't abort the complete loop?

Binding inhibit-interaction non-nil could cause the body signal an
error, so this should be taken into account if we move ignore-errors
inwards.  This code must NOT signal any errors, ever.  Which AFAIU
means that if we want ignore-errors not to abort the rest of the loop
(why not, btw? these are just temporary files, after all), we should
redesign this loop such that it catches the errors and continues with
the rest of the buffers.

> >  ;;; 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?

You assume that the temporary Ediff files are always visited in some
buffer?  Is that assumption true?