Skip to content

Instantly share code, notes, and snippets.

@cpaulbond
Created February 24, 2016 21:01
Show Gist options
  • Save cpaulbond/0cbfec84862c75ec6658 to your computer and use it in GitHub Desktop.
Save cpaulbond/0cbfec84862c75ec6658 to your computer and use it in GitHub Desktop.
Because sometimes the comments are so bad, they just have to go!
(defun punt-comments ()
(interactive)
(goto-char (point-min))
(while (re-search-forward "/\\*\\|//" nil t)
(let ((start (match-beginning 0)))
(if (string= (match-string 0) "/*")
(if (search-forward "*/" nil t)
(delete-region start (point)))
(delete-region start (line-end-position))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment