A Nice Example of Using Bug-hunter from Sacha

Sacha Chua has a great post on using bug-hunter. She had a problem in her large Emacs configuration file and used bug-hunter to find it. If you’re like me—and apparently Sacha—you won’t use it very often but when you’re trying to track down an issue in your configuration, it’s just what you need. Every time I’ve used it, it found my problem quickly and easily.

For those not familiar with bug-hunter, it works by doing a binary search on your configuration: it loads the first half of your configuration and if the bug appears, it starts over loading the first quarter. If the bug is not present, it starts over loading the second half of the configuration. As with a traditional binary search, it recursively narrows down the line causing the problem until there’s only one left.

Sacha’s use case was a little unusual because the error happened asynchronously not at load time so she patched bug-hunter to capture when the offending application was being set up. Take a look at her post to see the details.

It’s a testament to the flexibility of bug-hunter that Sacha was easily able to coerce it into working for her situation. The usual use of bug-hunter is tracking down why Emacs won’t load but as Sacha’s post shows, it can be helpful in more general situations. The next time you need to figure out what part of your configuration is causing you a problem, you should give bug-hunter a try. It’s a great utility.

This entry was posted in General and tagged . Bookmark the permalink.