Skip to content

Instantly share code, notes, and snippets.

@qsun
Created November 5, 2011 09:37
Show Gist options
  • Save qsun/1341320 to your computer and use it in GitHub Desktop.
Save qsun/1341320 to your computer and use it in GitHub Desktop.
Remove the continuous spaces before and after current point
(defun consolidate-spaces ()
"Remove the continuous spaces before and after current point"
(interactive)
(let (start end)
(skip-chars-backward "[:space:]")
(setq start (point))
(skip-chars-forward "[:space:]")
(setq end (point))
(delete-region start end)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment