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 11:56:03 +0200	[thread overview]
Message-ID: <cjtqur$avk$1@sea.gmane.org> (raw)
In-Reply-To: E1CEUcI-0003bS-KF@fencepost.gnu.org

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

>     If this should be fixed for arbitrary LaTeX commands which are not
>     fontified, one would have to check if the underscores in concern are
>     located inside of math environments.
>
> \nolinkurl and \url are not related to math.  Is there an intermediate
> possibility, one that doesn't check specifically for math
> environments, but handles all the constructs that are not related to
> math?

None I know of.

Unescaped underscores can be used in a variety of places; in labels,
references, verbatim commands/environments, math commands/environments
etc.  The current implementation searches for occurences of unescaped
underscores in the buffer and checks for the presence of certain
faces.  If it finds e.g. `tex-verbatim-face', it knows that there is
no math-related content and skips this occurence.  If there is no such
face, it assumes that it is inside of a math command or environment
and fontifies the stuff after the underscore.  This may cause false
fontifications.

If the code wanted to check if the (unfontified) underscore at hand is
part of math content it would have to search for constructs starting
or ending math (that's what `texmathp' does).  So for each underscore
you could end up scanning a large part of the buffer.  A way out of
this could be to scan the buffer linearly from start to end and stop
only at math-related content for the fontification of subscripts and
superscripts.  (Of course, for JIT fontification one would have to
look upwards in the buffer when fontification starts.)

> Meanwhile, why is texmathp so slow?

-- 
Ralf

  reply	other threads:[~2004-10-05  9:56 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 [this message]
2004-10-05 10:16     ` Ralf Angeli
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='cjtqur$avk$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.