[Top][All Lists]

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

Re: [AUCTeX-devel] Style system Was: Inconsistency in loading/saving .el

From: Pierre Lorenzon
Subject: Re: [AUCTeX-devel] Style system Was: Inconsistency in loading/saving .el files
Date: Fri, 23 May 2008 18:45:08 +0200 (CEST)


When investigating the code to check how I could improve the
style system I discover this apparent contradiction. 

It would be better (in my opinion) or at least more comfortable
if the TeX-update-style was called after all local variables
(including file locale one and especially TeX-master) are
evaluated and set. 

Indeed since TeX-master is not necessarily set when running
TeX-update-style there is a test in this function to try to
guess if the master file might be accessed or not. However if
TeX-master is not set the TeX-master-file will simply return
the current file name and the test in TeX-update-style will
simply produce a useless reccursion. In other functions called
by TeX-update-style this lack of TeX-master will also be
painful ! 

Anyway, the reason for which the TeX-update-style is called
before local variable setting is complete is understandable :
menus should be set in the mode function : it is completely
natural ! Menus should know about the style settings : it is
still natural ! But style updating would like to know more
about the local variables ... And I suspect that menu
initialization cannot be complete. 

Thus TeX-update-style is called once more in general by the the
find-file-hook and at this point updating can run completely. 

Hence there seems to be an intrinsic contradiction : and fro my
point of view it simply result from the fact that in emacs
philosophy, the mode is something closely related to a buffer
and then that there's no matter if local variables are set
after mode function is completely run. But in our case, menus
belong to the mode and once more it seems completely natural to
me. But menus depend on the DOCUMENT which is not really a well
defined emacs "object" and at least depending from several
files from which emacs does not know a priori that they are

Were you aware of this problem ? Did I completely misunderstand
everything and there's in fact no problem at all ? 

Anyway if the problem exists I have any ideas to overcome it :
for instance storing more informations in the .el file
(TeX-master ...) that might be retrieved earlier in the style
updating process. Changing anything in the file local variable
evaluation by customizing the hack-local-variables looks like
to be infinitely more dangerous ! Setting menus somewhere else
(I mean later) does not look like natural ... 



reply via email to

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