5

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?

Trey Jackson
  • 73,529
  • 11
  • 197
  • 229
Alan Turing
  • 12,223
  • 16
  • 74
  • 116

1 Answers1

3

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.
phils
  • 71,335
  • 11
  • 153
  • 198
geekosaur
  • 59,309
  • 11
  • 123
  • 114
  • 1
    Also note that `C-h v case-fold-search RET` tells you if the variable is buffer-local. – phils Mar 17 '11 at 21:10