17 Nov 2010 aleix   » (Journeyer)

ropemacs and remote files (fuse)

This morning I needed to edit some python scripts from a local server at work and, as always, used the TRAMP Emacs mode, but immediately found a problem. A few months ago I installed the great python refactoring library rope and its Emacs mode ropemacs. It comes out that ropemacs asks you for the location of your rope project if it cannot find it (this always happens the first time you start a project).

TRAMP URLs look like this:

/ssh:user@server:/path

So, you can now imagine what happens when Emacs gives an URL like this to rope (which is a python library and doesn’t know anything about TRAMP URLs) as if it was a local file name…

Traceback (most recent call last):
  ...
  ...
  File "/usr/lib/python2.6/.../ropemode/interface.py", line 88, in open_project
    self.project = rope.base.project.Project(root)
  File "/usr/lib/python2.6/.../rope/base/project.py", line 134, in __init__
    os.mkdir(self._address)
OSError: [Errno 2] No such file or directory: '/ssh:user@server:/path'

The worst is that you are continuously being asked by Emacs to enter a valid rope project location.

The solution? Simply use the FUSE SSH Filesystem.

$ sudo apt-get install sshfs
$ sshfs user@server:path mountpoint

FUSE stands for Filesystem in Userspace. With FUSE you will end up editing remote files as if they were in your computer and the great thing is that you don’t need root access, so any user can mount a FUSE filesystem.

Update 2010/11/17: FUSE mounted directory can be unmounted with:

$ fusermount -u mountpoint

Syndicated 2010-11-16 17:27:08 from axelio

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!