Created
August 10, 2012 20:38
-
-
Save ninjudd/3317672 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun compress-space-forward () | |
"*Replaces all spaces, tabs and newlines after point with a single space." | |
(interactive) | |
(re-search-forward "[ \t\n\r]+\\([^ \t\n\r]\\)" nil t) | |
(replace-match " \\1" nil nil)) | |
(defun compress-space-backward () | |
"*Replaces all spaces, tabs and newlines after point with a single space." | |
(interactive) | |
(re-search-backward "\\([^ \t\n\r]\\)[ \t\n\r]+" nil t) | |
(replace-match "\\1 " nil nil)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment