emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: y-or-n-p and emacs --daemon


From: Dan Nicolaescu
Subject: Re: y-or-n-p and emacs --daemon
Date: Wed, 3 Dec 2008 19:02:33 -0800 (PST)

Stefan Monnier <address@hidden> 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).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]