branch: externals/auctex commit 8af05de02e766633d594ffb63a44415a0f6d2169 Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
Apply styles in reverse order * tex.el (TeX-run-style-hooks): Apply style hooks in reverse order. With that, a local style can modify a private or a global style, and a private style can modify a global one. --- ChangeLog | 6 ++++++ tex.el | 6 +++++- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0a1036..146564f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-03-23 Tassilo Horn <t...@gnu.org> + + * tex.el (TeX-run-style-hooks): Apply style hooks in reverse + order. With that, a local style can modify a private or a global + style, and a private style can modify a global one. + 2015-03-17 Mos� Giordano <m...@gnu.org> * doc/wininstall.texi: Fix a broken link. diff --git a/tex.el b/tex.el index 88e2336..df8369f 100644 --- a/tex.el +++ b/tex.el @@ -2708,7 +2708,11 @@ See variable `TeX-style-hook-dialect' for supported dialects." (and (TeX-shdex-in-p TeX-style-hook-dialect (aref hook 2)) (funcall (aref hook 1)))) (t (error "Invalid style hook %S" hook)))) - (cdr-safe (TeX-assoc-string style TeX-style-hook-list))) + ;; Drop the LATEX entry and then reverse the list + ;; of style hooks in order to run styles in the + ;; order global, private, local (assuming + ;; TeX-style-path has that ordering, too). + (reverse (cdr-safe (TeX-assoc-string style TeX-style-hook-list)))) ;; This happens in case some style added a new parser, and ;; now the style isn't used anymore (user deleted ;; \usepackage{style}). Then we're left over with, e.g.,