Not sure when “a few years ago” was, but in 2013 (“4th gen”) Intel had more far than just “M” as a suffix for their consumer CPUs. They had at least EC, EQ, HQ, K, M, MQ, R, S, T, TE, U, and Y. Various generations between now and then have a variety of different suffixes, but never just “M” so far as I know.
It used to be M -> 45W, U -> 15W, Y <15W for mobile CPUs, but Y CPUs were awful and only on the most budget devices. At some point M also sprouted H and HQ, of which M and HQ eventually got dropped.
K was for overclocked/unlocked CPUs, T was for TDP limited CPUs. For "average consumers", both were pretty irrelevant.
Never seen EC, EQ, MQ, R, S or TE cpus,
Still, 4th-9th gen were pretty simple, you needed to know K (unlocked) and F (no integrated graphics) for desktop CPUs if you were buying the CPU directly, if it just came in your PC an OEM built it didn't make a difference.
Laptops you also needed two: M (later H) for faster, less battery life, U for slower, more battery life. If you were going for a netbook, maybe Y also, but there certainly wasn't any price range to contain both Y and M/H CPUs.
Another commenter upward [1] linked an archive of an older nomenclature (though not from the same time I was checking—I was just looking at Intel Ark) which details the more exotic suffixes.