diff options
| author | Roland McGrath | 1995-06-08 13:03:15 +0000 |
|---|---|---|
| committer | Roland McGrath | 1995-06-08 13:03:15 +0000 |
| commit | 965f7ac9c14aee503be09b8b27eb9dc745ccad89 (patch) | |
| tree | 0d1c753721f14a41bc828129d73d6a373dc58e0f | |
| parent | eaac2be133ec866b67ef345e8a3f317916e77598 (diff) | |
| download | emacs-965f7ac9c14aee503be09b8b27eb9dc745ccad89.tar.gz emacs-965f7ac9c14aee503be09b8b27eb9dc745ccad89.zip | |
(rlogin): If optional second arg is buffer or string, use that as name.
| -rw-r--r-- | lisp/rlogin.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/rlogin.el b/lisp/rlogin.el index 30a3fcb3f43..c9dd71bd2a0 100644 --- a/lisp/rlogin.el +++ b/lisp/rlogin.el | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | ;; along with this program; if not, write to: The Free Software Foundation, | 20 | ;; along with this program; if not, write to: The Free Software Foundation, |
| 21 | ;; Inc.; 675 Massachusetts Avenue.; Cambridge, MA 02139, USA. | 21 | ;; Inc.; 675 Massachusetts Avenue.; Cambridge, MA 02139, USA. |
| 22 | 22 | ||
| 23 | ;; $Id: rlogin.el,v 1.27 1995/04/07 22:27:24 friedman Exp roland $ | 23 | ;; $Id: rlogin.el,v 1.28 1995/05/12 17:51:12 roland Exp roland $ |
| 24 | 24 | ||
| 25 | ;;; Commentary: | 25 | ;;; Commentary: |
| 26 | 26 | ||
| @@ -105,7 +105,7 @@ this variable is set from that.") | |||
| 105 | (defvar rlogin-history nil) | 105 | (defvar rlogin-history nil) |
| 106 | 106 | ||
| 107 | ;;;###autoload | 107 | ;;;###autoload |
| 108 | (defun rlogin (input-args &optional prefix) | 108 | (defun rlogin (input-args &optional buffer) |
| 109 | "Open a network login connection to HOST via the `rlogin' program. | 109 | "Open a network login connection to HOST via the `rlogin' program. |
| 110 | Input is sent line-at-a-time to the remote connection. | 110 | Input is sent line-at-a-time to the remote connection. |
| 111 | 111 | ||
| @@ -114,6 +114,9 @@ Communication with the remote host is recorded in a buffer `*rlogin-HOST*' | |||
| 114 | If a prefix argument is given and the buffer `*rlogin-HOST*' already exists, | 114 | If a prefix argument is given and the buffer `*rlogin-HOST*' already exists, |
| 115 | a new buffer with a different connection will be made. | 115 | a new buffer with a different connection will be made. |
| 116 | 116 | ||
| 117 | When called from a program, if the optional second argument is a string or | ||
| 118 | buffer, it names the buffer to use. | ||
| 119 | |||
| 117 | The variable `rlogin-program' contains the name of the actual program to | 120 | The variable `rlogin-program' contains the name of the actual program to |
| 118 | run. It can be a relative or absolute path. | 121 | run. It can be a relative or absolute path. |
| 119 | 122 | ||
| @@ -153,9 +156,11 @@ variable." | |||
| 153 | (format "*rlogin-%s@%s*" user host))) | 156 | (format "*rlogin-%s@%s*" user host))) |
| 154 | proc) | 157 | proc) |
| 155 | 158 | ||
| 156 | (cond ((null prefix)) | 159 | (cond ((null buffer)) |
| 157 | ((numberp prefix) | 160 | ((or (stringp buffer) (bufferp buffer)) |
| 158 | (setq buffer-name (format "%s<%d>" buffer-name prefix))) | 161 | (setq buffer-name buffer)) |
| 162 | ((numberp buffer) | ||
| 163 | (setq buffer-name (format "%s<%d>" buffer-name buffer))) | ||
| 159 | (t | 164 | (t |
| 160 | (setq buffer-name (generate-new-buffer-name buffer-name)))) | 165 | (setq buffer-name (generate-new-buffer-name buffer-name)))) |
| 161 | 166 | ||