Windows 10, Emacs 25
2 Answers
isearch is case-insensitive by default, and this behaviour is connected to that.
Typing M-c while isearching calls isearch-toggle-case-fold which enables you to switch to a case-sensitive search, at which point you'll observe that your search string will retain its mixed-case when you paste it into the minibuffer.
The manual says:
Normally, when the search is case-insensitive, text yanked into the search string is converted to lower case, so that the search remains case-insensitive (*note case folding: Lax Search.). However, if the value of the variable ‘search-upper-case’ (*note search-upper-case: Lax Search.) is other than ‘not-yanks’, that disables this down-casing.
See:
- C-hig
(emacs)Isearch Yank - C-hig
(emacs)Lax Search - M-x
customize-optionRETsearch-upper-case
If you select the text and paste it while the pointer is still in the scratch buffer ( in your example) the text is copied all lower case.
This is corrected by moving the pointer to the minibuffer like so: copy-region: M-w, calling I-serach: C-s or M-x I-search-forward ,moving the pointer to the mini buffer: C-x o, mouse click, or whatever method you use, and yank C-y.
The text will be copied correctly.
- 1Alt-e is a quick way to edit the isearch string.InHarmsWay– InHarmsWay2018-07-08 14:05:16 +00:00Commented Jul 8, 2018 at 14:05

