auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Problem with latex2e style hook --- LaTeX/Texinfo collision


From: Vincent Belaïche
Subject: Re: [AUCTeX] Problem with latex2e style hook --- LaTeX/Texinfo collision
Date: Fri, 8 Jan 2016 12:27:52 +0100

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)

  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).
     
----------------------------------------
> From: address@hidden
> Date: Fri, 8 Jan 2016 11:26:26 +0100
> Subject: Re: [AUCTeX] Problem with latex2e style hook --- LaTeX/Texinfo 
> collision
> To: address@hidden
> CC: address@hidden
>
> Hi Vincent,
>
> 2016-01-05 10:25 GMT+01:00 Vincent Belaïche <address@hidden>:
>> Hello Mosè,
>>
>> HAPPY NEW YEAR 2016 !
>>
>> Concerning the dialect information, to my recollection my problem
>> was just that when editing latex2e.texi of the latexrefman project
>> (on GNA!), AUCTeX was loading a LaTeX specific automatic style, and
>> this was forcing the TeX-font command to work with LaTeX alist
>> rather than Texinfo alist. So my primary intent was to solve this
>> issue. Since only Texinfo was suffering, and the rest of the world
>> seemed to be happy, I was just meaning :texinfo on the one side, and
>> :other-than-texinfo but I just used :latex instead of
>> :other-than-texinfo (LaTeX is anyway the dominant TeX extension,
>> isn't it).
>>
>> To speak the truth:
>> - I don't even know what ConTeXt is (is that another TeX extension
>> package like plain-TeX, LaTeX, or Texinfo) or is that another engine
>> (like xelatex or luatex) … ?
>
> ConTeXt is a TeX macro package, so falls in the first group you mentioned.
>
>> - I never write TeX documents (I use TeX only as a programming
>> language for maintaining a few LaTeX packages like lettre or
>> fmtcount).
>>
>> So, I don't mind at all if TeX-style-hook-dialect would be set to
>> :tex instead of :latex for plainTeX files, the only potential issue
>> I can see is if some Elisp style file would be used both for
>> plainTeX and for LaTeX (as there are generic packages like babel,
>> pgf or pstricks that can run both in plainTeX and in LaTeX, so there
>> may be some need to declare Elisp style file in a multi-dialect way,
>> and possibly to use the dialect information to fine-tune the
>> behaviour).
>
> Indeed this is also a problem that came up to my mind while thinking
> about new dialects. PGF/TikZ can be used in plain-TeX, LaTeX and
> ConTeXt, see section 2.2 of documentation, but the core of the package
> is just the same for all three "dialects". Do you think is it easy to
> implement specification of multiple dialects in AUCTeX style files?
>
>> Concerning your idea to use the major mode, well, I am not sure
>> about that for the sake of futureproofness, because you could have
>> files where there are several dialects together and some major mode
>> that switches the current dialect dynamically so that which style
>> hook applies could be tuned. This is not the case currently, but
>> what I am meaning is that dialect and major mode are not the same
>> information, and that in the future AUCTeX may evolve to use the
>> dialect information more dynamically. For instance in DocTeX
>> typically you have plain-TeX within the
>> \begin{macrocode}...\end{macrocode} and LaTeX outside of them.
>
> This wasn't my best option, I prefer taking the value provided by the
> current buffer.
>
> Bye,
> Mosè                                    


reply via email to

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