emacs-devel
[Top][All Lists]
Advanced

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

Re: Is (provide 'foo) at the start good or bad?


From: William Xu
Subject: Re: Is (provide 'foo) at the start good or bad?
Date: Fri, 12 Jun 2009 18:15:55 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (windows-nt)

"Stephen J. Turnbull" <address@hidden> writes:

> Provide at the bottom is an obtuse way to find out
> how much memory you have.  No choice.

Well, seems elisp evaluator detects this quite early, as shown below: 

,----
| Debugger entered--Lisp error: (error "Recursive `require' for feature `a'")
|   require(a)
|   eval-buffer(#<buffer  *load*<8>> nil "q:/.emacs.d/site-lisp/b.el" nil t)  ; 
Reading at buffer position 13
|   .  
|   .  
|   eval-buffer(#<buffer  *load*<2>> nil "q:/.emacs.d/site-lisp/b.el" nil t)  ; 
Reading at buffer position 13
|   load-with-code-conversion("q:/.emacs.d/site-lisp/b.el" 
"q:/.emacs.d/site-lisp/b.el" nil t)
|   require(b)
|   eval-buffer(#<buffer  *load*> nil "q:/.emacs.d/site-lisp/a.el" nil t)  ; 
Reading at buffer position 13
|   load-with-code-conversion("q:/.emacs.d/site-lisp/a.el" 
"q:/.emacs.d/site-lisp/a.el" nil t)
|   require(a)
|   eval((require (quote a)))
|   eval-last-sexp-1(nil)
|   eval-last-sexp(nil)
|   call-interactively(eval-last-sexp nil nil)
`----

So, the most reliable way would be just-in-time requires like you
explained.  Providing at the top might solve some problem, it look likes
a treat.  OTOH, this took me quite a while to figure out what is going
wrong.

-- 
William

http://xwl.appspot.com





reply via email to

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