emacs-devel
[Top][All Lists]
Advanced

[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: Sun, 01 May 2005 13:08:26 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

David Kastrup <address@hidden> 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)




reply via email to

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