if (((result and line != indent) or
             (not result and line != firstline_indent)) and line[-1] == ' '):