From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: delete-file succeeds without deleting the file Date: Mon, 11 Jan 2016 07:16:19 +0100 Message-ID: <87si24bpzg.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452493012 22564 80.91.229.3 (11 Jan 2016 06:16:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jan 2016 06:16:52 +0000 (UTC) To: Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 11 07:16:43 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aIVmU-0002wA-MW for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jan 2016 07:16:42 +0100 Original-Received: from localhost ([::1]:51838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIVmT-0004Em-PI for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jan 2016 01:16:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIVmK-0004Ed-3e for help-gnu-emacs@gnu.org; Mon, 11 Jan 2016 01:16:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIVmG-0002TD-V1 for help-gnu-emacs@gnu.org; Mon, 11 Jan 2016 01:16:32 -0500 Original-Received: from mout.web.de ([212.227.17.11]:56014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIVmG-0002Sz-M5 for help-gnu-emacs@gnu.org; Mon, 11 Jan 2016 01:16:28 -0500 Original-Received: from drachen.dragon ([94.217.126.232]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0LzK61-1a59sK3Deb-014ToM; Mon, 11 Jan 2016 07:16:21 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:bXo7urRautOInrSdRskvfBrCqAssOznbaatEg0X2jwySVDYE3HX +GKTkLFPGS7jHfbO4eO+f6IihN8IAB3ZFtHYjEAc6lN5Hw5OpwEulMsArSBJ55cEz4FfgjI SkeKjxX1kSVjzBevKVRH9+LOEsmvN3CzQ30e9KNvvtf86Z/APm4McYG66f4m6JR4CbLTuyH Y3scOrUN5k6DH2yCpyMTg== X-UI-Out-Filterresults: notjunk:1;V01:K0:WbIrsuTlPBs=:syd4/IYvu+8vH/rGY+Fgkm sN6GshfAozbWxC7vqk3xsGvTspJUpbodM4K9FGsz7/mRVf31Euu4wAJW/KXWwlQW8a8a9i7Hh bCattX+WhWSZLElkA8+wTlxrULNtlqwZ0F1e0JMvpCOQ6BIc7QriIVtXwGOmW6nJDJh0GX3FI +XMM2RG+PDYCPwIFDL/ZeHIE0puLXwhY/uxWfnT8qSnKTgpZP3b5ZVUfeGMXFq0IWhJ6z9DM1 vomqkNgy886kW9yhR+Oqs/LhPzSlOdtS/vEDDPBZ1ZePE6qdw1wTCKJKQRKKXsC1k3mWLV2+n XFXic7hcbuss6GBfIzs/boA9eT5Ehy4+4p4GDYTyQ4FkVw8LCLzp6fT2kko8BKXFmSy+hUJgT RnbLuTzMdVhUVlE+l13d3Qs1wr1XJQgcoS7w8VxQ24gCitJHMGX7XHap1k7WFtzrWXQm6T3Eb 9rX+OM2N2llEeHOuZhUmmrxMiNaZhBCDLiPXlTYqTmBfhPBYIpjlohq34aVK9naUtGvPbbYI9 tm5DgRCPXKgJhwgL9cmjbGj73fboKfMg73fPJmkvKtQeXHdr1XX1L0yRbBKuicJs98BWuPbkB x2FsVv0wnjKblBlsXm+J/gYC13/sWRGnYAJ1CDdVeg4Xh24B0o9+Vjo9pm5L1NkNb2N33hrT3 RKVBSfsbjp2kwDwrEoYLmufXTgw0RO+YFkvU+MeIWOiwN9O9tBkdsycYlzkvXdkH7SIHGhrAd hDhdgPYIQeIqRMr0Cv7/SGq3Y1kXJylz31iPA89WB79aGeOoezYGlUmEPb0kHa779dGIn+JJ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.11 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108688 Archived-At: Hello, in my code, I want to use something like this: --8<---------------cut here---------------start------------->8--- (defmacro foo-save-index (&rest body) ;; Modeled after `magit-with-temp-index' (declare (debug t)) (macroexp-let2 nil temp-index-file '(expand-file-name (make-temp-name "index.foo")) `(unwind-protect (let ((process-environment process-environment)) (setenv "GIT_INDEX_FILE" ,temp-index-file) ,@body) (when (file-exists-p ,temp-index-file) (delete-file ,temp-index-file))))) --8<---------------cut here---------------end--------------->8--- This makes it possible to work with a temporary git index while working with git commands in BODY. All those commands are synchronous. This works as expected, but in some, quite rare cases, the temporary index file survives. There is no error, and delete-file seems to terminate always successfully. Anybody any idea how this can happen? Thanks, Michael.