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


Message #37 received at 74881 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lin Sun <sunlin7 <at> hotmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
 "74881 <at> debbugs.gnu.org" <74881 <at> debbugs.gnu.org>
Subject: Re: bug#74881: 31.0.50; [PATCH] * lisp/vc/ediff-util.el: Remove
 temp files on kill-emacs
Date: Sun, 29 Dec 2024 02:49:14 +0100
Hi,

I'm a bit late, feel free to ignore may comments if you think it's not
worth the trouble.

Lin Sun <sunlin7 <at> hotmail.com> writes:

> +(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?


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


Michael.




This bug report was last modified 135 days ago.

Previous Next


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