From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.devel Subject: Re: latexenc-find-file-coding-system is slow. Date: Sun, 01 May 2005 13:08:26 +0200 Message-ID: <873bt7dx05.fsf@xs4all.nl> References: <87ekcxrbb8.fsf@arnested.dk> <87u0lpye89.fsf_-_@xs4all.nl> <8564y43cw2.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1114945828 28360 80.91.229.2 (1 May 2005 11:10:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 May 2005 11:10:28 +0000 (UTC) Cc: Thien-Thi Nguyen , Arne =?us-ascii?Q?=3D=3Futf-8=3FQ=3FJ=3DC3=3DB8rgensen=3F=3D?= , Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 01 13:10:25 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DSCKs-0008Ot-70 for ged-emacs-devel@m.gmane.org; Sun, 01 May 2005 13:10:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DSCRY-00065r-MB for ged-emacs-devel@m.gmane.org; Sun, 01 May 2005 07:17:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DSCRM-00065c-TM for emacs-devel@gnu.org; Sun, 01 May 2005 07:16:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DSCRM-00065Q-6H for emacs-devel@gnu.org; Sun, 01 May 2005 07:16:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DSCRM-0005pm-44 for emacs-devel@gnu.org; Sun, 01 May 2005 07:16:48 -0400 Original-Received: from [194.109.24.29] (helo=smtp-vbr9.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DSCNr-0005FB-Gx; Sun, 01 May 2005 07:13:11 -0400 Original-Received: from pijl (a80-127-67-124.adsl.xs4all.nl [80.127.67.124]) by smtp-vbr9.xs4all.nl (8.12.11/8.12.11) with ESMTP id j41B8RNn067906; Sun, 1 May 2005 13:08:27 +0200 (CEST) (envelope-from Lute.Kamstra@xs4all.nl) Original-Received: from lute by pijl with local (Exim 3.36 #1 (Debian)) id 1DSCJG-0002Je-00; Sun, 01 May 2005 13:08:26 +0200 Original-To: David Kastrup In-Reply-To: <8564y43cw2.fsf@lola.goethe.zz> (David Kastrup's message of "Sat, 30 Apr 2005 10:08:29 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Original-Lines: 36 X-Virus-Scanned: by XS4ALL Virus Scanner 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:36513 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36513 David Kastrup writes: [...] > 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. For now, I've installed the fix below. Lute. *** lisp/international/latexenc.el 28 Apr 2005 20:58:55 -0000 1.2 --- lisp/international/latexenc.el 1 May 2005 10:49:43 -0000 *************** *** 121,128 **** ;; try to find the coding system in this file (goto-char (point-min)) (if (or ! (re-search-forward "^[^%$]*\\inputencoding{\\(.*\\)}" nil t) ! (re-search-forward "^[^%$]*\\usepackage\\[\\(.*\\)\\]{inputenc}" nil t)) (let* ((match (match-string 1)) (sym (intern match))) (when (latexenc-inputenc-to-coding-system match) --- 121,128 ---- ;; try to find the coding system in this file (goto-char (point-min)) (if (or ! (re-search-forward "^[^%\n]*\\\\inputencoding{\\(.*\\)}" nil t) ! (re-search-forward "^[^%\n]*\\\\usepackage\\[\\(.*\\)\\]{inputenc}" nil t)) (let* ((match (match-string 1)) (sym (intern match))) (when (latexenc-inputenc-to-coding-system match)