Comments on Shimura varieties and the Selberg trace formula