emacs-devel
[Top][All Lists]
Advanced

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

RE: when to call provide, first or last?


From: Drew Adams
Subject: RE: when to call provide, first or last?
Date: Mon, 27 Feb 2012 06:05:46 -0800

 
> I'm just trying to clarify what the idiomatic way to use it is.

Put it last, EXCEPT for this situation described in section `(elisp) Named
Features': 

 "Although top-level calls to `require' are evaluated during byte
  compilation, `provide' calls are not.  Therefore, you can ensure that a
  file of definitions is loaded before it is byte-compiled by including a
  `provide' followed by a `require' for the same feature, as in the
  following example.

     (provide 'my-feature)  ; Ignored by byte compiler,
                            ;   evaluated by `load'.
     (require 'my-feature)  ; Evaluated by byte compiler.

  The compiler ignores the `provide', then processes the `require' by
  loading the file in question.  Loading the file does execute the
  `provide' call, so the subsequent `require' call does nothing when the
  file is loaded."

> Maybe a summary of this discussion should be in the manual?

Consider filing a doc bug, after you've reread pertinent parts of the manual and
are still convinced that improvement is in order.





reply via email to

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