Mosè Giordano <[email protected]> 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).

> 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.

> I'd prefer to avoid this, as it makes `LaTeX-insert-label' more
> complicated, but it's the only solution I envisage to support both
> macros and environments.  What do you think?

I think the above suggestion is not too complex and should solve the
issue at hand.

Bye,
Tassilo


_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to