GNU bug report logs -
#79252
Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames
Previous Next
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> 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.
This bug report was last modified 20 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.