From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Fwd: Bug in lisp indentation Date: Wed, 18 Jul 2007 00:42:23 -0400 Message-ID: References: <864pk3305t.fsf@lola.quinscape.zz> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1184733724 10379 80.91.229.12 (18 Jul 2007 04:42:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 Jul 2007 04:42:04 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 18 06:42:02 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IB1ML-0004RQ-SC for ged-emacs-devel@m.gmane.org; Wed, 18 Jul 2007 06:41:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IB1ML-0006PR-5i for ged-emacs-devel@m.gmane.org; Wed, 18 Jul 2007 00:41:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IB1Ln-00069X-E4 for emacs-devel@gnu.org; Wed, 18 Jul 2007 00:41:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IB1Ll-00068i-Ry for emacs-devel@gnu.org; Wed, 18 Jul 2007 00:41:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IB1Ll-00068c-Jv for emacs-devel@gnu.org; Wed, 18 Jul 2007 00:41:21 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IB1Ll-0002dr-7c for emacs-devel@gnu.org; Wed, 18 Jul 2007 00:41:21 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IB1Ml-0008PK-EK; Wed, 18 Jul 2007 00:42:23 -0400 In-reply-to: <864pk3305t.fsf@lola.quinscape.zz> (message from David Kastrup on Tue, 17 Jul 2007 10:27:26 +0200) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:75036 Archived-At: > The main purpose of lisp-indent-region was to optimize reindenting > of regions. This optimization made a big difference, way back when. > Maybe it isn't necessary any more, but I'd like someone to try it > on a not very fast computer and see. Parsing arbitrarily far backward for every line is always going to make for quadratic behavior. I think what takes the time is parsing _down_ from the top of the function. Finding the start of the defun is very fast by comparison, at least for Lisp. The parsing down is quadratic too. The question is whether this is a noticeable delay in practice for common cases. Can someone who uses a slow machine please check that? I think we should try to come up with a general scheme where parsing data can get cached and interpolated easily, so that lisp-indent-region would basically be (let ((indent-cache (make-indent-cache))) (loop through region (indent-line))) It is a good idea in principle. One would need to design this caching system. Would you like to try? If that isn't done, and if just deleting lisp-indent-region leads to annoying slowdowns, then the only other choice is to fix the bug in lisp-indent-region. Would someone please try that?