]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-cmds.el
Merge changes from emacs-23 branch
[gnu-emacs] / lisp / net / tramp-cmds.el
index 86f80331f07864f02a6a1d7b8880214cb17d1b26..5937a737b961f4a2080ec7c29d65ffa4564935b0 100644 (file)
@@ -4,6 +4,7 @@
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
+;; Package: tramp
 
 ;; This file is part of GNU Emacs.
 
@@ -49,6 +50,7 @@
          x)))
     (buffer-list))))
 
+;;;###tramp-autoload
 (defun tramp-cleanup-connection (vec)
   "Flush all connection related objects.
 This includes password cache, file cache, connection cache, buffers.
@@ -106,8 +108,7 @@ This includes password cache, file cache, connection cache, buffers."
   (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)
@@ -129,6 +130,7 @@ This includes password cache, file cache, connection cache, buffers."
 
 ;; Tramp version is useful in a number of situations.
 
+;;;###tramp-autoload
 (defun tramp-version (arg)
   "Print version number of tramp.el in minibuffer or current buffer."
   (interactive "P")
@@ -226,7 +228,7 @@ Before reproducing the bug, you might apply
 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*
@@ -254,7 +256,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.
@@ -283,10 +285,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."
@@ -308,15 +308,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)))
@@ -328,7 +327,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.
@@ -376,10 +375,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.
@@ -390,6 +389,9 @@ please ensure that the buffers are attached to your email.\n\n")
 
 (defalias 'tramp-submit-bug 'tramp-bug)
 
+(add-hook 'tramp-unload-hook
+         (lambda () (unload-feature 'tramp-cmds 'force)))
+
 (provide 'tramp-cmds)
 
 ;;; TODO:
@@ -398,7 +400,7 @@ please ensure that the buffers are attached to your email.\n\n")
 ;; * WIBNI there was an interactive command prompting for Tramp
 ;;   method, hostname, username and filename and translates the user
 ;;   input into the correct filename syntax (depending on the Emacs
-;;   flavor) (Reiner Steib)
+;;   flavor)  (Reiner Steib)
 ;; * Let the user edit the connection properties interactively.
 ;;   Something like `gnus-server-edit-server' in Gnus' *Server* buffer.
 ;; * It's just that when I come to Customize `tramp-default-user-alist'
@@ -407,7 +409,7 @@ please ensure that the buffers are attached to your email.\n\n")
 ;;   Option and should not be modified by the code.  add-to-list is
 ;;   called in several places. One way to handle that is to have a new
 ;;   ordinary variable that gets its initial value from
-;;   tramp-default-user-alist and then is added to. (Pete Forman)
+;;   tramp-default-user-alist and then is added to.  (Pete Forman)
 
 ;; arch-tag: 190d4c33-76bb-4e99-8b6f-71741f23d98c
 ;;; tramp-cmds.el ends here