Hi Stefan, >>>>> Stefan Monnier <monn...@iro.umontreal.ca> writes: > My understanding is that the intention is to add the function on the > global part of the hook, which is what the patch below does. > If the intention is to add it buffer-locally, then the code will need to > be restructured since the `add-hook` currently runs only when loading > AUCTeX and not when enabling the mode.
I agree, by the following reasons, that it's appropriate to delete the `make-variable-buffer-local' as you proposed: Since AUCTeX run `TeX-auto-add-type' only once per an information type, `add-hook' in this macro should operate on the global value of `TeX-remove-style-hook'. There is another instance of `add-hook' on `TeX-remove-style-hook' in the form (add-hook 'TeX-remove-style-hook (lambda () (setq LaTeX-largest-level nil))) in latex.el at its top level. I also think that this `add-hook' should operate on the global value of `TeX-remove-style-hook'. Thus it looks apparently wrong to apply `make-variable-buffer-local' to it. How do others on auctex-dev list think? > AFAICT, `TeX-auto-add-type` is a macro that's run exclusively at the > top-level of some of AUCTeX's files (context.el, tex.el, and latex.el), This isn't correct actually, though it isn't important under the current context. Many files among style/*.el add their own information types by this macro. Regards, Ikumi Keita