From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: y-or-n-p and emacs --daemon Date: Wed, 03 Dec 2008 14:33:55 -0500 Message-ID: <87abbdm4t8.fsf@cyd.mit.edu> References: <18742.25383.80136.946560@a1i15.kph.uni-mainz.de> <87ocztcy3t.fsf@grumblesmurf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228332855 11377 80.91.229.12 (3 Dec 2008 19:34:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2008 19:34:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Espen Wiborg Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 03 20:35:18 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 1L7xVB-0002L9-ID for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 20:35:13 +0100 Original-Received: from localhost ([127.0.0.1]:34919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7xU1-0007C5-EA for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 14:34:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7xTx-0007BX-Bg for emacs-devel@gnu.org; Wed, 03 Dec 2008 14:33:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7xTu-0007BJ-Pf for emacs-devel@gnu.org; Wed, 03 Dec 2008 14:33:56 -0500 Original-Received: from [199.232.76.173] (port=42119 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7xTu-0007BG-I8 for emacs-devel@gnu.org; Wed, 03 Dec 2008 14:33:54 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:49283) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7xTt-0006za-VN for emacs-devel@gnu.org; Wed, 03 Dec 2008 14:33:54 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 8F3D757E04B; Wed, 3 Dec 2008 14:33:55 -0500 (EST) In-Reply-To: <87ocztcy3t.fsf@grumblesmurf.org> (Espen Wiborg's message of "Wed, 03 Dec 2008 12:11:18 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:106532 Archived-At: Espen Wiborg writes: >> $ emacs-23 -Q --daemon --eval '(y-or-n-p "hello? ")' >> >> 1. It hangs indefinitely, >> 2. it does not detach properly (it forks, but the parent doesn't exit), >> 3. it doesn't start the server. >> >> Now the problem is that y-or-n-p is called from many places, so >> depending on the configuration there is some chance that Emacs will >> ask for user interaction before initialisation is finished. There is >> even one in server-start (which AFAICS won't be triggered in daemon >> mode, but still...). > > Actually, this yes-or-no-p *is* triggered in daemon mode, but only > (AFAICT) in the case uncovered by bug #1310, where a client's X > connection is lost and the daemon tries to shut down. The only thing I can think of is to make y-or-n-p and yes-or-no-p default to "no" when only the daemon's dummy terminal is open. Does anyone have a better suggestion?