Stellar activity and exoplanets ofMdwarfs from CARMENES visible to near-infrared spectroscopy