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: Sun, 15 Dec 2024 10:04:19 +0200 Message-ID: <86h675s77g.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18915"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 15 09:05:37 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 1tMjdA-0004mT-Ho for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 09:05:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMjch-0001t4-GV; Sun, 15 Dec 2024 03:05:07 -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 1tMjce-0001rc-Q7 for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 03:05:04 -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 1tMjce-0005ID-FE for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 03:05:04 -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=tR/Ce645mPDb8+9u7W61j7Uok9kiq/5Xn7GXWQynNjo=; b=mZdO5SFfOXBOdhC1KATaxaHev610tyuiOkQJlEJ3+/fUWms1SoIWc0o4+hTNMRdOcOMpb81f5dRM/G2YyYdGxdGFZjj4+Ix/iBUHJbByymrS0hyDGh1ljpm5HShSRE+auDTyn1WK5aPCifu8ZZDI/LWBmSirQN06ygUJXzIrK4O0NFrTywp4aci3R1SpeF8AcVmrashxz+v0kQemZVW7XEXg78qg4F83MB2WdP1ElFSbgdD+CzFbIgxLeTGEs3DSrTpskPmfO6LZmfvl3QQoK9Tg6TEDOcQ4GYWHxpw3jZL0b3MWfIiJklkEERuoCp2ILLKy43zOWaRk94o75aOTKA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMjcd-0007Ha-3z for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 03:05:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 08:05:03 +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.173424987027916 (code B ref 74881); Sun, 15 Dec 2024 08:05:03 +0000 Original-Received: (at 74881) by debbugs.gnu.org; 15 Dec 2024 08:04:30 +0000 Original-Received: from localhost ([127.0.0.1]:49479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMjc5-0007G7-43 for submit@debbugs.gnu.org; Sun, 15 Dec 2024 03:04:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMjc2-0007Ft-Su for 74881@debbugs.gnu.org; Sun, 15 Dec 2024 03:04:27 -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 1tMjbx-00055O-Gt; Sun, 15 Dec 2024 03:04:21 -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=tR/Ce645mPDb8+9u7W61j7Uok9kiq/5Xn7GXWQynNjo=; b=rGNRjMjF1C7Z RuSOnUvIt4mRXqvLve+5/8D5+zjX0IGl4X1bVzRy1dci2AQkvszRZSsxdT6iQrGrSd6cr4VBEHuAU 79gy4lJDz09n18i39BwHqHDMw9DFsvWYvuYDeVElrUx1NoqlQiXeLc/BMZ1Wd/omHzHQmHLFIiDYR l51YbAxgjMH7t/Qd04NRZP/OnUyN1ZOvPyCCmoMMRkahvNXxWp8Am034ISykXlAHSNw9WyKvZ2cPr DemDgvy64vl6VCDv1PApz4ntgnGibb8E8YArhRi6U09Bym2SWzV+Dz8L29LGJptO8XFUWPaSIv2kt fYmJoR9Wc28m+b2YgkhX0g==; In-Reply-To: (message from Lin Sun on Sun, 15 Dec 2024 05:59:40 +0000) 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:297090 Archived-At: > From: Lin Sun > Date: Sun, 15 Dec 2024 05:59:40 +0000 > > @@ -488,6 +494,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) > (run-hooks 'ediff-startup-hook) > ) ; eval in control-buffer > control-buffer)) This should be carefully programmed to avoid preventing Emacs from exiting due to some problem. If ediff-delete-temp-files or one of the functions it calls can signal an error, it should be wrapped by condition-case, and if it or one of its callees can try interacting with the user, we should use kill-emacs-query-functions instead. Alternatively, we could end the Ediff session when Emacs is killed. Bottom line: this is a minor cleanup feature, so we should be very careful not to cause any regressions and problems just because we want to exit more cleanly. (On most systems, files in /tmp are routinely deleted by system's cleanup processes anyway.) Thanks.