From: Juri Linkov <juri@jurta.org>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: "Stephen J. Turnbull" <stephen@xemacs.org>,
Stefan Monnier <monnier@IRO.UMontreal.CA>,
"emacs-devel@gnu.org" <emacs-devel@gnu.org>
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 [thread overview]
Message-ID: <87zl0ffnlm.fsf@mail.jurta.org> (raw)
In-Reply-To: <4BE06C72.60003@swipnet.se> ("Jan Djärv"'s message of "Tue, 04 May 2010 20:50:26 +0200")
>> (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/
prev parent reply other threads:[~2010-05-04 19:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1O8efK-0003y3-Sb@internal.in.savannah.gnu.org>
2010-05-02 19:24 ` [Emacs-diffs] /srv/bzr/emacs/trunk r100117: Run kill-emacs when exiting for display closed or SIGTERM/HUP Stefan Monnier
2010-05-02 20:53 ` Jan Djärv
2010-05-03 0:55 ` Stefan Monnier
2010-05-03 8:21 ` Jan D.
2010-05-03 17:43 ` Stefan Monnier
2010-05-03 18:08 ` Jan Djärv
2010-05-04 2:38 ` Stefan Monnier
2010-05-04 7:59 ` Jan Djärv
2010-05-04 11:49 ` Stephen J. Turnbull
2010-05-04 13:03 ` Jan D.
2010-05-04 13:48 ` Stefan Monnier
2010-05-04 14:42 ` Jan D.
2010-05-04 3:03 ` Stephen J. Turnbull
2010-05-04 8:06 ` Jan Djärv
2010-05-04 11:33 ` Stephen J. Turnbull
2010-05-04 12:51 ` Jan D.
2010-05-04 13:54 ` Stefan Monnier
2010-05-04 14:26 ` Jan D.
2010-05-04 18:50 ` Stefan Monnier
2010-05-05 5:17 ` Stephen J. Turnbull
2010-05-05 7:21 ` Jan Djärv
2010-05-05 14:00 ` Stefan Monnier
2010-05-05 16:18 ` Jan Djärv
2010-05-05 18:24 ` Stefan Monnier
2010-05-04 16:45 ` Juri Linkov
2010-05-04 18:50 ` Jan Djärv
2010-05-04 19:55 ` Juri Linkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zl0ffnlm.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
--cc=jan.h.d@swipnet.se \
--cc=monnier@IRO.UMontreal.CA \
--cc=stephen@xemacs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.