> re-search-forward("^[^%$]*\\usepackage\\[\\(.*\\)\\]{inputenc}" nil t) ^^ shouldn't this be \\\\ ?
> I guess the re-searching in latexenc-find-file-coding-system needs to > be improved. I see two obvious ways to speed it up: - 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". - don't search through the whole buffer but only though the first part (10K or so) of it. > Since this change, opening a 117k .texi file takes seconds. It used The filename regexp was broken, I've adjusted it so it doesn't get triggered for .texi files. Stefan _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel