auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-devel] Re: \\_> in tex-fold


From: Ralf Angeli
Subject: [AUCTeX-devel] Re: \\_> in tex-fold
Date: Sun, 17 Apr 2005 13:06:17 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

* Masayuki Ataka (2005-04-16) writes:

> In tex-fold.el, TeX-fold-region uses \\_> to match `the empty
> string, but only at the end of a symbol'.
>
> (defun TeX-fold-region (start end &optional type)
>  ... (snip)
>                            (t
>                             ;; "\\_>" is only available with Emacs
>                             ;; 21.4 or later (checked into CVS Emacs
>                             ;; on 2004-05-19). (This could be used in
>                             ;; font-latex as well for
>                             ;; `font-latex-match-variable-make' and
>                             ;; friends instead of "\\>" and would fix
>                             ;; issues with starred macros.)
>                             (concat (regexp-quote TeX-esc)
>                                     (regexp-opt item-list t)
>                                     (if (string-match "\\_>" "X")
>                                         "\\_>"
>                                       "address@hidden")))))
>
> (1)
> This comment is not correct, anymore.  "\\_>" is only available
> with Emacs 22, and font-latex does not have
> `font-latex-match-variable-make'.

In some sense it is still there.  The function is generated.

> (2)
> (string-match "\\_>" "")
> => 1
>
> This means
>   $1\leq2$, $1\neq2$, $1\to2$
> are not folded when we set TeX-fold-macro-spec-list for \leq,
> \neq, and \to, respectively.

Hm, the problem is that numbers have word syntax which makes them part
of a symbol.  I think word syntax for numbers generally is correct but
this renders \\_> useless for the task at hand.

> But I don't have good solution to fix issues with starred
> macros without "\\_>" Xp

I think we can simply remove \\_> from the code above.  The
alternative with address@hidden should work as well; even with starred
macros.

-- 
Ralf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]