I wanted to close alltt inside a command (to add some ornaments around the text), but the spaces that were used for putting the monospaced text into columns was not preserved.
I found the solution here: Problem with alltt package when defining new command
It is (in simplified form):
\newenvironment{comm}[1]
{%
#1%
\begin{alltt}}
{\end{alltt}}
it works, but I need to put extra newline after \begin:
\begin{comm}
user: some-user
password: some-password
\end{comm}
Without this newline it looks like this:

This extra newline is not 'eaten' though, it is preserved, so you always have a huge vertial space before actual text. I tried to switch it for for example \null but it didn't work.
I tried to remove % signs and it worked exactly the same way.
This is not a big problem (I hacked it with some vspace), but I would like to know why is it so, because I think it might clarify some matters for me.

commenvironment? Try removing[1]and#1. – egreg Sep 14 '12 at 14:18