Ciao Mosè Answers inserted below... ---------------------------------------- > From: m...@gnu.org > Date: Sat, 16 Aug 2014 22:20:37 +0200 > Subject: Re: [AUCTeX] Problem with latex2e style hook --- LaTeX/Texinfo > collision > To: vincent....@hotmail.fr > CC: auctex@gnu.org; t...@gnu.org > > Hi Vincent, > > 2014-08-16 7:04 GMT+02:00 Vincent Belaïche <vincent....@hotmail.fr>: > > BTW, I later thought that is may be useful to have more elements in the > > vector to specify what caused the addition of the hook. For instance > > that would now be > > > > [TeX-style-hook HOOK-FUN CONTEXT ORIGINATOR-TAG ORIGINATOR-SIGNATURE] > > > > where ORIGINATOR-TAG would be some symbol, indicating how the hook was > > created, e.g. 'TeX-normal-mode would indicated that the hook was > > automatically created (not added programmatically) and > > ORIGINATOR-SIGNATURE would be some other information that is proper to > > the originator, like the source file full path over which > > TeX-normal-mode was run when ORIGINATOR-TAG = 'TeX-normal-mode > > What do you mean by "the source file full path over which > TeX-normal-mode was run"?
Some hooks are generated automatically by AUCTeX parser --- that takes all the \newcommand and \newenvironment found in the TeX master, and also loads the styles for \usepackage and \documentclass called from preamble. Some other hooks are generated programmatically, i.e. for some package foo.sty you have the equivalent foo.el that is in auctex/styles. Now if you have some foo.tex in some directory sd/ containing some \usepackage{foo} you will have an AUCTeX style "foo" that will load two hooks: * one from auctex/styles/foo.el, and * one from sd/auto/foo.el What I mean by "originator" is something that would allow to differentiate these two hooks --- no matter how you implement it, the idea of using a full path needs further discussion --- so that no stack-overflow recursion is caused (not sure that would happen ?), and so that sd/auto/foo.el replaces only its hook in the AUCTeX style "foo", but has not border effect on the hook from auctex/styles/foo.el, and vice versa. > The path of the *tex (or bib) file from which the style hook has been > created? That could be a fix for the mentioned bug! > With originators, I was referring to another potential problem that may need some provision for making easier solving in the future. See above... I think --- but yet I am not fully sure --- that the current solution which I propose would be sufficient to overcome the foo.tex + foo.bib situation. What you only need is that BibTeX would set new variable TeX-style-hook-context to :bibtex, so that LaTeX hooks do not do some undesirable setting in foo.bib, and vice versa --- well to my knowledge there are not yet BibTeX or Texinfo auto hooks, but that could happen in the future --- after all one can define some @macro in Texinfo and @string in BibTeX. When some day, someone would put on the table such parsing for generating auto hooks for Texinfo or BibTeX, one would then certainly need that LaTeX auto hooks are in a sd/auto_latex, and similarky sd/auto_texinfo and sd/auto_bibtex for Texinfo auto hooks and BibTeX auto-hook respectively, this way foo.bib, foo.texi and foo.tex, all bad-luckilly in the same sd/ directory would not collide their respective foo.el generated automatically. > Bye, > Mosè Arrivederci, Vincent. _______________________________________________ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex