[Top][All Lists]
[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: |
Juri Linkov |
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 22:55:49 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) |
>> (defvar command-line-default-directory nil
>> "Default directory to use for command line arguments.
>> This is normally copied from `default-directory' when Emacs starts.")
>
> Isn't this circular? Who gets its value first?
Yes, this is a problem. The very first thing `command-line' does
is to set `command-line-default-directory' from `default-directory',
and the very last thing it does is to load the session file.
I think this order is not right. At least, restoring the saved session
should cooperate with restoring the saved desktop. `command-line'
restores the desktop when it runs `after-init-hook'. So perhaps
`emacs-session-restore' should be called before `desktop-read'.
Then desktop.el could save the desktop file name in the session file
and restore it in another session using the desktop file name
from the session data.
>> However, a new command line arg --chdir seems unnecessary. When the
>> user wants `command-line-default-directory' to be another directory,
>> then the user can cd to this directory before running Emacs.
>
> The user can not cd if Emacs is started from the session manager.
This means that --chdir should not be a user-level command-line arg
If it is intended for the session manager, then `--smid' should be
enough for the session manager.
>> If this is necessary for the session management, it's another problem.
>> There is a special arg --smid that could be used.
>
> I don't follow. --smid is strictly for session manager use. If you
> mean Emacs could save command-line-default-directory when it is
> terminated by the session manager, that is doable.
Emacs can save `command-line-default-directory', but not restore (I mean
the problem mentioned above). But the code saved to the session file
could explicitly set `default-directory' of *scratch* and *Messages* to
the saved value of `command-line-default-directory'.
>>> Desktop file isn't loaded.
>>
>> I think --smid should restore the same desktop file that was saved
>> in the previous session. And also restore the old value of
>> `command-line-default-directory'.
>
> And if no session file was used, and there is one in the directory
> Emacs is restarted from?
When `emacs-save-session-functions' will save the current desktop
file name, then `emacs-session-restore' will restore the desktop
using this file name.
--
Juri Linkov
http://www.jurta.org/emacs/
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., (continued)
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Stefan Monnier, 2010/05/04
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Jan D., 2010/05/04
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Stefan Monnier, 2010/05/04
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Stephen J. Turnbull, 2010/05/05
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Jan Djärv, 2010/05/05
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Stefan Monnier, 2010/05/05
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Jan Djärv, 2010/05/05
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Stefan Monnier, 2010/05/05
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Juri Linkov, 2010/05/04
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP., Jan Djärv, 2010/05/04
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP.,
Juri Linkov <=