From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: gerd.moellmann@t-online.de (Gerd Moellmann) Newsgroups: gmane.emacs.devel Subject: Re: Declarations in macro definitions Date: 20 Mar 2002 13:11:29 +0100 Sender: emacs-devel-admin@gnu.org Message-ID: <86k7s7qw0e.fsf@gerd.dnsq.org> References: <86g02zqsp0.fsf@gerd.dnsq.org> <200203180905.g2I95ic08431@wijiji.santafe.edu> <86y9goxm0l.fsf@gerd.dnsq.org> <200203192218.g2JMIsY08758@rum.cs.yale.edu> Reply-To: gerd@gnu.org NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1016665998 17114 127.0.0.1 (20 Mar 2002 23:13:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 20 Mar 2002 23:13:18 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16npGg-0004Rv-00 for ; Thu, 21 Mar 2002 00:13:18 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16npMd-0006a5-00 for ; Thu, 21 Mar 2002 00:19:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16npGY-0007Um-00; Wed, 20 Mar 2002 18:13:10 -0500 Original-Received: from delysid.gnu.org ([158.121.106.20]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16noY9-00081Y-00; Wed, 20 Mar 2002 17:27:17 -0500 Original-Received: from mailout04.sul.t-online.com ([194.25.134.18]) by delysid.gnu.org with esmtp (Exim 3.34 #2) id 16ng9r-0005ZI-00; Wed, 20 Mar 2002 08:29:39 -0500 Original-Received: from fwd01.sul.t-online.de by mailout04.sul.t-online.com with smtp id 16newQ-0008MR-06; Wed, 20 Mar 2002 13:11:42 +0100 Original-Received: from gerd.dnsq.org (520015515780-0001@[80.130.127.31]) by fwd01.sul.t-online.com with esmtp id 16newG-0SQdUmC; Wed, 20 Mar 2002 13:11:32 +0100 Original-Received: (from gerd@localhost) by gerd.dnsq.org (8.11.6/8.11.6) id g2KCBU000970; Wed, 20 Mar 2002 13:11:30 +0100 (CET) (envelope-from gerd@gnu.org) X-Authentication-Warning: gerd.dnsq.org: gerd set sender to gerd@gnu.org using -f Original-To: "Stefan Monnier" In-Reply-To: <200203192218.g2JMIsY08758@rum.cs.yale.edu> Original-Lines: 37 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 X-Sender: 520015515780-0001@t-dialin.net Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2062 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2062 > > In that case I guess my patch won't be needed. > > I don't think that there is anything already installed that does what > you patch does. Maybe someone has been working on this, but at least > I haven't heard anything conclusive. In case the patch might be useful anyway---I see that I forgot to send the diff for bytecomp.el (the thing would be pretty useless if it didn't work with compiled code :-). Here it is: *** bytecomp.el 2002/03/13 23:05:30 2.94 --- bytecomp.el 2002/03/20 12:06:35 *************** *** 1980,1985 **** --- 1980,2001 ---- (stringp (car-safe (cdr-safe (cdr-safe body))))) (byte-compile-warn "probable `\"' without `\\' in doc string of %s" (nth 1 form)))) + + ;; Generate code for declarations in macro definitions. + ;; Remove declarations from the body of the macro definition. + (when macrop + (let ((tail (nthcdr 2 form))) + (when (stringp (car (cdr tail))) + (setq tail (cdr tail))) + (while (and (consp (car (cdr tail))) + (eq (car (car (cdr tail))) 'declare)) + (let ((declaration (car (cdr tail)))) + (setcdr tail (cdr (cdr tail))) + (princ `(if macro-declaration-function + (funcall macro-declaration-function + ',name ',declaration)) + outbuffer))))) + (let* ((new-one (byte-compile-lambda (cons 'lambda (nthcdr 2 form)))) (code (byte-compile-byte-code-maker new-one))) (if this-one _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel