Suppose $G$ is a complex Lie group, $P$ a Borel subgroup, $E$ a representation of $P$ that induces a vector bundle ${\cal E}$ over $G/P$. The general version of Borel-Weil-Bott theorem, as stated in Bott's 1957 paper, says that $H^*(G/P,{\cal E}) = \sum K\otimes H^*(p,v,{\rm Hom}(K,E))$, where $p$ is the Lie algebra of $P$, $v$ the Lie algebra of the intersection of $P$ with the maximal compact subgroup $M$ of $G$, and the sum is over all irreducible representations $K$ of $M$.

My question is how to compute the relative Lie algebra cohomology appearing on the RHS of this formulae in practice, say when $M$ is of ADE type (and $G$ its complexification). I understand that in the degree $0$ case, ${\rm H}^0$ is computed simply as homomorphisms from $K$ to $E$ over $p$. What is an efficient way to compute the higher cohomology groups?

Also: the more commonly seen version of the theorem deals with line bundle ($E$ being a $1$-dimensional representation of $P$). In this case, the RHS is usually expressed in terms of the highest weight representation given by a Weyl group transformation of the weight vector associated with that $1$-dimensional representation. How does this result follow from the general formula above expressed in terms of relative Lie algebra cohomology, and in particular, why does the length of the Weyl group element translate into the degree of the cohomology group?