# HG changeset patch # User Francesco Potort # Date 779975225 0 # Node ID de32691e953c714cf3083c0829ad626f2aeb6dea # Parent 696f213398e8ad50897440273870b6d28559b184 * rlogin.el (rlogin): recognise the `-l user' option to rlogin and let comint and ange-ftp know about the correct home directory. diff -r 696f213398e8 -r de32691e953c lisp/rlogin.el --- 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."