1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-13 09:30:24 -08:00

* net/rcompile.el (remote-compile): Replace ange-ftp based

implementation by Tramp functions.  Based on a patch published by
Marc Abramowitz <msabramo@gmail.com>.

* net/tramp.el (tramp-unload-tramp): Provide a doc string.
This commit is contained in:
Michael Albinus 2006-06-25 21:05:03 +00:00
parent a3ac22e448
commit 08b1eb21d5
3 changed files with 38 additions and 11 deletions

View file

@ -1,3 +1,11 @@
2006-06-25 Michael Albinus <michael.albinus@gmx.de>
* net/rcompile.el (remote-compile): Replace ange-ftp based
implementation by Tramp functions. Based on a patch published by
Marc Abramowitz <msabramo@gmail.com>.
* net/tramp.el (tramp-unload-tramp): Provide a doc string.
2006-06-24 Yoshinori Koseki <kose@meadowy.org> 2006-06-24 Yoshinori Koseki <kose@meadowy.org>
* international/fontset.el (setup-default-fontset): Fix a typo in * international/fontset.el (setup-default-fontset): Fix a typo in

View file

@ -115,17 +115,25 @@ nil means run no commands."
;;;; entry point ;;;; 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 ;;;###autoload
(defun remote-compile (host user command) (defun remote-compile (host user command)
"Compile the current buffer's directory on HOST. Log in as USER. "Compile the current buffer's directory on HOST. Log in as USER.
See \\[compile]." See \\[compile]."
(interactive (interactive
(let ((parsed (or (and (featurep 'ange-ftp) (let ((parsed (and (featurep 'tramp)
(ange-ftp-ftp-name default-directory)))) (file-remote-p default-directory)))
host user command prompt) host user command prompt l l-host l-user)
(if parsed (if parsed
(setq host (nth 0 parsed) (funcall (symbol-function 'with-parsed-tramp-file-name)
user (nth 1 parsed)) default-directory l
(setq host l-host
user l-user))
(setq prompt (if (stringp remote-compile-host) (setq prompt (if (stringp remote-compile-host)
(format "Compile on host (default %s): " (format "Compile on host (default %s): "
remote-compile-host) remote-compile-host)
@ -155,8 +163,9 @@ See \\[compile]."
(setq remote-compile-user user)) (setq remote-compile-user user))
((null remote-compile-user) ((null remote-compile-user)
(setq remote-compile-user (user-login-name)))) (setq remote-compile-user (user-login-name))))
(let* ((parsed (and (featurep 'ange-ftp) (let* (localname ;; Pacify byte-compiler.
(ange-ftp-ftp-name default-directory))) (parsed (and (featurep 'tramp)
(file-remote-p default-directory)))
(compile-command (compile-command
(format "%s %s -l %s \"(%scd %s; %s)\"" (format "%s %s -l %s \"(%scd %s; %s)\""
remote-shell-program remote-shell-program
@ -165,16 +174,25 @@ See \\[compile]."
(if remote-compile-run-before (if remote-compile-run-before
(concat 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))) compile-command)))
(setq remote-compile-host host) (setq remote-compile-host host)
(save-some-buffers nil nil) (save-some-buffers nil nil)
(compilation-start compile-command) (compilation-start compile-command)
;; Set comint-file-name-prefix in the compilation buffer so ;; 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 (with-current-buffer compilation-last-buffer
(set (make-local-variable 'comint-file-name-prefix) (when (featurep 'tramp)
(concat "/" host ":"))))) (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 ;;; arch-tag: 2866a132-ece4-4ce9-9f91-ec147f803f73
;;; rcompile.el ends here ;;; rcompile.el ends here

View file

@ -7591,6 +7591,7 @@ Therefore, the contents of files might be included in the debug buffer(s).")
;; - Cleanup autoloads ;; - Cleanup autoloads
;;;###autoload ;;;###autoload
(defun tramp-unload-tramp () (defun tramp-unload-tramp ()
"Discard Tramp from loading remote files."
(interactive) (interactive)
;; When Tramp is not loaded yet, its autoloads are still active. ;; When Tramp is not loaded yet, its autoloads are still active.
(tramp-unload-file-name-handlers) (tramp-unload-file-name-handlers)