From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Incorrect indentation after :name Date: Thu, 07 Jul 2005 01:36:57 -0400 Message-ID: References: <42C80B48.3080103@student.lu.se> <87r7edhlsu.fsf-monnier+emacs@gnu.org> <85oe9hvih7.fsf@junk.nocrew.org> <85vf3pt4v2.fsf@junk.nocrew.org> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1120716513 7169 80.91.229.2 (7 Jul 2005 06:08:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2005 06:08:33 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 07 08:08:32 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DqPYi-000692-TF for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2005 08:08:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DqPa4-0000wf-Bp for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2005 02:09:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DqPLI-0004jp-Nc for emacs-devel@gnu.org; Thu, 07 Jul 2005 01:54:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DqPL4-0004bG-6t for emacs-devel@gnu.org; Thu, 07 Jul 2005 01:54:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DqPL1-0004SV-Mf for emacs-devel@gnu.org; Thu, 07 Jul 2005 01:54:19 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DqPCz-0001bc-W6 for emacs-devel@gnu.org; Thu, 07 Jul 2005 01:46:02 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DqP4D-00053R-Sp; Thu, 07 Jul 2005 01:36:57 -0400 Original-To: Lars Brinkhoff In-reply-to: <85vf3pt4v2.fsf@junk.nocrew.org> (message from Lars Brinkhoff on Tue, 05 Jul 2005 21:44:33 +0200) 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:40531 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40531 The code works by checking the position of &body inside the macro argument list, and setting the lisp-indent-function property of the macro name to that number. It is clever, and adapting it to macros that are not loaded would not be easy. Meanwhile, the (declare (indent ...)) construct has the same problem. It is part of the macro definition, so it won't be available unless the macro is loaded. For macros that aren't standardly loaded, explicitly putting on a lisp-indent-function property was better in that it could be available when the macro isn't. However, we could make autoload.el, when a defmacro is autoloaded, generate a form that puts the appropriate property onto the macro name. That could go in loaddefs. It could look for a `declare' form, and if there is none, it could then try your approach of looking for &body. We could also put code like this into the standard definition of defmacro, in eval.c, for use on non-autoloaded macros. (You made the change in the cl version of defmacro. That version that is not normally used.) Want to do this?