From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Will Parsons Newsgroups: gmane.emacs.help Subject: Re: require a package only if present Date: 11 Jul 2009 21:42:24 GMT Message-ID: References: Reply-To: ellenophilos@yahoo.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1247352045 31800 80.91.229.12 (11 Jul 2009 22:40:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Jul 2009 22:40:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 12 00:40:38 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MPlFG-0000GQ-5q for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Jul 2009 00:40:38 +0200 Original-Received: from localhost ([127.0.0.1]:39772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPlFF-0002iL-Aj for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Jul 2009 18:40:37 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Original-X-Trace: individual.net PDP6qbOoq64MWoVczvSHIQ4rm1pq2TfdyEgruPaL5SI/+DC2uv Cancel-Lock: sha1:s/WzXN461VigAQUM6M3YGQO6QAU= User-Agent: slrn/0.9.8.1 (FreeBSD) Original-Xref: news.stanford.edu gnu.emacs.help:170768 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65969 Archived-At: 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