all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hendrik Tews <hendrik@askra.de>
To: "Daniel Martín" <mardani29@yahoo.es>
Cc: 45577@debbugs.gnu.org
Subject: bug#45577: 27.1; please document default-directory for filters and sentinels
Date: Mon, 04 Jan 2021 23:39:25 +0100	[thread overview]
Message-ID: <87im8ciaxu.fsf@cert.kernkonzept.com> (raw)
In-Reply-To: <m1ft3lto8s.fsf@yahoo.es> ("Daniel Martín"'s message of "Fri, 01 Jan 2021 02:55:15 +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





      parent reply	other threads:[~2021-01-04 22:39 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
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 [this message]

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

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

  git send-email \
    --in-reply-to=87im8ciaxu.fsf@cert.kernkonzept.com \
    --to=hendrik@askra.de \
    --cc=45577@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.