unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Unknown <unknown@unknown.invalid>
To: Hendrik Tews <hendrik@askra.de>
Cc: 45577@debbugs.gnu.org
Subject: bug#45577: 27.1; please document default-directory for filters and sentinels
Date: Fri, 01 Jan 2021 02:55:15 +0100	[thread overview]
Message-ID: <m1ft3lto8s.fsf@yahoo.es> (raw)
In-Reply-To: <87y2hdzp44.fsf@cert.kernkonzept.com> (Hendrik Tews's message of "Thu, 31 Dec 2020 21:39:55 +0100")

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	other threads:[~2021-01-01  1:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 20:39 bug#45577: 27.1; please document default-directory for filters and sentinels Hendrik Tews
2021-01-01  1:55 ` Unknown [this message]
2021-01-01 11:03   ` Lars Ingebrigtsen
2021-01-04 22:42     ` Hendrik Tews
2021-01-05  8:54       ` Lars Ingebrigtsen
2021-01-11 15:49         ` Lars Ingebrigtsen
2021-01-04 22:39   ` Hendrik Tews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1ft3lto8s.fsf@yahoo.es \
    --to=unknown@unknown.invalid \
    --cc=45577@debbugs.gnu.org \
    --cc=hendrik@askra.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).