Subject: bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir

From: Juri Linkov <[email-masked]>
Date: Tue, 09 Feb 2021 19:50:33 +0200

>  @vindex save-some-buffers-default-predicate
> +@vindex save-some-buffers-restrict-to-caller-subdirs
>  You can customize the value of
> -@code{save-some-buffers-default-predicate} to control which buffers
> -Emacs will ask about.
> +@code{save-some-buffers-default-predicate} and
> +@code{save-some-buffers-restrict-to-caller-subdirs} to control which
> +buffers Emacs will ask about.

Why not simply add a new option to the existing variable
save-some-buffers-default-predicate?  For example:

(defcustom save-some-buffers-default-predicate nil
  "Default predicate for `save-some-buffers'."
  :group 'auto-save
  ;; FIXME nil should not be a valid option, let alone the default,
  ;; eg so that add-function can be used.
  :type '(choice (const :tag "Default" nil)
                 (const :tag "Subdirs of default directory" default-directory)
                 (const :tag "Project root" project-root)
                 function)