]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug when calling `rgrep` non-interactively
authorStefan Kangas <stefankangas@gmail.com>
Tue, 13 Dec 2022 21:01:45 +0000 (22:01 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Tue, 13 Dec 2022 22:32:21 +0000 (23:32 +0100)
* lisp/progmodes/grep.el (rgrep): Fix bug where running
non-interactively requires running it interactively
first.  (Bug#60024)

lisp/progmodes/grep.el

index 2446e86abbeb71bc75552c92327a784f05da9b8f..35cac43bee170f62a801b42bb05cd3cf5493ec42 100644 (file)
@@ -1254,6 +1254,10 @@ or not."
                                          nil default-directory t))
                (confirm (equal current-prefix-arg '(4))))
           (list regexp files dir confirm))))))
+  ;; If called non-interactively, also compute the defaults if we
+  ;; haven't already.
+  (unless grep-find-template
+    (grep-compute-defaults))
   (when (and (stringp regexp) (> (length regexp) 0))
     (unless (and dir (file-accessible-directory-p dir))
       (setq dir default-directory))