Variable: grep-save-buffers

grep-save-buffers is a customizable variable defined in grep.el.gz.

Value

ask

Documentation

If non-nil, save buffers before running the grep commands.

If ask, ask before saving. If a function, call it with no arguments with each buffer current, as a predicate to determine whether that buffer should be saved or not. E.g., one can set this to
  (lambda ()
    (string-prefix-p my-grep-root (file-truename (buffer-file-name))))
to limit saving to files located under my-grep-root.

This variable was added, or its default value changed, in Emacs 26.1.

Probably introduced at or before Emacs version 26.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/grep.el.gz
(defcustom grep-save-buffers 'ask
  "If non-nil, save buffers before running the grep commands.
If `ask', ask before saving.  If a function, call it with no arguments
with each buffer current, as a predicate to determine whether that
buffer should be saved or not.  E.g., one can set this to
  (lambda ()
    (string-prefix-p my-grep-root (file-truename (buffer-file-name))))
to limit saving to files located under `my-grep-root'."
  :version "26.1"
  :type '(choice
          (const :tag "Ask before saving" ask)
          (const :tag "Don't save buffers" nil)
          function
          (other :tag "Save all buffers" t)))