]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow rgrep users to indicate case folding easier
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 Jun 2022 13:32:57 +0000 (15:32 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 Jun 2022 13:33:12 +0000 (15:33 +0200)
* lisp/progmodes/grep.el (rgrep): Allow the user to toggle case
sensitivity interactively (bug#16913).

lisp/progmodes/grep.el

index a8d743b87a8e654284935d535c4f04c50ccdbbb3..4dedbc66aee90f3c29bda67c0ef82492fba484f2 100644 (file)
@@ -1205,7 +1205,11 @@ When called programmatically and FILES is nil, REGEXP is expected
 to specify a command to run.
 
 If CONFIRM is non-nil, the user will be given an opportunity to edit the
-command before it's run."
+command before it's run.
+
+Interactively, the user can use the `M-c' command while entering
+the regexp to indicate whether the grep should be case sensitive
+or not."
   (interactive
    (progn
      (grep-compute-defaults)
@@ -1233,7 +1237,8 @@ command before it's run."
                                   grep-find-command)))
            (compilation-start regexp #'grep-mode))
       (setq dir (file-name-as-directory (expand-file-name dir)))
-      (let ((command (rgrep-default-command regexp files nil)))
+      (let* ((case-fold-search (read-regexp-case-fold-search regexp))
+             (command (rgrep-default-command regexp files nil)))
        (when command
          (if confirm
              (setq command