Hello Mosè, I have had a look at your patch, and everything seems OK to me.
Concerning variable `TeX-style-hook-dialect-weight-alist', its use is to convert dialect symbols (ie `:latex', `:texinfo', etc...) into a integer bitmap representation, so that dialect expressions (`or', `and', and `not') are evaluated to an integer bitmap. This is done by function `TeX-shdex-eval' (please remember shdex stands for Style Hook Dialect EXpression). So, functionally speaking, there is no meaning what weight you associate to each symbol, provided that: - weights are powers of 2 within 30bits (info "(elisp) Integer Basics"), and - no two symbols have the same weight Performance-wise there may be a very small impact what the order of association cells are in variable `TeX-style-hook-dialect-weight-alist', because function `TeX-shdex-eval' uses `assq' which finds cells in linear time. Initially I used this order: :latex, :texinfo, :bibtex, as in fact I write more often LaTeX documents than Texinfo documents, and Texinfo documents than BibTeX files. That is just my personal feeling, not sure whether this is a widely shared order, and I doubt anyway that there are any statistics about TeX dialect use. Fine, idle talk: that order has a non detectable impact on performance. Just do as you like. BR, Vincent. ---------------------------------------- > From: m...@gnu.org > Date: Mon, 11 Jan 2016 11:37:15 +0100 > Subject: Re: [AUCTeX] Problem with latex2e style hook --- LaTeX/Texinfo > collision > To: vincent....@hotmail.fr > CC: auctex@gnu.org > > Hi Vincent, > > 2016-01-08 12:27 GMT+01:00 Vincent Belaïche <vincent....@hotmail.fr>: >> Hello Mosè, >> >> Ok, so the way we go is to have multi-dialect hooks, and you are asking >> "Do you think is it easy to implement specification of multiple dialects >> in AUCTeX style files?". >> >> So the good news is that in the contribution which I did multi-dialect >> style files were supported from the beginning --- because at the time >> when I did it, I had already in mind the fact that some packages are >> multidialects. Please, look at the TeX-add-style-hook docstring. Assume >> that you would have the two new dialects :context and :plaintex, then >> for pgf hook you would declare the following in place of the >> DIALECT-EXPR argument : >> >> (or :latex :context :plaintex) > > Oh, right, I already read it! And it seems I forgot it as well ;-) > >> Vincent. >> >> PS-1: If you add new dialects, I think that the only thing to do is >> >> 1) To change the docstring of TeX-style-hook-dialect variable to update >> the full list of supported dialects >> >> 2) To change the corresponding major-more definition, so that the >> initialisation of the TeX-style-hook-dialect variable be done >> accordingly. >> >> >> PS-2: I don't know whether the DocTeX mode is used only for LaTeX, or is >> there something similar for ConTeXt. In the later case, you should >> update also the DocTeX mode definition so that the >> TeX-style-hook-dialect variable be initialized either to :latex or >> to :context, accordingly, or maybe we need some :doctex-latex and >> :doctex-context dialects (I don't think so, the style hook should >> be written in a way that they you only primitive of the AUCTeX >> kernel, and these primitives should react accordingly whether you >> are in DocTeX mode or not, I DocTeX is not really a dialect, but >> rather some file polyglotting method (ie making two dialects >> co-exist in the same file). > > Please, take a look at the attached patch. In particular, I'm not > sure about the value of `TeX-style-hook-dialect-weight-alist' and the > order of the dialects, but probably it isn't really important. > > Bye, > Mosè _______________________________________________ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex