changeset 8917:de32691e953c

* rlogin.el (rlogin): recognise the `-l user' option to rlogin and let comint and ange-ftp know about the correct home directory.
author Francesco Potortì <pot@gnu.org>
date Mon, 19 Sep 1994 11:47:05 +0000
parents 696f213398e8
children 1be99ca9da45
files lisp/rlogin.el
diffstat 1 files changed, 23 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/rlogin.el	Mon Sep 19 05:54:59 1994 +0000
+++ b/lisp/rlogin.el	Mon Sep 19 11:47:05 1994 +0000
@@ -23,7 +23,7 @@
 ;;; Commentary:
 
 ;; Support for remote logins using `rlogin'.
-;; $Id: rlogin.el,v 1.17 1994/02/05 21:13:43 roland Exp friedman $
+;; $Id: rlogin.el,v 1.18 1994/06/16 08:09:34 friedman Exp pot $
 
 ;; If you wish for rlogin mode to prompt you in the minibuffer for
 ;; passwords when a password prompt appears, just enter m-x send-invisible
@@ -87,21 +87,30 @@
 
 The variable `rlogin-explicit-args' is a list of arguments to give to
 the rlogin when starting.  They are added after any arguments given in ARGS."
-  (interactive (list (read-from-minibuffer "rlogin arguments (hostname first): ")
-                     current-prefix-arg))
+  (interactive (list
+		(read-from-minibuffer "rlogin arguments (hostname first): ")
+		current-prefix-arg))
   (let* ((process-connection-type rlogin-process-connection-type)
          (buffer-name (format "*rlogin-%s*" input-args))
          args
+	 host
+	 user
 	 proc
          (old-match-data (match-data)))
     (while (string-match "[ \t]*\\([^ \t]+\\)$" input-args)
-      (setq args 
-            (cons (substring input-args (match-beginning 1) (match-end 1))
-                  args)
+      (setq args (cons (substring input-args
+				  (match-beginning 1) (match-end 1))
+		       args)
             input-args (substring input-args 0 (match-beginning 0))))
     (store-match-data old-match-data)
-    (setq buffer-name (format "*rlogin-%s*" (car args))
-          args (append args rlogin-explicit-args))
+    (setq args (append args rlogin-explicit-args))
+    (setq host (car args))
+    (let ((tmpargs (cdr args)))
+      (while (and tmpargs
+		  (not (string= (car tmpargs) "-l")))
+	(setq tmpargs (cdr tmpargs)))
+      (setq user (car (cdr tmpargs))))
+    (setq buffer-name (format "*rlogin-%s*" host))
     (and prefix (setq buffer-name 
                       (buffer-name (generate-new-buffer buffer-name))))
     (switch-to-buffer buffer-name)
@@ -116,12 +125,15 @@
           (rlogin-mode)
           ;; Set the prefix for filename completion and directory tracking
           ;; to find the remote machine's files by ftp.
-          (setq comint-file-name-prefix (concat "/" (car args) ":"))
+          (setq comint-file-name-prefix (concat "/"
+						(and user (concat user "@"))
+						host ":"))
           (and rlogin-initially-track-cwd
                ;; Presume the user will start in his remote home directory.
                ;; If this is wrong, M-x dirs will fix it.
-               (cd-absolute (concat "/" (car args) ":~/")))))))
-
+               (cd-absolute (concat "/"
+				    (and user (concat user "@"))
+				    host ":~/")))))))
 (defun rlogin-mode ()
   "Set major-mode for rlogin sessions. 
 If `rlogin-mode-hook' is set, run it."