diff options
| author | Michael Albinus | 2024-04-19 12:15:47 +0200 |
|---|---|---|
| committer | Michael Albinus | 2024-04-19 12:15:47 +0200 |
| commit | 52d3ee46dbc6fb0fbcfbb8e446fb385aef189893 (patch) | |
| tree | 6478b28caf0b2b62c20dab74695f46ac5e7db7f9 | |
| parent | 2675c2824f77f46476831e637e4bc0fec692a0f1 (diff) | |
| download | emacs-52d3ee46dbc6fb0fbcfbb8e446fb385aef189893.tar.gz emacs-52d3ee46dbc6fb0fbcfbb8e446fb385aef189893.zip | |
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.
| -rw-r--r-- | doc/misc/tramp.texi | 11 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 11 |
2 files changed, 21 insertions, 1 deletions
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 | |||
| @@ -5888,6 +5888,17 @@ as above in your @file{~/.emacs}: | |||
| 5888 | 5888 | ||
| 5889 | 5889 | ||
| 5890 | @item | 5890 | @item |
| 5891 | How to ignore errors when changing file attributes? | ||
| 5892 | |||
| 5893 | @vindex tramp-inhibit-errors-if-setting-file-attributes-fail | ||
| 5894 | Sometimes, for example while saving remote files, errors appear when | ||
| 5895 | changing file attributes like permissions, time stamps, or ownership. | ||
| 5896 | If these errors can be ignored, set user option | ||
| 5897 | @code{tramp-inhibit-errors-if-setting-file-attributes-fail} to a | ||
| 5898 | non-@code{nil} value. This transforms the error into a warning. | ||
| 5899 | |||
| 5900 | |||
| 5901 | @item | ||
| 5891 | How to disable other packages from calling @value{tramp}? | 5902 | How to disable other packages from calling @value{tramp}? |
| 5892 | 5903 | ||
| 5893 | There are packages that call @value{tramp} without the user ever | 5904 | There are packages that call @value{tramp} without the user ever |
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." | |||
| 3533 | 3533 | ||
| 3534 | ,@body))) | 3534 | ,@body))) |
| 3535 | 3535 | ||
| 3536 | (defcustom tramp-inhibit-errors-if-setting-file-attributes-fail nil | ||
| 3537 | "Whether to warn only if `tramp-*-set-file-{modes,times,uid-gid}' fails." | ||
| 3538 | :version "30.1" | ||
| 3539 | :type 'boolean) | ||
| 3540 | |||
| 3536 | (defmacro tramp-skeleton-set-file-modes-times-uid-gid | 3541 | (defmacro tramp-skeleton-set-file-modes-times-uid-gid |
| 3537 | (filename &rest body) | 3542 | (filename &rest body) |
| 3538 | "Skeleton for `tramp-*-set-file-{modes,times,uid-gid}'. | 3543 | "Skeleton for `tramp-*-set-file-{modes,times,uid-gid}'. |
| @@ -3548,7 +3553,11 @@ BODY is the backend specific code." | |||
| 3548 | ;; "file-writable-p". | 3553 | ;; "file-writable-p". |
| 3549 | '("file-directory-p" "file-exists-p" "file-symlinkp" "file-truename") | 3554 | '("file-directory-p" "file-exists-p" "file-symlinkp" "file-truename") |
| 3550 | (tramp-flush-file-properties v localname)) | 3555 | (tramp-flush-file-properties v localname)) |
| 3551 | ,@body)) | 3556 | (condition-case err |
| 3557 | (progn ,@body) | ||
| 3558 | (error (if tramp-inhibit-errors-if-setting-file-attributes-fail | ||
| 3559 | (display-warning 'tramp (error-message-string err)) | ||
| 3560 | (signal (car err) (cdr err))))))) | ||
| 3552 | 3561 | ||
| 3553 | (defmacro tramp-skeleton-write-region | 3562 | (defmacro tramp-skeleton-write-region |
| 3554 | (start end filename append visit lockname mustbenew &rest body) | 3563 | (start end filename append visit lockname mustbenew &rest body) |