GNU bug report logs - #25309
11.89.8; multi-level script fontification stacks incorrectly

Previous Next

Package: auctex;

Reported by: Gennady Uraltsev <gennady.uraltsev <at> gmail.com>

Date: Sat, 31 Dec 2016 14:14:01 UTC

Severity: normal

Found in version 11.89.8

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #77 received at 25309 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Uwe Brauer <oub <at> mat.ucm.es>
Cc: 25309 <at> debbugs.gnu.org, Gennady Uraltsev <gennady.uraltsev <at> gmail.com>
Subject: Re: bug#25309: 11.89.8;
 multi-level script fontification stacks incorrectly
Date: Mon, 02 Jan 2017 18:47:33 +0100
Uwe Brauer <oub <at> mat.ucm.es> writes:

Hi Uwe,

> I have seen his shots, these are border line cases, which are used very
> little. Look I have written mathematics with latex over the last 25
> years and in countless occasions I have used ^or   but never nested
> expressions and this is also true for the publications and writings I
> have seen in these years. I reckon that 95 % of the people writing
> mathematics never use nested ^. So I could understand your argument if
> there were 50 % non nested and 50 % nested but it is the case.

That might indicate that you are working in a field of math where there
are few exponentiated expressions which are already exponentiated.  But
I don't think that exponents have grown out of vogue in general. ;-)

> Please don't move us back to the middle age.

Come on, reverting this broken feature doesn't move us back to the
middle ages.

>    > There are examples where its completely confusing with
>    > `multi-level' and would definitely make you read something else
>    > than what has been written with `invisible'.
>
> What's about the following compromise:
>
> Remove multi-level, but leave invisible and add to the docstring
> something like
>
> Please note that invisible only works for a simple sub and
> superscripts.  Nested constructions are not supported, in fact those
> can be displayed in a confusing way.

"In fact, those will be displayed in a completely wrong way!" would be
more correct.

> If you need those constructs please do not use the invisible option.

Let's use this compromise: I have already removed the feature but you
are free to put

--8<---------------cut here---------------start------------->8---
(require 'font-latex)
(defun font-latex-match-script-chars (limit)
  (let ((p (point)))
    (and (re-search-forward "[_^]" limit t)
	 (let ((pos (match-beginning 0)))
	   (and (font-latex-faces-present-p 'font-latex-math-face pos)
		(not (font-latex-faces-present-p '(font-lock-constant-face
						   font-lock-builtin-face
						   font-lock-comment-face
						   font-latex-verbatim-face) pos))
		;; Check for backslash quoting
		(not (let ((odd nil)
			   (pos pos))
		       (while (eq (char-before pos) ?\\)
			 (setq pos (1- pos) odd (not odd)))
		       odd)))))))

(add-to-list 'font-latex-keywords-2
	     '(font-latex-match-script-chars
	       (0 '(face font-latex-math-face invisible t)))
	     t)
--8<---------------cut here---------------end--------------->8---

into your ~/.emacs, and then scripts will be hidden again.  (You don't
need to configure `font-latex-fontify-script'.  Just let it on its
default value of t for Emacs.)

Bye,
Tassilo




This bug report was last modified 8 years and 187 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.