Ok, try the following in docTeX-mode:
transform the following:
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
[EMAIL PROTECTED]@[EMAIL PROTECTED]
\edef\next{\noexpand
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@#1}}{#3}%
{#4}}}\next}}
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
\def\next{#3}%
\expandafter\ifx\csname [EMAIL PROTECTED]@#1\endcsname\next
[EMAIL PROTECTED]@[EMAIL PROTECTED]
\else
[EMAIL PROTECTED]@[EMAIL PROTECTED]@#1}}%
\fi
\global\expandafter\let\csname [EMAIL PROTECTED]@#1\endcsname\next
\edef\next{\noexpand
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@#1}}{#3}%
{#4}}}\next}}
into
% [EMAIL PROTECTED]
% \begin{macrocode}
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
[EMAIL PROTECTED]@[EMAIL PROTECTED]
\edef\next{\noexpand
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@#1}}{#3}%
{#4}}}\next}}
% \end{macrocode}
% \end{macro}
% [EMAIL PROTECTED]
% \begin{macrocode}
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
\def\next{#3}%
\expandafter\ifx\csname [EMAIL PROTECTED]@#1\endcsname\next
[EMAIL PROTECTED]@[EMAIL PROTECTED]
\else
[EMAIL PROTECTED]@[EMAIL PROTECTED]@#1}}%
\fi
\global\expandafter\let\csname [EMAIL PROTECTED]@#1\endcsname\next
\edef\next{\noexpand
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@#1}}{#3}%
{#4}}}\next}}
% \end{macrocode}
% \end{macro}
This _should_ be as easy as marking a definition with
transient-mark-mode (an active mark), then using
C-c C-e macrocode RET
C-u C-x C-x (or maybe instead C-c . C-u C-x C-x)
C-c C-e macro RET [EMAIL PROTECTED] RET
Instead: no way. It is simply impossible to keep AUCTeX from
reformatting the contents. I don't think that AUCTeX should even
_touch_ stuff with a different comment prefix (if any) than the one
for the environment, not even if you insert macro and macrocode
environments in the other order.
I found this quite frustrating since I _know_ that there is code
intended to leave verbatim stuff alone.
It does not work for inserting environments around existing stuff,
seemingly.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
_______________________________________________
auctex-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/auctex-devel