Making occur a Bit Smarter

Abo-abo is still blogging up a storm and giving us a daily dose of great Elisp. Someone looking to amass a first rate Emacs configuration could do worse than simply grab abo-abo’s daily posts and integrate them into their .emacs file.

One very nice offering is this bit of Elisp that makes occur a little bit smarter. His code arranges to make any active region the default regular expression for occur unless there’s no region, in which case the symbol at point is used.

He says that these two cases hit about 95% of his invocations of occur. Your mileage may vary, of course, but I’d guess most of us would have a similar success rate. At any rate, it’s a nice optimization and just a few lines so head on over and take a look. I’m definitely going to integrate it into my configuration.

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