Reinstalling Packages

Bozhidar Batsov over at Emacs Redux, has got another useful bit of Elisp to help clean up packages that may not have been compiled correctly. This sometimes happens to me when I update a package with package.el. The idea is to unload the function, reinstall it, and then load it again.

Batsov’s packages his Elisp as a simple function. It’s not especially user friendly because it can’t be called interactively so he provides another function that you can call with the usual Meta+x mechanism and choose the package through the completing-read function.

As Batsov says, this probably isn’t something that you’re going to need very often so you might not want to clutter up your configuration with it if you worry about such things. Even if that’s the case, you can just call the three commands separately. The require function isn’t interactive but it’s easy to call from the minibuffer with eval-expression, usually bound to Meta+:.

If you’re the type of person who hates to restart Emacs, this can be an easy way to resolve update problems without having to start over with your Emacs instance. I’ve added the interactive version to my config but haven’t needed it yet. We’ll see how it goes.

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