From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: debug declaration. Date: Fri, 25 Mar 2005 10:14:38 -0500 Message-ID: References: <87br9a8ijc.fsf@xs4all.nl> <87wtrwf0iq.fsf@xs4all.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1111764056 3303 80.91.229.2 (25 Mar 2005 15:20:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 25 Mar 2005 15:20:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 25 16:20:56 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DEqas-0000Yl-49 for ged-emacs-devel@m.gmane.org; Fri, 25 Mar 2005 16:19:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DEqqN-0004mz-HS for ged-emacs-devel@m.gmane.org; Fri, 25 Mar 2005 10:35:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DEqo0-0002Ab-Hh for emacs-devel@gnu.org; Fri, 25 Mar 2005 10:33:01 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DEqnz-00029d-29 for emacs-devel@gnu.org; Fri, 25 Mar 2005 10:32:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DEqny-00028O-NX for emacs-devel@gnu.org; Fri, 25 Mar 2005 10:32:58 -0500 Original-Received: from [206.47.199.164] (helo=simmts6-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DEqWF-0003DJ-Tn for emacs-devel@gnu.org; Fri, 25 Mar 2005 10:14:40 -0500 Original-Received: from empanada.home ([70.49.83.30]) by simmts6-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050325151439.OOSP1597.simmts6-srv.bellnexxia.net@empanada.home>; Fri, 25 Mar 2005 10:14:39 -0500 Original-Received: by empanada.home (Postfix, from userid 502) id 4B9D34AB088; Fri, 25 Mar 2005 10:14:38 -0500 (EST) Original-To: Lute Kamstra In-Reply-To: <87wtrwf0iq.fsf@xs4all.nl> (Lute Kamstra's message of "Fri, 25 Mar 2005 12:06:05 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:35148 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35148 >> Try (debug (sexp def-form def-form def-form form def-form [&optional stringp])) > This does indeed work. (The brackets are not necessary, are they?) I find it good practice to always use the brackets, but you're right, it's not necessary. > The node "Specification List" in the lisp manual says that def-form > can only be used after &define, however. And when I do that, things > seem to break. Experience proves the doc is wrong. What I found instead is that `form' can't be used after &define. I think the bug is not that things don't work with `&define' but that edebug should burp on a spec that uses both &define and `form' (or `body' for that matter). >> Another option is to evaluate those arguments before you plug them in the >> body of your major mode function, so they're only evaluated once, when >> the major mode is defined, thus reproducing the "pre-macro" behavior. > Considering backward compatibility, that's probably the right thing to do. It also moves more work to macro-expansion time which is good. But beware, it can also break backward compatibility, because now evaluation can take place at byte-compile time. OTOH it's closer to what I meant by "turn it into a macro" (in the comment that prompted you to look into this whole thing). Ideally define-generic-mode should (just like define-derived-mode does) generate stand-alone code which does not require generic.el. Stefan