auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Minor bug and a few other things


From: Marcin Borkowski
Subject: Re: [AUCTeX-devel] Minor bug and a few other things
Date: Fri, 08 May 2015 00:39:48 +0200

On 2015-04-30, at 21:32, Tassilo Horn <address@hidden> wrote:

> Marcin Borkowski <address@hidden> writes:
>
>>> Do you use SMIE for that (info "(elisp)SMIE")?  It would be very cool
>>> if one could use `forward-sexp'/`backward-sexp' for navigating
>>> (La)TeX code.
>>
>> No, but I'll take a look.  I'm afraid, though, that it might not be
>> enough.  Consider these cases:
>>
>> \bigl( .. \bigr)
>>
>> \bigl[ .. \bigr)
>>
>> \bigl[ .. bigr[    % this is no mistake, some people use this notation!
>>
>> \left\{ .. \right.
>>
>> \bigl\langle .. \bigr)
>>
>> \bigl[ .. \bigr|
>>
>> \langle .. )
>>
>> All the above are valid, paired delimiters.  Can SMIE handle that?
>
> Actually, I don't know either.  It's just that SMIE seems to be the way
> to go if one wants to provide solid indentation and navigation without
> too much effort.  But of course it is possible that SMIE doesn't work in
> our case.
>
> But the above doesn't look too bad to me, at least not so bad that you
> couldn't write it down as grammar.
>
>   BIGL   => '\bigl' OPAREN
>   OPAREN => '(' | '[' | '\langle' | '\{'
>   BIGR   => '\'? 'bigr' CPAREN
>   CPAREN => ')' | '[' | '|'
>   ...

Sorry for the delay - I've been quite busy lately.

The above won't work.  Again, I'm not saying SMIE won't work, but it's
not that simple.  For instance, you can use "right" delimiters with
"\bigl".  For instance, this is not well-paired:

\lbrack ... \lbrack

but this is:

\bigl\lbrack ... \bigr\lbrack

(And this is not /that/ stupid: some people use inverted brackets to
mean an open interval, so that e.g. [0,1] contains 0 and 1, and ]0,1[
does not.)  Basically, you have "lparen's", "rparen's" and "aparen's"
("a" as in "ambiguous"), and they can be prefixed by \bigl / \bigr and
friends.

Anyway, the highlighting code (as well as jumping to the matching
delimiter and changing /both/ delimiters to a bigger/smaller variant) is
more or less ready.  I'll post it soon.

>> (I'm not saying it can't, I just want to know.  Reading its docs will
>> take me some time, and I won't be able to do it until at least Friday.
>> In fact, I'm just back home from a one-day visit at a TeX
>> conference;-).)
>
> Oh, we need TeX experts here!  I'm only a mere mortal LaTeX user whose
> knowledge is enough to write his documents but I've never coded some
> moderately advanced TeX stuff.  Actually, whenever I can, I use LuaLaTeX
> and then I call Lua from TeX to do complicated calculations and emit the
> results as TeX again.  ;-)

Ha, I never learned Lua enough.  OTOH, I'm not really an "expert",
though I did my share of lower-level TeX hacking.

> Bye,
> Tassilo

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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