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 14:50:04 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> Yes, --chdir solves partially the problem you encountered.  The problem
>> with that is the "partially".  Adding a new feature to *partially* fix
>> a bug is only a good idea if that bug can't be solved fully some other
>> way (e.g. by adding a different feature).
> The --chdir was introduced to restore a feature we had earlier, it is
> not a new feature.

Arguing on words.

> It is a new command line option, but an old feature
> w.r.t. session management.

I still don't understand what was that feature you're talking about.
The way I see it, it was more like some accidental behavior which
happened to be convenient.  I'd like to use this "breakage" as an
opportunity to replace those lucky accidents by sound behavior.

> > 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).
> Oh, they do care where Emacs is started from the command line.  How else can
> they get Emacs to automatically read saved desktops?

The fact that there are no other way currently is (one of) the problem(s)
I'd like to fix here.

> > You're suggesting a user-level feature (a new command line arg) based on
> > some obscure internal detail.
> I didn't think automatic loading of desktops and getting the right
> default-directory was obscure.

You misread, since neither of those two are internal details.

> > 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.
> No, if I have done a cd in some buffer, it is not enough.  But for all
> other uses, it is.

No, there are plenty of other cases, since the default-directory is
generally inherited from the buffer from which you create the new
buffer: no need to "cd", just open a file, and then do C-h f car RET and
you'll get that file's directory as default-directory in *Help*.

> > Doesn't matter as long as the end result is the one we want.
> > Usually I'd expect $HOME to be a good choice.
> And how will Emacs avoid to load my desktop file there if I didn't use
> it previously?

That argues for a change in desktop.el to make it behave better with
session management.

>> If you don't use desktop, then Emacs is restarted in a completely
>> different state, so it's really no surprise that the default-directory
>> in *scratch* is different.  It's just a very minor detail in
>> this respect.
> It may be to you, but it is not to me.  I open files all the time from
> *scratch* just because the default directory there is right.  It is a bug
> for Emacs not to restore this after a session restart.

Can you describe your use-case more precisely?

BTW, why use --chdir rather than save the default-directories in the
session file if you think that it should work even without desktop.el?

> I'd like desktop.el to be more modular so we could save desktop
> automatically in the session specific restore data file.  I tried
> once, but it was so hard coded to use just one file, so I gave up.

Ah, now you're starting to talk.  Can you give some details of what you
tried and where the "hardcoding" was showing its ugly head?

> If I start emacs in /some/dir without a desktop file and have desktop-mode
> enabled, there will be no desktop saved when I log out.
> When the session manager then restarts Emacs in $HOME it will read my
> desktop file in $HOME.  That is a bug also.

OK, let's try and fix it right, then.


        Stefan




reply via email to

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