Skip to content

idutils

I love hearing the odd details of how other people work. Usually I’m hoping to learn something that will help me be more productive, and, if not, to hear about something delightfully awful, convoluted, and obscure.

Talking to Roland at JavaOne yielded a nice mix of both. One interesting thing is that he uses full-text search on his source and basically (AIUI) doesn’t run grep from inside Emacs. I, on the other hand, was a long-time igrep user, switching to rgrep (new in Emacs 22) recently.

I decided to give Roland’s approach a try.

First I took a look at namazu, since I knew it had some sort of Emacs integration, and because it is packaged in Fedora. Unfortunately it doesn’t seem to understand how to index source code.

So then I tried GNU idutils. I had heard of this years ago, and even tried it once or twice, but somehow it didn’t end up in my repertoire. Anyway, it turns out that this is a pretty nice tool. It isn’t packaged for Fedora, but building it only took a couple minutes. The Emacs support code needed some tweaks (email me if you want this), but works ok enough out of the box.

The result is pretty nice. For small projects it may not matter much, but searches over the code I’m indexing (GCC) are much, much faster. This is especially nice since the work I’m doing on GCC at the moment requires repeated searches for all the users of various global variables.

Idutils could use a little love — right now there’s no way to incrementally update the index, which is a pain. If it affects me enough I suppose I’ll set up a cron job or something using inotify. This is just gloss, though. The important thing is that it has removed a pointless wait from my process.

11 Comments

  1. Ulisses Furquim wrote:

    Hi, have you tried cscope with emacs? It’s very good for C/C++ projects.

    Monday, July 9, 2007 at 12:29 am | Permalink
  2. tom wrote:

    Nope, for some reason I still haven’t tried cscope. I have it installed but I just haven’t gotten around to figuring out how to use it.

    Monday, July 9, 2007 at 3:12 pm | Permalink
  3. tom wrote:

    can you send me the fixed for idtools? cscope is good for the languages it was designed for (C, C++, lex, yacc).
    idtools is more generic and can process a wider range of languages since it is not as specialized.

    Sunday, September 2, 2007 at 2:11 am | Permalink
  4. tom wrote:

    tom — I’ll email you as well, but for others reading here, my patches are all in GNU idutils cvs.

    Sunday, September 2, 2007 at 3:18 am | Permalink
  5. RIchard Dawe wrote:

    I find idutils useful too. I’ve put Fedora 8 packages of idutils CVS here: . I’m going to try to get it accepted into Fedora.

    Saturday, December 8, 2007 at 7:05 am | Permalink
  6. RIchard Dawe wrote:

    The URL to my packages seems to have been stripped out. They’re at yum DOT phekda DOT org / fedora / F8

    Saturday, December 8, 2007 at 7:06 am | Permalink
  7. Jim Blandy wrote:

    I’ve cleaned up the Emacs Lisp support for idutils a bit. But it doesn’t seem like it’s really maintained at all, so I’m not sure where to send the fix.

    Friday, February 29, 2008 at 11:03 pm | Permalink
  8. Jim Blandy wrote:

    Oh — I see from the earlier comment that there are CVS sources somewhere…

    Friday, February 29, 2008 at 11:04 pm | Permalink
  9. tom wrote:

    Yeah — I cleaned up the elisp as well and Jim Meyering checked it in.
    Maybe your cleanup is better than mine :)

    BTW you can M-x package-install-file on the CVS idutils.el and it will DTRT.

    I occasionally contemplate making a new idutils that avoids the really complicated
    database stuff in favor of sqlite or the like, and also allows for incremental updates. I miss the latter feature a lot.

    Saturday, March 1, 2008 at 12:02 am | Permalink
  10. Greg McGary wrote:

    I had a design for incremental update ages ago, but never implemented it. For that matter, I hadn’t done a darn thing with idutils for so many years, I fired myself as maintainer. 8^)

    I never suffered much for lack of incremental update because a full rebuild was quick enough. I guess it’s not quick enough for you, Tom.

    At the time I first wrote it in C (1985), the very compact database format was an important feature. Nowadays, it doesn’t mean much.

    The first incarnation of idutils was written in Bourne shell and produced a text-file database that searchable with a small script wrapped around grep. I recall being inspired by sh examples in Kernighan & Pike’s book _The UNIX Programming Environment_.

    Tuesday, August 12, 2008 at 2:31 am | Permalink
  11. Any idea where to find the original bash version?

    Thursday, November 5, 2009 at 8:15 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*