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

Previous Next

Package: emacs;

Reported by: Lin Sun <sunlin7 <at> hotmail.com>

Date: Sun, 15 Dec 2024 06:00:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: sunlin7 <at> hotmail.com, 74881 <at> debbugs.gnu.org
Subject: bug#74881: 31.0.50; [PATCH] * lisp/vc/ediff-util.el: Remove temp files on kill-emacs
Date: Mon, 30 Dec 2024 15:02:31 +0200
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: sunlin7 <at> hotmail.com,  74881 <at> debbugs.gnu.org
> Date: Mon, 30 Dec 2024 00:34:22 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > > > @@ -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?
> 
> I think you misunderstood: my idea was to put `ediff-delete-temp-files'
> to the local hook binding of the ediff control buffers (which we
> currently consult anyway).  This would result in the same calls as now -
> at least when local `kill-emacs-hook' bindings worked.

I don't understand how a buffer-local kill-emacs-hook could work.
Emacs calls the value of this hook only once, when it is going to
exit.  So if the value is buffer-local, whether or not the hook is
called will depend on which buffer is the current buffer when Emacs is
killed.  Or did I miss something?




This bug report was last modified 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.