Praveen’s Journal

March 29, 2008

Remote file editing on GNU Emacs using TRAMP

Filed under: General — Tags: , , — Praveen Kumar @ 7:54 am

I have been using GNU Emacs for programming for nearly 9 years now. It is exciting to keep discovering new extensions to Emacs throughout. I have heard of Ange-FTP before that can be used for remote file editing using FTP. However, I have never tried remote file editing on a local Emacs session. In most of the scenarios, I was dealing with editing files on the remote machines by invoking Emacs locally on those machines. But this time, I felt that invoking GNU Emacs (22) on my tiny VPS would be an overkill. So, I decided to try out remote file editing from a local Emacs session.

Even though I knew that I can do this with AgneFTP, I didn’t really care to read the info about it as I don’t run FTP on my server. The first hit on Google when I searched about remote file editing on Emacs was TRAMP (Transparent Remote [file] Access, Multiple Protocol). I am using GNU Emacs 23 trunk snapshot. TRAMP is included by default in GNU Emacs 22+. Configuration of TRAMP was quite simple. I had to load the module and set the protocol for remote access. Just a two liner in my .emacs did the trick.

(require 'tramp)
(add-to-list 'tramp-default-method-alist '("praveen.kumar.net.in" "" "ssh"))

The three entries for tramp-default-method-alist element are host, user and protocol. You can fill in the host, the user or both. Another interesting use of TRAMP is editing files as root on local machine. This can be quite handy as well. Take a look at TRAMP user guide for full configuration options. Once I added these lines, I was able to open /home/praveen/.bashrc on my server using the file name as /praveen.kumar.net.in:~/.bashrc in the normal find-file (C-x C-f) function. Happy remote editing!

March 28, 2008

Breaking a long silence!

Filed under: General — Tags: , , — Praveen Kumar @ 10:27 pm

I have been a highly inactive blogger these days. It doesn’t mean that I have too many things to take care of. For some reason, I felt that I lost interest in blogging for some time now. Every week I would have found at least a couple things to write about. I would also start a new post. However, I would end up canceling it after I had typed a few lines. Maybe I turned too lazy to write something. But not anymore! I decided to break the long period of inactivity.

As a part of the new start, I have just upgraded my journal to use Wordpress 2.5. I have also decided to throw away my old clumsy theme. I temporarily use the “Wordpress Classic” theme. I am planning to tweak the same theme to match my color preferences. I am also thinking if I should try modifying the “Wordpress Default” theme to use fluid width and use it. But I won’t be doing it before next weekend. I would reserve a couple of posts to talk about Wordpress 2.5 and my thoughts about Wordpress theming.

What it means is that you (looks like I have at least 10 regular readers of my blog still) would be seeing regular activities in my journal from now on. I am also curious to know about the ones who are subscribed to my feed. If you don’t mind, please leave me a comment. Thanks for your support, readers!

Powered by WordPress