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: Daniel Martín
Subject: bug#45577: 27.1; please document default-directory for filters and sentinels
Date: Fri, 01 Jan 2021 02:55:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin)

Hendrik Tews <hendrik@askra.de> writes:

> Hi,
>
> the value of default-directory has a number of implicit effects.
> Therefore, it would be good, if the elisp manual would
> explicitly state the value that default-directory has in process
> filters and process sentinels. From the behavior I see, it seems
> it gets the value from the working directory of the process. Is
> this right?

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.

As you said, it's usually the same as the working directory of the
process, because the working directory of an inferior process in Emacs
is usually initialized from default-directory when the process is
started.  This is described at (info "(elisp) Subprocess Creation").
Note that default-directory *may change* as the user switches buffers or
sets it explicitly with "M-x cd", for example.

For more information about when and how Emacs changes default-directory
for file-visiting and non-file-visiting buffers, see (info "(emacs) File
Names").

I don't think the manual needs to be much more explicit here, IMHO,
because process filters and sentinels are not very different from other
functions.  But let's wait for more opinions from the Emacs developers.




reply via email to

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