Skip to content

Instantly share code, notes, and snippets.

@danlamanna
Created February 10, 2013 23:14
Show Gist options
  • Save danlamanna/4751470 to your computer and use it in GitHub Desktop.
Save danlamanna/4751470 to your computer and use it in GitHub Desktop.
(defun fix-double-capital()
"Go back to last occurence of a 'double capital' at start of word and correct."
(interactive)
(if (re-search-backward "\\b\\([A-Z]\\{2\\}\\)" nil t)
(replace-match (concat (substring (match-string 0) 0 1) ;concat first char
(downcase (substring (match-string 0) 1 2))) t) ; with downcased second char
(message "No double capital found!")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment