From: Richard M. Stallman Date: Sun, 12 Mar 1995 18:18:29 +0000 (+0000) Subject: (rlogin): Use pop-to-buffer. X-Git-Tag: emacs-19.34~4881 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=67398f34bbdbd2b8c7096024fd4fdecce664dad8;p=emacs.git (rlogin): Use pop-to-buffer. (same-window-regexps): Add elt to match *rlogin-...* with or without at end. --- 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 @@ ;; along with this program; if not, write to: The Free Software Foundation, ;; Inc.; 675 Massachusetts Avenue.; Cambridge, MA 02139, USA. -;; $Id$ +;; $Id: rlogin.el,v 1.24 1995/02/28 09:51:49 friedman Exp rms $ ;;; Commentary: @@ -100,14 +100,16 @@ this variable is set from that.") (define-key rlogin-mode-map "\C-i" 'rlogin-tab-or-complete))) +;;;###autoload (add-hook 'same-window-regexps "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)") + ;;;###autoload (defun rlogin (input-args &optional prefix) "Open a network login connection to HOST via the `rlogin' program. Input is sent line-at-a-time to the remote connection. -Communication with the remote host is recorded in a buffer *rlogin-HOST* -\(or *rlogin-USER@HOST* if the remote username differs\). -If a prefix argument is given and the buffer *rlogin-HOST* already exists, +Communication with the remote host is recorded in a buffer `*rlogin-HOST*' +\(or `*rlogin-USER@HOST*' if the remote username differs\). +If a prefix argument is given and the buffer `*rlogin-HOST*' already exists, a new buffer with a different connection will be made. The variable `rlogin-program' contains the name of the actual program to @@ -151,21 +153,21 @@ variable." (cond ((and (null prefix) (comint-check-proc buffer-name)) - (switch-to-buffer buffer-name)) + (pop-to-buffer buffer-name)) ;; This next case is done all in the predicate (including side effects - ;; like switch-to-buffer) to avoid extra string consing via multiple + ;; like pop-to-buffer) to avoid extra string consing via multiple ;; concats. ((and (numberp prefix) (let ((bufname (concat buffer-name "<" prefix ">"))) (and (comint-check-proc bufname) - (switch-to-buffer bufname))))) + (pop-to-buffer bufname))))) (t (cond ((numberp prefix) (setq buffer-name (concat buffer-name "<" prefix ">"))) (t (setq buffer-name (generate-new-buffer-name buffer-name)))) - (switch-to-buffer buffer-name) + (pop-to-buffer buffer-name) (comint-exec (current-buffer) buffer-name rlogin-program nil args) (setq proc (get-process buffer-name)) ;; Set process-mark to point-max in case there is text in the