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 16:07:54 -0500 Message-ID: <874p1lj7bp.fsf@cyd.mit.edu> References: <18742.25383.80136.946560@a1i15.kph.uni-mainz.de> <87ocztcy3t.fsf@grumblesmurf.org> <87abbdm4t8.fsf@cyd.mit.edu> <200812031953.mB3Jr4qh027604@mothra.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228338503 2089 80.91.229.12 (3 Dec 2008 21:08:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2008 21:08:23 +0000 (UTC) Cc: emacs-devel@gnu.org, Espen Wiborg To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 03 22:09: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 1L7yy8-0006K7-0d for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 22:09:12 +0100 Original-Received: from localhost ([127.0.0.1]:33767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7ywx-0001SX-Hb for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 16:07:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7yws-0001O9-Cv for emacs-devel@gnu.org; Wed, 03 Dec 2008 16:07:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7ywq-0001Kj-Qa for emacs-devel@gnu.org; Wed, 03 Dec 2008 16:07:54 -0500 Original-Received: from [199.232.76.173] (port=55467 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7ywq-0001Ka-M6 for emacs-devel@gnu.org; Wed, 03 Dec 2008 16:07:52 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:48713) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7ywq-0008TG-9u for emacs-devel@gnu.org; Wed, 03 Dec 2008 16:07:52 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 6A11357E04B; Wed, 3 Dec 2008 16:07:54 -0500 (EST) In-Reply-To: <200812031953.mB3Jr4qh027604@mothra.ics.uci.edu> (Dan Nicolaescu's message of "Wed, 3 Dec 2008 11:53:04 -0800 (PST)") 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:106539 Archived-At: Dan Nicolaescu writes: > > 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. I don't think that would solve the problem either, since AFAIU the daemon might not have a user accessible terminal at all (as bug#1310). What we could do is to make y-or-n-p signal an error. Individual callers will then have to check for daemon-mode and do something else before calling y-or-n-p; which is also probably the way to fix bug#1310.