I am using following answer to search and replace a word in the entire buffer:
(defun query-replace-region-or-from-top () (interactive) (progn (let ((orig-point (point))) (if (use-region-p) (call-interactively 'query-replace) (save-excursion (goto-char (point-min)) (call-interactively 'query-replace))) (message "Back to old point.") (goto-char orig-point)))) (global-set-key "\C-x\C-r" 'query-replace-region-or-from-top)```
When I apply query-replace-region-or-from-top
, for example emacs
into emacs_world
it also changes EMACS
into EMACS_WORLD
.
How can I make query-replace-region-or-from-top
case-sensitive?
defun
function like using(let ((case-fold-search nil))