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: Philipp <p.stephani2 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Daniel Mendler <mail <at> daniel-mendler.de>, Alan Third <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: Sun, 23 May 2021 12:30:36 +0200

> Am 22.05.2021 um 15:09 schrieb Eli Zaretskii <eliz <at> gnu.org>:
> 
> 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.
> 

The actual working directory as seen by the kernel/process should indeed be irrelevant.  What matters is that when processing command-line arguments in batch mode, Emacs behaves like other Unix tools in that it resolves relative filenames as relative to the working directory that was current when the process was started.  In other words, when executing

   emacs -Q -batch -eval '(print default-directory)'

from a shell, Emacs must always print a representation of the shell's current working directory (ignoring corner cases such as "default directory has been removed during process startup").  Guaranteeing that (a) when processing command-line arguments the *scratch* buffer is current (unless changed by a previous command-line argument), and (b) its default directory will be set to a representation of the initial process working directory should ensure that.  I guess that's already the case for all operating systems, and we only need to document it.



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.