# HG changeset patch # User Michael Albinus # Date 1151269503 0 # Node ID 5b1bf37e044dc70ebe6c35eb41a8802b91ea2bc2 # Parent dbe1bcee035797b717ddf876cb89f943c7f6ac6e * net/rcompile.el (remote-compile): Replace ange-ftp based implementation by Tramp functions. Based on a patch published by Marc Abramowitz . * net/tramp.el (tramp-unload-tramp): Provide a doc string. diff -r dbe1bcee0357 -r 5b1bf37e044d lisp/ChangeLog --- a/lisp/ChangeLog Sun Jun 25 03:22:50 2006 +0000 +++ b/lisp/ChangeLog Sun Jun 25 21:05:03 2006 +0000 @@ -1,3 +1,11 @@ +2006-06-25 Michael Albinus + + * net/rcompile.el (remote-compile): Replace ange-ftp based + implementation by Tramp functions. Based on a patch published by + Marc Abramowitz . + + * net/tramp.el (tramp-unload-tramp): Provide a doc string. + 2006-06-24 Yoshinori Koseki * international/fontset.el (setup-default-fontset): Fix a typo in diff -r dbe1bcee0357 -r 5b1bf37e044d lisp/net/rcompile.el --- a/lisp/net/rcompile.el Sun Jun 25 03:22:50 2006 +0000 +++ b/lisp/net/rcompile.el Sun Jun 25 21:05:03 2006 +0000 @@ -115,17 +115,25 @@ ;;;; entry point +;; We use the Tramp internal functions `with-parsed-tramp-file-name' +;; and `tramp-make-tramp-file-name'. Better would be, if there are +;; functions to provide user, host and localname of a remote filename, +;; independent of Tramp's implementation. The function calls are +;; wrapped by `funcall' in order to pacify the byte compiler. +;; ange-ftp check removed, because it is handled also by Tramp. ;;;###autoload (defun remote-compile (host user command) "Compile the current buffer's directory on HOST. Log in as USER. See \\[compile]." (interactive - (let ((parsed (or (and (featurep 'ange-ftp) - (ange-ftp-ftp-name default-directory)))) - host user command prompt) + (let ((parsed (and (featurep 'tramp) + (file-remote-p default-directory))) + host user command prompt l l-host l-user) (if parsed - (setq host (nth 0 parsed) - user (nth 1 parsed)) + (funcall (symbol-function 'with-parsed-tramp-file-name) + default-directory l + (setq host l-host + user l-user)) (setq prompt (if (stringp remote-compile-host) (format "Compile on host (default %s): " remote-compile-host) @@ -155,8 +163,9 @@ (setq remote-compile-user user)) ((null remote-compile-user) (setq remote-compile-user (user-login-name)))) - (let* ((parsed (and (featurep 'ange-ftp) - (ange-ftp-ftp-name default-directory))) + (let* (localname ;; Pacify byte-compiler. + (parsed (and (featurep 'tramp) + (file-remote-p default-directory))) (compile-command (format "%s %s -l %s \"(%scd %s; %s)\"" remote-shell-program @@ -165,16 +174,25 @@ (if remote-compile-run-before (concat remote-compile-run-before "; ") "") - (if parsed (nth 2 parsed) default-directory) + (if parsed + (funcall (symbol-function 'with-parsed-tramp-file-name) + default-directory nil localname) + "") compile-command))) (setq remote-compile-host host) (save-some-buffers nil nil) (compilation-start compile-command) ;; Set comint-file-name-prefix in the compilation buffer so - ;; compilation-parse-errors will find referenced files by ange-ftp. + ;; compilation-parse-errors will find referenced files by Tramp. (with-current-buffer compilation-last-buffer - (set (make-local-variable 'comint-file-name-prefix) - (concat "/" host ":"))))) + (when (featurep 'tramp) + (set (make-local-variable 'comint-file-name-prefix) + (funcall (symbol-function 'tramp-make-tramp-file-name) + nil ;; multi-method. To be removed with Tramp 2.1. + nil + remote-compile-user + remote-compile-host + "")))))) ;;; arch-tag: 2866a132-ece4-4ce9-9f91-ec147f803f73 ;;; rcompile.el ends here diff -r dbe1bcee0357 -r 5b1bf37e044d lisp/net/tramp.el --- a/lisp/net/tramp.el Sun Jun 25 03:22:50 2006 +0000 +++ b/lisp/net/tramp.el Sun Jun 25 21:05:03 2006 +0000 @@ -7591,6 +7591,7 @@ ;; - Cleanup autoloads ;;;###autoload (defun tramp-unload-tramp () + "Discard Tramp from loading remote files." (interactive) ;; When Tramp is not loaded yet, its autoloads are still active. (tramp-unload-file-name-handlers)