C-M-\ auto-indents the entire buffer, but C-M-u-q works just inside the function or macro you're in when you type the command (it does nothing outside a code block).
Emacs help actually defines these as two separate commands (C-M-u is "backward-up-list", C-M-q is "indent-sexp"), but I find that I can just hold down C-M, and then type "u", "q" in succession for the same effect.