GNU bug report logs - #45577
27.1; please document default-directory for filters and sentinels

Previous Next

Package: emacs;

Reported by: Hendrik Tews <hendrik <at> askra.de>

Date: Thu, 31 Dec 2020 20:41:01 UTC

Severity: normal

Tags: notabug

Found in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 45577 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Hendrik Tews <hendrik <at> askra.de>
Cc: 45577 <at> debbugs.gnu.org
Subject: Re: bug#45577: 27.1; please document default-directory for filters
 and sentinels
Date: Fri, 01 Jan 2021 02:55:15 +0100
Hendrik Tews <hendrik <at> 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.




This bug report was last modified 4 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.