optional require in .emacs

In my .emacs I was loading the subversion plugin.

(require 'psvn)

Unfortunately on systems that don’t have the subversion plugin Emacs would barf on this line and stop loading the rest of the .emacs file.

Fortunately someone else had asked a similar question, alternative to (require …), on gnu.emacs.help.

Based on that thread I updated my .emacs with this code.

(condition-case nil
  (require 'psvn)
  (error (message "Subversion plugin unavailable, skipping load ...")))


Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>