Wasn't there an old standard for text format strings that could be placed at the end of source files that would be understood by Vim and Emacs? I never used it, but this reminds me of it.
And the Emacs equivalent, file-local variables[0]. However, these are editor-specific, as far as I'm aware, although Python was able to extract the commonalities between them to support file encoding in PEP 0263[1].