auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Wrap dollars around active region


From: Florêncio Neves
Subject: Re: [AUCTeX-devel] Wrap dollars around active region
Date: Tue, 4 Jun 2013 13:04:50 -0400

A slightly unrelated comment: currently the dollar sign does not play
well with electric-pair-mode.  Only if you bind $ to
self-insert-command will it insert a pair of dollar signs and place
the point between them.  This might be the right time to fix that...

F.

On 6/4/13, Tassilo Horn <address@hidden> wrote:
> Mosè Giordano <address@hidden> writes:
>
>> 2013/6/3 Tassilo Horn <address@hidden>:
>>> I think it's a good change, but since it's incompatible, users should
>>> get some warning message.  That is, `TeX-insert-dollar' should check if
>>> the value is a cons, and if not, issue a warning and treat t as ("$"
>>> . "$").
>> Ok, that's simple to do, but since these variables have been
>> introduced some months after release of last stable version, can't we
>> assume that people that customized these variables follow AUCTeX
>> development?
>
> Ah, you are right.  I've thought `TeX-math-close-single-dollar' was old,
> but in fact only `TeX-math-close-double-dollar' is old.
>
>>> BTW, I don't see why we need 2 variables.  Shouldn't
>>> `TeX-electric-dollar' with no active region make the behavior you get
>>> with `TeX-math-close-single-dollar' and the same customization.
>> Good question.  I've supposed someone can want to use
>> `TeX-electric-dollar' but not `TeX-math-close-single-dollar' or vice
>> versa.  I use both, but I don't know what other people prefer.
>
> Well, I think most users either like electricity or they don't.  I'd
> prefer just one variable `TeX-electric-math' or so that supersedes
> `TeX-electric-dollar', `TeX-math-close-single-dollar', and
> `TeX-math-close-double-dollar'.
>
> The value '("$" . "$") with no active region, inserting the opening $
> would insert the closing dollar and place point in between.  With an
> active region, it would place the opening and closing dollars around the
> region, and keep the region active.  Then, you could transform a + b = c
> to $$a + b = c$$ by selecting the region and hitting $ twice.
>
> When configured to '("\\(" . "\\)") it would be cool if with the active
> region above, typing $ once would transform it to \(a + b = c\) and
> typing $ again would make it to \[a + b = c\].
>
> Does that make sense?
>
> (As a bonus, I think it would be fancy if a third $ would remove the
> math again, so that you can cycle though the states "no math" -> "inline
> math" -> "displaymath".)
>
>>> And since the variable doesn't deal only with $ but is more flexible
>>> (good!), it should probably be renamed (maybe
>>> `TeX-electric-inline-math', and `TeX-insert-inline-math') and aliased
>>> with `define-obsolete-variable-alias' and
>>> `define-obsolete-function-alias'.  I've just checked, and XEmacs 21.4
>>> supports those, too, except for the 3rd and 4th arguments.
>> Ok, but about keeping compatibility making `TeX-electric-dollar'
>> obsolete for  see above.
>
> Yes, right.  We'd only have to deal with `TeX-math-close-double-dollar'.
> I'd just check if it is bound in `TeX-insert-dollar', and if it is,
> issue a message that the variable is removed and users should use
> `TeX-electric-math' instead.
>
> Bye,
> Tassilo
>
> _______________________________________________
> auctex-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/auctex-devel
>



reply via email to

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