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: Wed, 13 Aug 2014 13:15:50 +0200

2014-08-12 16:45 GMT+02:00 Mosè Giordano <address@hidden>:
> 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.

Please find attached the patch.

Actually, I'm noticing `LaTeX-insert-label' overlaps with
`LaTeX-label-alist' (which is undocumented in the AUCTeX manual) and
`LaTeX-section-label'.  The problem is that when RefTeX is used,
`reftex-label' ignores `LaTeX-label-alist' and `LaTeX-section-label',
instead `LaTeX-insert-label' is valuated before calling
`reftex-label'.

We could completely remove the new `LaTeX-insert-label' and check with
`LaTeX-label-alist' and `LaTeX-section-label' whether a label should
be inserted, before calling `reftex-label'.  What do you think?

Bye,
Mosè

Attachment: patch
Description: Binary data


reply via email to

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