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

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

Re: require a package only if present


From: Will Parsons
Subject: Re: require a package only if present
Date: 11 Jul 2009 21:42:24 GMT
User-agent: slrn/0.9.8.1 (FreeBSD)

Edward O'Connor wrote:
>
>> I am trying to use the same copy of .emacs across various machines.  
>> Some, however, don't have certain packages. So I need to replace  
>> lines like:
>>
>> (require 'tex-site)
>>
>> with code that checks whether tex-site is present and only loads it  
>> if there. How can I do that? Any pointers welcome.
>
> (require 'tex-site nil t)

I don't believe that works for XEmacs (which may be irrelevant for the OP),
so I use instead:

(when (locate-library "lib-name")
  (require 'lib-name))

-- 
Will


reply via email to

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