Subject: bug#50187: 28.0.50; tramp is called from calendar

From: Eli Zaretskii <[email-masked]>
Date: Sat, 17 Sep 2022 09:20:38 +0300

> Cc: Michael Heerdegen <[email-masked]>, [email-masked],
>  Lars Ingebrigtsen <[email-masked]>, Michael Albinus <[email-masked]>
> From: Sam Steingold <[email-masked]>
> Date: Fri, 16 Sep 2022 17:43:17 -0400
> 
> It makes perfect sense for *occur* to inherit `default-directory', and
> no sense for calendar.

Then "M-x calendar" should take care of setting the default-directory
of its buffer.  It cannot be done by the infrastructure, because in
many cases when a buffer is created, Emacs doesn't yet know its future
purpose.

But we are arguing about issues that might be purely academic.
Michael asked you to collect some Tramp-related data, so he could look
into what happens in this particular case.  Please provide him the
data he asked for: it could very well lead to a simple and
uncontroversial solution.

> Specifically, define a function `disinherit' (and add `disinherit'
> optional argument to `get-buffer-create' et al) that would reset
> `default-directory' et al to the "root" value (whatever the value would
> be in *scratch* for `emacs -Q`) for the newly created buffer.

The default-directory of *scratch* is the directory where you start
Emacs, so it's not a fixed directory, and I don't see how it can serve
the model for anything referenced in this discussion.