Next: How do I search for, delete, or replace unprintable (eight-bit or control) characters?, Previous: How can I replace highlighted text with what I type?, Up: Common requests [Contents][Index]
The value of the variable case-fold-search
determines whether
searches are case sensitive:
(setq case-fold-search nil) ; make searches case sensitive (setq case-fold-search t) ; make searches case insensitive
Similarly, for replacing, the variable case-replace
determines
whether replacements preserve case.
You can also toggle case sensitivity at will in isearch with M-c.
To change the case sensitivity just for one major mode, use the major mode’s hook. For example:
(add-hook 'foo-mode-hook (lambda () (setq case-fold-search nil)))