From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <86ed1ppbmg.fsf@gnu.org> References: <86h675s77g.fsf@gnu.org> <864j2py29u.fsf@gnu.org> <864j2ow93z.fsf@gnu.org> <875xn3jm1x.fsf@web.de> <86jzbjq8a8.fsf@gnu.org> <87zfkevzb5.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8330"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sunlin7@hotmail.com, 74881@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 30 14:03:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tSFQY-00021l-1G for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Dec 2024 14:03:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSFQG-0007Jo-6Y; Mon, 30 Dec 2024 08:03:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSFQE-0007JJ-Vv for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2024 08:03:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tSFQE-0000f2-Nb for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2024 08:03:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=37o0Zrpiwdb4lt2oNRdeTl5P7IhbTDmzLc4J6uaCde8=; b=ZSdGsI0jGlk+SkbxU5LDCq7PzC4/k0j3dtBDJHrb2cjenVy232Evz2AYX9OnVxdBI44Ye/YknPszVHRby83mBj4x8maib4gIQ0qf9iFl2kJtG4oUSpzxVmNMPEpW4DPygBwhC4wvicHzrO2mg4SIj+eAph28sj4Sk68tfKKUEZ9GmSogeDxu6ocbeNol9mCuTtSuEi+E8KdRR3RWoXvveD19Zy/N/YRGZVaklspN87yc03OOgzO711PpnUpUFJbKLW1E0t80Dz8OfAtKotYr1VGcGB0pVGYK8RgmM4fPNzUpyvRfIw4j0rOzyoa1Cz/t8c3rGOSAN+USHrEcUVnLcQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tSFQE-0000FT-Fo for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2024 08:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Dec 2024 13:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74881 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74881-submit@debbugs.gnu.org id=B74881.1735563768924 (code B ref 74881); Mon, 30 Dec 2024 13:03:02 +0000 Original-Received: (at 74881) by debbugs.gnu.org; 30 Dec 2024 13:02:48 +0000 Original-Received: from localhost ([127.0.0.1]:57745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tSFPv-0000Ek-C5 for submit@debbugs.gnu.org; Mon, 30 Dec 2024 08:02:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tSFPs-0000ER-CH for 74881@debbugs.gnu.org; Mon, 30 Dec 2024 08:02:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSFPm-0000dB-Hp; Mon, 30 Dec 2024 08:02:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=37o0Zrpiwdb4lt2oNRdeTl5P7IhbTDmzLc4J6uaCde8=; b=NETdvjwARUgm hHVOh1oTsK0KAj3OMwBXsAfaYxtjdNjkRdCtkmoJteriJU8KT4tJkggJLGA8sscEbiOGTMhTikRNA By+EVBi0O5nCxTo0MKV0CrRyCs2AvxpiJX0I5VZg+bmC+NDSjmvd50vvICEZKcVVbasJdh1UmOdlt QPJZL2tnnXY1RxHOjA4oURyptOzDwamef5hZ0yhE9BEZqibhTOVvWhIrz5Jh2uALt5/1yj/ypwwaN hsbs/fb8ZaQiAO4zuW87mxGyznVew4i2iISDeaFseP+mI1QeCFLEJ5OdzFaD8uAnaCk0XY0oIwMbm rGFBK+JcaA+AuiG2K8hjPA==; In-Reply-To: <87zfkevzb5.fsf@web.de> (message from Michael Heerdegen on Mon, 30 Dec 2024 00:34:22 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297997 Archived-At: > From: Michael Heerdegen > Cc: sunlin7@hotmail.com, 74881@debbugs.gnu.org > Date: Mon, 30 Dec 2024 00:34:22 +0100 > > Eli Zaretskii 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?