[Top][All Lists]

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

Re: latexenc-find-file-coding-system is slow.

From: David Kastrup
Subject: Re: latexenc-find-file-coding-system is slow.
Date: Sat, 30 Apr 2005 10:08:29 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Lute Kamstra <address@hidden> writes:

> Thien-Thi Nguyen <address@hidden> writes:
>> Arne Jørgensen <address@hidden> writes:
>>> Richard Stallman <address@hidden> wrote March 4, 2005:
>>> > We can now install them.  Could you send me the
>>> > latest version of your changes, with change log
>>> > entries?
>>> 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.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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