summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/grep.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 2446e86abbe..35cac43bee1 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -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))