From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.help Subject: Re: About features Date: Thu, 07 Mar 2013 20:47:50 +0800 Organization: The Church of Emacs Message-ID: <51388C76.5010704@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1362660515 28953 80.91.229.3 (7 Mar 2013 12:48:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Mar 2013 12:48:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 07 13:48:56 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UDaFc-00033J-H3 for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Mar 2013 13:48:49 +0100 Original-Received: from localhost ([::1]:39277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDaFG-0006l9-SF for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Mar 2013 07:48:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDaF1-0006k2-JX for help-gnu-emacs@gnu.org; Thu, 07 Mar 2013 07:48:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDaEy-0000kq-T3 for help-gnu-emacs@gnu.org; Thu, 07 Mar 2013 07:48:11 -0500 Original-Received: from mail-pa0-f43.google.com ([209.85.220.43]:40664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDaEy-0000kc-Jt for help-gnu-emacs@gnu.org; Thu, 07 Mar 2013 07:48:08 -0500 Original-Received: by mail-pa0-f43.google.com with SMTP id bh2so449476pad.2 for ; Thu, 07 Mar 2013 04:48:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:organization:user-agent :mime-version:to:subject:content-type:content-transfer-encoding; bh=RALB0ECeInbw+ohA/6ohqqSlTs2qwRb1qqCyo3TcqJQ=; b=nJSFK6nMyWpvL/S360T8YNsyC2Zc+WAxQ6SKMbtfq5ABZGS3Yb1bYGjKPzAzAOOzRM OhkyvBQJB05+IqrAI0bpvkADbpkFe1x/PHh8HThwUZQNdmZEZcV1o0YTQxjtekrVg0z1 Xinh7SCUq2sSvFjGvicpae8uAfR7zNF7aIM52y/W4HEoX4s5OBZPs1ckaZ/Ymd6LDXVn Gm8ya2qkk9qLaCZEcPdX5jup3JL3PUjhFf0o4M64blnVLNI3HzTL/4D+5N/6Cd5SZLc4 H3j4ju5nuroeA5xT/wVyiTTG1xuFqkSIGqyslt6MthieJx18MfJOBnVK9B9b8hDasSKT CdOw== X-Received: by 10.66.7.98 with SMTP id i2mr2690620paa.207.1362660487577; Thu, 07 Mar 2013 04:48:07 -0800 (PST) Original-Received: from [192.168.1.110] ([123.114.124.46]) by mx.google.com with ESMTPS id vq9sm1605877pbc.36.2013.03.07.04.48.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Mar 2013 04:48:06 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.43 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89408 Archived-At: >>>> Why should we use `provide' and `require'? Is >>>> `load'/`load-library'/`load-file' >>>> enough? Thanks. >>> `provide' allows you to `require' unconditionally, but the library/file >>> will >>> only be loaded if necessary. >> Can you explain it more detailed? > Simplifying, it's something like: > (defun require (feature) > (if (not (member feature features)) > (load feature))) > (defun provide (feature) > (if (not (member feature features)) > (push feature features))) > As I said in my earlier response: require won't reload a library if it's > already been loaded, and it uses the features variable to keep track of > which libraries have been loaded this way. I see. Thanks, I misunderstood your meaning before. (My English sucks.) -- Best regards, Xue Fuqiao. http://www.emacswiki.org/emacs/XueFuqiao