auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Sharing value of a variable between all files of the


From: Matthew Leach
Subject: Re: [AUCTeX-devel] Sharing value of a variable between all files of the same document
Date: Sat, 16 Apr 2016 22:57:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Mosè Giordano <address@hidden> writes:

> Hi Matt,

Hi Mosè,

That sounds like a good idea; I do have some questions.

> 2016-04-15 20:39 GMT+02:00 Matthew Leach <address@hidden>:
>> Hi Mosè,
>>
>> Mosè Giordano <address@hidden> writes:
>>
>>> On third thought, it's pretty tricky to locally change the value of
>>> `TeX-command-extra-options' once it's set.  The only simple way I
>>> found is to manually edit the auto saved file and then revert the *TeX
>>> buffer, not the best option indeed.
>>
>> I agree - this doesn't seem like an ideal fix.  One possible solution
>> that I've thought about that seems more intuitive is to include a new
>> line in the footer of TeX-master files for variables that should be set
>> document-wide.
>>
>> For example, when I create a new TeX file I have:
>>
>> --8<---------------cut here---------------start------------->8---
>> %%% Local Variables:
>> %%% mode: latex
>> %%% TeX-master: t
>> %%% End:
>> --8<---------------cut here---------------end--------------->8---
>>
>> What about if we add a new category called 'Document Variables':
>>
>> --8<---------------cut here---------------start------------->8---
>> %%% Local Variables:
>> %%% Document Variables:
>> %%% mode: latex
>> %%% TeX-master: t
>> %%% End:
>> --8<---------------cut here---------------end--------------->8---
>>
>> and all variables that are set here would be set locally on any TeX file
>> that has this file listed as the TeX-master?  Setting 'Document
>> Variables' where TeX-master is not `t' would be silently ignored.
>>
>> Do you think that could work?
>
> I was rather thinking about a new alist `TeX-document-variables' to be
> stored in the auto saved file

Would `TeX-document-variables' be stored exclusively in the TeX-master's
auto-save file or all the auto-save files for a document?  If it is the
latter, we would need to ensure the alists are synchronised for all
auto-save files in a document, do you know of an easy way to do this?

> , with the name of a variable as key and its value as value.  This
> should be used only for certain variables, above all (or only) those
> related to TeXing options (engine, extra options,
> `ConTeXt-Mark-version', etc).  

How would the user set and edit a variable document wide?  Would we
provide a new interactive setter function that would write that to the
`TeX-document-variables' alist?

> Every function that needs to access those variable should check this
> alist first fallbacking onto the (local) value of the variable if not
> present in `TeX-document-variables'.  We can define a function similar
> to `TeX-process-get-variable' to get the value of the variable from
> the alist.  

Rather than modifying all the places where these values are accessed,
couldn't we check the alist and set the buffer-local variables when a
buffer is loaded?  When reading the alist, we could exclude variables
that we don't allow.

Thanks,
-- 
Matt



reply via email to

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