Path: utzoo!attcan!uunet!littlei!intelisc!omepd!merlyn From: merlyn@intelob (Randal L. Schwartz @ Stonehenge) Newsgroups: comp.emacs Subject: Re: defmacro vs. defun Summary: A simpler solution... Message-ID: <3679@omepd> Date: 26 Jul 88 02:19:53 GMT References: <3910019@eecs.nwu.edu> <24364@think.UUCP> <12443@agate.BERKELEY.EDU> Sender: news@omepd Reply-To: merlyn@intelob (Randal L. Schwartz @ Stonehenge) Organization: Stonehenge; netaccess via BiiN Lines: 50 In-reply-to: weemba@garnet.berkeley.edu (Matthew P Wiener) In article <12443@agate.BERKELEY.EDU>, weemba@garnet (Matthew P Wiener) writes: | In article <24364@think.UUCP>, rlk@think (Robert Krawitz) writes: | >In article <3910019@eecs.nwu.edu>, gore@eecs (Jacob Gore) writes: | >]>I suspect that putting a (require 'cl) followed by a (provide 'cl) at the | >]>top of the cl.el file would solve the compilation problems with that file | >]Won't that cause cl.el to load itself in infinitely? | >Hmm. Probably will, at that. So much for that idea... | | Try | | (condition-case nil (require 'cl) (error)) | (provide 'cl) | | instead. Or, as a little experimentation showed (yes, it is not intuitive, but tested...): (provide 'cl) (require 'cl) Reasons? If file is loaded normally, the provide satisfies the require, and hence no recursion. If the file is byte-compiled without loading first, the provide is ignored, but the require is eval-ed (scan bytecomp.el for require for details), and the file gets loaded. Cool, eh? One version of (eval-when 'compile (FORM)) could be: (require 'FooBar (prog1 "/dev/null" (provide 'FooBar) (if load-in-progress (y-or-n-p "WAS LOADING " ) (y-or-n-p "WAS COMPILING ") ) ) ) where the WAS LOADING is executed at load time, and WAS COMPILING is executed at compile time. Yes, yes, yes, a hack, but it does work. "FooBar" of course is your favorite random string. This, of course, does not work the second time around, but hey, its only Monday. -- Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 on contract to BiiN Technical Publications (for now :-), Hillsboro, Oregon or ...!tektronix!ogcvax!omepd!intelob!merlyn Standard disclaimer: I *am* my employer!