From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <831r9zkkaq.fsf@gnu.org> References: <2d81bff4-21fc-ce96-f1f1-f0bbf60b233e@daniel-mendler.de> <837djrklhx.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11740"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alan@idiocy.org, 48579@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 22 14:48:22 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkR3G-0002pw-6g for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 14:48:22 +0200 Original-Received: from localhost ([::1]:33048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkR3F-0000P0-8c for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 08:48:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkR2y-0000L5-EL for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 08:48:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkR2w-0004u3-9m for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 08:48:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lkR2w-0007vx-8h for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 08:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 May 2021 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48579 X-GNU-PR-Package: emacs Original-Received: via spool by 48579-submit@debbugs.gnu.org id=B48579.162168762330418 (code B ref 48579); Sat, 22 May 2021 12:48:02 +0000 Original-Received: (at 48579) by debbugs.gnu.org; 22 May 2021 12:47:03 +0000 Original-Received: from localhost ([127.0.0.1]:38497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkR1y-0007uX-QE for submit@debbugs.gnu.org; Sat, 22 May 2021 08:47:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkR1w-0007u3-SI for 48579@debbugs.gnu.org; Sat, 22 May 2021 08:47:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58914) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkR1r-0004bx-JZ; Sat, 22 May 2021 08:46:55 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3709 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkR1p-0007Zf-I5; Sat, 22 May 2021 08:46:55 -0400 In-Reply-To: (message from Daniel Mendler on Sat, 22 May 2021 14:37:35 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207046 Archived-At: > Cc: alan@idiocy.org, 48579@debbugs.gnu.org > From: Daniel Mendler > 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.