[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Adding key/vals to predefined ones
From: |
Arash Esbati |
Subject: |
Re: [AUCTeX-devel] Adding key/vals to predefined ones |
Date: |
Tue, 24 Feb 2015 19:29:08 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Tassilo Horn <tsdh <at> gnu.org> writes:
Hi Tassilo,
> I haven't looked at your complete code again but isn't the problem with
> the buffer-local variable that it's, well, buffer-local whereas it
> actually should be document-local. That is, in a multi-file document
> using enumitem, the new key-vals are only available in the buffer of the
> file containing the new key-val definition but not in other buffers of
> the same document?
The buffer-local variable is set by the function
`LaTeX-enumitem-update-key-val-options' which relies on
`LaTeX-enumitem-SetEnumitem(Key|Value)-list' controlled by AUCTeX
auto-parser. My presumption was that it should work this way.
> So could you please validate that it works as expected with multi-file
> documents?
A 2 files test-case is attached below and it seems to me that it works.
One thing occured to me though: When I close the files and re-open
`master.tex', I get with C-h v:
LaTeX-enumitem-SetEnumitemValue-list is a variable defined in `enumitem.el'.
Its value is ((("label" "numeric")) nil)
Local in buffer master.tex; global value is nil
AUCTeX runs the style hook for `masterone.tex', but ignores the following
from `masterone.el':
(TeX-add-style-hook
"masterone"
(lambda ()
(LaTeX-add-enumitem-SetEnumitemValues
'("leftmargin" "standard"))))
I have to hit C-c C-n in `master.tex' to get that variable updated
document-wide. My expection that AUCTeX would DTRT right away.
Best, Arash
--8<---------------cut here---------------start------------->8---
\documentclass[10pt,a4paper]{article}
% Test 1, Step 1: Include the next 3 lines and hit C-c C-n,
% and go to masterone.tex
\usepackage[inline]{enumitem}
\SetEnumitemKey{twocol}{itemsep=1\itemsep}
\SetEnumitemValue{label}{numeric}{\arabic*.}
\begin{document}
\input{masterone}
% Test 1, Step 3: Press C-c C-e
\begin{enumerate}[twocol,label=numeric]
\item Completion works;
\item LaTeX-enumitem-SetEnumitemKey-list is a variable defined in `enumitem.el'.
Its value is (("twocol") nil)
Local in buffer master.tex; global value is nil
\item LaTeX-enumitem-SetEnumitemValue-list is a variable defined in
`enumitem.el'.
Its value is ((("label" "numeric")) nil)
Local in buffer master.tex; global value is nil
\end{enumerate}
% Test 2, Step 2: Press C-c C-n and then C-c C-e:
\begin{itemize}[leftmargin=standard]
\item Completion works;
\item LaTeX-enumitem-SetEnumitemValue-list is a variable defined in
`enumitem.el'.
Its value is ((("label" "numeric"))
(("leftmargin" "standard"))
nil)
Local in buffer master.tex; global value is nil
\end{itemize}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
--8<---------------cut here---------------end--------------->8---
--8<---------------cut here---------------start------------->8---
\section{File Masterone}
\label{sec:file-masterone}
% Test 1, Step 2: Press C-c C-n and then C-c C-e:
\begin{enumerate}[twocol,label=numeric]
\item Completion works;
\item LaTeX-enumitem-SetEnumitemKey-list is a variable defined in `enumitem.el'.
Its value is (("twocol") nil)
Local in buffer masterone.tex; global value is nil
\item LaTeX-enumitem-SetEnumitemValue-list is a variable defined in
`enumitem.el'.
Its value is ((("label" "numeric")) nil)
Local in buffer masterone.tex; global value is nil
\end{enumerate}
% Test 2, Step 1: Insert this and hit C-c C-n:
\SetEnumitemValue{leftmargin}{standard}{\parindent}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% End:
--8<---------------cut here---------------end--------------->8---