bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#66546: 30.0.50; save-buffer to write-protected file without backup f


From: Eli Zaretskii
Subject: bug#66546: 30.0.50; save-buffer to write-protected file without backup fails
Date: Sun, 15 Oct 2023 08:33:49 +0300

> From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
> Cc: 66546@debbugs.gnu.org
> Date: Sat, 14 Oct 2023 22:31:36 +0200
> 
> > Please explain what happens with "C-0 C-x C-s", and why.  I don't
> > think I understand that, given what you wrote.
> 
> "C-0 C-x C-s" prompts me whether to write the modified buffer to the
> write-protected file.  When I reply "yes", I expect Emacs to do the
> following:
> 
> 1. Get the mode bits/extended attributes of "foo".
> 2. Remove the write-potection on "foo".
> 3. Write the buffer to "foo", not creating a backup file.
> 4. Restore the mode bits/extended attributes on "foo" to their previous
>    state taken in step 1.

So far, so good.

> What happens instead:
> 
> Emacs errors out that it cannot write to the file, even though it has
> the permissions and means to temporarily remove the write-protection on
> it.

Why cannot Emacs write to the file, and what do the extended
attributes have to do with that?

> >> I propose to just drop that call to `set-file-extended-attributes',
> >> like this:
> >
> > Why does it make sense to ignore the extended attributes here, when we
> > don't ignore them elsewhere in Emacs?
> 
> Because we do not have the equivalent to `(logior OLD-MODE 128)' for
> extended attributes yet.

I still don't follow you: why do we need that in this situation?  I
hope if you answer to me previous question above in enough detail, it
will also answer this question.  So far I don't understand why this
fails and what do extended attributes have to do with it.





reply via email to

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