From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel 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 Organization: JURTA Message-ID: <87zl0ffnlm.fsf@mail.jurta.org> References: <3D94147C-CA80-4DB1-AD11-4707C3077275@swipnet.se> <4BDE87A4.5060701@swipnet.se> <4BDF1106.7060200@swipnet.se> <87633474hd.fsf@uwakimon.sk.tsukuba.ac.jp> <4BDFD57A.3050808@swipnet.se> <874oinppgn.fsf@mail.jurta.org> <4BE06C72.60003@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1273066246 2099 80.91.229.12 (5 May 2010 13:30:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 13:30:46 +0000 (UTC) Cc: "Stephen J. Turnbull" , Stefan Monnier , "emacs-devel@gnu.org" To: Jan =?iso-8859-1?Q?Dj=E4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 05 15:30:38 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9egP-00066D-SV for ged-emacs-devel@m.gmane.org; Wed, 05 May 2010 15:30:38 +0200 Original-Received: from localhost ([127.0.0.1]:56509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9egP-000184-7S for ged-emacs-devel@m.gmane.org; Wed, 05 May 2010 09:30:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9OHa-0005Rn-97 for emacs-devel@gnu.org; Tue, 04 May 2010 15:59:54 -0400 Original-Received: from [140.186.70.92] (port=48994 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9OHX-0005Nu-Go for emacs-devel@gnu.org; Tue, 04 May 2010 15:59:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9OHV-0000m2-NQ for emacs-devel@gnu.org; Tue, 04 May 2010 15:59:51 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:40075 helo=mx2.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9OHV-0000lc-C3 for emacs-devel@gnu.org; Tue, 04 May 2010 15:59:49 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.30.129.cable.starman.ee [82.131.30.129]) by mx2.starman.ee (Postfix) with ESMTP id 6291B3F40E0; Tue, 4 May 2010 22:59:41 +0300 (EEST) In-Reply-To: <4BE06C72.60003@swipnet.se> ("Jan =?iso-8859-1?Q?Dj=E4rv=22's?= message of "Tue, 04 May 2010 20:50:26 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124528 Archived-At: >> (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/