bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45577: 27.1; please document default-directory for filters and senti


From: Hendrik Tews
Subject: bug#45577: 27.1; please document default-directory for filters and sentinels
Date: Mon, 04 Jan 2021 23:39:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]