unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: David Kastrup <dak@gnu.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Fwd: Bug in lisp indentation
Date: Wed, 18 Jul 2007 00:42:23 -0400	[thread overview]
Message-ID: <E1IB1Ml-0008PK-EK@fencepost.gnu.org> (raw)
In-Reply-To: <864pk3305t.fsf@lola.quinscape.zz> (message from David Kastrup on Tue, 17 Jul 2007 10:27:26 +0200)

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

  parent reply	other threads:[~2007-07-18  4:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-14 18:00 [lenst@lysator.liu.se: Bug in lisp indentation] Richard Stallman
2007-07-14 19:53 ` Bug in lisp indentation Thien-Thi Nguyen
2007-07-14 20:04   ` Stefan Monnier
2007-07-14 20:46     ` Thien-Thi Nguyen
2007-07-15 14:43   ` Lennart Staflin
2007-07-15 17:23     ` Thien-Thi Nguyen
2007-07-16 14:04       ` Lennart Staflin
2007-07-16 14:59         ` Thien-Thi Nguyen
2007-07-14 20:06 ` Thien-Thi Nguyen
2007-07-16  1:49 ` Fwd: " Stefan Monnier
2007-07-17  3:34   ` Richard Stallman
2007-07-17  8:27     ` David Kastrup
2007-07-17 17:00       ` Stefan Monnier
2007-07-18  4:42       ` Richard Stallman [this message]
2007-07-18 18:49         ` Stefan Monnier
2007-07-20 13:42           ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1IB1Ml-0008PK-EK@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).