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

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

Re: About features


From: Xue Fuqiao
Subject: Re: About features
Date: Thu, 07 Mar 2013 20:47:50 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3

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



reply via email to

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