From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 16 03:37:18 2025 Received: (at submit) by debbugs.gnu.org; 16 Aug 2025 07:37:18 +0000 Received: from localhost ([127.0.0.1]:40689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unBTX-000663-8d for submit@debbugs.gnu.org; Sat, 16 Aug 2025 03:37:18 -0400 Received: from lists.gnu.org ([2001:470:142::17]:55032) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umzsr-0001Pp-Gz for submit@debbugs.gnu.org; Fri, 15 Aug 2025 15:14:38 -0400 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 1umzsl-0004zl-Rj for bug-gnu-emacs@gnu.org; Fri, 15 Aug 2025 15:14:31 -0400 Received: from relay.yourmailgateway.de ([188.68.63.162]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1umzsj-0001hN-9q for bug-gnu-emacs@gnu.org; Fri, 15 Aug 2025 15:14:31 -0400 Received: from mors-relay-8201.netcup.net (localhost [127.0.0.1]) by mors-relay-8201.netcup.net (Postfix) with ESMTPS id 4c3Wxq2kLZz3ytB for ; Fri, 15 Aug 2025 21:14:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rd10.de; s=key2; t=1755285263; bh=SSAfIgAXIYkNgWlkuqpCPEValF1dJrpuHxNRJWOAU9E=; h=Date:From:Subject:To:From; b=WXhQsU6wTTuoJd5WfspVUqTQnNoHy3ePS05hpsaX/bpHNIGb35kO97/akiZHS2rjD mgJ2SdUdoJLHkpGxuaqhD2ohMloUa2h0nIikwu144LLir5w4LHBfA1zrOw3L6+sGZe P02yICBcv8YAMcIHIS0xjkikg4XH6hcy5D8FalTvooANBjMTTxUyQ6pJMR6pfrlsnx MLjMTIbhr8rIdsF9hc3GtnevGnzPcq588CMiXfk55fOWTixxh9d4i9woMse3p03X2G c6ZsDwUfTNICqPYIINrdcd0hgmNdaTnF5PV3NJ19pLQCw5Hb9m3ZzDai1nGZjN6Jcs 6/4qwmBZSKJ4A== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8201.netcup.net (Postfix) with ESMTPS id 4c3Wxq210hz3yt0 for ; Fri, 15 Aug 2025 21:14:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.898 X-Spam-Level: X-Spam-Status: No, score=-2.898 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no Received: from mx2eb1.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4c3Wxp3xQJz8tXJ for ; Fri, 15 Aug 2025 21:14:22 +0200 (CEST) Received: from [IPV6:2a02:3102:8e00:2060:6bbc:30dc:511b:15e7] (dynamic-2a02-3102-8e00-2060-6bbc-30dc-511b-15e7.310.pool.telefonica.de [IPv6:2a02:3102:8e00:2060:6bbc:30dc:511b:15e7]) by mx2eb1.netcup.net (Postfix) with ESMTPSA id C14321003C6 for ; Fri, 15 Aug 2025 21:14:17 +0200 (CEST) Authentication-Results: mx2eb1; spf=pass (sender IP is 2a02:3102:8e00:2060:6bbc:30dc:511b:15e7) smtp.mailfrom=rdiez-2006@rd10.de smtp.helo=[IPV6:2a02:3102:8e00:2060:6bbc:30dc:511b:15e7] Received-SPF: pass (mx2eb1: connection is authenticated) Message-ID: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> Date: Fri, 15 Aug 2025 21:14:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "R. Diez" Content-Language: en-GB Subject: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PPP-Message-ID: <175528525799.31031.16087906392113491768@mx2eb1.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: C14321003C6 X-NC-CID: IPqSjNy4qtwOQ8/ZGIYFfnT0JzSz0j73h6CWkR/2 Received-SPF: pass client-ip=188.68.63.162; envelope-from=rdiez-2006@rd10.de; helo=relay.yourmailgateway.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 16 Aug 2025 03:37:11 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) Hi all: Some time ago, I enabled option 'file-precious-flag' after getting file corruption when editing remote files over unstable links. The trouble is, 'file-precious-flag' generates cryptic temporary filenames like "tmp1eghjG". If there is a network problem while saving, such files are left scattered behind, and when you (or some other sysadmin) realise about those orphaned files next month (or even later), such filenames make it hard to know exactly was caused the problem and what file it was related to. In the past months, I have increasingly suffered this orphaned file problem due to a Tramp issue described here: Please change the naming template for temporary files https://lists.gnu.org/archive/html/tramp-devel/2025-08/msg00007.html After some struggling (I am no Emacs guru), I finally tracked down the related code in my Emacs 29. Function basic-save-buffer-2 in files.el builds the temporary filename like this: (setq tempname (make-temp-file (expand-file-name "tmp" dir))) That is where those tmpXXXX filenames are coming from. In contrast, function make-auto-save-file-name in the same file (files.el) uses the buffer's filename to construct the temporary filename: (make-temp-file (let ((fname (expand-file-name (format "#%s#" buffer-name) Could you modify the first make-temp-file call, so that it is clear what file the temporary file relates to? It would also be best if the word "Emacs" were part or the temporary filename, like Tramp does, so that you know what piece of software caused the littering. Thanks in advance, rdiez From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 16 05:33:14 2025 Received: (at 79252) by debbugs.gnu.org; 16 Aug 2025 09:33:14 +0000 Received: from localhost ([127.0.0.1]:40996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unDHl-0003pA-Qc for submit@debbugs.gnu.org; Sat, 16 Aug 2025 05:33:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55362) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unDHj-0003ou-Ae for 79252@debbugs.gnu.org; Sat, 16 Aug 2025 05:33:11 -0400 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 1unDHd-0001Uw-BR; Sat, 16 Aug 2025 05:33:05 -0400 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=EgaB37Naqw67ZUeIMZVROaX8l3po7+5MjVx0dl25cDg=; b=ekqRMjuKf70U 02hKt0N1qmu0Yo6JOajmKlWzaSoPW7K2b+jzocX2F/XTcdNRwBlxEKh2gfvBmCveQsunxOW0Sn2bo hQL01jIUGLBH0xH6bshByCL3PGV2arXUuyIfS/awlCWN1XubTV2mbTv8H/qy+mTvHPdxU3ueeBd/g JdCWtn4Aj3l3CudlFYn+jqRIw9DFjIdnmaMBUvsTG6sM8l4LbLBHQdPxVF5Bl7AK945OjBo7/0loZ b03/0Ge5iZYjAznOFIP6GM/KyQIMmKu1RwpG2n/jCo9HWj/xzQ4rGiYpp0L4GPLwrYFaO2uroU4S7 hzE3GW94S+TE/j0+LHtECw==; Date: Sat, 16 Aug 2025 12:33:03 +0300 Message-Id: <86a53zligg.fsf@gnu.org> From: Eli Zaretskii To: "R. Diez" In-Reply-To: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> (bug-gnu-emacs@gnu.org) Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79252 Cc: 79252@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 15 Aug 2025 21:14:17 +0200 > From: "R. Diez" via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Hi all: > > Some time ago, I enabled option 'file-precious-flag' after getting file corruption when editing remote files over unstable links. > > The trouble is, 'file-precious-flag' generates cryptic temporary filenames like "tmp1eghjG". If there is a network problem while saving, such files are left scattered behind, and when you (or some other sysadmin) realise about those orphaned files next month (or even later), such filenames make it hard to know exactly was caused the problem and what file it was related to. > > In the past months, I have increasingly suffered this orphaned file problem due to a Tramp issue described here: > > Please change the naming template for temporary files > https://lists.gnu.org/archive/html/tramp-devel/2025-08/msg00007.html > > After some struggling (I am no Emacs guru), I finally tracked down the related code in my Emacs 29. Function basic-save-buffer-2 in files.el builds the temporary filename like this: > > (setq tempname > (make-temp-file > (expand-file-name "tmp" dir))) > > That is where those tmpXXXX filenames are coming from. > > In contrast, function make-auto-save-file-name in the same file (files.el) uses the buffer's filename to construct the temporary filename: > > (make-temp-file > (let ((fname > (expand-file-name > (format "#%s#" buffer-name) > > Could you modify the first make-temp-file call, so that it is clear what file the temporary file relates to? It would also be best if the word "Emacs" were part or the temporary filename, like Tramp does, so that you know what piece of software caused the littering. Sorry, I don't understand the issue. Perhaps some details are missing. The file-precious-flag variable is so that the original file is not wiped out when there are some I/O errors during saving. If everything goes okay, the temporary file created when file-precious-flag is non-nil is renamed into the original file, and the temporary file will no longer exist. If something does go wrong, you should see an error message when you save the buffer, and the message should tell you right there and then what problem happened and which file was involved in the problem. At that moment, the original file still exists with its original contents, and the new contents may or may not have been written to the temporary file. So you should be able to see the reason for the I/O problem and the two versions of the file, and take the proper action. Thus, there should not be any reason for examining these files after a long time, because any errors are immediately reported to the user. Why doesn't this happen for you? did you somehow suppress those error messages? Or perhaps there's a different bug, not directly related to the way we generate the temporary file's name in this case? From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 16 15:33:05 2025 Received: (at 79252) by debbugs.gnu.org; 16 Aug 2025 19:33:05 +0000 Received: from localhost ([127.0.0.1]:43570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unMeG-0007IJ-Q5 for submit@debbugs.gnu.org; Sat, 16 Aug 2025 15:33:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48430) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unMeE-0007Ho-AE for 79252@debbugs.gnu.org; Sat, 16 Aug 2025 15:33:02 -0400 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 1unMe7-0007eN-Ue; Sat, 16 Aug 2025 15:32:55 -0400 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=WOceQ11Zt2rdoOYc5OOVWymc503VMzSkWs3sia8tBFI=; b=CW9Wx7p1zjV2 4mNpaYHmknTvoHgeoHL4UbAMLrGXOThvqCQEckgV26zM52XBADf9fmRn48efmz6gwCqRR1UXGu0cU cnFVS2NGICsqttS0C3mF+aGLbYlvQMdR59/3zPlemAj6DDDhNt2OLG1hpiVRlgrMW5Vj7XBfNQPcL YGYgabXw4ILVG30vjz4NxuT++jaFElzawNdFkNQyZrvH6XdmsSkVZJzopQq0fms6FSJlk0O7XoMKg pEyzIdGZA2pHG9LGpvAwKUeOgTjXgCv55hZGtQwoBr57Apeo1FEClpBUtw+sM9JgOarddSn1jOITM C0VXDGpSVlOP1//DrNPpiw==; Date: Sat, 16 Aug 2025 22:32:53 +0300 Message-Id: <86zfbzhxju.fsf@gnu.org> From: Eli Zaretskii To: "R. Diez" In-Reply-To: (rdiez-2006@rd10.de) Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79252 Cc: 79252@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 16 Aug 2025 20:53:04 +0200 > From: "R. Diez" > Cc: 79252@debbugs.gnu.org > > > > Sorry, I don't understand the issue. Perhaps some details are missing. > > OK, I'll try to explain it with more details. > > A number of years ago, I enabled option 'file-precious-flag' after getting file corruption when editing remote files with Tramp over unstable network connections. When you enable 'file-precious-flag', you never actually see the temporary filenames being generated, because they are short lived. If everything works well, those files quickly disappear anyway. > > After enabling 'file-precious-flag', I just noticed that my file corruption problems went away. I quickly forgot the implementation trick with the temporary file. Whenever the editing session failed, I got a network error, which was expected in my environment. So I just tried later, when the link was up again. > > I didn't think at the time that Emacs might be leaving temporary files behind when the network link failed. The reason is, I normally do not look at the directories, because I keep the complicated Tramp paths in a text file, so I just copy-and-paste them to re-open the remote files directly. An example of such a Tramp filename is: > > /ssh:username@my-hostname|sudo:root@my-hostname:/etc/prometheus/prometheus.yml > > Every now and then, I did spot a files named like "tmp1eghjG" here and there, but at a much later time, and I didn't think much of it. The config files I edit are small, and in the rare occasion I did look at the file, it was 0 bytes long anyway. > > These aren't my systems and I do not edit their config files often, so even if I had investigated further and the temporary files hadn't been empty, I would have probably blamed them on some pesky sysadmin using a lesser editor like Vim, or even worse, some editor written in JavaScript. }8-) > > Fast forward a few years. I have recently started to hit the Tramp issue I described, and this time I did look around, so that's how I figured out that those temporary files were actually my doing. It never occurred to me that the core Emacs wouldn't go out of its way to make my life super easy, how would I??? So naturally, the first thing I tried was to blame Tramp, but its developers were smart enough to generate temporary filenames with a recognisable prefix. > > Now that I know, and after the time I invested, I will forever remember. I just thought I shouldn't let the next Emacs user, or some unrelated sysadmin, unnecessarily scratch their heads when the next network hitch or software bug unduly leaves such a temporary file behind, or when such a file comes up in an strace log. If the temporary file had been named "prometheus.yml.Emacs-tmp1eghjG", I would have known straight away where it came from. Thanks for the details. But I still don't understand one aspect of this: when these temporary files are left around, there should have been some error either writing them or renaming them to the original name. Those error messages should have alerted you to the fact that something went wrong, right there and then. So I don't understand why you haven't paid attention to those problems right when they happened, instead of noticing those temporary files much later. Are you saying that these errors happen silently in your case? If so, I would like to see a recipe for reproducing these problems, because errors during saving of a buffer should never be silent. And if you don't care about the errors that caused these files to be left around, then I don't really understand why you want to know from which files they came. The temporary files directory is usually emptied from time to time, because the files left there are of no importance. So why deleting them all is not what you do? why is it important to know which files gave birth to them? From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 02:27:00 2025 Received: (at 79252) by debbugs.gnu.org; 17 Aug 2025 06:27:00 +0000 Received: from localhost ([127.0.0.1]:44672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unWr5-0007LN-25 for submit@debbugs.gnu.org; Sun, 17 Aug 2025 02:27:00 -0400 Received: from relay.yourmailgateway.de ([188.68.63.170]:38967) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unM1h-0005Hq-4H for 79252@debbugs.gnu.org; Sat, 16 Aug 2025 14:53:14 -0400 Received: from mors-relay8203.netcup.net (localhost [127.0.0.1]) by mors-relay8203.netcup.net (Postfix) with ESMTPS id 4c47Qv0ns2z8dS9; Sat, 16 Aug 2025 18:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rd10.de; s=key2; t=1755370391; bh=FErS6dtG8p+gLMuHFZQjlas2lMa+qkzQXd4r/N+zZAU=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=UOOCUgSqL0AM6R4EJ2aBLwDydIaKDK6GVle2/B3NY+w9Oix2kkYiQNU4rI8rz04Ye enprxF+hffmsQ146+TipsH21VtQ+sMGqchYOwaE9PrDP/eSW07gcJ3Uz+dKghtXAIe OBLjRInzZ5O6YjT/HdkBjEiHGkbTIRJLO3aI3l1Qw3Hw6Gcy5nXj0xmWS24uDRNBMi Rx0BUoRg8E/9VIyb8CRbHrGBuiewAWvo475mHPYsq2Ddf5ap4mBVpcY644EBo4YOrZ B6mrVZnTM7fpZOtWNguUZXIBwrxTr5OxTi7T90+TahqXkNeEz2weQhNvWN27RPL7It TxHn+pX6r83ig== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay8203.netcup.net (Postfix) with ESMTPS id 4c47Qv03ZLz8dNf; Sat, 16 Aug 2025 18:53:11 +0000 (UTC) Received: from mx2eb1.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4c47Qt1Gl7z8svJ; Sat, 16 Aug 2025 20:53:10 +0200 (CEST) Received: from [IPV6:2a02:3102:8e00:2060:a84a:a900:2942:33cf] (dynamic-2a02-3102-8e00-2060-a84a-a900-2942-33cf.310.pool.telefonica.de [IPv6:2a02:3102:8e00:2060:a84a:a900:2942:33cf]) by mx2eb1.netcup.net (Postfix) with ESMTPSA id 71F01100207; Sat, 16 Aug 2025 20:53:05 +0200 (CEST) Authentication-Results: mx2eb1; spf=pass (sender IP is 2a02:3102:8e00:2060:a84a:a900:2942:33cf) smtp.mailfrom=rdiez-2006@rd10.de smtp.helo=[IPV6:2a02:3102:8e00:2060:a84a:a900:2942:33cf] Received-SPF: pass (mx2eb1: connection is authenticated) Message-ID: Date: Sat, 16 Aug 2025 20:53:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "R. Diez" Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames To: Eli Zaretskii References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> Content-Language: en-GB In-Reply-To: <86a53zligg.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PPP-Message-ID: <175537038570.28841.14214762192777711478@mx2eb1.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: 71F01100207 X-NC-CID: yTxHbvs4ud8l0BoQcK8PROT2/BVlTsGqB7HMBg+w X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79252 X-Mailman-Approved-At: Sun, 17 Aug 2025 02:26:58 -0400 Cc: 79252@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Sorry, I don't understand the issue. Perhaps some details are missing. OK, I'll try to explain it with more details. A number of years ago, I enabled option 'file-precious-flag' after getting file corruption when editing remote files with Tramp over unstable network connections. When you enable 'file-precious-flag', you never actually see the temporary filenames being generated, because they are short lived. If everything works well, those files quickly disappear anyway. After enabling 'file-precious-flag', I just noticed that my file corruption problems went away. I quickly forgot the implementation trick with the temporary file. Whenever the editing session failed, I got a network error, which was expected in my environment. So I just tried later, when the link was up again. I didn't think at the time that Emacs might be leaving temporary files behind when the network link failed. The reason is, I normally do not look at the directories, because I keep the complicated Tramp paths in a text file, so I just copy-and-paste them to re-open the remote files directly. An example of such a Tramp filename is: /ssh:username@my-hostname|sudo:root@my-hostname:/etc/prometheus/prometheus.yml Every now and then, I did spot a files named like "tmp1eghjG" here and there, but at a much later time, and I didn't think much of it. The config files I edit are small, and in the rare occasion I did look at the file, it was 0 bytes long anyway. These aren't my systems and I do not edit their config files often, so even if I had investigated further and the temporary files hadn't been empty, I would have probably blamed them on some pesky sysadmin using a lesser editor like Vim, or even worse, some editor written in JavaScript. }8-) Fast forward a few years. I have recently started to hit the Tramp issue I described, and this time I did look around, so that's how I figured out that those temporary files were actually my doing. It never occurred to me that the core Emacs wouldn't go out of its way to make my life super easy, how would I??? So naturally, the first thing I tried was to blame Tramp, but its developers were smart enough to generate temporary filenames with a recognisable prefix. Now that I know, and after the time I invested, I will forever remember. I just thought I shouldn't let the next Emacs user, or some unrelated sysadmin, unnecessarily scratch their heads when the next network hitch or software bug unduly leaves such a temporary file behind, or when such a file comes up in an strace log. If the temporary file had been named "prometheus.yml.Emacs-tmp1eghjG", I would have known straight away where it came from. Best regards, rdiez From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 02:27:06 2025 Received: (at 79252) by debbugs.gnu.org; 17 Aug 2025 06:27:07 +0000 Received: from localhost ([127.0.0.1]:44675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unWr8-0007Ly-Ep for submit@debbugs.gnu.org; Sun, 17 Aug 2025 02:27:06 -0400 Received: from relay.yourmailgateway.de ([194.59.206.189]:50367) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unNCp-0000jT-7L for 79252@debbugs.gnu.org; Sat, 16 Aug 2025 16:08:48 -0400 Received: from relay02-mors.netcup.net (localhost [127.0.0.1]) by relay02-mors.netcup.net (Postfix) with ESMTPS id 4c496542ZWz48Dn; Sat, 16 Aug 2025 22:08:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rd10.de; s=key2; t=1755374925; bh=Sw4mRygV8FDaY+pp2u6FiI3d51BHVp7rH9YA8FUu+Gk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eCo+qLtpG+4ueR2h8nHtoY3Vzn2BE6LOEb8tTPJgM32LvxOB+eL/ALo0aqKflt0ns 9TMKi4LSTpK7lznvt0t1OTPlOCg/Yr1wVh2YjdIejHKkteuof2EQxh+eUW8TEf17h2 FqnjLBrfRyGYpRCytEome25xv9GYjrTZAGs9LrbLwPxx42aLFCn6dIuiUxeWKkxL/r w8rwpz1qRjyEgrbKFIn1+h+bc77KFJzaUTRSZt/oK5YaIlkgi/VzFRTrfBAMyVULHT Ux/dW742khvdTUbzCkpR2CW/bJio/yg9P1rk3+asHHJujHn1KGMLxFPVFGk3tby+ww kDY5jYvbWbX7w== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by relay02-mors.netcup.net (Postfix) with ESMTPS id 4c49653ZbHz7xSt; Sat, 16 Aug 2025 22:08:45 +0200 (CEST) Received: from mx2eb1.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4c49651tzcz8svF; Sat, 16 Aug 2025 22:08:45 +0200 (CEST) Received: from [IPV6:2a02:3102:8e00:2060:a84a:a900:2942:33cf] (dynamic-2a02-3102-8e00-2060-a84a-a900-2942-33cf.310.pool.telefonica.de [IPv6:2a02:3102:8e00:2060:a84a:a900:2942:33cf]) by mx2eb1.netcup.net (Postfix) with ESMTPSA id 963261003C6; Sat, 16 Aug 2025 22:08:40 +0200 (CEST) Authentication-Results: mx2eb1; spf=pass (sender IP is 2a02:3102:8e00:2060:a84a:a900:2942:33cf) smtp.mailfrom=rdiez-2006@rd10.de smtp.helo=[IPV6:2a02:3102:8e00:2060:a84a:a900:2942:33cf] Received-SPF: pass (mx2eb1: connection is authenticated) Message-ID: <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> Date: Sat, 16 Aug 2025 22:08:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames To: Eli Zaretskii References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> <86zfbzhxju.fsf@gnu.org> From: "R. Diez" Content-Language: en-GB In-Reply-To: <86zfbzhxju.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PPP-Message-ID: <175537492085.8544.10186709652586417202@mx2eb1.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: 963261003C6 X-NC-CID: RYb5DUsOco6L0Xfi0tiSi+mQLmMVrIQXXP5TE5g6 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79252 X-Mailman-Approved-At: Sun, 17 Aug 2025 02:26:58 -0400 Cc: 79252@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Thanks for the details. But I still don't understand one aspect of > this: when these temporary files are left around, there should have > been some error either writing them or renaming them to the original > name. Those error messages should have alerted you to the fact that > something went wrong, right there and then. So I don't understand why > you haven't paid attention to those problems right when they happened, > instead of noticing those temporary files much later. I can't remember well at the moment, but I think that, when the network I had was unstable, I was getting a network error, and I was expecting such trouble. That network error did not mention that a temporary file like tmp1eghjG could not be renamed on the remote host. Or it may have been in the *Messages* log, but I did not look so far, and I cannot remember such an explicit error message on the minibuffer. If it had been that explicit, I would probably have made a note to delete that temporary file later on, when the connection was up again. In the case of the Tramp issue I mentioned above, Tramp was timing out the SSH connection, and upon reconnection I was getting the prompt: Tramp: Opening connection nil for root@my-hostname using sudo...done ...somewhere/prometheus.yml locked by rdiez@rdiez4 ... (pid 2019108144160269955): (s, q, p, ?)? Whether I chose "steal" or "proceed" did not really matter, I could save changes and carry on working on the file. At no point in time was I shown any message regarding a temporary file like tmp1eghjG having been left behind on the remote host. Your suspicion is probably right: there must be some Lisp code path somewhere which is not reporting or handling such an error properly. The trouble is, my Emacs skills are not great, and I have already invested quite a lot of time in this matter, so I am not inclined to research even more at this time. I hope you understand. You can probably simulate such an error by setting a low Tramp connection timeout and injecting an error in the code which renames the temporary file. > And if you don't care about the errors that caused these files to be left around, It is not that I do not care about such errors. In the first scenario, I was expecting a network error, because the connection was unstable, and I got one. I then retried later, and it worked. You wouldn't normally think that, when the first error occurred, a temporary file may have been left behind. In the second scenario, I did not get an error, but an annoying prompt, which I answered every time, and then I could carry on editing. Again, there is nothing there which would make me think that a temporary file had been left behind on the remote host. > then I don't really understand why you want to know from > which files they came. The temporary files directory is usually > emptied from time to time, because the files left there are of no > importance. So why deleting them all is not what you do? why is it > important to know which files gave birth to them? Because those temporary files were not created under /tmp, but next to the edited file. This is what the directory looked like (it is just an example, this could happen with any config file you edit with Tramp's sudo method): $ ls /etc/prometheus [on the remote host] alertmanager_templates alertmanager.yml blackbox.yml consoles console_libraries prometheus.yml tmp1egfjG tmpXtggjx tmp6rgzjT tmpK5gkjY There is nothing linking those temporary files to say alertmanager.yml or blackbox.yml. Those temporary files tend to be 0 bytes long and they remain forever under /etc/prometheus (or wherever you happened to edit files). But even if you are only littering your /tmp directory, or if you are only inspecting an strace output whilst troubleshooting something else, it would be nice to recognise what is generating a particular temporary file, or what its purpose is. Well-written software like systemd (hold on, did I just say that???) generates proper names even under /tmp/. For example: $ ls -la /tmp/ drwx------ 3 root root 4.096 2025-08-01 20:39 systemd-private-7052d6f3239046d9949f866654072e46-bluetooth.service-cInwER/ drwx------ 3 root root 4.096 2025-08-01 20:39 systemd-private-7052d6f3239046d9949f866654072e46-colord.service-lHaH71/ drwx------ 3 root root 4.096 2025-08-01 20:39 systemd-private-7052d6f3239046d9949f866654072e46-ModemManager.service-Zr0yTf/ Best regards, rdiez From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 03:29:09 2025 Received: (at 79252) by debbugs.gnu.org; 17 Aug 2025 07:29:09 +0000 Received: from localhost ([127.0.0.1]:44840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unXpF-0007go-3S for submit@debbugs.gnu.org; Sun, 17 Aug 2025 03:29:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58728) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unXpB-0007gD-0c for 79252@debbugs.gnu.org; Sun, 17 Aug 2025 03:29:07 -0400 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 1unXp4-0000ua-GX; Sun, 17 Aug 2025 03:28:58 -0400 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=3FZDkiy18t4Ot37PMS0D1NxeqrNN7z6g2D0rUcBvHXM=; b=B7nK/6isPTnK NwZOziUPheiJPyUrePhsxSKcfysHgzslnilNg8ghVDdj4SLYQ1i42BNnhiXq1A2ektJw0W8swAwRm u72aYgcM3mm/a74mI6V9reYvno6fTLbTCL4IAb4+l01NxUHFw9EaDwmu9FPHZLuGBUVZbOYN0/Bau u+++i8Ek0jE3ejGIgQKRpTp8AM3DglJ43bfqTn/Culfhnoc5Zs1WMUyyo5FMTEHbJfEFCmZzTY3uD jo08nLBE8686GJ6H2LALFC9Aybx+kBEhSgqk6rs2hZ/ZHpZO4nxURzb15Hr9/omNm41A4ng09nkK1 F4VWHgf9XU9KQ7XwRT79Jw==; Date: Sun, 17 Aug 2025 10:28:54 +0300 Message-Id: <86qzxaieyx.fsf@gnu.org> From: Eli Zaretskii To: "R. Diez" , Michael Albinus In-Reply-To: <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> (rdiez-2006@rd10.de) Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> <86zfbzhxju.fsf@gnu.org> <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79252 Cc: 79252@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 16 Aug 2025 22:08:40 +0200 > Cc: 79252@debbugs.gnu.org > From: "R. Diez" > > > > Thanks for the details. But I still don't understand one aspect of > > this: when these temporary files are left around, there should have > > been some error either writing them or renaming them to the original > > name. Those error messages should have alerted you to the fact that > > something went wrong, right there and then. So I don't understand why > > you haven't paid attention to those problems right when they happened, > > instead of noticing those temporary files much later. > > I can't remember well at the moment, but I think that, when the network I had was unstable, I was getting a network error, and I was expecting such trouble. > > That network error did not mention that a temporary file like tmp1eghjG could not be renamed on the remote host. Or it may have been in the *Messages* log, but I did not look so far, and I cannot remember such an explicit error message on the minibuffer. If it had been that explicit, I would probably have made a note to delete that temporary file later on, when the connection was up again. > > In the case of the Tramp issue I mentioned above, Tramp was timing out the SSH connection, and upon reconnection I was getting the prompt: > > Tramp: Opening connection nil for root@my-hostname using sudo...done > ...somewhere/prometheus.yml locked by rdiez@rdiez4 ... (pid > 2019108144160269955): (s, q, p, ?)? > > Whether I chose "steal" or "proceed" did not really matter, I could save changes and carry on working on the file. > > At no point in time was I shown any message regarding a temporary file like tmp1eghjG having been left behind on the remote host. > > Your suspicion is probably right: there must be some Lisp code path somewhere which is not reporting or handling such an error properly. The trouble is, my Emacs skills are not great, and I have already invested quite a lot of time in this matter, so I am not inclined to research even more at this time. I hope you understand. > > You can probably simulate such an error by setting a low Tramp connection timeout and injecting an error in the code which renames the temporary file. > > > > And if you don't care about the errors that caused these files to be left around, > > It is not that I do not care about such errors. In the first scenario, I was expecting a network error, because the connection was unstable, and I got one. I then retried later, and it worked. You wouldn't normally think that, when the first error occurred, a temporary file may have been left behind. > > In the second scenario, I did not get an error, but an annoying prompt, which I answered every time, and then I could carry on editing. Again, there is nothing there which would make me think that a temporary file had been left behind on the remote host. > > > > then I don't really understand why you want to know from > > which files they came. The temporary files directory is usually > > emptied from time to time, because the files left there are of no > > importance. So why deleting them all is not what you do? why is it > > important to know which files gave birth to them? > > Because those temporary files were not created under /tmp, but next to the edited file. This is what the directory looked like (it is just an example, this could happen with any config file you edit with Tramp's sudo method): OK, thanks. I think the patch below should do what you are asking for. Michael, could you please review the patch and tell if you see any issues with it? diff --git a/lisp/files.el b/lisp/files.el index 84e9254..3e85244 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6245,7 +6245,13 @@ basic-save-buffer-2 ;; for saving the buffer. (setq tempname (make-temp-file - (expand-file-name "tmp" dir))) + ;; The MSDOS 8+3 restricted namespace cannot be + ;; relied upon to produce a different file name + ;; if we append ".tmp". + (if (and (eq system-type 'ms-dos) + (not (msdos-long-file-names))) + (expand-file-name "tmp" dir) + (concat buffer-file-name ".tmp")))) ;; Pass in nil&nil rather than point-min&max ;; cause we're saving the whole buffer. ;; write-region-annotate-functions may use it. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 03:56:24 2025 Received: (at 79252) by debbugs.gnu.org; 17 Aug 2025 07:56:24 +0000 Received: from localhost ([127.0.0.1]:44917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unYFb-0000lR-OQ for submit@debbugs.gnu.org; Sun, 17 Aug 2025 03:56:24 -0400 Received: from mout.gmx.net ([212.227.15.15]:32865) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unYFZ-0000l9-ON for 79252@debbugs.gnu.org; Sun, 17 Aug 2025 03:56:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1755417363; x=1756022163; i=michael.albinus@gmx.de; bh=dAhTJF9bCb0rfcSZK18u2GWEz2QehlmoDJwrxLOLz2w=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=do40Dvo6dnzky1SF4utrVVSN+ZV3wAdqPNsNFnbb/Sb723VwVQH4xIDc+AUIVbAJ KbtPf/Mx9CQX0vSSh5ku2mDo3fjL60YqwjP4KigBiwXsX9yhkjEUlo+HH+Te8lt5i P0KfakTk+Omw29QrCZUrCwmQwR3mhRkaMU7mJmkmksnnCmCLK+vJx8uJ6MTFTPurK t3E971Vc689HIAqd82rbEtFpH+Th8WO6CCVDbTZK4JPu+DYaMMnUjuQW1ppB1jlsr m/CgGzf9vF6nLDPa19hQ1K2ih28fhh4KVABhdLw1Ql1Vj29W8GDXa5XlpUSi0xWRo zCs6f6ORejz7AwMdfg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtOKi-1uZjBt0lTC-00rMNz; Sun, 17 Aug 2025 09:56:03 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames In-Reply-To: <86qzxaieyx.fsf@gnu.org> References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> <86zfbzhxju.fsf@gnu.org> <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> <86qzxaieyx.fsf@gnu.org> Date: Sun, 17 Aug 2025 09:56:02 +0200 Message-ID: <871ppacrfx.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:S6X2nnMJjMy3zvEDt+Jhtuf0YrcwclPvcQ6WyYvZJvqVT63Vt82 PwI04zRvPAqtqV5LWeSmg+99dkSjxALl7Co8vgEK/tOm0Vw+T2cbvHNfAolnmxxgRRUVCvJ Y15O2nny1g/3r8ksLTDgZaUwIIyAQM0m/xgVKVUSiikhtFK7nc1nqkzed3+CxpplI9JJ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GTNMibfrEonKxIBmEZwG+UO35QmiZdWTRDYphzEq 0fD6EFkohHsql6UrBmgFC3wkbgbRxnCyLBVtQk5sWQhkDQZZo83+zr9EHnaKBHBrfy1x4gPhG sbJBqPf7xuwgx3UkTYlNewyA78+FWV3n6qoJIlpUizgwldtsGE1NSn2WiuRd3j2/blJ2pgEE/ Jrl1zOQKcObUhT4MnI1OOiwCtlLIGkV0e1zbiDJQW8GNvodsXM/ee3BqrP/40iz0GYfv1P84I yj7Q2Je4yN8xWRQxD5s198QdAF0tET88vONIKPTsArNwmN11WcI2f3sHhwFM31IB1xePYhPi3 27jE1qR9h/sdKIOzMlP/YKk6QSy7NDYDTokstKd4vsW0q2/A1jjEwKTLUp/fsj2xWnhsu1Nhh pkgzP2gaZid7gZSCQsyzGhOwJeC/B7mqBBZitwX6LH/3cVTih7tehE/ZEaDKYbHWBSpVVLuTm ul6tmstN4BNuJ/RPx7o7gYAh7zW/aTxMygamgE0w/mPotC9weQwCiwTYFHNlbEdBVC+i/Ve5D d7deZqJqkra0oiPQKMLPHPt67BIF X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79252 Cc: 79252@debbugs.gnu.org, "R. Diez" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, > Michael, could you please review the patch and tell if you see any > issues with it? > > diff --git a/lisp/files.el b/lisp/files.el > index 84e9254..3e85244 100644 > --- a/lisp/files.el > +++ b/lisp/files.el > @@ -6245,7 +6245,13 @@ basic-save-buffer-2 > ;; for saving the buffer. > (setq tempname > (make-temp-file > - (expand-file-name "tmp" dir))) > + ;; The MSDOS 8+3 restricted namespace cannot be > + ;; relied upon to produce a different file name > + ;; if we append ".tmp". > + (if (and (eq system-type 'ms-dos) > + (not (msdos-long-file-names))) > + (expand-file-name "tmp" dir) > + (concat buffer-file-name ".tmp")))) > ;; Pass in nil&nil rather than point-min&max > ;; cause we're saving the whole buffer. > ;; write-region-annotate-functions may use it. On a first glance, it looks OK. I don't know whether we need special care for symlinks, i.e., use buffer-file-truename instead of buffer-file-name. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 04:07:19 2025 Received: (at 79252) by debbugs.gnu.org; 17 Aug 2025 08:07:19 +0000 Received: from localhost ([127.0.0.1]:44958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unYQA-0001Kv-VS for submit@debbugs.gnu.org; Sun, 17 Aug 2025 04:07:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48952) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unYQ8-0001Kf-Hn for 79252@debbugs.gnu.org; Sun, 17 Aug 2025 04:07:17 -0400 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 1unYQ2-0004eu-DK; Sun, 17 Aug 2025 04:07:10 -0400 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=LB6VmsUIT/Iu47d20NERklKAS0/EVNRJayn44CbUsFU=; b=pY1Ol5f14QCg Jv+WezYlDF+93FSxNAHwbzgzmplmFYYtOdszJZ3+/MkQZhBMxWQjeOk75hD6Lm9WNZhsa05GQdqpl CsxujmsJioDYi6z/fopV6QGQoYta8u1wU0//+YUJLK5Vb05pWsZiKW7TIbopsvreGS55cYX7YE9zv nYXzPQv3xMTHg/BDxErY3B3XTRiyfqchP3w6Hby6PWJ46AqH5j7gq+RtQduOAc7++DvMXppbBHrr8 N9NckB/tQAU5uQwNfu4jzT1RFW7SlTOxXPcPti5B2V2BYUgCzpIGN7YGK2r3YM9o0T5YZkzvEfxL4 SBsws3YJijLLoLnumXIaZA==; Date: Sun, 17 Aug 2025 11:07:06 +0300 Message-Id: <86jz32id79.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <871ppacrfx.fsf@gmx.de> (message from Michael Albinus on Sun, 17 Aug 2025 09:56:02 +0200) Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> <86zfbzhxju.fsf@gnu.org> <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> <86qzxaieyx.fsf@gnu.org> <871ppacrfx.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79252 Cc: 79252@debbugs.gnu.org, rdiez-2006@rd10.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: "R. Diez" , 79252@debbugs.gnu.org > Date: Sun, 17 Aug 2025 09:56:02 +0200 > > Eli Zaretskii writes: > > Hi Eli, > > > Michael, could you please review the patch and tell if you see any > > issues with it? > > > > diff --git a/lisp/files.el b/lisp/files.el > > index 84e9254..3e85244 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -6245,7 +6245,13 @@ basic-save-buffer-2 > > ;; for saving the buffer. > > (setq tempname > > (make-temp-file > > - (expand-file-name "tmp" dir))) > > + ;; The MSDOS 8+3 restricted namespace cannot be > > + ;; relied upon to produce a different file name > > + ;; if we append ".tmp". > > + (if (and (eq system-type 'ms-dos) > > + (not (msdos-long-file-names))) > > + (expand-file-name "tmp" dir) > > + (concat buffer-file-name ".tmp")))) > > ;; Pass in nil&nil rather than point-min&max > > ;; cause we're saving the whole buffer. > > ;; write-region-annotate-functions may use it. > > On a first glance, it looks OK. I don't know whether we need special care > for symlinks, i.e., use buffer-file-truename instead of buffer-file-name. Thanks for the review. What could be the issues with symlinks? The directory of buffer-file-name is writable, so using the name of the symlink should be okay, since we create a normal file. Or what am I missing? From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 04:48:37 2025 Received: (at 79252) by debbugs.gnu.org; 17 Aug 2025 08:48:37 +0000 Received: from localhost ([127.0.0.1]:45109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unZ49-0003XI-A6 for submit@debbugs.gnu.org; Sun, 17 Aug 2025 04:48:37 -0400 Received: from mout.gmx.net ([212.227.17.22]:53235) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unZ45-0003Wu-CU for 79252@debbugs.gnu.org; Sun, 17 Aug 2025 04:48:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1755420498; x=1756025298; i=michael.albinus@gmx.de; bh=/ibOYgUjnF17RMXMDGiggWM7ab4gNl7XDLR4taxehHA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=HoVdga5KeKrhRsmORSNSijMeJfCg/WU1XY/UyugPI08VF4CwSF2NvdyQgg7YOHdW xuqzny9+F94+d78dX9HVmRQ+ywwRldaUjYcxqDBfs1GlbYGLb5iKFDkRzWpfeML56 bQyoDTDKXbR6GSmR2iY4Sxss+j5evojpDnNq8H8rZKLO/6lXrrwaxSPDwl+/NM9Kc SE5IoMQyhgdzVOKbzDjbEnsy4e3lzv7+vxtuR/Sa1hjSvAhT+j1fDZlwwo5nmhQDu qcde//cmElosgqyBY8Kxn9gtEGvIPwd1WyDfgy29DzmS6XEaBKSAkHtF8XcFY1exb cHb0wEQ+Ji0M1NLRzQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N0oBx-1ub6DH1ANZ-010gqI; Sun, 17 Aug 2025 10:48:18 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames In-Reply-To: <86jz32id79.fsf@gnu.org> References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> <86zfbzhxju.fsf@gnu.org> <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> <86qzxaieyx.fsf@gnu.org> <871ppacrfx.fsf@gmx.de> <86jz32id79.fsf@gnu.org> Date: Sun, 17 Aug 2025 10:48:17 +0200 Message-ID: <87plcubage.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:OKp7y2Kgukx5DYVtQRVr0V29+tqwx+ltbNCwBoP9Kt5c8evz1L+ 1AsnZxKM/iBfgkQUvwhLGfONJLbmbeFkZxPMJpqGQUlGj/hWzDFUvKkVtWVhN7BjxASY1Xj xvh09uQQwrl1L5uxvQZ0pmlJVl+skqR0D9AnFRWYDKxHQewJv66w2KV8PhYZLiNN9PMZw8R GTwd6jSHU8TN8KTwfnXOw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:029C5po2WIo=;7d9ShxKnWoAdAf5tFvufEOmNi/h 4esOylQKsSf2LTRV5QykOTb+x/Uh5fN18fTdv3eDTsGskkMbVYZdasYD/xbgwGBi3g94Gh9DV 7Dd1zX7W6i0WOwM6uqidKa4PjUSw4mc42UXtO+bKuJ0bekuYHqXhT1pSLeRW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GbPRqtIWSbJedyU43L9b6DbKK KHAf3QwPavC452GsD90MmXnZaZ75B9617Bd9+XFih/oLn7y30YdPsd/5M6X0LgNzDpyK2dVAP BcY5cvm3Se/LuWO5B7GOzEduj8KR4naVzrE3/wK74jeQkX7S0DX6kdY4RfqANl4tcxsqOsmPT xi9ApAUQXZqkTniE0lBRw4BWw8St9HUkoDQZdK+KZDl7V867oJRTSiJGZC/I14WEq4k24kR0r p9iwdV4xDlB5ItykoqM38L4zlZw6BxqGrxD5kECc8dwuiaMn8MmvrV1U3nqWEJ5RhJiZw9f4x fVsqock= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79252 Cc: 79252@debbugs.gnu.org, rdiez-2006@rd10.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, >> On a first glance, it looks OK. I don't know whether we need special care >> for symlinks, i.e., use buffer-file-truename instead of buffer-file-name. > > What could be the issues with symlinks? The directory of > buffer-file-name is writable, so using the name of the symlink should > be okay, since we create a normal file. Or what am I missing? I don't see an issue. It is just the idea, that the temp file is more related to the canonical file instead of the link source. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 14:58:50 2025 Received: (at 79252) by debbugs.gnu.org; 17 Aug 2025 18:58:50 +0000 Received: from localhost ([127.0.0.1]:47938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uniaf-0005Ho-K3 for submit@debbugs.gnu.org; Sun, 17 Aug 2025 14:58:50 -0400 Received: from relay.yourmailgateway.de ([194.59.206.189]:48489) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uniac-0005HZ-Kb for 79252@debbugs.gnu.org; Sun, 17 Aug 2025 14:58:48 -0400 Received: from relay02-mors.netcup.net (localhost [127.0.0.1]) by relay02-mors.netcup.net (Postfix) with ESMTPS id 4c4lVr3V8cz49RG; Sun, 17 Aug 2025 20:58:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rd10.de; s=key2; t=1755457124; bh=V1Lh12ZAxAyIsiIKTcG6+JEMgsI3xAbzWGyEIoQcT1U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SWuqXZ2G9z6PYSWhlRwRSt8emCrHs/OaGR0zB8obkblIE6T/COgVK6TWwHOp4t87v 4tH9JfEDVPfB4k/XAUozPanEPhjIc9zuzuRk1vpg8cqsqR8ktdoomNAKKKK9XBnTI3 4hV6OxKzFA5J8mV0qyteexREzx4r09ItF45b80zjq5eLLl2SIF/VXOXtisNosSSN6O b4mMQezER+e2F35QAyx184DjGErRdh2k4PmcH/MuWSQ1Osdo50ag2bn4tE5+LVUn8C uKp2/iqq8FNsucKBXMfdnd8fU6TXMHztvh+pA3optcY6G9N+VnjPTdXMGeWw7WHhOm L97cuQnWIryvA== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by relay02-mors.netcup.net (Postfix) with ESMTPS id 4c4lVr35x2z7ww7; Sun, 17 Aug 2025 20:58:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.898 X-Spam-Level: X-Spam-Status: No, score=-2.898 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no Received: from mx2eb1.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4c4lVq5Sx8z8tZR; Sun, 17 Aug 2025 20:58:43 +0200 (CEST) Received: from [IPV6:2a02:3102:8e00:2060:29c6:3163:3c04:c7fe] (dynamic-2a02-3102-8e00-2060-29c6-3163-3c04-c7fe.310.pool.telefonica.de [IPv6:2a02:3102:8e00:2060:29c6:3163:3c04:c7fe]) by mx2eb1.netcup.net (Postfix) with ESMTPSA id 12789100207; Sun, 17 Aug 2025 20:58:39 +0200 (CEST) Authentication-Results: mx2eb1; spf=pass (sender IP is 2a02:3102:8e00:2060:29c6:3163:3c04:c7fe) smtp.mailfrom=rdiez-2006@rd10.de smtp.helo=[IPV6:2a02:3102:8e00:2060:29c6:3163:3c04:c7fe] Received-SPF: pass (mx2eb1: connection is authenticated) Message-ID: Date: Sun, 17 Aug 2025 20:58:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames To: Eli Zaretskii , Michael Albinus References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> <86zfbzhxju.fsf@gnu.org> <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> <86qzxaieyx.fsf@gnu.org> <871ppacrfx.fsf@gmx.de> <86jz32id79.fsf@gnu.org> <87plcubage.fsf@gmx.de> From: "R. Diez" Content-Language: de-DE, en-GB In-Reply-To: <87plcubage.fsf@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PPP-Message-ID: <175545711934.13051.9619269014246808779@mx2eb1.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: 12789100207 X-NC-CID: xEocSynfOxs3FyHaeyhe17W3FnOHHJ1FndzPxQMS X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79252 Cc: 79252@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I think the patch below should do what you are asking for. I don't really know much Emacs or Lisp, but the patch looks fine to me too. At first, I thought that Tramp was the one creating the temporary file, so I suggested this change to Tramp: > For a file like: > > myfile.txt > > I suggest a temporary filename like: > > myfile.txt.EmacsTrampTmp1eghjG Michael Albinus' reply was: > That wouldn't be possible. An extension, like ".txt", must be kept. See the full text here: https://lists.gnu.org/archive/html/tramp-devel/2025-08/msg00008.html Your patch does change the file extension, but I do not know whether that is actually a problem. The original temporary filename had no extension anyway. > I don't see an issue. It is just the idea, that the temp file is more > related to the canonical file instead of the link source. While checking 'file-precious-flag' because of this issue, I saw related option 'file-preserve-symlinks-on-save'. The documentation does not recommend enabling it, or leaving it disabled, but since enabling it seems to mirror the symlink behaviour when 'file-precious-flag' is disabled, I decided to enable 'file-preserve-symlinks-on-save' on my system. So far without trouble. I am mentioning it mainly because I would imagine the Lisp code that queries 'file-preserve-symlinks-on-save' could offer some insight into the necessary symlink handling. However, if anything comes out of that, I would do it in a separate patch. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 18 02:45:06 2025 Received: (at 79252) by debbugs.gnu.org; 18 Aug 2025 06:45:07 +0000 Received: from localhost ([127.0.0.1]:49012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1untcA-0007J4-HC for submit@debbugs.gnu.org; Mon, 18 Aug 2025 02:45:06 -0400 Received: from mout.gmx.net ([212.227.17.21]:46747) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1untc6-0007I1-Gi for 79252@debbugs.gnu.org; Mon, 18 Aug 2025 02:45:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1755499486; x=1756104286; i=michael.albinus@gmx.de; bh=hVmfVXVQA5J9GaqN2dfo35BBIZtvw7pBAt9asbasCG8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=scZ/Wpc1iNn07P2EBtEXuf/+oNDWaOkqjLJwh8PB9szEtnzDDHIt64xuLdzT4yWH tAR69S1N25TR3lubZqN0shUmVWsMUE+mZaKrJR6ltWvHCFzjKt3YRQMjkrtJ8YCTc Ts4JcWaN2XNmf+7RCUyVHVPWXgOFYtGRiG3WyfIVX/vN6qZ+7o3SkpxPhbGICGGAT mvPbvjNL46wi6aKuWEhCRf8QNGBd/0ObRjpk0r89UKMclAZEng4dsAb5zz667bF1e tnVg+MA/hYaQ4jfSjHHonMt6lqjG2wVGYFdigiNsL7VrXDDEiW9dXDu/vsY6NhTKO /yQ7jx935tVH7kdrKw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWigq-1v3Gje2cSe-00LXez; Mon, 18 Aug 2025 08:44:46 +0200 From: Michael Albinus To: "R. Diez" Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames In-Reply-To: References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> <86zfbzhxju.fsf@gnu.org> <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> <86qzxaieyx.fsf@gnu.org> <871ppacrfx.fsf@gmx.de> <86jz32id79.fsf@gnu.org> <87plcubage.fsf@gmx.de> Date: Mon, 18 Aug 2025 08:44:45 +0200 Message-ID: <87v7mlb02q.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-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uLboorxlQgi+DRQTChdRobFgq5G5+iN3IZw uAukoWs+6RkzWykavSUTlrFcYaG05tNGw84cttZfRp9yTJYC9C1DA1Qi/XB9V4KGzU8RC0nzD O9nosM0nUeASSXTidreiTv+p97Au8An76gJl7/MP8NBObxhfjodVP/WlO5p07uqog62uipF69 F5T41Lqd9VCMWDuksG4HqbU5DbEM02V2Qsb1j+Hm28KrcyPMgB1uK8BJMuvgXA1VoBaT+mxoz DvUIIdmWCpCbC2/QWc3qiK9CMaeorqb0IyMVxvxF8XBcJ7TOfV8AANylG9/hnu6t8EE0h1+cg X7edFEdcFpYbJPSZ6IlDg502Gh3POmlV319Vj+viZqhKUDHs2ysPvpZAG/Ku4Cq7qICK7LpKU 8ZCzGXmsWjQIdxbKJplg+GNWR8ruJZ0CzTgxdHHJ3FOEd7Q7Bc3KlPVcVT5C7XXTcPjPZx/Uv CKGgL4cYT+PADbEnq4JtLraD1qFWCq67l40P10+hCBPfCgjqmKA36dmc9L6vCwOpjeJm9n1zG owsbnWddqj29HpEk+n5i0kCvDpbGKJLd10q1wYKvThUSfCFqaz0Mw1s+Eqzqs/06xd5iepq/j j2H1SnK98+/mKHx5YCoub7vrOYALT+b0Zjn6tnXltzwxuL5Fo1nZO0bi6dFC8Yxc+nunXx0bC /KMbmV/dUsyHMT/3+hMMMgU15YTsqub2pvJyfhiL3ZmZqnXCtkN7su/KcjBxh/zX500CnuKPW Ofj+iaYl2cznPSQExakL8RqocyWCTktWXoTEE9plWlAtXToCHg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79252 Cc: 79252@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) "R. Diez" writes: Hi, > At first, I thought that Tramp was the one creating the temporary file, so I suggested this change to Tramp: > >> For a file like: >> >> myfile.txt >> >> I suggest a temporary filename like: >> >> myfile.txt.EmacsTrampTmp1eghjG > > Michael Albinus' reply was: > >> That wouldn't be possible. An extension, like ".txt", must be kept. > > See the full text here: https://lists.gnu.org/archive/html/tramp-devel/2025-08/msg00008.html > > Your patch does change the file extension, but I do not know whether that is actually a problem. The original temporary filename had no extension anyway. Keeping the extension of a file in a respective temp file is needed, if you want to apply actions on that temp file. For example, set a proper major mode for the temp file according to auto-mode-alist. In the given case, use a temporary file for handling file-precious-flag, it isn't needed, indeed. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 23 08:11:37 2025 Received: (at 79252-done) by debbugs.gnu.org; 23 Aug 2025 12:11:37 +0000 Received: from localhost ([127.0.0.1]:38968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1upn5s-0004IS-QU for submit@debbugs.gnu.org; Sat, 23 Aug 2025 08:11:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38232) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1upn5n-0004I6-UX for 79252-done@debbugs.gnu.org; Sat, 23 Aug 2025 08:11:35 -0400 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 1upn5h-0006Un-6j; Sat, 23 Aug 2025 08:11:25 -0400 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=2GkZmUsAiqJDQvQxpB4IHEotLIMTmhw6iDVntLBvb2k=; b=nOL8q5PlK1i9 3qUvpas69kLokHwBmWDrbk5+rf+gEhcxt1HOVq5LueGAf7HkQ6LDnJMJO+FGXKeUGYM58dQk0pPxl jt6XUpbkxFLB2kCSWRVfp8qqOshEDObdPKGnWwWct7LtoAvsrZAbj7bQRCAFulz7LqaXotdxL6vj5 vRwKgEirkDQDlXBxB5a8g5OXH+TsVqmEPCiOFtfT13aHg1O0wVyFrXprf2UhlL0UJ2XcORogT1Hrz fr5tV5JAz18o+J3GY/R1ORLoNoKdr4L+q3p6/hS10E43g06uVpE88xQfbJYUazXxiYe8wEJ/ZvlQk qFDGBfvt/WYvh4XuCxqnVg==; Date: Sat, 23 Aug 2025 15:11:22 +0300 Message-Id: <86bjo6b5lh.fsf@gnu.org> From: Eli Zaretskii To: "R. Diez" In-Reply-To: (rdiez-2006@rd10.de) Subject: Re: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames References: <84668bed-d924-4953-804c-01c8fb4a612c@rd10.de> <86a53zligg.fsf@gnu.org> <86zfbzhxju.fsf@gnu.org> <5ddf3b61-11d9-4b1c-a338-6d14f03dc034@rd10.de> <86qzxaieyx.fsf@gnu.org> <871ppacrfx.fsf@gmx.de> <86jz32id79.fsf@gnu.org> <87plcubage.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79252-done Cc: 79252-done@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > X-Spam-Status: No, score=-2.898 required=6.31 tests=[ALL_TRUSTED=-1, > BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, > URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] > autolearn=ham autolearn_force=no > Date: Sun, 17 Aug 2025 20:58:38 +0200 > Cc: 79252@debbugs.gnu.org > From: "R. Diez" > > > > I think the patch below should do what you are asking for. > > I don't really know much Emacs or Lisp, but the patch looks fine to me too. Thanks, so now installed on the master branch, and closing the bug.