GNU bug report logs - #24999
24.5; bad doc for invocation-directory

Previous Next

Package: emacs;

Reported by: Francesco Potortì <pot <at> gnu.org>

Date: Wed, 23 Nov 2016 10:25:02 UTC

Severity: minor

Found in version 24.5

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Francesco Potortì <pot <at> gnu.org>
Cc: 24999 <at> debbugs.gnu.org
Subject: bug#24999: closed (Re: bug#24999: 24.5;	bad doc for invocation-directory)
Date: Fri, 25 Nov 2016 15:27:01 +0200
> Date: Fri, 25 Nov 2016 09:44:00 +0100
> From: Francesco Potortì <pot <at> gnu.org>
> Cc: 24999 <at> debbugs.gnu.org
> 
> Now that I rethink of it.  I put this my .emacs:
> 
> (setq start-directory (progn (set-buffer "*scratch*") default-directory))

What does this do when Emacs is invoked with "--chdir DIR"?

> and, while writing it, it struck me that "invocation-directory" should
> mean just that: the directory from which Emacs was invoked.  Maybe at
> some time in the past it was, or someone thought it should have been,
> which may explain the wrong docs in the Elisp manual.
> 
> The current value of invocation-directory should be assigned to
> something like exec-directory, or executable-directory or something like
> that. 

No, it's too late to change the semantics of invocation-directory, it
has been with us in its present meaning far too long.  If you look at
how it's generated, you will understand: it starts with the value of
argv[0], there are fallbacks for when that doesn't include leading
directories (one of the fallbacks is to search PATH, for example).

Once again, Emacs knows its original current directory when it starts,
so exposing that to Lisp should be easy, if that is desired.




This bug report was last modified 8 years and 242 days ago.

Previous Next


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