From: Karl Fogel <kfogel@red-bean.com>
To: emacs-devel@gnu.org
Subject: file-precious-flag not taken seriously enough?
Date: Thu, 13 Nov 2008 01:26:34 -0500 [thread overview]
Message-ID: <87bpwkgmzp.fsf@red-bean.com> (raw)
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
next reply other threads:[~2008-11-13 6:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-13 6:26 Karl Fogel [this message]
2008-11-13 15:26 ` file-precious-flag not taken seriously enough? Chong Yidong
2008-11-14 14:43 ` Kevin Rodgers
2008-11-14 23:18 ` Karl Fogel
2008-11-15 14:55 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bpwkgmzp.fsf@red-bean.com \
--to=kfogel@red-bean.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).