M-x delete-horizontal-space) removes all spaces between non-spaces.
But this key binding is not convenient to strike and remember...
There is a similar key binding
just-one-space) - remove all spaces and add one.
In 2013-01-30 Michal Nazarewicz introduced a new function
cycle-spacing that combines both
delete-horizontal-space by cycling between one space, no space and
Now I have in my
(when (fboundp 'cycle-spacing) (global-set-key (kbd "M-SPC") 'cycle-spacing))