;;; rlogin.el --- remote login interface
-;; Copyright (C) 1992, 93, 94, 95, 97, 1998, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 2002, 2003, 2004,
+;; 2005 Free Software Foundation, Inc.
;; Author: Noah Friedman
;; Maintainer: Noah Friedman <friedman@splode.com>
;; Keywords: unix, comm
-;; $Id: rlogin.el,v 1.3 2002/03/14 11:51:47 miles Exp $
-
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
(require 'shell)
(defgroup rlogin nil
- "Remote login interface"
+ "Remote login interface."
:group 'processes
:group 'unix)
(let* ((process-connection-type rlogin-process-connection-type)
(args (if rlogin-explicit-args
- (append (rlogin-parse-words input-args)
+ (append (split-string input-args)
rlogin-explicit-args)
- (rlogin-parse-words input-args)))
- (host (car args))
+ (split-string input-args)))
+ (host (let ((tail args))
+ ;; Find first arg that doesn't look like an option.
+ ;; This still loses for args that take values, feh.
+ (while (and tail (= ?- (aref (car tail) 0)))
+ (setq tail (cdr tail)))
+ (car tail)))
(user (or (car (cdr (member "-l" args)))
(user-login-name)))
(buffer-name (if (string= user (user-login-name))
(goto-char orig-point)))))))
\f
-;; Parse a line into its constituent parts (words separated by
-;; whitespace). Return a list of the words.
-(defun rlogin-parse-words (line)
- (let ((list nil)
- (posn 0)
- (match-data (match-data)))
- (while (string-match "[^ \t\n]+" line posn)
- (setq list (cons (substring line (match-beginning 0) (match-end 0))
- list))
- (setq posn (match-end 0)))
- (set-match-data (match-data))
- (nreverse list)))
-
(defun rlogin-send-Ctrl-C ()
(interactive)
(process-send-string nil "\C-c"))
(provide 'rlogin)
+;;; arch-tag: 6e20eabf-feda-40fa-ab40-0d156db447e4
;;; rlogin.el ends here