From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Strange eval-after-load Date: Mon, 3 Jul 2006 11:57:28 +0100 Message-ID: <20060703105727.GA2626@muc.de> References: <20060702133304.GA4008@muc.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1151920865 7150 80.91.229.2 (3 Jul 2006 10:01:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Jul 2006 10:01:05 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 03 12:00:59 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 1FxLEW-0005Gg-Tm for ged-emacs-devel@m.gmane.org; Mon, 03 Jul 2006 12:00:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxLEW-00019a-Fg for ged-emacs-devel@m.gmane.org; Mon, 03 Jul 2006 06:00:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FxLDk-0000ue-8V for emacs-devel@gnu.org; Mon, 03 Jul 2006 06:00:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FxLDi-0000sI-1G for emacs-devel@gnu.org; Mon, 03 Jul 2006 05:59:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxLDh-0000s5-NK for emacs-devel@gnu.org; Mon, 03 Jul 2006 05:59:57 -0400 Original-Received: from [193.149.48.1] (helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FxLR7-0000LD-Gs for emacs-devel@gnu.org; Mon, 03 Jul 2006 06:13:49 -0400 Original-Received: (qmail 2376 invoked from network); 3 Jul 2006 09:59:51 -0000 Original-Received: from acm.muc.de (HELO localhost.localdomain) (Debian-exim@193.149.49.134) by mail.muc.de with SMTP; 3 Jul 2006 09:59:51 -0000 Original-Received: from acm by localhost.localdomain with local (Exim 4.50) id 1FxM7M-0000nA-1O; Mon, 03 Jul 2006 11:57:28 +0100 Original-To: Richard Stallman Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i 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:56410 Archived-At: Morning, Richard! On Sun, Jul 02, 2006 at 06:30:55PM -0400, Richard Stallman wrote: > > Starting immediately, please do NOT install calls to eval-after-load > > in Emacs without asking for my specific approval. > > I would beg you not to be so dogmatic. > This rule is the only way to get control over the situation. I don't really understand what the situation is over which control has to be got. It is possible to to use eval-after-load badly, just as it is possible to use goto badly. That's a far cry from demonstrating that all e-a-l's/goto's are bad. > For example, in > cc-defs.el, we have: > > ;; Make edebug understand the macros. > (eval-after-load "edebug" > '(progn > (def-edebug-spec cc-eval-when-compile t) > (def-edebug-spec c-point t) > Isn't there now a defun feature for doing this? There is, and thanks to Thi for telling me about it. However, this new `declare' feature in defmacro seems to be a bit ad-hoc. Since it doesn't exist in older Emacsen, it's not suitable for packages like CC Mode, which will continue to need edebugging on these other (X)Emacsen. I really don't want to contemplate anything like a macro `meta-macro' where (meta-macro c-lang-defvar ...... t) would expand to a `defmacro' containing a `declare' in Emacs 22, and to a `defmacro' followed by `(eval-after-load "edebug" ...)' in other Emacsen. I can't see any other way around this problem. I absolutely do not want to take these `(eval-after-load "edebug" ...)'s out of CC Mode, because it would create so much hassle for no gain that I can see (and I'll admit I'm struggling to keep up with all the work on CC Mode as it is). However, the main point of that example from cc-defs.el was not to plead it as a special case, but to demonstrate the existence of a good use of eval-after-load. Nobody, not even yourself, has said that that code snippet is intrinsically bad. There will surely be other uses of eval-after-load which are just as useful and necessary. Rather than banning eval-after-load, why not formulate when it is acceptable to use it, and put this advice into the Elisp manual? -- Alan.