如果我使用Meta-/自动补全像ThisClass这样的单词,emacs会感到困惑,给我的结果是THISCLASS或thisclass。更糟糕的是,如果我输入ThisC然后自动完成,它会给出Thisclass,这是非常令人沮丧的。
有没有办法修改这种行为?
发布于 2010-12-08 13:50:52
除了hippie-expand之外,您还可以通过自定义以下变量来使用dabbrev实现您想要的行为:
dabbrev-case-fold-search is a variable defined in `dabbrev.el'.
Its value is nil
This variable is potentially risky when used as a file local variable.
Documentation:
Control whether dabbrev searches should ignore case.
A value of nil means case is significant.
A value of `case-fold-search' means case is significant
if `case-fold-search' is nil.
Any other non-nil version means case is not significant.
You can customize this variable.发布于 2013-12-11 06:06:10
虽然修改搜索行为是解决问题的一种方法,但另一种可能更好的方法是保持搜索行为不变,而改为修改替换行为。
为此,将变量dabbrev-case-replace设置为nil。
这种方式可能更好,因为即使您键入的大小写不正确,它仍然会正确匹配,然后以正确的大小写完成。
例如:假设你有一个变量"aVariable“。如果您更改了搜索行为(将dabbrev-case-fold-search设置为nil),则键入"av“将与您的变量不匹配。但是,如果您改为更改替换行为(将dabbrev-case-replace设置为nil),则键入"av“将扩展为"aVariable”。
参考:http://www.gnu.org/software/emacs/manual/html_node/emacs/Dabbrev-Customization.html
https://stackoverflow.com/questions/4384204
复制相似问题