emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/telnet.el [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/net/telnet.el [emacs-unicode-2]
Date: Mon, 28 Jun 2004 04:36:29 -0400

Index: emacs/lisp/net/telnet.el
diff -c emacs/lisp/net/telnet.el:1.5.6.1 emacs/lisp/net/telnet.el:1.5.6.2
*** emacs/lisp/net/telnet.el:1.5.6.1    Fri Apr 16 12:50:33 2004
--- emacs/lisp/net/telnet.el    Mon Jun 28 07:29:49 2004
***************
*** 1,6 ****
  ;;; telnet.el --- run a telnet session from within an Emacs buffer
  
! ;; Copyright (C) 1985, 1988, 1992, 1994 Free Software Foundation, Inc.
  
  ;; Author: William F. Schelter
  ;; Maintainer: FSF
--- 1,6 ----
  ;;; telnet.el --- run a telnet session from within an Emacs buffer
  
! ;; Copyright (C) 1985, 88, 1992, 94, 2004  Free Software Foundation, Inc.
  
  ;; Author: William F. Schelter
  ;; Maintainer: FSF
***************
*** 197,214 ****
  ;;;###autoload (add-hook 'same-window-regexps 
"\\*telnet-.*\\*\\(\\|<[0-9]+>\\)")
  
  ;;;###autoload
! (defun telnet (host)
    "Open a network login connection to host named HOST (a string).
  Communication with HOST is recorded in a buffer `*PROGRAM-HOST*'
  where PROGRAM is the telnet program being used.  This program
  is controlled by the contents of the global variable `telnet-host-properties',
  falling back on the value of the global variable `telnet-program'.
  Normally input is edited in Emacs and sent a line at a time."
!   (interactive "sOpen connection to host: ")
    (let* ((comint-delimiter-argument-list '(?\  ?\t))
         (properties (cdr (assoc host telnet-host-properties)))
         (telnet-program (if properties (car properties) telnet-program))
!          (name (concat telnet-program "-" (comint-arguments host 0 nil) ))
         (buffer (get-buffer (concat "*" name "*")))
         (telnet-options (if (cdr properties) (cons "-l" (cdr properties))))
         process)
--- 197,224 ----
  ;;;###autoload (add-hook 'same-window-regexps 
"\\*telnet-.*\\*\\(\\|<[0-9]+>\\)")
  
  ;;;###autoload
! (defun telnet (host &optional port)
    "Open a network login connection to host named HOST (a string).
+ Optional arg PORT specifies alternative port to connect to.
+ Interactively, use \\[universal-argument] prefix to be prompted for port 
number.
+ 
  Communication with HOST is recorded in a buffer `*PROGRAM-HOST*'
  where PROGRAM is the telnet program being used.  This program
  is controlled by the contents of the global variable `telnet-host-properties',
  falling back on the value of the global variable `telnet-program'.
  Normally input is edited in Emacs and sent a line at a time."
!   (interactive (list (read-string "Open connection to host: ")
!                    (cond
!                     ((null current-prefix-arg) nil)
!                     ((consp current-prefix-arg) (read-string "Port: "))
!                     (t (prefix-numeric-value current-prefix-arg)))))
!   (if (and port (numberp port))
!       (setq port (int-to-string port)))
    (let* ((comint-delimiter-argument-list '(?\  ?\t))
         (properties (cdr (assoc host telnet-host-properties)))
         (telnet-program (if properties (car properties) telnet-program))
!        (hname (if port (concat host ":" port) host))
!          (name (concat telnet-program "-" (comint-arguments hname 0 nil) ))
         (buffer (get-buffer (concat "*" name "*")))
         (telnet-options (if (cdr properties) (cons "-l" (cdr properties))))
         process)
***************
*** 221,249 ****
        ;; Don't send the `open' cmd till telnet is ready for it.
        (accept-process-output process)
        (erase-buffer)
!       (send-string process (concat "open " host "\n"))
        (telnet-mode)
        (setq comint-input-sender 'telnet-simple-send)
        (setq telnet-count telnet-initial-count))))
  
  (put 'telnet-mode 'mode-class 'special)
  
! (defun telnet-mode ()
    "This mode is for using telnet (or rsh) from a buffer to another host.
  It has most of the same commands as comint-mode.
  There is a variable ``telnet-interrupt-string'' which is the character
  sent to try to stop execution of a job on the remote host.
! Data is sent to the remote host when RET is typed.
! 
! \\{telnet-mode-map}
! "
!   (interactive)
!   (comint-mode)
!   (setq major-mode 'telnet-mode
!       mode-name "Telnet"
!       comint-prompt-regexp telnet-prompt-pattern)
!   (use-local-map telnet-mode-map)
!   (run-hooks 'telnet-mode-hook))
  
  ;;;###autoload (add-hook 'same-window-regexps 
"\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")
  
--- 231,252 ----
        ;; Don't send the `open' cmd till telnet is ready for it.
        (accept-process-output process)
        (erase-buffer)
!       (send-string process (concat "open " host
!                                  (if port " " "") (or port "")
!                                  "\n"))
        (telnet-mode)
        (setq comint-input-sender 'telnet-simple-send)
        (setq telnet-count telnet-initial-count))))
  
  (put 'telnet-mode 'mode-class 'special)
  
! (define-derived-mode telnet-mode comint-mode "Telnet"
    "This mode is for using telnet (or rsh) from a buffer to another host.
  It has most of the same commands as comint-mode.
  There is a variable ``telnet-interrupt-string'' which is the character
  sent to try to stop execution of a job on the remote host.
! Data is sent to the remote host when RET is typed."
!   (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern))
  
  ;;;###autoload (add-hook 'same-window-regexps 
"\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]