Meadow3+tramp+openssh

(以前から書こうと思っていて忘れていたことです。以前=Meadowをバージョンアップした - ヒルズで働く@robarioの技ログ


trampはリモートにあるファイルを直接編集することができるパッケージです。詳しくはググレカス

設定は

(require 'tramp)
(setq tramp-default-method "ssh")
(setcdr (assq 'tramp-login-program (assoc "ssh" tramp-methods)) '("~/bin/f_ssh"))

これだけでOKです。が、f_ssh.exeというものを用意しないといけません。

plink.exeを使う場合はplinkメソッドを使えばOKですが、Cygwinssh.exe(openssh)を使う場合はそのままでは動きません。fakecygptyというものが必要になります。詳しくはググレカス
fakecygpty.exeをf_ssh.exeという名前でどこかに置いておきます。上記設定の最後の行では、そのf_sshを使うようにtramp-methodsの"ssh"のtramp-login-programを書き換えています。

fakecygpty.exeはMeadow3に付いてきます。 INSTALL.Meadow.jaにある通りにすれば、f_ssh.exeも用意しなくて良いです。
(require 'tramp)
(setq mw32-process-wrapper-alist '(("/\\(bash\\|tcsh\\|svn\\|ssh\\|gpg[esvk]?\\)\\.exe" . (nil . ("fakecygpty.exe")))))
これでssh系(インラインメソッド)は使えます。 scp系はできなかった。mw32-process-wrapper-alistにscpを追加してもダメ。 多分tramp内部での処理で、コピー先のパスに「:(コロン)」が入ってるからだと思う。 TRAMP User Manual に書いてあった。
If you wish to use the scpx connection method, then you might have the problem that GNU Emacs calls scp with a Windows filename such as c:/foo. The Cygwin version of scp does not know about Windows filenames and interprets this as a remote filename on the host c.
("fakecygpty.exe" . set-process-connection-type-pty)にしたら動きませんでした。