summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-cmds.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2013-09-10 09:45:33 +0200
committerMichael Albinus <michael.albinus@gmx.de>2013-09-10 09:45:33 +0200
commit6480194ca1080908a32fb2eb700f3dcf938972d5 (patch)
tree532710ee8dd0e57c83635c5a6b71b153bb12d1da /lisp/net/tramp-cmds.el
parent9a2c9b476440268e8d6fbacfec52865a76a8b395 (diff)
downloademacs-6480194ca1080908a32fb2eb700f3dcf938972d5.tar.gz
* net/tramp.el (tramp-cleanup): Remove. Functionality added to
`tramp-cleanup-connection'. * net/tramp-cmds.el (tramp-cleanup-connection): Add optional parameters KEEP-DEBUG and KEEP-PASSWORD. * net/tramp.el (tramp-file-name-handler): * net/tramp-adb.el (tramp-adb-maybe-open-connection): * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell) (tramp-maybe-open-connection): * net/tramp-smb.el (tramp-smb-maybe-open-connection): Use `tramp-cleanup-connection'. * net/tramp-sh.el (tramp-maybe-open-connection): Catch 'uname-changed inside the progress reporter.
Diffstat (limited to 'lisp/net/tramp-cmds.el')
-rw-r--r--lisp/net/tramp-cmds.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index de06cd5cbc9..5015929534d 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -55,9 +55,11 @@
(buffer-list))))
;;;###tramp-autoload
-(defun tramp-cleanup-connection (vec)
+(defun tramp-cleanup-connection (vec &optional keep-debug keep-password)
"Flush all connection related objects.
-This includes password cache, file cache, connection cache, buffers.
+This includes password cache, file cache, connection cache,
+buffers. KEEP-DEBUG non-nil preserves the debug buffer.
+KEEP-PASSWORD non-nil preserves the password cache.
When called interactively, a Tramp connection has to be selected."
(interactive
;; When interactive, select the Tramp remote identification.
@@ -80,14 +82,15 @@ When called interactively, a Tramp connection has to be selected."
"Enter Tramp connection: " connections nil t
(try-completion "" connections)))
(when (and name (file-remote-p name))
- (with-parsed-tramp-file-name name nil v))))))
+ (with-parsed-tramp-file-name name nil v))))
+ nil nil))
(if (not vec)
;; Nothing to do.
(message "No Tramp connection found.")
;; Flush password cache.
- (tramp-clear-passwd vec)
+ (unless keep-password (tramp-clear-passwd vec))
;; Flush file cache.
(tramp-flush-directory-property vec "")
@@ -101,7 +104,8 @@ When called interactively, a Tramp connection has to be selected."
;; Remove buffers.
(dolist
(buf (list (get-buffer (tramp-buffer-name vec))
- (get-buffer (tramp-debug-buffer-name vec))
+ (unless keep-debug
+ (get-buffer (tramp-debug-buffer-name vec)))
(tramp-get-connection-property vec "process-buffer" nil)))
(when (bufferp buf) (kill-buffer buf)))))