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: Fri, 27 Dec 2024 10:10:37 +0200 Message-ID: <864j2py29u.fsf@gnu.org> References: <86h675s77g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12215"; 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 Fri Dec 27 09:11:26 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 1tR5RN-00032U-ML for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Dec 2024 09:11:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tR5R3-0000B6-VM; Fri, 27 Dec 2024 03:11:05 -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 1tR5R0-0000Ak-Hd for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2024 03:11:02 -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 1tR5R0-0002tn-9M for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2024 03:11: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:References:In-Reply-To:From:Date:To:Subject; bh=uL1x35dj5qXuU7yF+JGNTdXmoiLer5XrCGbSGaZHIGE=; b=lxNNbjl6brZp0yIlSVyX4HYQrnqzHwko+JGQNIBykDKQ1Ijk6x6i/DeQ4wYsHEuoSLjK5ROkOktCVXSb/vzpZ+RNsRb3aLVrkYdKS8J4HQoVnKUSgAsS/Aau8OwrTsP/7+P1XkLjhIPhY6U5oR8TDN7F5xLasLXwF5N8sTvIgI67l01j3Oxc4O3LaOqAzAfi06yI2qbSu9Cdc1wWjVqEHlv+SoAS2IxHkerr0Vl4DeQeRdr+5tK/y6w97cWjNA1t00OI6X+2nvnej6jSBJmRSRnohZIk2P/SPzjXKrxJQoTBDW7fB/Vxe7SqhnkFq3+aTAvQIDd0+G2ZwDE4ckfZqg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tR5Qz-0002IZ-R2 for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2024 03:11:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Dec 2024 08:11: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.17352870478810 (code B ref 74881); Fri, 27 Dec 2024 08:11:01 +0000 Original-Received: (at 74881) by debbugs.gnu.org; 27 Dec 2024 08:10:47 +0000 Original-Received: from localhost ([127.0.0.1]:44582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tR5Ql-0002I1-Fh for submit@debbugs.gnu.org; Fri, 27 Dec 2024 03:10:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tR5Qj-0002Hi-As for 74881@debbugs.gnu.org; Fri, 27 Dec 2024 03:10:46 -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 1tR5Qd-0002rv-Sz; Fri, 27 Dec 2024 03:10:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=uL1x35dj5qXuU7yF+JGNTdXmoiLer5XrCGbSGaZHIGE=; b=pwWNpheRy1BR1tq1R9Y1 3fw4TbRz8kjTeoEhYGLSfb9JD7HxjgRwZ5/026ae0IYhdColzYJMdgADqCFFA2tnjBtXpoQ6vqsTx MK2/6gs3GJJt+75tqZrqco80dw3y9/1HUFKyDOxn2GG3mp2oPjUtZUTMiegpCc95MLdsVTtsC9f0r G2P1FMlnVz6lw4CAaKQEq7M3ZYLS/sPA0f8beURGoMb0hic72T3LUFOVup8KPO/GV0zai7wIA2kU9 rh/EVNUv/elIzXx4uS9urdZznnlFWAunDEv7bZ5mYOb+H8ki6IZZ+s4kicJg2Fe0owSnUbnekiS05 bZhPVLJvcPv51g==; In-Reply-To: (message from Lin Sun on Fri, 27 Dec 2024 05:38:57 +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:297811 Archived-At: > From: Lin Sun > CC: "74881@debbugs.gnu.org" <74881@debbugs.gnu.org> > Date: Fri, 27 Dec 2024 05:38:57 +0000 > > Hi Eli, > > I checked the "ediff-delete-temp-files", it should be safe for executing.  Is it more safe to wrap it with `ignore-errors` ? Like: > > +(defun ediff--delete-temp-files-on-kill-emacs () > + "Delete the temp-files associated with the ediff buffers." > + (dolist (b (buffer-list)) > + (with-current-buffer b > + (when (eq major-mode 'ediff-mode) > + (ignore-errors (ediff-delete-temp-files)))))) > Yes, probably. For a good measure, I'd also bind inhibit-interaction to a non-nil value, to make sure we never ever ask the user anything inside ediff-delete-temp-files.