From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier 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 14:50:04 -0400 Message-ID: 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> <87d3xb7vge.fsf@uwakimon.sk.tsukuba.ac.jp> <4BE0184C.1090902@swipnet.se> <4BE02EA7.2070102@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1273045772 21899 80.91.229.12 (5 May 2010 07:49:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 07:49:32 +0000 (UTC) Cc: "Stephen J. Turnbull" , "emacs-devel@gnu.org" To: "Jan D." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 05 09:49:31 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 1O9ZMI-0007zg-BN for ged-emacs-devel@m.gmane.org; Wed, 05 May 2010 09:49:30 +0200 Original-Received: from localhost ([127.0.0.1]:49054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9ZMH-0000bp-I3 for ged-emacs-devel@m.gmane.org; Wed, 05 May 2010 03:49:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9NCP-0002CM-Pj for emacs-devel@gnu.org; Tue, 04 May 2010 14:50:29 -0400 Original-Received: from [140.186.70.92] (port=33747 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9NCN-0002A2-Ml for emacs-devel@gnu.org; Tue, 04 May 2010 14:50:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9NCL-0007EM-TM for emacs-devel@gnu.org; Tue, 04 May 2010 14:50:27 -0400 Original-Received: from tomts13-srv.bellnexxia.net ([209.226.175.34]:49182) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9NCL-0007E6-Lt for emacs-devel@gnu.org; Tue, 04 May 2010 14:50:25 -0400 Original-Received: from toip3.srvr.bell.ca ([209.226.175.86]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20100504185012.KTPI12176.tomts13-srv.bellnexxia.net@toip3.srvr.bell.ca> for ; Tue, 4 May 2010 14:50:12 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEANYE4EtGN5LW/2dsb2JhbACdL3K+ZIUTBA Original-Received: from bas1-montreal42-1178047190.dsl.bell.ca (HELO alfajor.home) ([70.55.146.214]) by toip3.srvr.bell.ca with ESMTP; 04 May 2010 14:42:07 -0400 Original-Received: by alfajor.home (Postfix, from userid 20848) id AC2A2BB55A; Tue, 4 May 2010 14:50:04 -0400 (EDT) In-Reply-To: <4BE02EA7.2070102@swipnet.se> (Jan D.'s message of "Tue, 04 May 2010 16:26:47 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Solaris 8 (1) 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:124523 Archived-At: >> 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