camelCase.el emacswiki有一个取消驼峰大小写的功能。但它似乎不起作用。我将这一部分添加到了camelCase.el本身。但是不能让它工作。我错过了什么?其他人也有同样的问题吗?
编辑:我添加了最后两个函数,其中一个是不起作用的函数
(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)发布于 2013-03-16 01:30:19
除了误导性的doc-string (它实际上默认为分隔符的"_",而不是"-“),您提供的un-camelcase-string的定义是有效的。你能给我们更多关于它是如何失败的以及在什么情况下失败的详细信息吗?
https://stackoverflow.com/questions/15420741
复制相似问题