camelCase.el emacswiki有一個un-camelcase函數。但它似乎並不奏效。我把這件作品添加到了camelCase.el本身。但不能讓它工作。 我錯過了什麼?其他人有沒有同樣的問題?un-camelCase代碼不能正常工作
編輯:我還有最後增加了兩個功能,其中之一是不工作
(defun camelCase-downcase-word (count)
"Make word starting at point lowercase, leaving point after word."
(interactive "*p")
(let ((start (point)))
(camelCase-forward-word count)
(downcase-region start (point))))
(defun un-camelcase-string (s &optional sep start)
"Convert CamelCase string S to lower case with word separator SEP.
Default for SEP is a hyphen \"-\".
If third argument START is non-nil, convert words after that
index in STRING."
(let ((case-fold-search nil))
(while (string-match "[A-Z]" s (or start 1))
(setq s (replace-match (concat (or sep "_")
(downcase (match-string 0 s)))
t nil s)))
(downcase s)))
(provide 'camelCase)
向我們顯示代碼。 – phils 2013-03-14 22:53:05