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 13:43:01 +0100
User-agent: Thunderbird 1.5.0.5 (X11/20060812)

jronald wrote:
"Colin S. Miller" <no-spam-thank-you@csmiller.demon.co.uk> ??????:450bdfd3$0$75037$14726298@news.sunsite.dk...
In runtime, how does "require" know where the feature list is? There is only machine code then.

John,

(require 'feature)
searches the paths listed in 'load-path',
this can be added to using (add-path).
It looks for a file called "feature.el" or "feature.elc".


Do you mean that "provide" modifies the files, both .el and .elc? I just can't imagine.
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.

(provide 'feature),
which is at the end of 'feature.el', confirms that the
package "feature" has been loaded; this makes a subsequent
(require 'feature) a no-operation command.

A feature is normally provided by a source file
of the same name as the feature, but can
be provided by a different file, by using
(require 'feature "feature-mode")
In this cause "feature-mode.el" or "feature-mode.elc"
will be loaded, they should have a
(provide 'feature) at the end.


To compile a source package into its .elc,
run (byte-compile-file) on it. This
is done when Emacs is compiled from its sources,
and unless you are writing your own packages,
you shouldn't need to use it.

HTH,
Colin S. Miller


reply via email to

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