- 论坛徽章:
- 0
|
原帖由 zengjin8310 于 2006-12-13 15:38 发表
不好意思, 忘记说我emacs版本了, 我用的是emacs22, cywin自带的我是不用的。
win下.emacs没问题的
cywin mount文件:
cygwin-mount.el
google一下, 下的到
你只需要放到 emacs loadpath里面就行, l ...
是不报错误了,可是telnet还是登不上.出错信息是:
Process telnet-x.x.x.x exited abnormally with code 255
是否跟SSH的配置有关?我.emacs的配置如下: (cygwin和emacs都装在c:/myrun/下)
(setq tramp-default-method "ftp")
(load-file "../myemacs/myMenu.el")
;;设置tab为4个空格的宽度,而不是原来的2
(setq default-tab-width 4)
;;设置缺省模式是text,而不是基本模式
(setq default-major-mode 'text-mode)
;;TELNET login
(add-to-list 'load-path "C:/myrun/emacs/ntemacs23/site-lisp")
(setenv "PATH" (concat "C:/myrun/cygwin/bin;" (getenv "PATH")))
(setq exec-path (cons "C:/myrun/cygwin/bin/" exec-path))
(require 'cygwin-mount)
(cygwin-mount-activate)
(add-hook 'comint-output-filter-functions
'shell-strip-ctrl-m nil t)
(add-hook 'comint-output-filter-functions
'comint-watch-for-password-prompt nil t)
(setq explicit-shell-file-name "bash.exe")
;; For subprocesses invoked via the shell
;; (e.g., "shell -c command")
(setq shell-file-name explicit-shell-file-name)
(require 'telnet)
(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)
(if (and buffer (get-buffer-process buffer))
(pop-to-buffer (concat "*" name "*"))
(pop-to-buffer
(apply 'make-comint name telnet-program nil telnet-options))
(setq process (get-buffer-process (current-buffer)))
;;(set-process-filter process 'telnet-initial-filter)
;; 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 telnet-remote-echoes nil)
;;(setq telnet-new-line "\n") ;; needed for cygwin 1.3.11
(setq comint-input-sender 'telnet-simple-send)
(setq telnet-count telnet-initial-count)
(setq comint-process-echoes t)
))) |
|