Is there an emacs function to convert a camel-cased word to underscore? Something, like:
longVariableName
M-x
to-underscore
There is now another general way in 2018: magnars/s.el: The long lost Emacs string manipulation library. - github.com, some examples regarding OP's question:
whatever case to snake case(underscore seperated):
(s-snake-case "some words") ;; => "some_words"
(s-snake-case "dashed-words") ;; => "dashed_words"
(s-snake-case "camelCasedWords") ;; => "camel_cased_words"
whatever case to lower camel case:
(s-lower-camel-case "some words") ;; => "someWords"
(s-lower-camel-case "dashed-words") ;; => "dashedWords"
(s-lower-camel-case "under_scored_words") ;; => "underScoredWords"
see more examples at its repo.