]> git.eshelyaron.com Git - emacs.git/commitdiff
Demote extended attribute errors in basic-save-buffer-2
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 7 Jun 2022 18:03:41 +0000 (20:03 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 7 Jun 2022 18:03:41 +0000 (20:03 +0200)
* lisp/files.el (basic-save-buffer-2): Give demoted errors when
reading extended attributes that fail (bug#43723).

lisp/files.el

index d876a76119c52833ac2e75456e0f8754bc986265..a505f62af81f4b997c1f4aca7695a9a0b686b10c 100644 (file)
@@ -5725,11 +5725,14 @@ Before and after saving the buffer, this function runs
                     (signal (car err) (cdr err))))
            ;; 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)))
+           (setq setmodes
+                  (or setmodes
+                      (list (or (file-modes buffer-file-name)
+                               (logand ?\666 (default-file-modes)))
+                            (with-demoted-errors
+                                "Error getting extended attributes: %s"
+                             (file-extended-attributes buffer-file-name))
+                           buffer-file-name)))
            ;; We succeeded in writing the temp file,
            ;; so rename it.
            (rename-file tempname
@@ -5746,9 +5749,12 @@ Before and after saving the buffer, this function runs
        ;; (setmodes is set) because that says we're superseding.
        (cond ((and tempsetmodes (not setmodes))
               ;; Change the mode back, after writing.
-              (setq setmodes (list (file-modes buffer-file-name)
-                                   (file-extended-attributes buffer-file-name)
-                                   buffer-file-name))
+              (setq setmodes
+                     (list (file-modes buffer-file-name)
+                           (with-demoted-errors
+                               "Error getting extended attributes: %s"
+                            (file-extended-attributes buffer-file-name))
+                          buffer-file-name))
               ;; If set-file-extended-attributes fails, fall back on
               ;; set-file-modes.
               (unless