emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exit


From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP.
Date: Tue, 04 May 2010 09:48:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>>>>> For this bug report, yes.  But for the more general session management
>>>>> handling, it really is "start where we stopped".
>>>> But that's the whole problem: what do you define as "where we stopped"?
>>>> As I said, there are as many current directories as there are buffers.
>>> Yes there is, it is what getcwd returns.  That is where the process is
>>> started.
>> A far cry from "where we stopped".

> No, according to the OS, that is exactly where the process current directory
> is when we stop.  Where do you say the process current directory is when
> Emacs stops?

What I say is that users couldn't care less what's the POSIX cwd of
Emacs (as long as it's sane, that is).

> A file dialog can remember where it was when closed last, and by default
> show that directory again.  That doesn't mean that the process now has two
> current directories.

You're suggesting a user-level feature (a new command line arg) based on
some obscure internal detail.  That doesn't make much sense unless
there's no other way to get the user-level behavior you want.

> internally. Restarting Emacs in the same directory as it stopped always
> work, but just pointing out a desktop file does not.  For example, the
> directory remembered by *scratch* is not restored.

The --chdir is not enough to restore the default-directory of all the
buffers either.  So if you want to preserve that info, then add
`default-directory' to desktop-locals-to-save rather than try to get
that same result in a round about way by adding a new vaguely related
feature which doesn't quite do what we want anyway.

>>>>> Who knows what other/future packages save in the current directory?
>>>> There's really no such thing as "Emacs's current directory".
>>> Yes there is, it is what getcwd returns.  Anything else is just cosmetics
>>> and not the current directory of the Emacs process.
>> In which way is this getcwd data relevant/useful?

> It is where Emacs was started, it is where Emacs was stopped, and thus where
> Emacs should be restarted.

Why?  Why would a user care?

> Where else should Emacs be restarted?

Doesn't matter as long as the end result is the one we want.
Usually I'd expect $HOME to be a good choice.

> I don't understand, why would we ever want Emacs to restart in a different
> directory than where it stopped?  You claim there is a bunch of directories
> to choose from, so we should just give up and not do anything?

Exactly, because that cwd doesn't matter to Emacs (and by extension to
Emacs's users).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]