setq of case-sensitivity in .emacs has no effect

坚强是说给别人听的谎言 提交于 2019-12-10 15:05:58

问题


I have a lot of custom stuff in my .emacs file: fonts, colors, window sizing, key bindings, etc. All of it works.

Then at the end, I just added a: (setq case-fold-search nil). It's a variable that when set to nil is supposed to make search case-sensitive in all emacs modes. It doesn't for me.

Setting case-fold-search to nil in an individual buffer works, but when I set it in .emacs, it doesn't work. Is there a reason why a setq declaration in a .emacs may not work sometimes? How should I try to debug the issue?


回答1:


That's normal behavior for buffer-local variables. setq-default can be used to establish a default value for them.

You can determine that a variable is buffer local by checking out its documentation, using C-h v case-fold-search (or M-x describe-variable), which in this case reports (note 4th line):

case-fold-search is a variable defined in `buffer.c'.
Its value is t

  Automatically becomes buffer-local when set in any fashion.

Documentation:
*Non-nil if searches and matches should ignore case.

You can customize this variable.


来源:https://stackoverflow.com/questions/5345051/setq-of-case-sensitivity-in-emacs-has-no-effect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!