GNU bug report logs - #48579
28.0.50; Spawning an emacs process using call-process results in inconsistent behavior between GNU/Linux and macOS

Previous Next

Package: emacs;

Reported by: Raj Krishnan <rajkrishnan1996 <at> gmail.com>

Date: Sat, 22 May 2021 07:36:02 UTC

Severity: minor

Tags: wontfix

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: alan <at> idiocy.org, 48579 <at> 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 14:54:26 +0200
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.




This bug report was last modified 2 years and 310 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.