From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.devel Subject: Re: Strange eval-after-load Date: Tue, 4 Jul 2006 17:41:29 -0400 Message-ID: <17578.57481.591256.63483@rgrjr.dyndns.org> References: <20060702133304.GA4008@muc.de> <20060702191851.GA1299@muc.de> <20060703171606.GD2626@muc.de> <20060704150240.GD1316@muc.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1152049323 10217 80.91.229.2 (4 Jul 2006 21:42:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Jul 2006 21:42:03 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 04 23:42:00 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FxseZ-0001uh-1a for ged-emacs-devel@m.gmane.org; Tue, 04 Jul 2006 23:41:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxseY-0001ei-Id for ged-emacs-devel@m.gmane.org; Tue, 04 Jul 2006 17:41:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FxseF-0001XN-5x for emacs-devel@gnu.org; Tue, 04 Jul 2006 17:41:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FxseE-0001Wa-Dj for emacs-devel@gnu.org; Tue, 04 Jul 2006 17:41:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxseE-0001WP-9E for emacs-devel@gnu.org; Tue, 04 Jul 2006 17:41:34 -0400 Original-Received: from [24.128.218.106] (helo=rgrjr.dyndns.org) by monty-python.gnu.org with smtp (Exim 4.52) id 1Fxsry-0006Fl-VS for emacs-devel@gnu.org; Tue, 04 Jul 2006 17:55:47 -0400 Original-Received: (qmail 21591 invoked by uid 500); 4 Jul 2006 21:41:29 -0000 Original-To: rms@gnu.org In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.0.50.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56530 Archived-At: From: Richard Stallman Date: Tue, 04 Jul 2006 16:52:53 -0400 I'm sure this isn't the only such example. As a more general solution (with the idea coming from David Kastrup), how about each "utility" library having an initialisation hook, along the lines of c-initialization-hook? This is a good solution, but since it is a certain amount of work to set this up in each package, we do it only for the packages that need it. Two observations: 1. It seems to me this can be done without any setup work on the part of the package. Suppose the provide routine were changed to run a specified hook, e.g. "foo-provide-hook" if "(provide 'foo)" were executed, and the symbol "foo" was not already on the "features" list? That would seem to be more or less equivalent to eval-after-load, but less magical, and without file synonym issues. (Maybe that's not the best idea for the hook name, but at least there are no "-provide-hook" hits in the codebase at present.) 2. I notice that Fprovide already does something related, but using after-load-alist instead of a per-package hook: /* Run any load-hooks for this file. */ tem = Fassq (feature, Vafter_load_alist); if (CONSP (tem)) Fprogn (XCDR (tem)); (This is documented for after-load-alist, BTW, but not for provide.) But this seems to have semantic problems of its own. What if two packages independently decide to use this mechanism for the same third package? It would be somewhat tricky for them to cooperate. Does this other use of after-load-alist also fall under your injunction not to use eval-after-load without first asking? -- Bob Rogers http://rgrjr.dyndns.org/