From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Ken Brown <kbrown@cornell.edu>
Cc: 10257@debbugs.gnu.org, jari <jari.aalto@cante.net>
Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive)
Date: Tue, 13 Dec 2011 21:54:39 -0500 [thread overview]
Message-ID: <jwv7h1zan7y.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <4EE7B2A9.6060308@cornell.edu> (Ken Brown's message of "Tue, 13 Dec 2011 15:16:41 -0500")
> The code I'm talking about is near the beginning of the definition of
> basic-save-buffer-2' in files.el:
Thanks.
> I'm not (yet) proposing a change. I'm simply asking what the rationale is
> for calling `yes-or-no-p' and making the user confirm that s/he wants to try
> to save the file.
I'm not sure what was the intention, but I know that this code is
triggered in cases such as:
- running as root: write will always succeed.
- saving to a read-only file that you own: while `write' will fail,
you can make it succeed by changing the access rights (which is what
tempsetmodes is for).
- saving to a read-only file in a writable dir: write will fail, but
you can make it succeed by calling unlink first [Not sure if this
works in Emacs right now].
In all these cases, Emacs is able to write the file, but the read-only
bit expresses an intention not to modify the file so it makes sense to
ask for confirmation.
This said, the code you quote should never prevent you from saving
a file, it should only ask for confirmation (i.e. it might be annoying
but it shouldn't prevent you from getting your work done).
But other than for the "running as root" case, the above two cases could
replace the `file-writable-p' test with a `write-region' test:
file-writable-p is documented (via POSIX's documentation of `access') to
be an approximation, whereas `write-region' should reliably tell us
whether we can write to the file.
> I don't see that any harm would come from just trying to
> do what the user asked for, without making him/her ask a second time.
I'm not sure what second time you're thinking of.
> If you agree, then I guess I would propose the following patch (not yet
> tested):
Your patch would probably remove the ability to save to a read-only file.
Stefan
next prev parent reply other threads:[~2011-12-14 2:54 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 18:23 bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Jari Aalto
2011-12-09 20:33 ` Ken Brown
2011-12-10 9:58 ` jaalto
2011-12-13 12:18 ` Ken Brown
2011-12-13 14:00 ` jari
2011-12-13 14:43 ` Eli Zaretskii
2011-12-13 15:12 ` Ken Brown
2011-12-13 19:27 ` Stefan Monnier
2011-12-13 20:16 ` Ken Brown
2011-12-14 2:54 ` Stefan Monnier [this message]
2011-12-14 3:27 ` Ken Brown
2011-12-14 8:01 ` Jari Aalto
2011-12-14 8:35 ` Eli Zaretskii
2011-12-14 12:24 ` Ken Brown
2011-12-14 12:55 ` Ken Brown
2011-12-14 13:10 ` Eli Zaretskii
2011-12-14 14:19 ` Ken Brown
2011-12-14 14:47 ` jari
2011-12-14 17:30 ` Eli Zaretskii
2011-12-14 17:57 ` Ken Brown
2011-12-15 2:43 ` Ken Brown
2011-12-15 2:53 ` Ken Brown
2011-12-15 3:19 ` Ken Brown
2011-12-15 4:04 ` Eli Zaretskii
2011-12-15 14:42 ` Ken Brown
2011-12-16 19:37 ` Ken Brown
2011-12-16 19:46 ` Eli Zaretskii
2011-12-16 23:15 ` Stefan Monnier
2011-12-17 17:08 ` Ken Brown
2011-12-14 14:15 ` jari
2011-12-14 14:29 ` Ken Brown
2011-12-14 14:43 ` jari
2011-12-14 17:21 ` Eli Zaretskii
2011-12-14 17:23 ` Richard Stallman
2011-12-13 16:26 ` jari
2011-12-13 16:52 ` Ken Brown
2011-12-13 17:48 ` jari
2011-12-13 17:48 ` Eli Zaretskii
2011-12-13 18:05 ` jari
2011-12-13 18:36 ` Eli Zaretskii
2011-12-15 14:44 ` Jason Rumney
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv7h1zan7y.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=10257@debbugs.gnu.org \
--cc=jari.aalto@cante.net \
--cc=kbrown@cornell.edu \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.