From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: defvar vs setqif.. Date: Mon, 20 May 2002 15:33:22 -0600 (MDT) Sender: emacs-devel-admin@gnu.org Message-ID: <200205202133.g4KLXMI25911@aztec.santafe.edu> References: <1021841986.24318.2803.camel@space-ghost> Reply-To: rms@gnu.org NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1021930553 32071 127.0.0.1 (20 May 2002 21:35:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 20 May 2002 21:35:53 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 179uor-0008LA-00 for ; Mon, 20 May 2002 23:35:53 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 179v2y-0001Pu-00 for ; Mon, 20 May 2002 23:50:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 179upA-0006o1-00; Mon, 20 May 2002 17:36:12 -0400 Original-Received: from pele.santafe.edu ([192.12.12.119]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 179umS-0006Ri-00; Mon, 20 May 2002 17:33:24 -0400 Original-Received: from aztec.santafe.edu (aztec [192.12.12.49]) by pele.santafe.edu (8.11.6+Sun/8.9.3) with ESMTP id g4KLXMm14695; Mon, 20 May 2002 15:33:22 -0600 (MDT) Original-Received: (from rms@localhost) by aztec.santafe.edu (8.10.2+Sun/8.9.3) id g4KLXMI25911; Mon, 20 May 2002 15:33:22 -0600 (MDT) X-Authentication-Warning: aztec.santafe.edu: rms set sender to rms@aztec using -f Original-To: walters@verbum.org In-Reply-To: <1021841986.24318.2803.camel@space-ghost> (message from Colin Walters on 19 May 2002 16:59:46 -0400) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4209 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4209 > An example: my .emacs needs to, say, (add-hook 'foo-mode-hook... ), > but the hook may not be defined, so i (defvar foo-mode-hook) before > this statement. Why do you defvar it? The best solution is to (require 'foo-mode) before adding the hook. That is often a costly solution, because it forces loading of foo-mode.el. If you package always needs foo-mode, the price must be paid anyway. But when it does not always need foo-mode, you should not require it at load time.