auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Manage auto insertion of labels


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] Manage auto insertion of labels
Date: Tue, 12 Aug 2014 16:45:47 +0200

2014-08-12 14:49 GMT+02:00 Tassilo Horn <address@hidden>:
> Mosè Giordano <address@hidden> writes:
>
>> Ok, a possibility would be to change the value accepted by
>> `LaTeX-insert-label' to, e.g,
>>
>>     (t . ("section" . section) ("subsection" . environment))
>>
>> so each element of the CDR is a cons, whose CAR is the name of the
>> macro/environment, and the CDR is the type.
>
> Quite complex.  Maybe it would be simpler to have special keys for the
> alist, e.g.,
>
>   ((environment-whitelist "figure" "table")
>    (environment-blacklist ...)
>    (section-whitelist ...)
>    (section-blacklist ...))
>
> And basically, having both a *-whitelist and a *-blacklist doesn't
> really make much sense.  So it could be compressed to, e.g.,
>
>   ((environments t "figure" "table")
>    (sections nil "paragraph" "paragraph*" "subparagraph" "subparagraph*"))
>
> meaning that only figure and table environments get a label (t =
> whitelist), and only sections "larger" than paragraph get one (nil =
> blacklist).

My idea of using t for blacklist and nil for whitelist was due to the
fact that for the base cases (always insert label, never insert
labels) I used t and nil, and adding exceptions was as simple as
adding elements to the list, keeping the same first element (t or
nil), though I agree t is logically more adapt for a whitelist and nil
for a blacklist.

However, I'll try to implement this interface later today.

>> The `LaTeX-label' function must be changed to take a second mandatory
>> argument specifying the type of the macro/environment to be labeled.
>
> I think `LaTeX-label' can figure that out on its own by calling
> `LaTeX-current-environment'.  If that returns "document", we're probably
> inserting a section label, else we're inserting an environment label.

Well, in beamer you can add a sectioning command inside a frame
environment.  This is not the standard behavior but it's legal to
insert a sectioning command inside an environment different from
document.  In addition `LaTeX-current-environment' isn't bullet-proof,
so avoid using it would be nice ;-)

Bye,
Mosè



reply via email to

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