Is there a way to find out (from Tex) the page number corresponding to a particular location in the source file? Using a macro in the file at that location is fine.
My motivation is that I'd like to (eventually) get a system working for partial compilation for Beamer presentations. Since I typically only change one or two frames between compilations, it's pretty inefficient that the entire document is recompiled every time (modulo tricks like conditional compilation, which help a bit). If I know which pages correspond to each frame, it should be possible to splice together an older compiled version with the new content.
EDIT: Sorry, I should have been more specific. I don't want any output in the pdf, rather I want to get it some other way (through a log file probably) so that I can access it from an external program.