Subject: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames

From: Michael Albinus <[email-masked]>
Date: Mon, 18 Aug 2025 08:44:45 +0200

"R. Diez" <[email-masked]> 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.