I am presently preparing lecture notes in beamer. I have the lecture course structured into parts, sections etc and I would like use the numbering scheme consistently throughout the course. Without doing a lot of manual copy-and-paste stuff this implies for me that a single .tex file (maybe with includes here and there) for the entire course is the best solution. But of course this means that LaTeX always has to process a lot of stuff and I always get a PDF with the entire course, which is not really practical.
To solve this, beamer class has the \lecture command and the accompanying \includeonlylecture command. However, if I use this, my structure will be broken, because Latex will ignore all structural elements (parts, sections, etc.) outside of the current lecture, producing new numberings for each lecture. Andrew's answer to Entire course with beamer provides an even more rigorous approach to the \lecture mechanism, but it will also ignore everything.
Therefore my question: How can I make \includeonlylecture{} to only ignore \frame commands and frame environments?
Here is a try of a MWE:
\documentclass[11pt, t, xcolor=dvipsnames, utf8x]{beamer}
\includeonlylecture{day2}
\begin{document}
\lecture{27. April 2014}{day1}
\part{one}
\frame{Ignore this....}
\section{one-one}
\lecture{24. April 2014}{day2}
\section{one-two}
\frame{Use this frame and let it be in section one-two}
\part{two}
\end{document}