首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >非camelCase代码不工作

非camelCase代码不工作
EN

Stack Overflow用户
提问于 2013-03-15 05:41:31
回答 1查看 113关注 0票数 0

camelCase.el emacswiki有一个取消驼峰大小写的功能。但它似乎不起作用。我将这一部分添加到了camelCase.el本身。但是不能让它工作。我错过了什么?其他人也有同样的问题吗?

编辑:我添加了最后两个函数,其中一个是不起作用的函数

代码语言:javascript
复制
(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)
EN

回答 1

Stack Overflow用户

发布于 2013-03-16 01:30:19

除了误导性的doc-string (它实际上默认为分隔符的"_",而不是"-“),您提供的un-camelcase-string的定义是有效的。你能给我们更多关于它是如何失败的以及在什么情况下失败的详细信息吗?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15420741

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档