[wellylug] Anyone here use SSH?

Daniel Pittman daniel at rimspace.net
Fri Jun 4 14:52:02 NZST 2010


Grant McLean <grant at mclean.net.nz> writes:
> On Fri, 2010-06-04 at 13:57 +1200, Michael Robinson wrote:
>> On Fri, Jun 04, 2010 at 11:16:46AM +1200, Grant McLean wrote:
>> > Sorry, I may have come across as a bit tetchy there :-)  Often when
>> > people hear about bcvi for the first time they focus on that bit (which
>> > isn't in bcvi it's in the editor) and they respond with something like:
>> > 
>> > "yeah but Vim/Emacs/Gedit/K-whatsit/Eclipse-plugin/etc already does
>> > that"
>> 
>> Actually, emacs *does*, but only sort of.  emacsclient requests emacs
>> open a particular file, and can do that over a TCP connection, which
>> could be proxied via ssh forwarding.  Unfortunately, it only presents
>> the filename, not the file contents as I understand bcvi does
>
> No bcvi doesn't present the file contents, it combines the server name
> and the absolute pathname of the file and creates a URL in a format that
> gvim can open over SSH.
>
> It sounds like a plugin could be used to do the same thing but pass the
> url to emacsclient instead of gvim.

  #!/bin/sh
  # assumes EMACS_SERVER_FILE is already set, and is not actually tested
  host=$(hostname --fqdn)
  user=$(whoami)
  file=$(echo "$1" | sed -e 's/"/\\"/g')
  exec emacsclient -e "(find-file \"/ssh:${user}@${host}:${file}")"

Not actually, y'know, tested or anything, but it should work.
        Daniel
-- 
✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons



More information about the wellylug mailing list