I'm running GNU Emacs 20.7.1 (i386-*-nt5.0.2195) using cmdproxy. I'd
like to use 'plink' as an SSH client in *shell* buffers. (And
ultimately with TRAMP, but that's another problem.) plink is part of
PuTTY, from which I got the following suggestion:
Owen Dunn <[EMAIL PROTECTED]> Thu, 01 Mar 2001 10:47:03
> Not tested this, but this bit of emacs lisp was contributed a while
> ago, and allegedly brings up an interactive shell buffer in emacs
> using plink:
> (defun plink (host)
> "Open a network login connection to host named HOST (a string).
> Communication with HOST is recorded in a buffer `*ssh-HOST*'.
> Normally input is edited in Emacs and sent a line at a time."
> (interactive "sOpen ssh connection to host: ")
> (require 'shell)
> (let ((name (concat "ssh-" host))
> (password (comint-read-noecho "password: " t)))
> (pop-to-buffer
> (make-comint name "c:/winnt/plink" nil host "-pw" password))
> (set-process-filter (get-process name) 'telnet-initial-filter)
> (telnet-mode)
> (accept-process-output (get-buffer-process (current-buffer)))
> (send-string (get-buffer-process (current-buffer))
> "stty echo\n")
> (setq telnet-count -16)))
I altered this slightly to avoid the hardcoded executable
* (setq plink-program "plink")
* (defun plink (host)
* "Open a network login connection to host named HOST (a string).
* Communication with HOST is recorded in a buffer `*ssh-HOST*'.
* Normally input is edited in Emacs and sent a line at a time."
* (interactive "sOpen ssh connection to host: ")
* (require 'shell)
* (let ((name (concat "ssh-" host))
* (password (comint-read-noecho "password: " t)))
* (pop-to-buffer (make-comint name
* plink-program nil host "-pw" password))
* (set-process-filter (get-process name) 'telnet-initial-filter)
* (telnet-mode)
* (accept-process-output (get-buffer-process (current-buffer)))
* (send-string (get-buffer-process (current-buffer))
* "stty echo\n")
* (setq telnet-count -16)))
However, I apparently don't have telnet-mode: if I do M-x plink, I get
prompted for hostname, then prompted for password, then
*Backtrace*
> Signaling: (void-function telnet-mode)
> (telnet-mode)
> (let ((name ...) (password ...))
> (pop-to-buffer
> (make-comint name plink-program nil host "-pw" password))
> (set-process-filter (get-process name)
> (quote telnet-initial-filter))
> (telnet-mode)
> (accept-process-output (get-buffer-process ...))
> (send-string (get-buffer-process ...) "stty echo\n")
> (setq telnet-count -16))
> plink("[EMAIL PROTECTED]")
> call-interactively(plink)
> execute-extended-command(nil)
> call-interactively(execute-extended-command)
So I'd like to know:
* Can I avoid telnet-mode? Or should I install it?
* If I can avoid it, how do I fix the code?
* If I should install it, from where can I get it?
Please reply directly to me as well as the list (I'm on the digest),
and TIA, [EMAIL PROTECTED]