]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-cmds.el
upstream
[gnu-emacs] / lisp / net / tramp-cmds.el
index 46f8d655544964435b2c656f6ecabf6f7da06ced..fcf523a706859161cabfb1b42ed3ddb4db9923e9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; tramp-cmds.el --- Interactive commands for Tramp
 
-;; Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2011 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -99,6 +99,15 @@ When called interactively, a Tramp connection has to be selected."
                   (tramp-get-connection-property vec "process-buffer" nil)))
       (when (bufferp buf) (kill-buffer buf)))))
 
+;;;###tramp-autoload
+(defun tramp-cleanup-this-connection ()
+  "Flush all connection related objects of the current buffer's connection."
+  (interactive)
+  (and (stringp default-directory)
+       (file-remote-p default-directory)
+       (tramp-cleanup-connection
+       (tramp-dissect-file-name default-directory 'noexpand))))
+
 ;;;###tramp-autoload
 (defun tramp-cleanup-all-connections ()
   "Flush all Tramp internal objects.
@@ -258,8 +267,8 @@ buffer in your bug report.
   (dolist (buffer
           (delq nil
                 (mapcar
-                 '(lambda (b)
-                    (when (string-match "\\*tramp/" (buffer-name b)) b))
+                 (lambda (b)
+                    (when (string-match "\\*tramp/" (buffer-name b)) b))
                  (buffer-list))))
     (let ((reporter-eval-buffer buffer)
          (buffer-name (buffer-name buffer))
@@ -281,6 +290,12 @@ buffer in your bug report.
        (insert ")\n"))
       (insert-buffer-substring elbuf)))
 
+  ;; Dump load-path shadows.
+  (insert "\nload-path shadows:\n==================\n")
+  (ignore-errors
+    (mapc (lambda (x) (when (string-match "tramp" x) (insert x "\n")))
+         (split-string (list-load-path-shadows t) "\n")))
+
   ;; Append buffers only when we are in message mode.
   (when (and
         (eq major-mode 'message-mode)