From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: y-or-n-p and emacs --daemon Date: Wed, 3 Dec 2008 11:53:04 -0800 (PST) Message-ID: <200812031953.mB3Jr4qh027604@mothra.ics.uci.edu> References: <18742.25383.80136.946560@a1i15.kph.uni-mainz.de> <87ocztcy3t.fsf@grumblesmurf.org> <87abbdm4t8.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228334018 15894 80.91.229.12 (3 Dec 2008 19:53:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2008 19:53:38 +0000 (UTC) Cc: emacs-devel@gnu.org, Espen Wiborg To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 03 20:54:43 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 1L7xno-0001aC-79 for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 20:54:28 +0100 Original-Received: from localhost ([127.0.0.1]:50175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7xme-0005kA-9V for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 14:53:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7xmb-0005jv-8U for emacs-devel@gnu.org; Wed, 03 Dec 2008 14:53:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7xma-0005jj-OM for emacs-devel@gnu.org; Wed, 03 Dec 2008 14:53:12 -0500 Original-Received: from [199.232.76.173] (port=35901 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7xma-0005jg-Lh for emacs-devel@gnu.org; Wed, 03 Dec 2008 14:53:12 -0500 Original-Received: from sallyv2.ics.uci.edu ([128.195.1.120]:49716) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1L7xmZ-0000f6-Qr for emacs-devel@gnu.org; Wed, 03 Dec 2008 14:53:12 -0500 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id mB3Jr4Kw004671; Wed, 3 Dec 2008 11:53:04 -0800 (PST) Original-Received: (from dann@localhost) by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mB3Jr4qh027604; Wed, 3 Dec 2008 11:53:04 -0800 (PST) In-Reply-To: <87abbdm4t8.fsf@cyd.mit.edu> (Chong Yidong's message of "Wed, 03 Dec 2008 14:33:55 -0500") Original-Lines: 31 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: mB3Jr4Kw004671 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:106535 Archived-At: Chong Yidong writes: > 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. Bad idea: (unless (y-or-n-p "Stop me from removing all your files") /bin/rm -rf / ) > Does anyone have a better suggestion? Ignore it, or fix it properly: so that it works like y-or-n-p when using -batch.