[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 52d3ee46dbc: New user option tramp-inhibit-errors-if-setting-file
From: |
Michael Albinus |
Subject: |
master 52d3ee46dbc: New user option tramp-inhibit-errors-if-setting-file-attributes-fail |
Date: |
Fri, 19 Apr 2024 06:16:10 -0400 (EDT) |
branch: master
commit 52d3ee46dbc6fb0fbcfbb8e446fb385aef189893
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
New user option tramp-inhibit-errors-if-setting-file-attributes-fail
* doc/misc/tramp.texi (Frequently Asked Questions):
Explain tramp-inhibit-errors-if-setting-file-attributes-fail.
* lisp/net/tramp.el
(tramp-inhibit-errors-if-setting-file-attributes-fail): New defcustom.
(tramp-skeleton-set-file-modes-times-uid-gid): Use it.
---
doc/misc/tramp.texi | 11 +++++++++++
lisp/net/tramp.el | 11 ++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 131a23b7423..b503ce13373 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -5887,6 +5887,17 @@ as above in your @file{~/.emacs}:
@end lisp
+@item
+How to ignore errors when changing file attributes?
+
+@vindex tramp-inhibit-errors-if-setting-file-attributes-fail
+Sometimes, for example while saving remote files, errors appear when
+changing file attributes like permissions, time stamps, or ownership.
+If these errors can be ignored, set user option
+@code{tramp-inhibit-errors-if-setting-file-attributes-fail} to a
+non-@code{nil} value. This transforms the error into a warning.
+
+
@item
How to disable other packages from calling @value{tramp}?
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5b101000926..34a636ab97d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3533,6 +3533,11 @@ on the same host. Otherwise, TARGET is quoted."
,@body)))
+(defcustom tramp-inhibit-errors-if-setting-file-attributes-fail nil
+ "Whether to warn only if `tramp-*-set-file-{modes,times,uid-gid}' fails."
+ :version "30.1"
+ :type 'boolean)
+
(defmacro tramp-skeleton-set-file-modes-times-uid-gid
(filename &rest body)
"Skeleton for `tramp-*-set-file-{modes,times,uid-gid}'.
@@ -3548,7 +3553,11 @@ BODY is the backend specific code."
;; "file-writable-p".
'("file-directory-p" "file-exists-p" "file-symlinkp" "file-truename")
(tramp-flush-file-properties v localname))
- ,@body))
+ (condition-case err
+ (progn ,@body)
+ (error (if tramp-inhibit-errors-if-setting-file-attributes-fail
+ (display-warning 'tramp (error-message-string err))
+ (signal (car err) (cdr err)))))))
(defmacro tramp-skeleton-write-region
(start end filename append visit lockname mustbenew &rest body)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 52d3ee46dbc: New user option tramp-inhibit-errors-if-setting-file-attributes-fail,
Michael Albinus <=