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 19:02:33 -0800 (PST) Message-ID: <200812040302.mB432Xv5000150@mothra.ics.uci.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> <874p1lj7bp.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 1228359779 1570 80.91.229.12 (4 Dec 2008 03:02:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2008 03:02:59 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org, Espen Wiborg To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 04 04:04:01 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 1L84VV-0007UB-Lv for ged-emacs-devel@m.gmane.org; Thu, 04 Dec 2008 04:04:01 +0100 Original-Received: from localhost ([127.0.0.1]:56221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L84UK-0003QL-V9 for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 22:02:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L84UH-0003PI-6H for emacs-devel@gnu.org; Wed, 03 Dec 2008 22:02:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L84UF-0003P6-Mn for emacs-devel@gnu.org; Wed, 03 Dec 2008 22:02:44 -0500 Original-Received: from [199.232.76.173] (port=40011 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L84UF-0003P3-Jy for emacs-devel@gnu.org; Wed, 03 Dec 2008 22:02:43 -0500 Original-Received: from sallyv2.ics.uci.edu ([128.195.1.120]:37715) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1L84UE-0002MI-V7 for emacs-devel@gnu.org; Wed, 03 Dec 2008 22:02:43 -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 mB432YYA008796; Wed, 3 Dec 2008 19:02:34 -0800 (PST) Original-Received: (from dann@localhost) by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mB432Xv5000150; Wed, 3 Dec 2008 19:02:33 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Wed, 03 Dec 2008 21:16:42 -0500") Original-Lines: 37 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: mB432YYA008796 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:106545 Archived-At: Stefan Monnier writes: > >> Bad idea: > >> (unless (y-or-n-p "Stop me from removing all your files") > >> /bin/rm -rf / > >> ) > > Such a question would be a bug that we need fixing. Usually Emacs is > pretty consistent in asking questions in such a way that `n' is > a safe answer. That's not safe enough, this might happen for code that is in the user's .emacs. > >> 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). > > Does someone know the reason for this problem? E.g. it's not clear to > me why the y-or-n-p question is displayed (even though it's after > "Starting Emacs daemon", so stdout should have been closed) but the "Starting Emacs daemon" is printed at the beginning of `command-line-1', before detaching. --eval is also run before detaching. > answer is ignored (or is it?). It's not ignored, the input is not setup right. strace shows: select(1, [], NULL, NULL, {100000, 0} ^^^ select is waiting on a empty set of descriptors so noninteractive || IS_DAEMON is probably missing in some place(s).