diff lisp/net/tramp-cmds.el @ 108377:7827d5a5c826

* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if not bound. (tramp-compat-copy-file): Add PRESERVE-SELINUX-CONTEXT. (tramp-compat-funcall): New defmacro. (tramp-compat-line-beginning-position) (tramp-compat-line-end-position) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-file-attributes) (tramp-compat-copy-file, tramp-compat-copy-directory) (tramp-compat-delete-file, tramp-compat-delete-directory) (tramp-compat-number-sequence, tramp-compat-process-running-p) * net/tramp.el (top, with-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (tramp-rfn-eshadow-update-overlay, tramp-handle-set-file-times) (tramp-handle-dired-compress-file, tramp-handle-shell-command) (tramp-completion-mode-p, tramp-check-for-regexp) (tramp-open-connection-setup-interactive-shell) (tramp-compute-multi-hops, tramp-read-passwd, tramp-clear-passwd) (tramp-time-diff, tramp-coding-system-change-eol-conversion) (tramp-set-process-query-on-exit-flag, tramp-unload-tramp) * net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-reporter-dump-variable, tramp-load-report-modules) (tramp-append-tramp-buffers) * net/tramp-gvfs.el (tramp-gvfs-handle-file-selinux-context): Use it. * net/tramp-imap.el (top): Autoload `epg-make-context'.
author Michael Albinus <albinus@detlef>
date Sun, 09 May 2010 21:57:55 +0200
parents 1d1d5d9bd884
children 35f14a2258f3
line wrap: on
line diff
--- a/lisp/net/tramp-cmds.el	Sat May 08 16:51:08 2010 -0400
+++ b/lisp/net/tramp-cmds.el	Sun May 09 21:57:55 2010 +0200
@@ -106,8 +106,7 @@
   (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)
@@ -254,7 +253,7 @@
 			      (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 +282,8 @@
 	(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 +305,14 @@
 	(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 +324,7 @@
 	 (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 +372,10 @@
 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.