Search code examples
emacscase-sensitiveincremental-search

How to search incrementally for an all-lower-case pattern in Emacs?


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.


Solution

  • 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.