]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-cmds.el
Add "Package:" file headers to denote built-in packages.
[gnu-emacs] / lisp / net / tramp-cmds.el
index fae9e699c05a3ddbd5f9ebf62f58caf172457003..c3243083695ff3a1c829861922b3f19669abc252 100644 (file)
@@ -1,9 +1,10 @@
 ;;; tramp-cmds.el --- Interactive commands for Tramp
 
-;; Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
+;; Package: tramp
 
 ;; This file is part of GNU Emacs.
 
@@ -84,7 +85,7 @@ When called interactively, a Tramp connection has to be selected."
     (tramp-clear-passwd vec)
 
     ;; Flush file cache.
-    (tramp-flush-directory-property vec "/")
+    (tramp-flush-directory-property vec "")
 
     ;; Flush connection cache.
     (tramp-flush-connection-property (tramp-get-connection-process vec))
@@ -102,9 +103,11 @@ When called interactively, a Tramp connection has to be selected."
 This includes password cache, file cache, connection cache, buffers."
   (interactive)
 
+  ;; Unlock Tramp.
+  (setq tramp-locked nil)
+
   ;; Flush password cache.
-  (when (functionp 'password-reset)
-    (funcall (symbol-function 'password-reset)))
+  (tramp-compat-funcall 'password-reset)
 
   ;; Flush file and connection cache.
   (clrhash tramp-cache-data)
@@ -216,9 +219,14 @@ If you can give a simple set of instructions to make this bug
 happen reliably, please include those.  Thank you for helping
 kill bugs in Tramp.
 
-Another useful thing to do is to put
+Before reproducing the bug, you might apply
+
+  M-x tramp-cleanup-all-connections
+
+This allows to investigate from a clean environment.  Another
+useful thing to do is to put
 
-  (setq tramp-verbose 8)
+  (setq tramp-verbose 9)
 
 in the ~/.emacs file and to repeat the bug.  Then, include the
 contents of the *tramp/foo* buffer and the *debug tramp/foo*
@@ -246,7 +254,7 @@ Used for non-7bit chars in strings."
                              (base64-encode-string val))))))
 
     ;; Dump variable.
-    (funcall (symbol-function 'reporter-dump-variable) varsym mailbuf)
+    (tramp-compat-funcall 'reporter-dump-variable varsym mailbuf)
 
     (unless (hash-table-p val)
       ;; Remove string quotation.
@@ -275,10 +283,8 @@ Used for non-7bit chars in strings."
        (load "mml" 'noerror))
     (require 'message nil 'noerror)
     (require 'mml nil 'noerror))
-  (when (functionp 'message-mode)
-    (funcall (symbol-function 'message-mode)))
-  (when (functionp 'mml-mode)
-    (funcall (symbol-function 'mml-mode) t)))
+  (tramp-compat-funcall 'message-mode)
+  (tramp-compat-funcall 'mml-mode t))
 
 (defun tramp-append-tramp-buffers ()
   "Append Tramp buffers and buffer local variables into the bug report."
@@ -300,15 +306,14 @@ Used for non-7bit chars in strings."
        (erase-buffer)
        (insert "\n(setq\n")
        (lisp-indent-line)
-       (funcall (symbol-function 'reporter-dump-variable)
-                'buffer-name (current-buffer))
+       (tramp-compat-funcall
+        'reporter-dump-variable 'buffer-name (current-buffer))
        (dolist (varsym-or-cons-cell (buffer-local-variables buffer))
          (let ((varsym (or (car-safe varsym-or-cons-cell)
                            varsym-or-cons-cell)))
            (when (string-match "tramp" (symbol-name varsym))
-             (funcall
-              (symbol-function 'reporter-dump-variable)
-              varsym (current-buffer)))))
+             (tramp-compat-funcall
+              'reporter-dump-variable varsym (current-buffer)))))
        (lisp-indent-line)
        (insert ")\n"))
       (insert-buffer-substring elbuf)))
@@ -320,7 +325,7 @@ Used for non-7bit chars in strings."
         (symbol-value 'mml-mode))
 
     (let ((tramp-buf-regexp "\\*\\(debug \\)?tramp/")
-         (buffer-list (funcall (symbol-function 'tramp-list-tramp-buffers)))
+         (buffer-list (tramp-compat-funcall 'tramp-list-tramp-buffers))
          (curbuf (current-buffer)))
 
       ;; There is at least one Tramp buffer.
@@ -368,10 +373,10 @@ 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")
              (dolist (buffer buffer-list)
-               (funcall (symbol-function 'mml-insert-empty-tag)
-                        'part 'type "text/plain" 'encoding "base64"
-                        'disposition "attachment" 'buffer buffer
-                        'description buffer))
+               (tramp-compat-funcall
+                'mml-insert-empty-tag 'part 'type "text/plain"
+                'encoding "base64" 'disposition "attachment" 'buffer buffer
+                'description buffer))
              (set-buffer-modified-p nil))
 
          ;; Don't send.  Delete the message buffer.