From: "Randy W. Sims" Date: 2004-11-14T02:03:12+09:00 Subject: Re: For Emacs Users ... (Was: Trivial trick for looking at complex code) Jim Weirich wrote: > On Friday 12 November 2004 06:30 pm, Hal Fulton wrote: > >>You'd be surprised how helpful this is: >> >> grep -E "^ *(class|module|attr|def)" file.rb > > > Oh, excellent! What a great way to outline your ruby code. > > >>OK, it's not rocket science, but I felt like sharing it. > > > You can also do this in emacs ... > > M-X grep RET grep -n -RE "^ *(class|module|attr|def)" lib RET > > And you will get a grep buffer with the tagged outline. Just middle mouse > click on any line in the grep buffer and emacs will automatically go to that > file and line number. Great for browsing code. In emacs, I like using imenu[1]. I just hold shift while pressing the right mouse button and I get a popup list of all classes and methods. speedbar[2] is nice also, but it unfortunately doesn't have ruby support. 1. 2.