unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* file-precious-flag not taken seriously enough?
@ 2008-11-13  6:26 Karl Fogel
  2008-11-13 15:26 ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Fogel @ 2008-11-13  6:26 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-15 14:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-13  6:26 file-precious-flag not taken seriously enough? Karl Fogel
2008-11-13 15:26 ` Chong Yidong
2008-11-14 14:43   ` Kevin Rodgers
2008-11-14 23:18     ` Karl Fogel
2008-11-15 14:55       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).