From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: egnarts-ms Newsgroups: gmane.emacs.devel Subject: Re: indentation of functions inside flet Date: Fri, 20 Jan 2012 06:37:55 -0800 (PST) Message-ID: <33174731.post@talk.nabble.com> References: <33173596.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1327075279 25333 80.91.229.12 (20 Jan 2012 16:01:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Jan 2012 16:01:19 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 20 17:01:14 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RoGtt-0001jo-BK for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2012 17:01:13 +0100 Original-Received: from localhost ([::1]:33328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoGts-0001kR-MS for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2012 11:01:12 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoFbO-00072Y-6v for Emacs-devel@gnu.org; Fri, 20 Jan 2012 09:38:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoFbI-0000Vb-ET for Emacs-devel@gnu.org; Fri, 20 Jan 2012 09:38:02 -0500 Original-Received: from sam.nabble.com ([216.139.236.26]:54461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoFbI-0000VX-9b for Emacs-devel@gnu.org; Fri, 20 Jan 2012 09:37:56 -0500 Original-Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RoFbH-0006rQ-DU for Emacs-devel@gnu.org; Fri, 20 Jan 2012 06:37:55 -0800 In-Reply-To: X-Nabble-From: egnartsms@gmail.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 216.139.236.26 X-Mailman-Approved-At: Fri, 20 Jan 2012 11:01:10 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:147776 Archived-At: Stefan Monnier wrote: > >> So it would be nice if Lisp mode indented such function definitions like >> defuns. I wonder, has anyone cared about this before me (I'm sure >> someone >> has) and are there any improvements to the Lisp mode available ? > > It would be nice if CL macros were indented better, I agree. > Note that the way to do it is to put the bulk of the code in cl(-*).el and > only change lisp-mode.el so as to provide hooks that CL needs. > > > Stefan > Basically, what is wrong with the current indentation mechanism is its short-sightedness. We have a possibility to specify how to indent macro forms, by attaching "lisp-indent-function" property to macro symbols, usually with (declare (indent ...)) declaration. But the key moment is this: indentation analysis is limited to only the immediate enclosing list. Once we want to indent at some point, we find out what is the innermost containing sexp, then we take its car and analyze it. So the car of immediate parent fully determines the indentation pattern. No further upward search is performed. For most cases this behavior is perfectly OK, but, as we see, for "flet"-like forms this is not the case. -- View this message in context: http://old.nabble.com/indentation-of-functions-inside-flet-tp33173596p33174731.html Sent from the Emacs - Dev mailing list archive at Nabble.com.