From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lin Sun 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 17:25:29 +0000 Message-ID: References: <86h675s77g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27215"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "74881@debbugs.gnu.org" <74881@debbugs.gnu.org> To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 18:26:39 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 1tMsO7-0006ye-3K for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 18:26:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMsNj-0005kk-5X; Sun, 15 Dec 2024 12:26:15 -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 1tMsNW-0005kR-Gy for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 12:26:07 -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 1tMsNW-0006Dx-0R for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 12:26: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:In-Reply-To:References:Date:From:To:Subject; bh=SYKPWnTGDQWPubT7Ef6ooKsDOvTdQwG6oI0zAr6NBAw=; b=u3DZvgvcX3pYBpfxDK6Nw/OifG2e6ITS7EGuKnLcJiOyzr8eHcnPWZSQDbOZFVDzOnAXDvmXy9vTf2k8LLiZnzVU0HaEnoZNY0o43icjTalob9lbjzCCqjq+CqB6ZSrB3+JC9UggJLX/+lCjIIDjrIenYFENnarIFxVIrzDHfcMljwNMApJfJs1Ft3jAyygozWlZeyd1RBBTpAwu76qJ2xRprd+UC7jY7/GaELR6VnmcpHxTTXGbyXviNzSFcpvnxTx0/+TFU/EfpqTR6hSy4pGBQyoCVelB21zrnv7SBXPZyodkYtIx5SJGpsXCx7A90bw/QzuQuX3DMxCTlpwWAg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMsNV-0000sL-QE for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 12:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lin Sun Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 17:26:01 +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.17342835443330 (code B ref 74881); Sun, 15 Dec 2024 17:26:01 +0000 Original-Received: (at 74881) by debbugs.gnu.org; 15 Dec 2024 17:25:44 +0000 Original-Received: from localhost ([127.0.0.1]:51832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMsNA-0000rY-MD for submit@debbugs.gnu.org; Sun, 15 Dec 2024 12:25:44 -0500 Original-Received: from mail-japaneastazolkn19010003.outbound.protection.outlook.com ([52.103.43.3]:47691 helo=TY3P286CU002.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMsN7-0000rE-Uj for 74881@debbugs.gnu.org; Sun, 15 Dec 2024 12:25:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xt84XUd9hRtYFFzkp16Qad+cvGHoRLW4W6g7B3CkO8R1KqQxDcXRSaR4iPtUorcefvMa0Kun97RMC9HCXIC3h0/aulD7IiaUY/IqIMZ4viO8jigfC2212hFfaFNaTfXu3+OBss1g1ouoAMZA9OozazoyEvG7rgnHOcLQk03FJhCW9PIbA+2UvN1B/8ICz/FQwK/4zmDoSazod6srjQBtpjriJ68aYqX5wm/eK8PTEQJDeridriIlqxJthHdn9/dfcdhzqPQUCNPrsgaevjRsRQWMY0w9GXkDVEmfMBqyMbj7HVS8OPwzbEs8rfLo+VkpyqQjHx1QDfp0QY3O17Hc6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SYKPWnTGDQWPubT7Ef6ooKsDOvTdQwG6oI0zAr6NBAw=; b=V9D9uZp6/Hkoc07kD1cjvrphHlX6EecEqplkg++bgI+rbpK2Qx2jVR4pNc7CE0TxnMCM6nZjA11xFPqoN4XDi0CuvPig8enizAOIr44yr030kWj2feYdWQ3aob+BvnnCon+d7Epe3u1kiXuvZ5o8Z7XUTM9A/gSc6fRc9hv1w1CgCgfdIBJgzboeOBH2OmzTNFXEGBGX4Yg4ABl1elkLGAilnI0CjIeNzWpOcxNjr5DoD4Koy5iirqYIn45Jmb6DRfj0nBz2nhZWozhZH+vl0yOTAVuj2eKmFitWSzxDaiNCOXLmXVtVCcFYN3WgoRi1C1rscWVacsGlcdZ9RZVYKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SYKPWnTGDQWPubT7Ef6ooKsDOvTdQwG6oI0zAr6NBAw=; b=PDNsUdmpoMqq+wsvVphchXl0zEfd/4TG0vWDTgiTTip3Btc3OCew98LH0UdsnopiIKwdzOZL9IZTXDSwX2djRxlZT+RL8rKURMri69Y0X2+6GD44krS0PX2bS2pBuP3YlzSYzKtfeGfnnd90rxeJ3pRf7sn6FEcXiOURouwbZE7yAwx973PvsMCOhch022FB9j6k1b12wtTcmJ6WoMiHOMs3WvZ4X89F/UVJM8dx6shhZn1Pm+4Qz6vX0tt7XalCnSImHYW37MZ+/6tH6Tfb6eZ53hcTRwmpKCIVUXjp2dEX3EU2pW+lFyhmaCKC7CncotJGh9KokHxRGLWqiOD97w== Original-Received: from TY3PR01MB10013.jpnprd01.prod.outlook.com (2603:1096:400:1de::6) by TYCPR01MB11254.jpnprd01.prod.outlook.com (2603:1096:400:3c1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Sun, 15 Dec 2024 17:25:30 +0000 Original-Received: from TY3PR01MB10013.jpnprd01.prod.outlook.com ([fe80::2b40:e5fd:fbab:bede]) by TY3PR01MB10013.jpnprd01.prod.outlook.com ([fe80::2b40:e5fd:fbab:bede%6]) with mapi id 15.20.8251.015; Sun, 15 Dec 2024 17:25:30 +0000 Thread-Topic: bug#74881: 31.0.50; [PATCH] * lisp/vc/ediff-util.el: Remove temp files on kill-emacs Thread-Index: AQHbTrQ6C9gBTPBRPkO0xoraS9YsXLLm8oALgACRi4U= In-Reply-To: <86h675s77g.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TY3PR01MB10013:EE_|TYCPR01MB11254:EE_ x-ms-office365-filtering-correlation-id: e5d4c8df-c322-4cbf-762c-08dd1d2d792b x-microsoft-antispam: BCL:0; ARA:14566002|15080799006|7092599003|19110799003|15030799003|8060799006|461199028|8062599003|102099032|440099028|3412199025; x-microsoft-antispam-message-info: 2VPthi8bpqdOROJDw/DFo7AjbSK3MEJ5j0xq3Xv/N0sqS/hnssEK1XxlfwigFoXpsbp2tobD+1HKa8fkh/Li6lu8ywGfB3CdFb+hyq4N0iMc/qVwRvgRZOOuoXgtbZv3fm3eoU7KXxxxmoUJ/cSDujBzrVvBR+v6Na46ZkSSLiWEpgojQBPgay6Z/yP5ra0cJ3P48Z+JOdGdm66oReqreCLkTvniLcZB2anPzZoDOjUf0MjBlOzLcl5YokgZQwf14VnpXD3zVqqjpMB3XUm9JdL0RKKx8TAfBX5ugLndUjPFNmgH8A1m53d1Qx6CruaxhdQpcfzWmulKZoSrAuUMfLa1jILN+C4Rg5WtJcG8u/qQEdgvyUem5vzseUx8Z87y3hbN5Hta+repI/N0d0EnMVcEL9dEwbMng4eIz/kxMxHwleG3iApFX9ZUzLmduR11ZIghMIHXUkEd+zXouNepgofhSgn0EpUieEpzE4QrikmH/2O2ScbO8Qu79B2x+PREk4+S1oFYLVtcrRkXQHNC1nQ6Wn0qKrU2UswOBTgAI7YGxMJeoXe+0g2nwRz730Jn8WIipRVPfecAzI+mSG0b4eUbu6EIdI7ikl1zqa2bP9JB41e9zd3wMDTtBQ4m9X0AuJLHssvDrOTKeDcj3UlN3PEmpc1ex19qV0ZQYFNlkDBCNnJikGV7gZUpqNU1PEFACAmirhYJp9k9KYqwVuY4P8PoMt8/QNMSu0ickrEy8zAV3ZJCYMRKxotL1E4yN 3VJA+cAYhyy6sURnNbElCuW2CzNMLrcB6U8vOBxx+0btLinfZf+Stzwi+w6ubyyHAh3nYWknzHPaPL6VVUeCz7xZFfreI4PQap x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: DH+7qN26rx/SFP1dKXPqXK4Y49/NGaMoezzi8ZkhcWt30o+IT/zE9XYxETlbWgq23qMmXhsT6N02Z2G5igyJ7JWZz/kLMBnRZG01qAP6BHrkda5DGhtQ6VXX0NDtasJEFhrE2q8j80y5MqXhio185vTC4sgbi8ESIDdKgMF2F9ShUaRV+NH/uiy5/IMTzkaHbRMR5HLfa7kGvzHgfxIXbNKSO7HHyWZUCjHCLij3FvXQ5o48cBeCYNsQKVTcwsDI1Wc7OVl+4FSbcNfHX32BOFmnG8g6mwuDWfj/jRywvsOGmcrkk9e0XI2DBRhp6CoQ7AxZWFbdChbEwQLi6kSXTzmOeZE+u21tqjAu9E0/U/ur6axjVziBqInDxEJWUQI+lQoBaonlGSmpupP2DXLehijt41Wvz3Sgie2C3k5Iak6KEZFiuye/XDA3h6juIdIFuEJmWFVYd4N/I28KpYbvxqasGwuBmPEupG+Adv1k1vd/p+IuYf0bFzU5X0gbrUqoByAfzMvcNhiY9ELWtjBDm+GlG77Y7RourqY/Gmd5MrYn+YBrxTWKkdSuBWx1dXgOT3iFgvBjCqgMbF6SkDnlrrTaBQ3aDo6LRyX5NmJcoAJfLm4EZWJw4lYl4O2M1l6ipSZej9ASXPNH3BkQtdL7tI/A0egrS30J66i2sJYIbRYoxzo0ey/DtKF7qcO++xVbdsUIsRvDfpkZYruN+TFC41dvLpeNiSrF2dFaT4MXT/J1xErPS09Z02f5yU fQsn/M65qDZaYKNN/wxyua7QYzN83BGR0BeAh+R6+Z4jXRWsw7j2oA6jlVv30FxVezJSvK5MxQHT9wvpdPUTYNXGg58ZPYcJ5N X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-15995.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TY3PR01MB10013.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e5d4c8df-c322-4cbf-762c-08dd1d2d792b X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2024 17:25:29.9874 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11254 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:297114 Archived-At: > From:=A0Eli Zaretskii =0A= > Sent:=A0Sunday, December 15, 2024 12:04 AM=0A= > > From: Lin Sun =0A= > > Date: Sun, 15 Dec 2024 05:59:40 +0000=0A= > >=0A= > > @@ -488,6 +494,7 @@ ediff-setup=0A= > >=A0=A0=A0=A0=A0=A0=A0 (if (ediff-buffer-live-p ediff-meta-buffer)=0A= > >=A0=A0=A0=A0=A0=A0=A0=A0=A0 (ediff-update-meta-buffer=0A= > >=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ediff-meta-buffer nil ediff-meta-session-= number))=0A= > > +=A0=A0=A0=A0=A0 (add-hook 'kill-emacs-hook #'ediff--delete-temp-files-= on-kill-emacs)=0A= > >=A0=A0=A0=A0=A0=A0=A0 (run-hooks 'ediff-startup-hook)=0A= > >=A0=A0=A0=A0=A0=A0=A0 ) ; eval in control-buffer=0A= > >=A0=A0=A0=A0=A0 control-buffer))=0A= >=0A= > This should be carefully programmed to avoid preventing Emacs from=0A= > exiting due to some problem.=A0 If ediff-delete-temp-files or one of the= =0A= > functions it calls can signal an error, it should be wrapped by=0A= > condition-case, and if it or one of its callees can try interacting=0A= > with the user, we should use kill-emacs-query-functions instead.=0A= =0A= The function ediff-delete-temp-files was called at the tail of Ediff quit = routine, =0A= will be also safe on kill-emacs routine, and can confirm it dose not intera= ctive =0A= with the user. Actually it deletes the temp files created by Ediff-mode, sh= ould =0A= has full privilege to do its job.=0A= =0A= > Alternatively, we could end the Ediff session when Emacs is killed.=0A= =0A= It maybe heavy to end the Ediff session if the user choose =0A= `ediff-setup-windows-plain` as the `ediff-window-setup-function` for a grap= hic =0A= frame, then ending a Ediff session will trigger emacs graphic frames layout= change =0A= (Ediff will restore frames layout to the one before its startup). So here = we just try =0A= clean up the temp files to avoid the heavy works.=0A= =0A= > Bottom line: this is a minor cleanup feature, so we should be very=0A= > careful not to cause any regressions and problems just because we want=0A= > to exit more cleanly.=A0 (On most systems, files in /tmp are routinely=0A= > deleted by system's cleanup processes anyway.)=0A= =0A= Agree and calling the ediff-delete-temp-files should only for the scenario = =0A= that user kill emacs during an Ediff-session, otherwise it will do nothing.= =0A= =0A= Thank you.=