From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler 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 14:54:26 +0200 Message-ID: References: <2d81bff4-21fc-ce96-f1f1-f0bbf60b233e@daniel-mendler.de> <837djrklhx.fsf@gnu.org> <831r9zkkaq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4419"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alan@idiocy.org, 48579@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 22 14:55:11 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 1lkR9q-0000vp-Ib for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 14:55:10 +0200 Original-Received: from localhost ([::1]:36120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkR9p-0002qa-I8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 08:55:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkR9i-0002qO-Tp for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 08:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkR9i-0006zC-MO for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 08:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lkR9i-00085i-KC for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 08:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 May 2021 12:55: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.162168807631060 (code B ref 48579); Sat, 22 May 2021 12:55:02 +0000 Original-Received: (at 48579) by debbugs.gnu.org; 22 May 2021 12:54:36 +0000 Original-Received: from localhost ([127.0.0.1]:38505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkR9H-00084u-WF for submit@debbugs.gnu.org; Sat, 22 May 2021 08:54:36 -0400 Original-Received: from server.qxqx.de ([178.63.65.180]:33019 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkR9F-00084g-TF for 48579@debbugs.gnu.org; Sat, 22 May 2021 08:54:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cAwFOdtnaYfps9DoW7rhkdwEWg1W8Bm8O2bbZ7QJ9cU=; b=b0HFC7l4Hr7Lpj7ZUzUpgjcieX lpnCHOiHvI8ACB5kBy7hH+LbDSZipbTPE26K4YowPLzJejH+oPUOt8bDrynoPFTm1jdox1mlfj04R czfMu9ueb8A9ecfpgpGZzjpCjbFmX5ixeTohkNy+gIkOukCzRQY26f2BDy/ixOLuXlbk=; In-Reply-To: <831r9zkkaq.fsf@gnu.org> Content-Language: en-US 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:207047 Archived-At: On 5/22/21 2:46 PM, Eli Zaretskii wrote: >> 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. > >> 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. This statement does not seem correct to me. There is a default-directory which I can access in the initial *scratch* buffer. Something is exposed here. Why is the default-directory not nil then? Seriously, what is the justification for this? If Emacs determines the current working directory on all platforms, why does it not guarantee that the initial *scratch* buffer sees this directory? But this discussion here seems to be a bit off-track. My point here is that the current working directory determination on MacOS uses a heuristic, which is not correct. It incorrectly determines that Emacs has been launched from the finder or some other Mac GUI application and therefore changes the directory to the home directory. If Emacs is indeed started from the GUI, this makes all sense. But this is not the case here. The TTY heuristic, that Alan described, is insufficient.