From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: cl-macs: default indentation for all arglists with top-level &body Date: Sun, 11 Apr 2021 12:23:45 -0400 Message-ID: References: <87blalt2w9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36692"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: akater Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 11 18:24:53 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVctJ-0009R7-6v for ged-emacs-devel@m.gmane-mx.org; Sun, 11 Apr 2021 18:24:53 +0200 Original-Received: from localhost ([::1]:33232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVctH-0001Yz-GY for ged-emacs-devel@m.gmane-mx.org; Sun, 11 Apr 2021 12:24:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVcsP-00015r-II for emacs-devel@gnu.org; Sun, 11 Apr 2021 12:23:57 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVcsN-0004qA-2B for emacs-devel@gnu.org; Sun, 11 Apr 2021 12:23:56 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A76DE440C17; Sun, 11 Apr 2021 12:23:53 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 06983440BA2; Sun, 11 Apr 2021 12:23:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1618158232; bh=J7ZvC+XtWkdt7kUcaWlco47lO7Uga/Q7P7UEZI8EelI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=IPLO7Yg4cUBwLd9oiA3CgML/1QQ/FcgIaIdv/wyy1tkGi+3GLum0rYw8+uccJzsJ2 s4zxRKkuivAoDZ7nWZSjWYkv41NZSeqOCaHkfOrUHS5QhMRP9aXpFU0gAAau4rwy5Q rlCfYQsX3lgmiOFZr8l2VwWpRsB/7kibI2xcvM9j84gIBXBVKeWfBmhjDjPV6e2fA2 SMcMWYYOOLZYm9jqkN8wpMjEyIMuMzg+nEMWPw1731ot52VoI0pk9YP3qIYkGW9xRW fVgIZ3/FBkxKW9itgU9JQgy21afIsi6J+iHsjkJcWjgUnbmgEQouNKAjm4VoOh0rWc wnrWRdnyPIbFQ== Original-Received: from alfajor (104-222-126-84.cpe.teksavvy.com [104.222.126.84]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C2D931207A5; Sun, 11 Apr 2021 12:23:51 -0400 (EDT) In-Reply-To: <87blalt2w9.fsf@gmail.com> (akater's message of "Sun, 11 Apr 2021 12:35:34 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267898 Archived-At: > ;; Placing the declaration in the end > ;; allows overriding the indentation setting > ;; with an explicit (declare (indent ..)) statement > ;; manually written in the form being expanded. > (setq header > (nconc header > (list > `(declare (indent ,according-to-&body)))))) I see one "problem" with this: it provides the `indent` but not the `debug` spec. Maybe another way to go about it is to try and infer the `indent` spec from the `debug` spec (since I think it's hopeless to try and guess the debug spec from the arglist). > The feature was > - suggested to be applied to usual ~defmacro~ as well > - not implemented as there is no ~&body~ in ~defmacro~ > - apparently shelved and then forgotten about > > I only suggest to alter ~cl-defmacro~. It would clearly be a lot more useful to make it work for `defmacro` as well since the very vast majority of macros are defined with `defmacro`. > As to whether the macro better inject ~(put ..)~ or ~(declare ..)~ form, > my preference is for the latter because FWIW, I think injecting `declare` is cleaner, indeed (but of course it needs to be careful not to override a pre-existing `declare`). Stefan