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: Mosè Giordano
Subject: Re: [AUCTeX-devel] Sharing value of a variable between all files of the same document
Date: Sun, 17 Apr 2016 00:15:32 +0200

Hi Matt,

2016-04-16 23:57 GMT+02:00 Matthew Leach <address@hidden>:
> 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?

No no, only in master's auto-save file.

>> , 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?

My simple idea was to set the variables as usual (either manually or
with `add-file-local-variable', I have no new special tool in mind),
but with this new framework users need to set them only once in the
master file, instead of every single file part of the document.

>> 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.

Sounds reasonable.  Actually, you suggested me the idea of not
creating a new alist, but rather defining a new function that sets the
relevant variables locally.  Much like `TeX-add-symbols' or
`LaTeX-add-environments'.

I can try and write down a proof-of-concept, but probably later next week.

Cheers,
Mosè



reply via email to

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