diff options
| author | Richard M. Stallman | 1995-03-12 18:18:29 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-03-12 18:18:29 +0000 |
| commit | 67398f34bbdbd2b8c7096024fd4fdecce664dad8 (patch) | |
| tree | afddd9845991cf4d3b1550d809455ff0ece781df | |
| parent | f39c6650e2bc91e8cd323c2fab2ff652fe0f8e8a (diff) | |
| download | emacs-67398f34bbdbd2b8c7096024fd4fdecce664dad8.tar.gz emacs-67398f34bbdbd2b8c7096024fd4fdecce664dad8.zip | |
(rlogin): Use pop-to-buffer.
(same-window-regexps): Add elt to match *rlogin-...*
with or without <N> at end.
| -rw-r--r-- | lisp/rlogin.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/rlogin.el b/lisp/rlogin.el index bef1ecbbd14..a37175cd814 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$ | 23 | ;; $Id: rlogin.el,v 1.24 1995/02/28 09:51:49 friedman Exp rms $ |
| 24 | 24 | ||
| 25 | ;;; Commentary: | 25 | ;;; Commentary: |
| 26 | 26 | ||
| @@ -100,14 +100,16 @@ this variable is set from that.") | |||
| 100 | (define-key rlogin-mode-map "\C-i" 'rlogin-tab-or-complete))) | 100 | (define-key rlogin-mode-map "\C-i" 'rlogin-tab-or-complete))) |
| 101 | 101 | ||
| 102 | 102 | ||
| 103 | ;;;###autoload (add-hook 'same-window-regexps "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)") | ||
| 104 | |||
| 103 | ;;;###autoload | 105 | ;;;###autoload |
| 104 | (defun rlogin (input-args &optional prefix) | 106 | (defun rlogin (input-args &optional prefix) |
| 105 | "Open a network login connection to HOST via the `rlogin' program. | 107 | "Open a network login connection to HOST via the `rlogin' program. |
| 106 | Input is sent line-at-a-time to the remote connection. | 108 | Input is sent line-at-a-time to the remote connection. |
| 107 | 109 | ||
| 108 | Communication with the remote host is recorded in a buffer *rlogin-HOST* | 110 | Communication with the remote host is recorded in a buffer `*rlogin-HOST*' |
| 109 | \(or *rlogin-USER@HOST* if the remote username differs\). | 111 | \(or `*rlogin-USER@HOST*' if the remote username differs\). |
| 110 | If a prefix argument is given and the buffer *rlogin-HOST* already exists, | 112 | If a prefix argument is given and the buffer `*rlogin-HOST*' already exists, |
| 111 | a new buffer with a different connection will be made. | 113 | a new buffer with a different connection will be made. |
| 112 | 114 | ||
| 113 | The variable `rlogin-program' contains the name of the actual program to | 115 | The variable `rlogin-program' contains the name of the actual program to |
| @@ -151,21 +153,21 @@ variable." | |||
| 151 | (cond | 153 | (cond |
| 152 | ((and (null prefix) | 154 | ((and (null prefix) |
| 153 | (comint-check-proc buffer-name)) | 155 | (comint-check-proc buffer-name)) |
| 154 | (switch-to-buffer buffer-name)) | 156 | (pop-to-buffer buffer-name)) |
| 155 | ;; This next case is done all in the predicate (including side effects | 157 | ;; This next case is done all in the predicate (including side effects |
| 156 | ;; like switch-to-buffer) to avoid extra string consing via multiple | 158 | ;; like pop-to-buffer) to avoid extra string consing via multiple |
| 157 | ;; concats. | 159 | ;; concats. |
| 158 | ((and (numberp prefix) | 160 | ((and (numberp prefix) |
| 159 | (let ((bufname (concat buffer-name "<" prefix ">"))) | 161 | (let ((bufname (concat buffer-name "<" prefix ">"))) |
| 160 | (and (comint-check-proc bufname) | 162 | (and (comint-check-proc bufname) |
| 161 | (switch-to-buffer bufname))))) | 163 | (pop-to-buffer bufname))))) |
| 162 | (t | 164 | (t |
| 163 | (cond | 165 | (cond |
| 164 | ((numberp prefix) | 166 | ((numberp prefix) |
| 165 | (setq buffer-name (concat buffer-name "<" prefix ">"))) | 167 | (setq buffer-name (concat buffer-name "<" prefix ">"))) |
| 166 | (t | 168 | (t |
| 167 | (setq buffer-name (generate-new-buffer-name buffer-name)))) | 169 | (setq buffer-name (generate-new-buffer-name buffer-name)))) |
| 168 | (switch-to-buffer buffer-name) | 170 | (pop-to-buffer buffer-name) |
| 169 | (comint-exec (current-buffer) buffer-name rlogin-program nil args) | 171 | (comint-exec (current-buffer) buffer-name rlogin-program nil args) |
| 170 | (setq proc (get-process buffer-name)) | 172 | (setq proc (get-process buffer-name)) |
| 171 | ;; Set process-mark to point-max in case there is text in the | 173 | ;; Set process-mark to point-max in case there is text in the |