October 04, 2006
Emacs and me

There's a discussion going on at the moment concerning refactoring dynamic languages. For whatever reason, its protagonists don't seem to be aware of Phil Dawes' excellent Bicycle Repair Man.

I'd love to give Bicycle Repair Man a go; it looks fab when Phil demos it. but there's one hurdle to get over first - Emacs. And it's a big one.

I've given Emacs a go a couple of times (most recently Aquamacs), and it seems to make sense to me. It's not totally horrid like that nasty vi thing that just beeps at me all the bloody time. No, it's just that the learning curve is steep, and I have real work to do, work that I can accomplish far more easily at the moment using jEdit.

There are loads of tasks that I can achieve really easily using jEdit that I wouldn't even know where to start looking for in Emacs - line sorting, search and replace across a filtered set of files throughout a directory sub-tree, opening files in archives or FTP repositories, HTMlifying, XML re-indenting. I know Emacs can do all this stuff, but I really don't know where to look for it all, and I need to get stuff done.

There are a couple of other jEdit features that I really like and would miss, too. The File System Browser (which I keep docked and open at all times) is a fabulous tool. I like a mouse driven interface for navigating around the file system, and jEdit's is a very powerful one. Also, the combination of the search bar and the hypersearch panel (which I leave on by default and dock at the bottom respectively) is really powerful too. Are there Emacs analogs of these tools?

Oh yes, and I like buffer tabs too.

And before Andy comes in and starts accusing me of being a weak-minded GUI lover, I'm not. I'm getting on fine with bash on the Mac. I'm starting to use awk and sed to do stuff on the command line that are totally impossible via a GUI. (Oh, and thanks for the help on that, Andy.)

So, should I stick with what I know? After all, it's not like I'm using Notepad here - jEdit's very good. Or should I take the pain and try to switch to Emacs? I'd be able to use Bicycle Repair Man!

Posted to Python by Simon Brunning at October 04, 2006 12:34 PM

Try: M-x speedbar

Posted by: Tom on October 4, 2006 02:08 PM

Bicycle Repair Man doesn't requie emacs - it just needs a buffer to run off. You can run it on the command line off a file if you want.

So any editor/IDE that exposes the files you're editing to it's plugins can use Bicycle Repair Man IIRC...

Posted by: Sam Newman on October 4, 2006 02:15 PM

Oooh, so I can integrate BRM into jEdit? Cool - that's a project for me...

Posted by: Simon on October 4, 2006 02:37 PM

Re Speedbar - thanks for that, Tom. It's kind of nice, but it doesn't have jEdit's File System Browser's features - go to buffer's directory, search from here, favorites. Or if it does, I can't see them. Still nice, though, thanks.

Posted by: Simon on October 4, 2006 02:43 PM

BRM is actually available in eclipse via PyDev - http://pydev.sourceforge.net/

Not sure what version of Phil's code it's using though

Posted by: Sam Newman on October 4, 2006 02:45 PM

...which means I might look into BRM for TextMate, if it just needs a buffer.

Posted by: tom armitage on October 4, 2006 03:40 PM

For whatever reason, BRM and Emacs have always been flaky for me. I've tried to figure out why, but have failed. Something will get weird, and it'll be broken until I close and reopen Emacs.

Posted by: Ian Bicking on October 4, 2006 04:32 PM

Yeah the speedbar isnt great (i never use it), but its more than just a filesystem viewer, you can have it list your clases, or debug info, or a variety of other information that makes sense to be exposed in a tree.
I did have the same feelings when i first started using emacs (i had been a jEdit and a vim user in the past), switching from eclipse + cdt (which is getting better, but for a ~7million c++ source base isnt great), so i just forced myself to stick it out for a few weeks, and now i prefer emacs to anything i have ever used. I do tend to program in at least 3 different languages a day (4 if you count shell), so having an editor that does them all is nice (i'm not a fan of the ide + projects model). Most of my work colleagues are visual c++ users, and it appears to be a horrible environment to work with, no one here really likes it, but they dont have anything 'better'. The big win for me with emacs is how well integrated it is with cvs, eclipse comes close here, but everything seems much slower, and back when i used jedit this was quite poor.
Even though i do code a lot in python (our build system, all my automated testing code, and anything i need to prototype externally to our 'one true app'), i havent really used bicyclerepairman, but it does sound pretty sweet, i do _always_ miss something when refactoring.

I would say its worth learning emacs, it is a steep curve (i think it took me about a week before i started feeling at all comfortable), but its just so flexible that you are pretty much set for life once you learn it (as long as you learn at least a little elisp). I've been a die hard emacser for well over 2 years now, and i'm still learning new things that (apology for use of cliche) improve my productivity. It also has tetris.

Posted by: Tom on October 4, 2006 05:19 PM

The problem with Emacs is that you need to drink the kool-aid for a while before you like it...

(Happy emacs user for 5 years now)

Posted by: aadis on October 4, 2006 07:04 PM

Dude, it works with Vim. Specifically this [1] Mac OSX package comes with it 'out of the box'.

Step away from the Emacs.

[1] http://www.macvim.org/

Posted by: Andy Todd on October 5, 2006 12:52 AM

"It's kind of nice, but it doesn't have jEdit's File System Browser's features - go to buffer's directory, search from here, favorites. Or if it does, I can't see them."

I think you are looking for bookmarks, find-dired and find-grep-dired, etc. For any X, the answer to "Does emacs have anything like X?" will be "Yes." You just have to look for it.

The Emacs info manual is extraordinarily complete for such broad functionality. You can also use M-x apropos when you aren't quite sure what the name of something will be.

Posted by: Steve on October 5, 2006 02:02 PM

On an unrelated note, when I go to
I get a 'blank' page - no new blog entries, and the most recent one listed is 'I fought the law'. Is there a bug, or am I doing something wrong?

Posted by: Richard Cook on October 5, 2006 03:33 PM

Works for me. Have you tried hitting refresh?

Posted by: Simon on October 5, 2006 03:57 PM

Clearing my cache did it - but what browser holds a cached page for months? You just have to write more.

Posted by: Richard Cook on October 5, 2006 04:15 PM

In case anyone's interested, David Coffin put together a script that gives you BRM hooks in TextMate. I've turned it into a redistributable bundle: http://e-scribe.com/news/356

Posted by: Paul Bissex on April 15, 2007 07:45 PM
Post a comment

Email Address:



Remember info?