auctex-devel
[Top][All Lists]
Advanced

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

Re: TeX-remove-style-hook is local


From: Tassilo Horn
Subject: Re: TeX-remove-style-hook is local
Date: Thu, 28 May 2020 21:41:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Tassilo Horn <tsdh@gnu.org> writes:

> No, I don't think so.  The top-level occurrences of
> `TeX-auto-add-type' just add the standard (La)TeX types.  You will
> never "unload" those.
>
> The important parts are the TeX-auto-add-type calls inside style hooks
> because you can stop using some style (package) in some document.  And
> then, the information parsed for that styles types needs to be erased
> by running the buffer-local TeX-remove-style-hook functions which set
> the generated buffer-local lists to nil.

Oh, after having a second look, I confess I am wrong and
TeX-remove-style-hook shouldn't be buffer-local.

Or alternatively, we could ensure that all TeX-auto-add-type calls
happen in style hooks and also move the standard (La)TeX/ConTeXt calls
into their respective mode functions, so that they will always happen
when the current buffer is the tex document (and not during load time).

But the first option is much simpler and has only the slight
disadvantage that more cheap lambdas might be called because now
TeX-remove-style-hook contains all clearance lambdas of all styles one
has ever used in some document in this emacs session.

I've committed your patch (except for the FIXME which I guess was more
of a note to us AUCTeX maintainers).

Thanks a lot,
Tassilo




reply via email to

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