help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alternative to (require ...)


From: Eli Zaretskii
Subject: Re: alternative to (require ...)
Date: 24 Feb 2004 19:19:15 +0200

> From: Sam Halliday <address@hidden>
> Newsgroups: gnu.emacs.help
> Date: Tue, 24 Feb 2004 16:32:51 +0000
> 
>   (require 'htmlize)
> 
> but if this package is not installed on the system, emacs bails on loading the
> rest of my ~/.emacs file. this is quite annoying as i like to maintain a 
> single
> ~/.emacs file and use it wherever i am using emacs.
> 
> is there an alternative command i can use, which doesn't result in emacs 
> crying
> if it can't find the package? or at least if there is an "if exists" check i
> could do and incorporate into a wrapper function, say called (requests ...)

Use condition-case.  Here's an example:

(condition-case err
    (require 'saveplace)
  (error
   (message "Cannot save places %s" (cdr err))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]