help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Very basic questions.


From: Colin S. Miller
Subject: Re: Very basic questions.
Date: Sat, 16 Sep 2006 19:42:20 +0100
User-agent: Thunderbird 1.5.0.5 (X11/20060812)

jronald wrote:
Thanks for your patient help.
"Colin S. Miller" <no-spam-thank-you@csmiller.demon.co.uk>
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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]