emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

file-precious-flag not taken seriously enough?


From: Karl Fogel
Subject: file-precious-flag not taken seriously enough?
Date: Thu, 13 Nov 2008 01:26:34 -0500

In lisp/files.el:(basic-save-buffer-2), we have this code:

    (let ((dir (file-name-directory buffer-file-name)))
      (if (and file-precious-flag
               (file-writable-p dir))
          ;; If file is precious, write temp name, then rename it.
          ;; This requires write access to the containing dir,
          ;; which is why we don't try it if we don't have that access.
          (let ((realname buffer-file-name)
                tempname succeed
                (umask (default-file-modes))
                (old-modtime (visited-file-modtime)))
        [...continue on to write directly to the file...]

The documentation for `file-precious-flag' doesn't say anything about
it only applying if the containing directory is writeable.  But that
seems to be how we treat it, in the conditional above.

Is this just a bug?

(Larger context: I'm implementing the `break-hardlinks-on-save' flag
as discussed in another thread, so am looking at where
`file-precious-flag' is used.)

-Karl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]