all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 43723@debbugs.gnu.org
Subject: bug#43723: 27.1; Errors in file-extended-attributes prevent from saving buffer
Date: Tue, 07 Jun 2022 13:52:27 +0200	[thread overview]
Message-ID: <87bkv4k7wk.fsf@gnus.org> (raw)
In-Reply-To: <83leu87ll6.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 07 Jun 2022 14:35:17 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> No, the problem is exactly that file-extended-attributes signals an
> error.  The set-file-extended-attributes part is handled correctly:
>
> 	       ;; If set-file-extended-attributes fails, fall back on
> 	       ;; set-file-modes.
> 	       (unless
> 		   (with-demoted-errors "Error setting attributes: %s"
> 		     (set-file-extended-attributes buffer-file-name
> 						   (nth 1 setmodes)))
> 		 (set-file-modes buffer-file-name
> 				 (logior (car setmodes) 128)))))

That code is for when the file isn't writable, so it's not normally
encountered.  (And apparently doesn't do anything anyway, see the other
bug report about this...)

> Which to me is just one more argument in favor of showing a simple
> message when file-extended-attributes fails, instead of signaling an
> error and breaking the save-buffer command.

So it's this bit that bugs out in obscure situations?

	    ;; Since we have created an entirely new file,
	    ;; make sure it gets the right permission bits set.
	    (setq setmodes (or setmodes
 			       (list (or (file-modes buffer-file-name)
					 (logand ?\666 (default-file-modes)))
				     (file-extended-attributes buffer-file-name)
				     buffer-file-name)))

Since this is such an unlikely thing to error out, perhaps just doing a
`with-demoted-errors' here is sufficient?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2022-06-07 11:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 14:43 bug#43723: 27.1; Errors in file-extended-attributes prevent from saving buffer Eli Zaretskii
2022-06-06 16:22 ` Lars Ingebrigtsen
2022-06-06 16:53   ` Eli Zaretskii
2022-06-07  9:26     ` Lars Ingebrigtsen
2022-06-07 11:35       ` Eli Zaretskii
2022-06-07 11:52         ` Lars Ingebrigtsen [this message]
2022-06-07 13:07           ` Eli Zaretskii
2022-06-07 18:04             ` Lars Ingebrigtsen

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=87bkv4k7wk.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=43723@debbugs.gnu.org \
    --cc=eliz@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 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.