2014-08-12 16:45 GMT+02:00 Mosè Giordano <[email protected]>:
> 2014-08-12 14:49 GMT+02:00 Tassilo Horn <[email protected]>:
>> 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).
>
> 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

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

Reply via email to