[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: latexenc-find-file-coding-system is slow.
From: |
Lute Kamstra |
Subject: |
Re: latexenc-find-file-coding-system is slow. |
Date: |
Fri, 29 Apr 2005 19:19:29 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Arne Jørgensen <address@hidden> writes:
> Stefan Monnier <address@hidden> writes:
[...]
>> - use (re-search-forward "\\\\usepackage\\[\\(.*\\)\\]{inputenc}")
>> and once it matched, check if it's inside a comment. This should be
>> *much* faster because of how the regexp-engine works (basically,
>> it will backtrack much less). The search as it is coded now could very
>> well fail with "regexp stack overflow".
[...]
> Lute Kamstra <address@hidden> writes:
[...]
>> Another idea is to change the regexps and search only for
>> \inputencoding{...} and \usepackage[...]{inputenc} at the start of a
>> line. That's where they typically are. This will speed up the search
>> dramatically.
>
> That would probably be an ok compromise (between what is actually
> legal LaTeX and what is normally used). But the other approaches can
> do the trick I would prefer to avoid this.
You can avoid it by using Stefan's suggestion above. It is probably
faster than my idea, but a bit more work to implement.
Lute.