GNU bug report logs -
#24999
24.5; bad doc for invocation-directory
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24999 in the body.
You can then email your comments to 24999 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Wed, 23 Nov 2016 10:25:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Francesco Potortì <pot <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 23 Nov 2016 10:25:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The elisp manual says:
-- Variable: invocation-directory
This variable holds the directory from which the Emacs executable
was invoked, or perhaps `nil' if that directory cannot be
determined.
However, the doc string says:
invocation-directory is a variable defined in `C source code'.
Its value is "/usr/bin/"
Documentation:
The directory in which the Emacs executable was found, to run it.
The value is nil if that directory's name is not known.
The second description is the correct one, and the elisp manual is
wrong.
The only way I found for obtaining the directory from which
Emacs was invoked is to get the default-directory of the *scratch*
buffer.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Thu, 24 Nov 2016 17:24:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Francesco Potortì <pot <at> gnu.org>
:
bug acknowledged by developer.
(Thu, 24 Nov 2016 17:24:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 24999-done <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 23 Nov 2016 11:23:08 +0100
> From: Francesco Potortì <pot <at> gnu.org>
>
> The elisp manual says:
>
> -- Variable: invocation-directory
> This variable holds the directory from which the Emacs executable
> was invoked, or perhaps `nil' if that directory cannot be
> determined.
>
> However, the doc string says:
>
> invocation-directory is a variable defined in `C source code'.
> Its value is "/usr/bin/"
>
> Documentation:
> The directory in which the Emacs executable was found, to run it.
> The value is nil if that directory's name is not known.
>
>
> The second description is the correct one, and the elisp manual is
> wrong.
Thanks, fixed on the release branch.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Thu, 24 Nov 2016 17:46:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 24999 <at> debbugs.gnu.org (full text, mbox):
I had written:
>The only way I found for obtaining the directory from which
>Emacs was invoked is to get the default-directory of the *scratch*
>buffer.
Can this be considered as a bug? Or at least a wishlist? Having a
variable that contains the invocation directory?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Thu, 24 Nov 2016 17:55:01 GMT)
Full text and
rfc822 format available.
Message #16 received at 24999 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 24 Nov 2016 18:45:22 +0100
> From: Francesco Potortì <pot <at> gnu.org>
>
> I had written:
>
> >The only way I found for obtaining the directory from which
> >Emacs was invoked is to get the default-directory of the *scratch*
> >buffer.
>
> Can this be considered as a bug? Or at least a wishlist? Having a
> variable that contains the invocation directory?
IMO it's not meaningful in Emacs to ask which directory was the
"current" when Emacs started. That's because Emacs pretends the
current directory is different for every buffer.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Thu, 24 Nov 2016 18:03:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 24999 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 24 Nov 2016 19:53:41 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 24999 <at> debbugs.gnu.org
>
> IMO it's not meaningful in Emacs to ask which directory was the
> "current" when Emacs started. That's because Emacs pretends the
> current directory is different for every buffer.
Nevertheless, I'd be interested to hear in what use case you needed to
know that directory.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Thu, 24 Nov 2016 18:10:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 24999 <at> debbugs.gnu.org (full text, mbox):
>> IMO it's not meaningful in Emacs to ask which directory was the
>> "current" when Emacs started. That's because Emacs pretends the
>> current directory is different for every buffer.
>
>Nevertheless, I'd be interested to hear in what use case you needed to
>know that directory.
It's just that I use to run sometimes two different instances of Emacs,
often different versions, with slightly different configurations
depending on the directory where I start them from. But I suppose
that's not a general enough use case :)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Thu, 24 Nov 2016 18:20:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 24999 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 24 Nov 2016 19:08:58 +0100
> From: Francesco Potortì <pot <at> gnu.org>
> Cc: 24999 <at> debbugs.gnu.org
>
> It's just that I use to run sometimes two different instances of Emacs,
> often different versions, with slightly different configurations
> depending on the directory where I start them from. But I suppose
> that's not a general enough use case :)
Maybe not. In any case, Emacs knows internally what was the original
pwd, so it would be easy to expose that to Lisp, if we want.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Fri, 25 Nov 2016 11:00:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 24999 <at> debbugs.gnu.org (full text, mbox):
>> >The only way I found for obtaining the directory from which
>> >Emacs was invoked is to get the default-directory of the *scratch*
>> >buffer.
>>
>> Can this be considered as a bug? Or at least a wishlist? Having a
>> variable that contains the invocation directory?
>
>IMO it's not meaningful in Emacs to ask which directory was the
>"current" when Emacs started. That's because Emacs pretends the
>current directory is different for every buffer.
Now that I rethink of it. I put this my .emacs:
(setq start-directory (progn (set-buffer "*scratch*") default-directory))
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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Fri, 25 Nov 2016 13:28:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 24999 <at> debbugs.gnu.org (full text, mbox):
> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Sat, 26 Nov 2016 01:08:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 24999 <at> debbugs.gnu.org (full text, mbox):
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> and, while writing it, it struck me that "invocation-directory" should
> mean just that: the directory from which Emacs was invoked.
'invocation-directory' is the directory in which the Emacs executable
was found. It is NOT supposed to be the directory that was current
at that time. If you run Emacs with ~/bin/emacs, 'invocation-directory'
would be "~/bin/".
--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Sat, 26 Nov 2016 01:09:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 24999 <at> debbugs.gnu.org (full text, mbox):
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> Once again, Emacs knows its original current directory when it starts,
> so exposing that to Lisp should be easy, if that is desired.
Isn't this found in default-directory in *scratch*?
--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24999
; Package
emacs
.
(Sat, 26 Nov 2016 07:21:02 GMT)
Full text and
rfc822 format available.
Message #40 received at 24999 <at> debbugs.gnu.org (full text, mbox):
> From: Richard Stallman <rms <at> gnu.org>
> CC: pot <at> gnu.org, 24999 <at> debbugs.gnu.org
> Date: Fri, 25 Nov 2016 20:07:59 -0500
>
> > Once again, Emacs knows its original current directory when it starts,
> > so exposing that to Lisp should be easy, if that is desired.
>
> Isn't this found in default-directory in *scratch*?
Not if you use --chdir on the command line, or have some --eval or -f
there that causes Emacs to change the directory at startup.
As I said, I'm not sure we need such a variable, but if we decide to
have it, it should be easy to add.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 24 Dec 2016 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 241 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.