From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ilya Zakharevich Newsgroups: gmane.emacs.help Subject: Re: indent-region for long Java strings very slow Date: Thu, 26 Oct 2006 23:12:47 +0000 (UTC) Organization: U.C. Berkeley Math. Department. Message-ID: References: <1161872117.135227.178220@i42g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1161906066 32204 80.91.229.2 (26 Oct 2006 23:41:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 Oct 2006 23:41:06 +0000 (UTC) Bcc: ilya Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 27 01:41:03 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GdEq8-0000xg-PY for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Oct 2006 01:40:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GdEq8-0003fY-3h for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Oct 2006 19:40:48 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!agate.berkeley.edu!ilya Original-Newsgroups: gnu.emacs.help Original-Lines: 20 Original-NNTP-Posting-Host: powdermilk.math.berkeley.edu Original-X-Trace: agate.berkeley.edu 1161904367 54832 169.229.140.13 (26 Oct 2006 23:12:47 GMT) Original-X-Complaints-To: usenet@agate.berkeley.edu Original-NNTP-Posting-Date: Thu, 26 Oct 2006 23:12:47 +0000 (UTC) User-Agent: trn [how to get a version via %-escapes???] with a custom header X-How-To-Reach-Me: The From: address is valid X-How-To-Disable-Cc: Put in the headers the line: Mail-Copies-To: never Originator: ilya@powdermilk.math.berkeley.edu Original-Xref: shelby.stanford.edu gnu.emacs.help:142694 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38314 Archived-At: [A complimentary Cc of this posting was sent to giethomas@gmail.com ], who wrote in article <1161872117.135227.178220@i42g2000cwa.googlegroups.com>: > When I build a very long Java String with lots of components (... + ... > + ... +), spread out over many lines (each terminated by a newline), > indent-region gets very, very slow. > > Anybody any idea why and how to avoid this? I suspect that this indicates c-mode being too dumb to use linear-time indent algorithm. 20 years ago it was acceptable to have quadratic-time indent logic; one could not do better, since parse-partial-sexp was not designed well enough. But I added necessary hooks to parse-partial-sexp (more than?) 10 years ago. Nowadays all the decent modes should have linear-time logic for indent. It looks like c-mode is not decent enough... Puzzled, Ilya