From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ralf Angeli Newsgroups: gmane.emacs.devel Subject: Re: [cs-usenet@arcor.de: tex-mode: too many _ (underscores) interpreted as subscripts] Date: Sun, 03 Oct 2004 15:52:48 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1096811451 2216 80.91.229.6 (3 Oct 2004 13:50:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 3 Oct 2004 13:50:51 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 03 15:50:45 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CE6lA-0001fT-00 for ; Sun, 03 Oct 2004 15:50:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CE6ri-0004N0-EY for ged-emacs-devel@m.gmane.org; Sun, 03 Oct 2004 09:57:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CE6ra-0004MA-FO for emacs-devel@gnu.org; Sun, 03 Oct 2004 09:57:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CE6rZ-0004LR-2y for emacs-devel@gnu.org; Sun, 03 Oct 2004 09:57:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CE6rY-0004LH-UP for emacs-devel@gnu.org; Sun, 03 Oct 2004 09:57:20 -0400 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CE6kv-0003LD-A0 for emacs-devel@gnu.org; Sun, 03 Oct 2004 09:50:29 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CE6ku-0008LQ-00 for ; Sun, 03 Oct 2004 15:50:28 +0200 Original-Received: from iwi190.iwi.uni-sb.de ([134.96.72.190]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 03 Oct 2004 15:50:28 +0200 Original-Received: from angeli by iwi190.iwi.uni-sb.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 03 Oct 2004 15:50:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-To: emacs-devel@gnu.org Original-Lines: 40 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: iwi190.iwi.uni-sb.de Mail-Copies-To: nobody User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:kebZ9l9kKD4ssRVQSA3e2phwZ10= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27827 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27827 * Richard Stallman (2004-10-03) writes: > Would someone please investigate this bug report and DTRT? > Stefan made these changes, but he hasn't responded to > my mail about this, so I think it is time to look > for someone else. > > From: Christian Schlauer > Subject: tex-mode: too many _ (underscores) interpreted as subscripts > To: emacs-pretest-bug@gnu.org > Date: Fri, 30 Jul 2004 15:21:23 +0200 [...] > The News file of CVS Emacs announces the following for TeX mode: > > *** verbatim environments are now highlighted in courier by font-lock > and super/sub-scripts are made into super/sub-scripts. > > At the moment, it considers too many underscores as subscript > commands. While it leaves \cite{blah99:_long_title} and > \verb+file_name+ alone, it displays the commands > \nolinkurl{file_name_with_underscore.txt} and > \url{file_name_with_underscore.txt} (both available with the hyperref > package, the last one also with url.sty) wrong, that is, the first > letter after an underscore in these commands is transformed into a > subscript. Inhibiting the subscript and superscript fontification is achieved by checking if certain faces are present. So a quick fix, only covering \nolinkurl and \url, would be to add these commands e.g. to the `citations' keywords in `tex-font-lock-keywords-2'. 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. In AUCTeX we are using texmathp.el (which is distributed with AUCTeX) for these purposes. But calls to `texmathp' can get very expensive especially in larger LaTeX files. -- Ralf