Mercurial > emacs
comparison lisp/telnet.el @ 707:e4253da532fb
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Wed, 10 Jun 1992 02:47:07 +0000 |
parents | 7cbd4fcd8b0f |
children | 1ca26ccad38e |
comparison
equal
deleted
inserted
replaced
706:86cb5db0b6c3 | 707:e4253da532fb |
---|---|
1 ;;; telnet.el --- run a telnet session from within an Emacs buffer | 1 ;;; telnet.el --- run a telnet session from within an Emacs buffer |
2 | 2 ;;; Copyright (C) 1985, 1988, 1992 Free Software Foundation, Inc. |
3 ;; Copyright (C) 1985, 1988 Free Software Foundation, Inc. | |
4 | 3 |
5 ;; This file is part of GNU Emacs. | 4 ;; This file is part of GNU Emacs. |
6 | 5 |
7 ;; GNU Emacs is free software; you can redistribute it and/or modify | 6 ;; GNU Emacs is free software; you can redistribute it and/or modify |
8 ;; it under the terms of the GNU General Public License as published by | 7 ;; it under the terms of the GNU General Public License as published by |
9 ;; the Free Software Foundation; either version 1, or (at your option) | 8 ;; the Free Software Foundation; either version 2, or (at your option) |
10 ;; any later version. | 9 ;; any later version. |
11 | 10 |
12 ;; GNU Emacs is distributed in the hope that it will be useful, | 11 ;; GNU Emacs is distributed in the hope that it will be useful, |
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
27 ;; filter is simplistic but should be okay for typical shell usage. | 26 ;; filter is simplistic but should be okay for typical shell usage. |
28 ;; needs hacking if it is going to deal with asynchronous output in a sane | 27 ;; needs hacking if it is going to deal with asynchronous output in a sane |
29 ;; manner | 28 ;; manner |
30 | 29 |
31 (require 'comint) | 30 (require 'comint) |
31 | |
32 (defvar telnet-new-line "\r") | 32 (defvar telnet-new-line "\r") |
33 (defvar telnet-mode-map nil) | 33 (defvar telnet-mode-map nil) |
34 (defvar telnet-prompt-pattern "^[^#$%>]*[#$%>] *") | 34 (defvar telnet-prompt-pattern "^[^#$%>]*[#$%>] *") |
35 (defvar telnet-replace-c-g nil) | 35 (defvar telnet-replace-c-g nil) |
36 (make-variable-buffer-local | 36 (make-variable-buffer-local |
118 (= (point) (point-max))))) | 118 (= (point) (point-max))))) |
119 (save-excursion | 119 (save-excursion |
120 (set-buffer (process-buffer proc)) | 120 (set-buffer (process-buffer proc)) |
121 (goto-char (process-mark proc)) | 121 (goto-char (process-mark proc)) |
122 (let ((now (point))) | 122 (let ((now (point))) |
123 ;; Insert STRING, omitting all C-m characters. | |
123 (let ((index 0) c-m) | 124 (let ((index 0) c-m) |
124 (while (setq c-m (string-match "\C-m" string index)) | 125 (while (setq c-m (string-match "\C-m" string index)) |
125 (insert-before-markers (substring string index c-m)) | 126 (insert-before-markers (substring string index c-m)) |
126 (setq index (1+ c-m))) | 127 (setq index (1+ c-m))) |
127 (insert-before-markers (substring string index))) | 128 (insert-before-markers (substring string index))) |
135 (if at-end | 136 (if at-end |
136 (goto-char (point-max))))) | 137 (goto-char (point-max))))) |
137 | 138 |
138 (defun telnet-send-input () | 139 (defun telnet-send-input () |
139 (interactive) | 140 (interactive) |
140 (comint-send-input telnet-new-line telnet-remote-echoes)) | 141 ; (comint-send-input telnet-new-line telnet-remote-echoes) |
142 (comint-send-input) | |
143 (if telnet-remote-echoes | |
144 (delete-region comint-last-input-start | |
145 comint-last-input-end))) | |
141 | 146 |
142 ;;;###autoload | 147 ;;;###autoload |
143 (defun telnet (arg) | 148 (defun telnet (arg) |
144 "Open a network login connection to host named HOST (a string). | 149 "Open a network login connection to host named HOST (a string). |
145 Communication with HOST is recorded in a buffer *HOST-telnet*. | 150 Communication with HOST is recorded in a buffer *HOST-telnet*. |