[Top][All Lists]

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

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

From: Tassilo Horn
Subject: Re: [AUCTeX-devel] Manage auto insertion of labels
Date: Tue, 12 Aug 2014 14:49:36 +0200
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux)

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 =

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


reply via email to

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