From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.devel Subject: Re: Weird &key arglists in ibuf-macs.el Date: Mon, 10 May 2004 16:11:08 +0100 Organization: funfunfun Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20040510142830.5C84.JMBARRANQUERO@wke.es> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084203822 26118 80.91.224.253 (10 May 2004 15:43:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 May 2004 15:43:42 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon May 10 17:43:18 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNCw1-0004O9-00 for ; Mon, 10 May 2004 17:43:17 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNCw1-00046m-00 for ; Mon, 10 May 2004 17:43:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BNCpR-0000sT-FV for emacs-devel@quimby.gnus.org; Mon, 10 May 2004 11:36:29 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.33) id 1BNCf8-00073e-Gp for emacs-devel@gnu.org; Mon, 10 May 2004 11:25:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.33) id 1BNCR1-0003fz-Vb for emacs-devel@gnu.org; Mon, 10 May 2004 11:11:54 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BNCQx-0003et-2K for emacs-devel@gnu.org; Mon, 10 May 2004 11:11:14 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BNCQw-0006k1-00 for ; Mon, 10 May 2004 17:11:10 +0200 Original-Received: from vegetable.demon.co.uk ([80.177.16.3]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 May 2004 17:11:10 +0200 Original-Received: from wence by vegetable.demon.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 May 2004 17:11:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-To: emacs-devel@gnu.org Original-Lines: 50 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: vegetable.demon.co.uk X-No-Yes: No Mail-Copies-To: nobody User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 Cancel-Lock: sha1:14uBKUsm1DSnUsQ9VtRv6bCiWUo= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23044 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23044 Juanma Barranquero wrote: > ibuf-macs.el contains a few macros with CL-style arglists of the form > (defmacro* macro1 (arg1 arg2 (&key arg3 arg4)...) > instead of > (defmacro* macro1 (arg1 arg2 &key arg3 arg4...) > I'm not sure that's a legal CL lambda list It is legal, see section 3.4.4.1 of the hyperspec . | Anywhere in a macro lambda list where a parameter name can | appear, and where ordinary lambda list syntax (as described in | Section 3.4.1 (Ordinary Lambda Lists)) does not otherwise allow | a list, a destructuring lambda list can appear in place of the | parameter name. When this is done, then the argument that would | match the parameter is treated as a (possibly dotted) list, to | be used as an argument list for satisfying the parameters in the | embedded lambda list. This is known as destructuring. It's often used for with-FOO type macros, e.g. (defmacro* with-foo ((&key x y z &rest stuff) &body more-stuff) ...) allowing (with-foo (:x x :y y :z z (more-stuff)) (doing-more-stuff)) > help-make-usage and company don't grok them: > ELISP> (documentation (defmacro* test1 (arg1 &key arg2) "No doc")) > "No doc\n\n(fn ARG1 &key ARG2)" > ELISP> (documentation (defmacro* test1 (arg1 (&key arg2)) "No doc")) > "No doc\n\n(fn ARG1 (&KEY arg2))" The thing to do here is to explicitly write the arglist in the end of the docstring. (documentation (defmacro* test1 (arg1 (&key arg2)) "No doc\n\n(fn ARG1 (&key ARG2))")) => No doc\n\n(fn ARG1 (&key ARG2)) -- Lawrence Mitchell