Wrong keyword style when using multiple languages in listings

With this code

\documentclass{article}
\usepackage{xcolor}
\usepackage{listings}

\lstset{%
language=[AlLaTeX]TeX,
alsolanguage=MetaPost,
texcsstyle=\color{blue},
basicstyle=\ttfamily%
}

\begin{document}
\begin{lstlisting}
$\sum_{n=1}^\infty\frac{1}{n^2}$.
\end{lstlisting}
\end{document}


the \sum is not colored. But, if I replace MetaPost by pstricks, \sum turns into blue.

Someone could help me and explain the problem?

From the listings package documentation:

Bug: texcs... interferes with other keyword lists. If, for example, emph contains the word foo, then the control sequence \foo will show up in emphstyle.

Based on this I tried to declare MetaPost first and TeX second, and it worked.

Code

\documentclass{article}
\usepackage{xcolor}
\usepackage{listings}

\lstset{%
language=MetaPost,
alsolanguage=[AlLaTeX]TeX,
texcsstyle=\color{blue},
basicstyle=\ttfamily%
}

\begin{document}
\begin{lstlisting}
$\sum_{n=1}^\infty\frac{1}{n^2}$.
\end{lstlisting}
\end{document}


You can also use a starred variant of texcsstyle to also highlight the backslash:

texcsstyle=*\color{blue}


Result