emacs-devel
[Top][All Lists]
Advanced

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

telnet-mode question


From: Miles Bader
Subject: telnet-mode question
Date: 22 Nov 2001 15:25:46 +0900

I'm currently cleaning up telnet-mode, which has suffered a bit of
bit-rot.

One of telnet-mode's "features" is that it looks for keywords in the
initial output from the telnet session, and tries to use them to
customize the session for various different types of hosts.  Here's the
function that does it:

   (defun telnet-check-software-type-initialize (string)
     "Tries to put correct initializations in.  Needs work."
     (let ((case-fold-search t))
       (cond ((string-match "unix" string)
              (setq telnet-prompt-pattern comint-prompt-regexp)
              (setq telnet-new-line "\n"))
             ((string-match "tops-20" string) ;;maybe add telnet-replace-c-g
              (setq telnet-prompt-pattern  "[@>]*"))
             ((string-match "its" string)
              (setq telnet-prompt-pattern  "^[^*>\n]*[*>] *"))
             ((string-match "explorer" string) ;;explorer telnet needs work
              (setq telnet-replace-c-g ?\n))))
     (setq comint-prompt-regexp telnet-prompt-pattern))

As you can see, it's not very clever, and indeed, doesn't work for any
system I use (though they are `unix' systems, they don't mention the
word `Unix' in the login banner etc).

Morever, I don't think any of the `customizations' that it does are
really useful:

   1) All of the non-unix systems it knows about are quite obsolete

   2) I don't think any of the variables it sets are really needed
      anymore:

         `comint-prompt-regexp' is deprecated now, and not used by default
         (anyway, it's only set on TOPS-20 and ITS systems, which are
         rather rare, I suspect :-)

         "Unix" telnet servers seem to work fine with the default value
         of `telnet-new-line' ("\r"), so I'm not sure why it's set.
         [Anyway, doesn't the telnet protocol require sending CR LF for
         newlines, meaning it's the _client_, not the server, that cares
         about the specific character emacs uses to terminate input?]

         Only `telnet-replace-c-g' (which says to delete C-g character
         from the output stream) is potentially still useful -- and
         it's only used for TI [I assume] explorer systems, of which
         any rare remaining units are probably not used as telnet
         servers...

In any case, I propose to get rid of the above function, and all of the
crufty machinery that goes with it (like telnet-replace-c-g).  I will do
so unless someone objects.

Thanks,

-Miles
-- 
Next to fried food, the South has suffered most from oratory.
                        -- Walter Hines Page



reply via email to

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