Ads by Google

Sunday, February 3, 2008

Using bookmarks...finally

Using Emacs for so long I never used bookmarks at all. Nada, not even once in almost 9-10 years. Sure I had read the documentation and knew that it existed. But using it?

Nope.

Bit like ctags. Know what it is about but since I don't program in C, I don't use it all.

Till about a few months back. Told to fix an application written in ksh, Oracle PL-SQL and Syncsort scripts. About 11KLOC lines of code in all.

The first few days I spent time opening many frames and buffers of the same file and it was clunky. I mean, there was a wall of Emacs frames on the taskbar.

There had got to be a better way. Since I had a RSS feed to the RecentChanges page on the Emacswiki site, I got a link about the bookmarks page.

A quick look at the page and then the manual, whipped up the one line change to my .emacs.


(global-set-key (quote [f9]) (quote bookmark-jump))


Setting bookmarks is done by C-x r m and entering a label using a mnemonic. Hint: Use the label latest for the most frequent or current focus of analysis. Then I use F9 to make Emacs prompt for a bookmark, which, by the way, allows tab completion in the minibuffer.

Bookmarks works in Dired buffers too AND tramp setup. Pressing F9 and Emacs prompting me for the password for the remote server is nice. Very nice (Yes, I know I can set the .authinfo or .netrc setup for the passwords)

With bookmarks, my analysis speed went up by an order of magnitude. I was using considerably less buffers, with less screen splitting and was going hither and thither through the code. Not only was my work done faster, I also bookmarked the frequent folders that I used to edit files in.

All in all, bookmarks WILL increase your productivity when you're looking at large code bases.

Those used to ISPF editors on the mainframe will not find this new, as it's very similar to labels. But the bookmarks on the mainframe is limited to the file you're currently editing or viewing. And I don't recollect whether the bookmarks are remembered across session; I think one cannot store those across sessions.

No comments: