Process a block of text as if it were in a buffer of a different filetype