From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Colin S. Miller" Newsgroups: gmane.emacs.help Subject: Re: Very basic questions. Date: Sat, 16 Sep 2006 19:42:20 +0100 Organization: SunSITE.dk - Supporting Open source Message-ID: <450c4597$0$75038$14726298@news.sunsite.dk> References: <450bdfd3$0$75037$14726298@news.sunsite.dk> <450bf16c$0$75039$14726298@news.sunsite.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1158435644 19511 80.91.229.2 (16 Sep 2006 19:40:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Sep 2006 19:40:44 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 16 21:40:43 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GOg1h-0000mh-IC for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Sep 2006 21:40:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GOg1h-0003Tj-3b for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Sep 2006 15:40:33 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail User-Agent: Thunderbird 1.5.0.5 (X11/20060812) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 67 Original-NNTP-Posting-Host: 62.56.73.25 Original-X-Trace: news.sunsite.dk DXC=3=@D3]oBoKeb>:U6jKdTQlYSB=nbEKnkkgEC[aiI3^@hG1[Bg<0aH5`\VT\m5_SIbfU_42Df:PaKhTcL2h5ahoTokF_>m>CYcVo05M 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:37420 Archived-At: jronald wrote: > Thanks for your patient help. > "Colin S. Miller" >> John, >> >> (require 'feature) loads the package 'feature' into >> Emacs's memory, it doesn't modify the source, >> or pre-compiled package, it just reads them. >> > "require" will find check if the feature already there first, and "provide" > will add a feature to the feature list. > How do they find the feature list? Or how do they know the memory location > where feature list is? > > John, The help for "require", accessed by C-h f require RET states `require' (buffer: *Hyper Apropos*, mode: Hyper-Apropos) Compiled Lisp function, (loaded from "poe"): arguments: (feature &optional filename noerror) If feature FEATURE is not loaded, load it from FILENAME. If FEATURE is not a member of the list `features', then the feature is not loaded; so load the file FILENAME. If FILENAME is omitted, the printname of FEATURE is used as the file name, but in this case `load' insists on adding the suffix `.el' or `.elc'. If the optional third argument NOERROR is non-nil, then return nil if the file is not found. Normally the return value is FEATURE. The variable "features" gives a list of loaded features, there is no list of available, unloaded features. For example, M-: (require 'foobar) reports, after checking each directory listed in the load-path variable. "Error: file-error; Data: (Cannot open load file foobar)" You can use C-h v load-path to obtain a list of the paths that Emacs will search. The keyboard sequence M-: (alt : on most keyboards) allows you to evaluate (run) any lisp expression, here I tried to require a non-existent feature. Each time you call (require) Emacs searches the load-path for a filename matching the feature you are attempting to require. HTH, Colin S. Miller -- Replace the obvious in my email address with the first three letters of the hostname to reply.