From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.help Subject: Re: Weird behavior of kill-emacs Date: Wed, 18 Feb 2015 20:49:04 +0000 Message-ID: References: <83y4nv3u6h.fsf@gnu.org> <874mqj0ys6.fsf@hochschule-trier.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1424292576 16603 80.91.229.3 (18 Feb 2015 20:49:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2015 20:49:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Andreas Politz , Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 18 21:49:26 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YOBYh-0002aT-PD for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Feb 2015 21:49:23 +0100 Original-Received: from localhost ([::1]:52922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOBYg-0004FC-TP for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Feb 2015 15:49:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOBYU-0004Em-Ol for help-gnu-emacs@gnu.org; Wed, 18 Feb 2015 15:49:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOBYT-0003zO-SW for help-gnu-emacs@gnu.org; Wed, 18 Feb 2015 15:49:10 -0500 Original-Received: from mail-la0-f53.google.com ([209.85.215.53]:37194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOBYP-0003xh-Ci; Wed, 18 Feb 2015 15:49:05 -0500 Original-Received: by labpn19 with SMTP id pn19so3752801lab.4; Wed, 18 Feb 2015 12:49:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to:cc :content-type; bh=2wdRU8gMY2q3yy2Iui3E9fP8inSqw2qKlB6BAsEuvyA=; b=T0JnQa21g0j2Qvd/4t9EKhTRfbD66GYMZvLFJBM3t0GqrXxwXksf1vkJhAHb64gcev sfhDu3kY4e8ABMpsW/FuA8h4k7RWqALa4F3G4vSLASTg8Xdzl3KdMQbBKzrnsiCvGWzJ 6wLt1cBmBuRYfJAj85aFyytLi5eCrxz6kJhkUKaoBppS3AjRYclmHllmkQO9yR9hWmTk VO0z8zd7Knh08jG26NQy6AI51Z8jGPjob/VIr0QYuhiK/sooNv52GE/9aumHgsE23yio zjeaEB2Ou86AWemOuBvGy44NAk5DT0KNWXzludbiwverRMqBDohP+NsExAEmh+9OB37B Qzfg== X-Received: by 10.112.198.233 with SMTP id jf9mr1112207lbc.9.1424292544615; Wed, 18 Feb 2015 12:49:04 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.53 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102798 Archived-At: Andreas Politz schrieb am Wed Feb 18 2015 at 9:07:44 PM: > Eli Zaretskii writes: > > >> Is there a way to work around this behavior? > > > > Why would you want to? > > emacs < /dev/null -Q --batch --eval '(progn (ignore-errors (read)) > (kill-emacs 42))'; echo $? > > returns with exit code 0, i.e. the argument to kill-emacs is ignored. I > guess the OP reads from stdin until EOF, which implies a fixed exit code > of 0. > Exactly. In the case of the flycheck unit test suite the behavior is triggered by some invocations of yes-or-no-p that try to read from stdin, but it's closed, so this path is triggered and Emacs exits with a code of 0 even if the tests fail.