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

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

bug#43723: 27.1; Errors in file-extended-attributes prevent from saving


From: Lars Ingebrigtsen
Subject: bug#43723: 27.1; Errors in file-extended-attributes prevent from saving buffer
Date: Tue, 07 Jun 2022 13:52:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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 via email to

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