summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2023-04-26 18:06:39 +0200
committerMichael Albinus <michael.albinus@gmx.de>2023-04-26 18:06:39 +0200
commit022f50ebe616e04bb34487a26d529ca08954d287 (patch)
tree617a2abdf09c7f17931a850f9e53709f7327b9f6 /doc
parentd07815a7cc3540201afa06e3c80c061e9f497815 (diff)
downloademacs-022f50ebe616e04bb34487a26d529ca08954d287.tar.gz
New command 'tramp-cleanup-some-buffers'
* doc/misc/tramp.texi (Cleanup remote connections): Document tramp-cleanup-some-buffers and tramp-cleanup-some-buffers-hook. * etc/NEWS: New command 'tramp-cleanup-some-buffers'. * lisp/net/tramp.el (tramp-handle-make-process): * lisp/net/tramp-adb.el (tramp-adb-handle-make-process): * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Use `tramp-taint-remote-process-buffer'. * lisp/net/tramp.el (tramp-post-process-creation): New defun. (tramp-handle-make-process): * lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection): * lisp/net/tramp-crypt.el (tramp-crypt-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-file-notify-add-watch) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-file-acl, tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): * lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-maybe-open-connection) (tramp-sudoedit-send-command): Use it. * lisp/net/tramp-cmds.el (tramp-tainted-remote-process-buffers): New defvar. (tramp-cleanup-dired-buffer-p) (tramp-delete-tainted-remote-process-buffer-function) (kill-buffer-hook, tramp-cleanup-remote-process-p) (tramp-cleanup-some-buffers): New defuns. (tramp-cleanup-some-buffers-hook): New defcustom. Add `buffer-file-name', `tramp-cleanup-dired-buffer-p' and `tramp-cleanup-remote-process-p' to the hook. (kill-buffer-hook): Add `tramp-delete-tainted-remote-process-buffer-function'. (tramp-cleanup-all-buffers): Rework. * lisp/net/tramp-compat.el (tramp-compat-always): New defalias. * test/lisp/net/tramp-tests.el (tramp--test-always): Delete. (tramp-test10-write-region, tramp-test21-file-links) (tramp--test-deftest-direct-async-process) (tramp-test37-make-auto-save-file-name) (tramp-test38-find-backup-file-name) (tramp-test39-make-lock-file-name) (tramp-test39-detect-external-change): Use `tramp-compat-always'.
Diffstat (limited to 'doc')
-rw-r--r--doc/misc/tramp.texi15
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 247d718b59a..43792c4e9e3 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -4377,7 +4377,6 @@ Flushes the current buffer's remote connection objects, the same as in
Flushes all active remote connection objects, the same as in
@code{tramp-cleanup-connection}. This command removes also ad-hoc
proxy definitions (@pxref{Ad-hoc multi-hops}).
-
@end deffn
@deffn Command tramp-cleanup-all-buffers
@@ -4386,6 +4385,20 @@ connections and ad-hoc proxy definition are cleaned up in addition to
killing all buffers related to remote connections.
@end deffn
+@deffn Command tramp-cleanup-some-buffers
+Similar to @code{tramp-cleanup-all-buffers}, where all remote
+connections and ad-hoc proxy definition are cleaned up. However,
+additional buffers are killed only if one of the functions in
+@code{tramp-cleanup-some-buffers-hook} returns @code{t}.
+@end deffn
+
+@defopt tramp-cleanup-some-buffers-hook
+The functions in this hook determine, whether a remote buffer is
+killed when @code{tramp-cleanup-some-buffers} is called. Per default,
+remote buffers which are linked to a remote file, remote @code{dired}
+buffers, and buffers related to a remote process are cleaned up.
+@end defopt
+
@node Renaming remote files
@section Renaming remote files