David Kastrup | 2 Nov 2004 00:00
Picon
Picon

Problems with C-c C-e macrocode in docTeX-mode


Hi,

If I mark a plain region of code in docTeX-mode (with
transient-mark-mode) and do C-c C-e macrocode, then the region gets
reformatted, and the macrocode environment is placed without being
outcommented.  This never makes sense, so it would be better if it was
always added outcommented, like

%    \begin{macrocode}
start of marked code
end of marked code
%    \end{macrocode}

If I try to achieve this by marking the region

% last commented line ^start of region
code code
code code ^end of region

then start of region gets an outcommented macrocode-begin, the end of
region gets a plain macrocode-end and AUCTeX barfs that it can't find
a matching begin (probably because it is outcommented) for its end.

Given that it inserted both of them, I'd call that behavior rather
childish.

In short: inserting an environment should just use the same state of
outcommentedness for beginning and end.

--

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


Gmane