From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" 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 20:33:21 +0900 Message-ID: <87d3xb7vge.fsf@uwakimon.sk.tsukuba.ac.jp> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1272973641 29702 80.91.229.12 (4 May 2010 11:47:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 11:47:21 +0000 (UTC) Cc: 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 Tue May 04 13:47:20 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 1O9Gap-0008J1-Hs for ged-emacs-devel@m.gmane.org; Tue, 04 May 2010 13:47:16 +0200 Original-Received: from localhost ([127.0.0.1]:55098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9Gao-00027r-M9 for ged-emacs-devel@m.gmane.org; Tue, 04 May 2010 07:47:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9GOf-0005bt-Qp for emacs-devel@gnu.org; Tue, 04 May 2010 07:34:41 -0400 Original-Received: from [140.186.70.92] (port=48418 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9GOa-0005Rx-8G for emacs-devel@gnu.org; Tue, 04 May 2010 07:34:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9GOF-0000ZL-RO for emacs-devel@gnu.org; Tue, 04 May 2010 07:34:17 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]:39838) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9GOF-0000Yh-9S for emacs-devel@gnu.org; Tue, 04 May 2010 07:34:15 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 5C4481535B3; Tue, 4 May 2010 20:34:13 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 80B601A3626; Tue, 4 May 2010 20:33:21 +0900 (JST) In-Reply-To: <4BDFD57A.3050808@swipnet.se> X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta29) "garbanzo" a03421eb562b XEmacs Lucid (x86_64-unknown-linux) 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:124500 Archived-At: Jan Dj=E4rv writes: > Put up a solution that addresses the problems: >=20 > Desktop file isn't loaded. > *scratch* and *Messages* and more get the wrong default directory. >=20 > It is nice of you to let us know that you don't care about getcwd, but n= ot=20 > very helpful. As I wrote, it's *one* data point. Specifically, I can't recall ever saving *scratch* or " *Message-Log*" to wherever I started my session; I want to save it to a project- specific directory, which in typical cases for me is many characters of typing away from what getcwd would return. (In fact, I often do C-x h M-w C-x b RET C-x C-f log RET C-y C-x C-s or the like.) Similarly, in my usage, it's very likely that the reason I have multiple sessions to choose from is that I split a session, by simply killing a bunch of buffers I don't need in the new session, and saving a desktop file somewhere appropriate. AFAICT that place is highly unlikely to have anything to do with getcwd(), but I'm willing to listen to your explanation. So my solution would be to (1) add `default-directory' to `desktop-locals-to-save' (which handles the default directory settings for *scratch* and " *Message-Log*", I think somebody already mentioned this), (2) write the desktop file to somewhere appropriate (probably `desktop-dirname', maybe asking the user), (3) write a thunk library (cd (or DESKTOP-DIRNAME "~")) (load-user-init-file) ; does Emacs have this? to ~/.emacs.d/sessions/xsm-XSM-CLIENT-ID.el, and set SmRestartCommand to emacs -q -l ~/.emacs.d/sessions/xsm-XSM-CLIENT-ID.el -clientId XSM-CLIENTID This is pretty kludgy; an improvement would be to build knowledge of XSM and any other common desktop session management protocols into Emacs, lose the "-q -l ~/.emacs.d/sessions/xsm-XSM-CLIENT-ID.el", and have an internal `session-manager-client-id' variable, which if non-nil is a string representing a session manager client ID, and use that to generate and load the thunk library. The thunk library probably can't really be avoided, because with it, the generalization to Emacs session managers other than desktop.el should be fairly straightforward. Without it, you'd need to build that knowledge into Emacs core. Yucky.