Subject: Re: bug#45577: 27.1; please document default-directory for filters and sentinels

From: Hendrik Tews <[email-masked]>
Date: Mon, 04 Jan 2021 23:39:25 +0100

Hi,

> Process filters and sentinels are functions, so default-directory, as
> any other buffer-local variable, will have the value that is bound in
> the current buffer.

This means that my guess was wrong. The current buffer may change
independently of the working directory of the process.

> because process filters and sentinels are not very different from other
> functions.

They are called asynchronously and the current buffer may change
arbitrarily and unrelated to the process. For functions called
from the command loop, the user has control over the current
buffer and therefore also default-directory. For filters and
sentinels the user cannot reliably control the current buffer and
neither can the programmer. IMO this is enough difference to
include a warning in the manual that filters and sentinels need
to set the current buffer in case they are not agnostic to the
current buffer of the value of default-directory.

Hendrik