emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: Bug in lisp indentation


From: Richard Stallman
Subject: Re: Fwd: Bug in lisp indentation
Date: Wed, 18 Jul 2007 00:42:23 -0400

    > 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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]