I would vote for "wontfix" because it would only affect xml based template languages. But i would like to have something like `guess_lexer` so that it automatically recognizes lexers. Each lexer provides a `analyse_text` method that returns an float between -1 and 1. The lexer with the highest return value wins the battle and lexes the content. If the highest value is -1 then it would use the plain text lexer.
Okay, closing this. You can use the guessing mechanism for a similar effect.
by doctype I was referring either to the HTML doctype or a namespace that the engine uses, it depends on the templating engine but it will be (from the lexer's perspective) the same since it's a way to identify the lexer for mix of html+extension.
actually this was step one of my idea, if you look at the current "Filename patterns"
and get_lexer_for_filename you will see that those apply only to file extensions.
so my idea as a whole was as you suggested make a 3th method that will wrap both and will evertually be the guess_lexer you suggested.