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 16:09:05 +0300 Message-ID: <83y2c6kj9q.fsf@gnu.org> References: <2d81bff4-21fc-ce96-f1f1-f0bbf60b233e@daniel-mendler.de> <837djrklhx.fsf@gnu.org> <831r9zkkaq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32593"; 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 15:10: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 1lkRON-0008Kj-4u for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 15:10:11 +0200 Original-Received: from localhost ([::1]:44286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkROM-0000nK-7i for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 09:10:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkROE-0000lA-8V for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 09:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55212) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkROE-0003vL-0F for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 09:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lkROD-0000H6-Of for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 09:10:01 -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 13:10:01 +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.1621688955993 (code B ref 48579); Sat, 22 May 2021 13:10:01 +0000 Original-Received: (at 48579) by debbugs.gnu.org; 22 May 2021 13:09:15 +0000 Original-Received: from localhost ([127.0.0.1]:38525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkRNS-0000Fw-Qn for submit@debbugs.gnu.org; Sat, 22 May 2021 09:09:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkRNQ-0000Fj-K8 for 48579@debbugs.gnu.org; Sat, 22 May 2021 09:09:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59192) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkRNK-0003et-PV; Sat, 22 May 2021 09:09:06 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1093 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 1lkRNK-0004zv-2I; Sat, 22 May 2021 09:09:06 -0400 In-Reply-To: (message from Daniel Mendler on Sat, 22 May 2021 14:54:26 +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:207050 Archived-At: > Cc: alan@idiocy.org, 48579@debbugs.gnu.org > From: Daniel Mendler > Date: Sat, 22 May 2021 14:54:26 +0200 > > > 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. We are mis-communicating. All I'm saying is that this default-directory is not (and doesn't have to be) the cwd of the Emacs process. > 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. I don't see why it matters what logic Emacs follows on macOS when its starts, wrt the cwd of the Emacs process. If you want to make sure that the default-directory of *scratch* is the directory where Emacs was started, we could add such a feature (it doesn't exists now, and relying on what you see on GNU/Linux means you are relying on one particular implementation). However, even if we do introduce such a feature, that still won't tell you anything about the cwd of the Emacs process. If this latter aspect is what you really care about, you will have to explain the rationale, because I don't see how it could be important.