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

From: Eli Zaretskii <[email-masked]>
Date: Mon, 08 Feb 2021 17:07:09 +0200

> From: Tino Calancha <[email-masked]>
> Date: Sun, 07 Feb 2021 23:32:07 +0100
> Cc: stefan monnier <[email-masked]>, [email-masked]
> 
> 
> I wish, by default, to only been prompted for buffers whose default-directory
> is under the caller dir (except when closing Emacs).
> 
> ## Description
> Everyday I connect via Tramp with machines at each of my properties (Hawaii,
> Maldives, Palawan, and a very large etc.)
> Then, in the same Emacs session, I connect to a host in Wall Street to see
> how my stock grows, making me richer.
> Often, a compilation buffer at New York city prompts me to save a buffer
> at Waikiki beach.  Quite distracting! Cannot focus on my money!
> 
> I found some people with related issues:
> https://emacs.stackexchange.com/questions/7268/package-el-asks-whether-i-want-to-save-modified-files-before-package-installatio
> https://emacs.stackexchange.com/questions/40593/automatically-dont-save-buffers-before-compiling
> 
> ## How to reproduce
> Sure, I understand not all of you can possibly reproduce the above conditions.
> Maybe you can try the following poor man's recipe:
> 
> emacs -Q ~/foo.txt
> ;; write something and do not save
> foo
> ;; now visit another, for instance, the Emacs source dir
> C-x d EMACS-SRC-DIR RET
> ;; call rgrep with whatever string
> M-x rgrep money RET *.el RET RET
> ;; You will be prompted to save ~/foo.txt

You are assuming that when save-some-buffers runs, the default
directory is the same as when you issued whatever command triggered
the call to save-some-buffers?  Is that assumption really accurate?