all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ralf Angeli <angeli@iwi.uni-sb.de>
Subject: Re: [cs-usenet@arcor.de: tex-mode: too many _ (underscores) interpreted as subscripts]
Date: Tue, 05 Oct 2004 12:16:16 +0200	[thread overview]
Message-ID: <cjts4n$e49$1@sea.gmane.org> (raw)
In-Reply-To: E1CEUcI-0003bS-KF@fencepost.gnu.org

[My last mail was sent prematurely.  Here is the rest of the answer.]

* Richard Stallman (2004-10-04) writes:

> Meanwhile, why is texmathp so slow?

It can happen that `texmathp' has to `re-search-backward' through the
whole buffer.  We had a bug report in AUCTeX where a file was supplied
which demonstrated the problem in a highly exaggerated way which lead
to fontification eating up a large amount of CPU resources.  The file
was about 10,000 lines and repeatedly contained

--8<---------------cut here---------------start------------->8---
\newcommand{\mycontent}{\ensuremath{\lambda_{1}}}%
\begin{itemize}%
\item
  \begin{align*}%
    \left\{
      \begin{array}{l}
        b_{c} \text{some long line with $\mycontent$}
      \end{array}
    \right\}
  \end{align*}%
\end{itemize}%
--8<---------------cut here---------------end--------------->8---

`texmathp' tries to limit the backward search by finding empty lines
which may denote a paragraph separation.  In the file there were no
empty lines, so at the end, it had to search all the way up those
10,000 lines for math environments.

The search involves two passes: One for commands and one for
environments.  The closer match is selected.  Currently both passes
can be limited only by the empty-line heuristic.  One could probably
speed the process up by limiting one search by the result of the
other.

-- 
Ralf

  parent reply	other threads:[~2004-10-05 10:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-03  1:19 [cs-usenet@arcor.de: tex-mode: too many _ (underscores) interpreted as subscripts] Richard Stallman
2004-10-03 13:52 ` Ralf Angeli
2004-10-03 19:21   ` Stefan
2004-10-03 19:53   ` Stefan
2004-10-04 15:19   ` Richard Stallman
2004-10-05  9:56     ` Ralf Angeli
2004-10-05 10:16     ` Ralf Angeli [this message]
2004-10-06 17:10       ` Richard Stallman
2004-10-07  9:08         ` Ralf Angeli
2004-10-08 16:05           ` Richard Stallman
2004-10-08 16:33             ` Ralf Angeli
2004-10-08 18:49               ` David Kastrup
2004-10-09 15:43                 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='cjts4n$e49$1@sea.gmane.org' \
    --to=angeli@iwi.uni-sb.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.