From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.devel Subject: Re: save-buffers-kill-terminal and emacsclient --no-wait Date: Wed, 31 Dec 2008 12:32:35 +0100 Message-ID: <18779.22611.15251.894066@a1ihome1.kph.uni-mainz.de> References: <18779.16263.37052.907240@a1ihome1.kph.uni-mainz.de> <20081231.110649.28891280.toto@withouthat.org> <20081231.112631.21593347.toto@withouthat.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1230723200 31465 80.91.229.12 (31 Dec 2008 11:33:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Dec 2008 11:33:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thorsten Bonow Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 31 12:34:26 2008 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.50) id 1LHzKu-0003da-Ag for ged-emacs-devel@m.gmane.org; Wed, 31 Dec 2008 12:34:04 +0100 Original-Received: from localhost ([127.0.0.1]:47515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHzJg-0008P5-DX for ged-emacs-devel@m.gmane.org; Wed, 31 Dec 2008 06:32:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHzJb-0008OS-3w for emacs-devel@gnu.org; Wed, 31 Dec 2008 06:32:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHzJW-0008Mq-VX for emacs-devel@gnu.org; Wed, 31 Dec 2008 06:32:42 -0500 Original-Received: from [199.232.76.173] (port=51857 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHzJW-0008MY-Me for emacs-devel@gnu.org; Wed, 31 Dec 2008 06:32:38 -0500 Original-Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:46953) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LHzJW-0000fY-66 for emacs-devel@gnu.org; Wed, 31 Dec 2008 06:32:38 -0500 Original-Received: from a1ihome1.kph.uni-mainz.de (a1ihome1.kph.uni-mainz.de [134.93.134.75]) by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id mBVBWZ5A010878; Wed, 31 Dec 2008 12:32:35 +0100 Original-Received: from a1ihome1.kph.uni-mainz.de (localhost [127.0.0.1]) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.1) with ESMTP id mBVBWZtv018926; Wed, 31 Dec 2008 12:32:35 +0100 Original-Received: (from ulm@localhost) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.0/Submit) id mBVBWZcA018921; Wed, 31 Dec 2008 12:32:35 +0100 In-Reply-To: <20081231.112631.21593347.toto@withouthat.org> X-Mailer: VM 8.0.2-487 under Emacs 22.2.1 (i686-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 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:107454 Archived-At: >>>>> On Wed, 31 Dec 2008, Thorsten Bonow wrote: Ulrich> Hi, is the following a bug, or the intended behaviour: Ulrich> $ emacs --daemon $ emacsclient --create-frame --no-wait Ulrich> Now save-buffers-kill-terminal (bound to C-x C-c) in this Ulrich> frame does just nothing. Toto> Not if you had read the manual ;-) It is the documented Toto> behaviour: Toto> If you type `C-x C-c' (`save-buffers-kill-terminal') in an Emacs Toto> frame created with `emacsclient', via the `-c' or `-t' options, Toto> Emacs deletes the frame instead of killing the Emacs process Toto> itself. [...] > But you're right to expect it to call (delete-frame)---which it > doesn't call under X. Works on the terminal (if you omit the > --no-wait option). So there is a bug---either in the code or in the > manual :-) Maybe a patch will clarify what I meant with "expected behaviour": --- lisp/files.el.~1.1030.~ +++ lisp/files.el @@ -5733,9 +5733,14 @@ (interactive "P") (let ((proc (frame-parameter (selected-frame) 'client)) (frame (selected-frame))) - (if (null proc) - (save-buffers-kill-emacs) - (server-save-buffers-kill-terminal proc arg)))) + (cond + ((null proc) + (save-buffers-kill-emacs)) + ((processp proc) + (server-save-buffers-kill-terminal proc arg)) + (t + (save-some-buffers arg t) + (delete-frame))))) ;; We use /: as a prefix to "quote" a file name