From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: latexenc-find-file-coding-system is slow. Date: Sat, 30 Apr 2005 10:08:29 +0200 Message-ID: <8564y43cw2.fsf@lola.goethe.zz> References: <87ekcxrbb8.fsf@arnested.dk> <87u0lpye89.fsf_-_@xs4all.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1114936340 7247 80.91.229.2 (1 May 2005 08:32:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 May 2005 08:32:20 +0000 (UTC) Cc: Thien-Thi Nguyen , Arne =?us-ascii?Q?=3D=3Futf-8=3FQ=3FJ=3DC3=3DB8rgensen=3F=3D?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 01 10:32:17 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DS9s7-0005ro-9k for ged-emacs-devel@m.gmane.org; Sun, 01 May 2005 10:32:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DS9ym-00031m-8G for ged-emacs-devel@m.gmane.org; Sun, 01 May 2005 04:39:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DS9rL-0001ni-Ne for emacs-devel@gnu.org; Sun, 01 May 2005 04:31:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DS9rI-0001mS-Hy for emacs-devel@gnu.org; Sun, 01 May 2005 04:31:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DS9rF-0001lM-7V for emacs-devel@gnu.org; Sun, 01 May 2005 04:31:22 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DS9u6-0005sV-9w for emacs-devel@gnu.org; Sun, 01 May 2005 04:34:18 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1DS9ps-0004An-4H; Sun, 01 May 2005 04:29:56 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 778CA1C46517; Sun, 1 May 2005 10:29:36 +0200 (CEST) Original-To: Lute Kamstra In-Reply-To: <87u0lpye89.fsf_-_@xs4all.nl> (Lute Kamstra's message of "Fri, 29 Apr 2005 14:11:34 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:36510 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36510 Lute Kamstra writes: > Thien-Thi Nguyen writes: > >> Arne J=C3=B8rgensen writes: >> >>> Richard Stallman wrote March 4, 2005: >>>=20 >>> > We can now install them. Could you send me the >>> > latest version of your changes, with change log >>> > entries? >>>=20 >>> So now I'm trying to post to list >> >> i have installed the files w/ the suggested names; >> only modification was to re-indent latexenc.el. > > Since this change, opening a 117k .texi file takes seconds. It used > to take a fraction of a second. I did a debug-on-quit during the wait > a couple of times and that consistently gave me one of these two > backtraces: > > Debugger entered--Lisp error: (quit) > re-search-forward("^[^%$]*\\inputencoding{\\(.*\\)}" nil t) > > Debugger entered--Lisp error: (quit) > re-search-forward("^[^%$]*\\usepackage\\[\\(.*\\)\\]{inputenc}" nil t) > > I guess the re-searching in latexenc-find-file-coding-system needs to > be improved. It simply needs to get limited: if the string is not in the first 3k or so, don't look further for it. However, if a 117k file already takes seconds, this also is a sign that the regular expressions are faulty (even searching the whole file should not take seconds at this size). And it certainly is a bug that the inverted character range contains $ instead of \n: $ is not special in the expression. --=20 David Kastrup, Kriemhildstr. 15, 44793 Bochum