From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#31981: Fix 'flymake-proc-legacy-flymake' temporary file deletion bug Date: Thu, 29 Aug 2019 12:04:57 -0400 Message-ID: <85v9ughs9i.fsf@gmail.com> References: <87lfvemb6z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="232854"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: 31981@debbugs.gnu.org To: Joel Rosdahl Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 29 18:06:22 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i3MwH-000yQu-J4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Aug 2019 18:06:21 +0200 Original-Received: from localhost ([::1]:51676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3MwG-00013P-Dw for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Aug 2019 12:06:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36048) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3Mvz-000116-CN for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2019 12:06:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i3Mvy-0002cc-7P for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2019 12:06:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44018) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i3Mvy-0002cS-3h for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2019 12:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i3Mvx-0002mK-S8 for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2019 12:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Aug 2019 16:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31981 X-GNU-PR-Package: emacs Original-Received: via spool by 31981-submit@debbugs.gnu.org id=B31981.156709471510564 (code B ref 31981); Thu, 29 Aug 2019 16:06:01 +0000 Original-Received: (at 31981) by debbugs.gnu.org; 29 Aug 2019 16:05:15 +0000 Original-Received: from localhost ([127.0.0.1]:52839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i3MvC-0002kJ-9e for submit@debbugs.gnu.org; Thu, 29 Aug 2019 12:05:14 -0400 Original-Received: from mail-io1-f49.google.com ([209.85.166.49]:43561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i3MvA-0002ju-L6 for 31981@debbugs.gnu.org; Thu, 29 Aug 2019 12:05:13 -0400 Original-Received: by mail-io1-f49.google.com with SMTP id u185so4156370iod.10 for <31981@debbugs.gnu.org>; Thu, 29 Aug 2019 09:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=XUPlpylcHQY0z9Ygwag+12aSKaFg/gLU4RnQ6YpiL+M=; b=HT/SyIfN9Xg7W6yoG/5tytVd2tf7YLvV5Nt3E6NgkpjdaUvzxsIRpCpzXVix1Agx+z GcUOODpw/PqawG6idi5SRN4kxhSx9N2uGvkq3aDTst2cnOkeJHqMQMS0z5bFOMK1cQ4O BCsVT5UJJTY4JCnxF3Sua44ldqYEHD7LBXT1Q8+etGP8apCgUBXtnm6bC2HJ+qh6HO3B Ggp+NmUEa5cfX14W7Ol8OOCW49LZxogHAM62TBsKSdvbfUrQHPksEFHqjq/hR0XEguee wQF669Y5ng4y8CXwF8j39bR2YLbl1QVqXOAPSCQXo+EmiQrk8H/XU1FVzFgaBFvE8joh 7Zmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=XUPlpylcHQY0z9Ygwag+12aSKaFg/gLU4RnQ6YpiL+M=; b=UuDXBpXX1PP1q1FkkKVsrtun9j1L4pMqrSYp/Q3feVygc+zEiyqbWirkDb4nkBn+ZE FJjEosk5E2Hf1pGaCDJRA42wR1Rxg1KwaZjrUUlQ3RFWHDjX24+0KB5FZJBR+DcnLhrZ FHgW8yRGkBcX/RVKHkFvmP8RFMESQr3fb7VynvOqBDhTU3rKHxKA3kYi7ouNY3/ri/hA +usLSVjInGcSZGR1CDvP6m/4I5viU9tnRr9lhDjOJ16+vdpY5lUSQJlmTbn3eymilqAY 3+X+roAiJ9n4ShWDgutE70eBVIiyzWkzBGxqfMH0ahyqu1Gdj5NNiDj7gDiZCK7koURQ 2X/g== X-Gm-Message-State: APjAAAXrhhrGkPzXMBG+9XWHkgu+/O8Jfy0FvCaNH+HwRhtgPkIDo611 kmLkktVQsumurjxntleywWxgF4k9 X-Google-Smtp-Source: APXvYqxi84mzBYMw9zpOjkcwSqLtxuMxa1SDJPaDDAzDB/aIS2N7tXohe54XTAFbOu4u+gYJdFBS5g== X-Received: by 2002:a6b:6a07:: with SMTP id x7mr3653347iog.168.1567094706766; Thu, 29 Aug 2019 09:05:06 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42]) by smtp.gmail.com with ESMTPSA id l8sm2014795ioh.85.2019.08.29.09.05.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Aug 2019 09:05:05 -0700 (PDT) In-Reply-To: (Joel Rosdahl's message of "Wed, 28 Aug 2019 21:18:33 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166053 Archived-At: Joel Rosdahl writes: > On Wed, 28 Aug 2019 at 01:38, Noam Postavsky wrote: >> If I'm reading flymake-proc-init-create-temp-buffer-copy correctly, it >> actually makes a new temporary file (say T1), but the file name is stored in >> a single variable, so Emacs effectively forgets about the original file T. > > The create-temp-f parameter to flymake-proc-init-create-temp-buffer-copy is in > practice flymake-proc-create-temp-inplace, which always creates the same result > for a given file-name and prefix. And file-name and prefix are the same for > both modification A and B (since it's the same file). Or am I missing > something? No, it's just me who missed this. There's a lot of indirection, and I didn't read that carefully. > but I just learnt to my surprise that global defvar-ed > variables are still dynamically scoped. Well, they would be unusable otherwise, since global vars don't have any lexical scope as such. > + ;; Make cleanup-f see the temporary file names > + ;; created by its corresponding init function > + ;; (bug#31981). > + (let ((flymake-proc--temp-source-file-name > + (process-get proc 'flymake-proc--temp-source-file-name)) > + (flymake-proc--temp-master-file-name > + (process-get proc 'flymake-proc--temp-master-file-name))) > + (funcall cleanup-f))))) A little awkward, but that's proably the best we can do without changing the signature of cleanup-f (which I guess would be much more troublesome).