auctex-devel
[Top][All Lists]
Advanced

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

LaTeX-current-environment in macrocode environment


From: Arash Esbati
Subject: LaTeX-current-environment in macrocode environment
Date: Thu, 10 Mar 2022 15:30:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi all,

while looking at the current code of doc.el, it does the following:

  (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
               '("macrocode" current-indentation) t)

Now take this small example as foo.dtx and eval the forms:

--8<---------------cut here---------------start------------->8---
%\iffalse
%<*driver>
\documentclass{ltxdoc}
\begin{document}
\DocInput{foo.dtx}
\end{document}
%</driver>
%\fi
%
% \begin{macro}{\foo}
% (LaTeX-current-environment) returns 'macro'.
%    \begin{macrocode}
\def\foo{%
  (LaTeX-current-environment) returns 'document'.
}
%    \end{macrocode}
% \end{macro}
%
% \endinput
%
% Local Variables:
% mode: doctex
% TeX-master: t
% End:
--8<---------------cut here---------------end--------------->8---

The `current-indentation' never happens inside macrocode environment
because it's not recognized.  I haven't looked into details (yet), but
can others confirm this behavior?

Best, Arash



reply via email to

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