From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <875xn3jm1x.fsf@web.de> References: <86h675s77g.fsf@gnu.org> <864j2py29u.fsf@gnu.org> <864j2ow93z.fsf@gnu.org> Reply-To: Michael Heerdegen Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19511"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , "74881@debbugs.gnu.org" <74881@debbugs.gnu.org> To: Lin Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 29 02:49:32 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 1tRiQt-0004wE-Dq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 Dec 2024 02:49:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRiQU-0005ro-O3; Sat, 28 Dec 2024 20:49:06 -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 1tRiQR-0005rU-1q for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 20:49: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 1tRiQQ-0006Vm-Ms for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 20:49:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=0T5XLYNm/bELtivhrseHgnbydDzMSZRbZQBO+mtJW3U=; b=OjA46xJUp5ZtwC8wQ0EyNY5aovgtB+X7tnMVCGu3GaUzFw/o80VQHPCrOnEVb4HD3EGFTN4K6lNZqpteYwH45xfOfTu+YnAUWLCPrNJ8rtsr/0B2L0AizTG7rahukg2Vf/L6iNTZ4MdkUGcnXKMx6+BxV+YMR8YkD4PEIWca631rIPi6PdN04re8W99zmOQk7nv8ZGXOFI4tADgOWEKdS2ZZkz8WiOID026gexWGoOPuPoFKeQSIGNTKY2eYdBOnucPMiuC6yzk84GUGc8gSuV5HWy2GRUkKZ6O8oW801PdSuYOFnWCGWXNmkGqgXpY2ezfOflaIztnWdMVPJebAsw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRiQQ-0007DV-7k for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 20:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Dec 2024 01:49: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.173543689827615 (code B ref 74881); Sun, 29 Dec 2024 01:49:02 +0000 Original-Received: (at 74881) by debbugs.gnu.org; 29 Dec 2024 01:48:18 +0000 Original-Received: from localhost ([127.0.0.1]:53175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRiPh-0007BL-UM for submit@debbugs.gnu.org; Sat, 28 Dec 2024 20:48:18 -0500 Original-Received: from mout.web.de ([212.227.15.4]:47417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRiPf-0007B0-ME for 74881@debbugs.gnu.org; Sat, 28 Dec 2024 20:48:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1735436885; x=1736041685; i=michael_heerdegen@web.de; bh=0T5XLYNm/bELtivhrseHgnbydDzMSZRbZQBO+mtJW3U=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ti/rQW+CmV2cHYZVv/9Sn1f7DirJmMJlKxenNvjESsKZ1lORtbI5bBmgNXd+ULYx qN9RNg/4FfuLc6SwmmPr9paJ1i9MqiKRK5etIxT3CvQtE7/Py4hMnkcqEAnlsmM9l svPaaVjN8DilKsLRJngVpNeSG+Ju4zBguXuTlPmA/MgztqQDFH25mgZmhpnJclWij tM+iDcKsqVuiQ1rx6hL/2U/6udOmJip7NQoYgyQkjnRKc79mKIr4P8TGD529UgKiy 2hR+DKhyf9suYTqdNqyeT3V98uOMniF4pzvDILFZXcZzeNgHnkor3fjTvUHVx6wQE MDkpKM8kDU3uTZnyNQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([92.75.138.197]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M28SL-1tUBO13zLN-006DlP; Sun, 29 Dec 2024 02:48:05 +0100 In-Reply-To: (Lin Sun's message of "Sat, 28 Dec 2024 08:04:52 +0000") X-Provags-ID: V03:K1:GvP4xiUocENdc1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gjdkGrr 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:297925 Archived-At: Hi, I'm a bit late, feel free to ignore may comments if you think it's not worth the trouble. Lin Sun 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-ema= cs) Would it be ok to avoid the above loop completely by using the buffer local version of `kill-emacs-hook' instead? Michael.