From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: alternative to (require ...) Date: 24 Feb 2004 19:19:15 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <20040224163251.5739e4cd@deasker> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1077643415 14797 80.91.224.253 (24 Feb 2004 17:23:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2004 17:23:35 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 24 18:23:14 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvgH4-0004mv-00 for ; Tue, 24 Feb 2004 18:23:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvgH0-0004Nz-Vh for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Feb 2004 12:23:11 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AvgEm-0003a1-Gz for help-gnu-emacs@gnu.org; Tue, 24 Feb 2004 12:20:52 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AvgBh-0001XH-LV for help-gnu-emacs@gnu.org; Tue, 24 Feb 2004 12:18:13 -0500 Original-Received: from [207.232.27.5] (helo=WST0054) by monty-python.gnu.org with asmtp (Exim 4.30) id 1AvgBg-0001VZ-OP for help-gnu-emacs@gnu.org; Tue, 24 Feb 2004 12:17:41 -0500 Original-To: help-gnu-emacs@gnu.org In-reply-to: <20040224163251.5739e4cd@deasker> (message from Sam Halliday on Tue, 24 Feb 2004 16:32:51 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:17152 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17152 > From: Sam Halliday > 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))))