unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Daniel Mendler <mail@daniel-mendler.de>
Cc: alan@idiocy.org, 48579@debbugs.gnu.org
Subject: bug#48579: 28.0.50; Spawning an emacs process using call-process results in inconsistent, behavior between GNU/Linux and macOS
Date: Sat, 22 May 2021 15:46:53 +0300	[thread overview]
Message-ID: <831r9zkkaq.fsf@gnu.org> (raw)
In-Reply-To: <ed6f5225-f1b4-fbda-286c-17138e45d63f@daniel-mendler.de> (message from Daniel Mendler on Sat, 22 May 2021 14:37:35 +0200)

> Cc: alan@idiocy.org, 48579@debbugs.gnu.org
> From: Daniel Mendler <mail@daniel-mendler.de>
> Date: Sat, 22 May 2021 14:37:35 +0200
> 
> > If this is what you think, then your concept of the default-directory
> > is in direct contradiction with how Emacs works.  The cwd of the Emacs
> > process is immaterial, and actually not even easily visible inside
> > Emacs.  When a buffer visits a file, Emacs makes a point of behaving
> > like that file's directory was its cwd.  For other buffers, my
> > suggestion is to consider their default-directory to be indeterminate,
> > and if you need it to have a specified value, you should force that by
> > calling 'cd' or setting default-directory explicitly.  Anything else
> > is bound to trip you some day, because it simply isn't how Emacs was
> > designed to behave.
> 
> I am aware that the file visiting buffers have a different
> default-directory. However the initial scratch buffer should inherit the
> current working directory of the parent process.

Like I said: this last expectation is wrong in Emacs.  The cwd of the
Emacs process is carefully concealed from Lisp, by design.  My advice
is not to make the assumption you do, because Emacs doesn't promise
you it will follow it.

> I don't see why some "indeterminate" or "undefined" behavior is
> justified here.

It is justified because that's how Emacs was designed.

> There is no technical roadblock preventing Emacs from determining the
> current directory (at least on Unixes).

Right, no roadblocks.  And Emacs does determine that, for its own
purposes, on all platforms.  It just doesn't expose that to Lisp.

> The problem is that the Mac Emacs port changes the directory
> according to its own standards.

I see no problem here.  There's nothing wrong with that behavior.

> Why do you call this "indeterminate", "undefined" or "random" behavior?
> Are there other examples where buffers have random directories?

They aren't random.





  reply	other threads:[~2021-05-22 12:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-22  5:30 bug#48579: 28.0.50; Spawning an emacs process using call-process results in inconsistent behavior between GNU/Linux and macOS Raj Krishnan
2021-05-22 10:26 ` Alan Third
2021-05-22 10:39   ` Eli Zaretskii
2021-05-22 11:35     ` Raj Krishnan
2021-05-22 11:44 ` bug#48579: 28.0.50; Spawning an emacs process using call-process results in inconsistent, " Daniel Mendler
2021-05-22 12:06   ` Alan Third
2021-05-22 12:14     ` Daniel Mendler
2021-05-22 12:29       ` Eli Zaretskii
2021-05-22 12:41         ` Daniel Mendler
2021-05-22 12:47           ` Eli Zaretskii
2021-05-22 13:01       ` Alan Third
2021-05-22 13:10         ` Daniel Mendler
2021-05-22 13:10         ` Eli Zaretskii
2021-05-22 13:15           ` Daniel Mendler
2022-07-15 10:01             ` bug#48579: 28.0.50; Spawning an emacs process using call-process results in inconsistent " Lars Ingebrigtsen
2021-05-22 12:20   ` bug#48579: 28.0.50; Spawning an emacs process using call-process results in inconsistent, " Eli Zaretskii
2021-05-22 12:37     ` Daniel Mendler
2021-05-22 12:46       ` Eli Zaretskii [this message]
2021-05-22 12:54         ` Daniel Mendler
2021-05-22 13:04           ` Alan Third
2021-05-22 13:13             ` Daniel Mendler
2021-05-22 13:20               ` Daniel Mendler
2021-05-22 13:09           ` Eli Zaretskii
2021-05-23 10:30             ` Philipp

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=831r9zkkaq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=48579@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=mail@daniel-mendler.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).