;;; tramp-cmds.el --- Interactive commands for Tramp
-;; Copyright (C) 2007-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
;; Author: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
;;; Commentary:
-;; This package provides all interactive commands which are releated
+;; This package provides all interactive commands which are related
;; to Tramp.
;;; Code:
(tramp-flush-directory-property vec "")
;; Flush connection cache.
- (tramp-flush-connection-property (tramp-get-connection-process vec))
+ (when (processp (tramp-get-connection-process vec))
+ (delete-process (tramp-get-connection-process vec))
+ (tramp-flush-connection-property (tramp-get-connection-process vec)))
(tramp-flush-connection-property vec)
;; Remove buffers.
(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.
'tramp-load-report-modules ; pre-hook
'tramp-append-tramp-buffers ; post-hook
- "\
+ (propertize "\n" 'display "\
Enter your bug report in this message, including as much detail
as you possibly can about the problem, what you did to cause it
and what the local and remote machines are.
(setq tramp-verbose 9)
-in the ~/.emacs file and to repeat the bug. Then, include the
+in your init file and to repeat the bug. Then, include the
contents of the *tramp/foo* buffer and the *debug tramp/foo*
buffer in your bug report.
--bug report follows this line--
-"))))
+")))))
(defun tramp-reporter-dump-variable (varsym mailbuf)
"Pretty-print the value of the variable in symbol VARSYM."
(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))
;; 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")))
+ (mapc
+ (lambda (x) (when (string-match "tramp" x) (insert x "\n")))
+ (split-string (tramp-compat-funcall 'list-load-path-shadows t) "\n")))
;; Append buffers only when we are in message mode.
(when (and
(kill-buffer nil)
(switch-to-buffer curbuf)
(goto-char (point-max))
- (insert "\n\
+ (insert (propertize "\n" 'display "\n\
This is a special notion of the `gnus/message' package. If you
use another mail agent (by copying the contents of this buffer)
-please ensure that the buffers are attached to your email.\n\n")
+please ensure that the buffers are attached to your email.\n\n"))
(dolist (buffer buffer-list)
(tramp-compat-funcall
'mml-insert-empty-tag 'part 'type "text/plain"