In Emacs, by default, incremental search is case-insensitive. However, if you type any upper case characters as part of the search string, it becomes a case-sensitive search. So the question is, how do you easily perform a case-sensitive search of an all lower case pattern. The fewer the characters and easier to remember the better. I'm pretty sure this is built in, just can't recall how to do it.
Asked
Active
Viewed 3,389 times
2 Answers
35
Emacs' incremental search (that is, isearch-forward
) has a lot of modifiers to change the current search's behavior which you can type on the fly immediately after C-s
.
From isearch-forward
's documentation:
Type
M-c
to toggle search case-sensitivity.

viam0Zah
- 25,949
- 8
- 77
- 100
5
Have (setq case-fold-search nil)
in your .emacs or M-x set-variable case-fold-search nil
.
-
1I'm looking for an on the fly answer, i.e. normally I do want insensitive, but occasionally I wish to do lowercase sensitive momentarily. – WilliamKF Sep 26 '09 at 17:15
-
1set-variable should do the trick for you. You can set a keyboard shortcut for it and switch between the two type of searches. – Ashwin Sep 27 '09 at 05:14