From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#38264: 27.0.50; Emacs terminates unexpectedly when noninteractive is t Date: Thu, 21 Nov 2019 00:35:50 +0800 Message-ID: <87wobuv72x.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> References: <87mucsshms.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <835zjf3ldp.fsf@gnu.org> <87imnf4xe9.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <834kyy1qu7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="129091"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38264@debbugs.gnu.org To: Eli Zaretskii , Artur Malabarba Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 20 17:38:44 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iXT07-000XRk-RY for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Nov 2019 17:38:43 +0100 Original-Received: from localhost ([::1]:60446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXT06-00053x-Nv for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Nov 2019 11:38:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46649) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXSzT-0004Vl-UY for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2019 11:38:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXSzS-0007UL-Hn for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2019 11:38:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iXSzS-0007UE-EQ for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2019 11:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iXSzS-0003Ke-8j for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2019 11:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Nov 2019 16:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38264 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 38264-submit@debbugs.gnu.org id=B38264.157426786212781 (code B ref 38264); Wed, 20 Nov 2019 16:38:02 +0000 Original-Received: (at 38264) by debbugs.gnu.org; 20 Nov 2019 16:37:42 +0000 Original-Received: from localhost ([127.0.0.1]:50803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXSz7-0003K5-Gg for submit@debbugs.gnu.org; Wed, 20 Nov 2019 11:37:41 -0500 Original-Received: from mail-wr1-f54.google.com ([209.85.221.54]:33020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXSz3-0003Jo-Os for 38264@debbugs.gnu.org; Wed, 20 Nov 2019 11:37:39 -0500 Original-Received: by mail-wr1-f54.google.com with SMTP id w9so635758wrr.0 for <38264@debbugs.gnu.org>; Wed, 20 Nov 2019 08:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=JtAq8W7kYyiEhX9skrh+1OIPqEEEC+J4ymKxsZrFxP4=; b=dpAVp8bFP8RNzTwGpQd62LmgdPWKIdKbuPzdtoWgKFaBaIvplBXT4vBidmobFWcUwD wupdUBpy4nOxU75cHeFo/BCINPkaRxGF25tk1x+cZCaZ61NzWqUbG3vfDxuWayK8E6RY U4PNKe9fkYY9gwKnUCqmEDQBaQ/G0R5oB2xQxMV9xxW0OC+1mhsWCxwxj9AFq0Dkmf5T lNAOiM3JLyu4VTfPgSgr1xjPY9hc3oSdGBdvM9EXt3OR8gIiEzh5CHqjaJ8I38oDWZ1l JS5zXQtJNBNJZy+ULZu3zO/V1RsNQ0ZiGjKeVmrQnccvVBdsY9An9b6jBSg2nfjYNP4T Tfzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=JtAq8W7kYyiEhX9skrh+1OIPqEEEC+J4ymKxsZrFxP4=; b=Lh6reNaAdkFbNvqRhiVuklF+97uf1Wf7pLMAzESTo7+tTrSNr7d74RxYo2ESe92ZZn 2e7duxWO4KDVjyJIaAVbEy/nyJFyCz28BT1T7Zicpow10OXUG/qOaewQ1jFAjzofWX9u dAM8Un5z4zx+Gc6ruZjySBi2yVcANOSbBtYtjfYo7MXfZ5uH7lCnFEJsH3gcAjFYlSIu 349/E5LlWmhYCXSd6TOPSRGyv8ry45chWFJjXX4MZYiNbO/2HQWedezNruQp/36XJeT8 YlV++qriW7Tynw6r7Pz8Bm76liOjeFHCi9vdbOUNQSd5jOx9W6v7GxbaNburD1OW/mOt jkGg== X-Gm-Message-State: APjAAAUExKajrMwf7dghlPGfgfLSJhRz9/bfyvRRxz1HyQejdw2EGjNN ob9baMGWhzTkE5wtyvNBCtM= X-Google-Smtp-Source: APXvYqyHT75iKWdqT7GxNaQr7XXAeP3z9A7F9FcsW5GHTQVZY2FHWwUGSeRNhfhoPMTCbKT5B20KTA== X-Received: by 2002:a05:6000:1605:: with SMTP id u5mr4369156wrb.252.1574267851912; Wed, 20 Nov 2019 08:37:31 -0800 (PST) Original-Received: from localhost ([5.226.137.4]) by smtp.gmail.com with ESMTPSA id j7sm34467603wro.54.2019.11.20.08.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 08:37:30 -0800 (PST) In-Reply-To: <834kyy1qu7.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172062 Archived-At: > How can Emacs distinguish between these two situations? The value of > 'noninteractive' is how it knows whether the session is an interactive > one, and your code steps on it. I agree that it indeed conforms with the manual (though it might make sense to add a note to the manual that setting noninteractive manually can cause issues). I am also wondering why there is no error shown in the terminal when emacs is terminated after executing the code I provided. I tried to run emacs in batch mode directly like $ emacs -Q --batch --eval '(/ 1 0)' Arithmetic error As expected, emacs prints "Arithmetic error" in the output. However, if I just run emacs -Q and execute the same with noninteractive bound to t, no output is produced in the terminal, which is very misleading since no clue is provided why emacs was terminated. Also, it seems that kill-emacs-hook is not called when emacs is terminated in the above situation. Does not sound right for me. > What package.el does makes little sense to me, see below. Does > straight.el have a reason to do the same, you did you just copy the > code from package.el? I suspect that it was just copying. Will forward your question to the straight.el author. Regards, Ihor Eli Zaretskii writes: >> From: Ihor Radchenko >> Cc: 38264@debbugs.gnu.org >> Date: Wed, 20 Nov 2019 00:57:18 +0800 >> >> > This is a feature: in non-interactive mode entering a debugger >> > displays the backtrace and then kills Emacs. >> >> It indeed makes sense. However, it does not make sense when >> noninteractive is manually set to 't in normal interactive mode. > > How can Emacs distinguish between these two situations? The value of > 'noninteractive' is how it knows whether the session is an interactive > one, and your code steps on it. > >> Note that package.el, for example, can set noninteractive to 't at some >> point (see package-generate-autoloads), even if emacs is otherwise >> interactive. >> >> > Why are you binding noninteractive to t while debug-on-error is >> > enabled? >> >> Similar to package.el, straight.el also binds noninteractive to 't when >> generating autoloads. > > What package.el does makes little sense to me, see below. Does > straight.el have a reason to do the same, you did you just copy the > code from package.el? > > If the code in straight.el is simply a copy from package.el, then just > remove the line which binds 'noninteractive'. You don't need it > because all it does is disable calls to 'message' inside > 'autoload-generate-file-autoloads', and you already bind > 'inhibit-message' to t, so no messages will be displayed anyway. > > Artur, I think for the same reason we have no need to bind > 'noninteractive' in 'package-generate-autoloads', or am I missing > something? > > Btw, the other places in package.el which use 'inhibit-message' to > bind 'save-silently' to a non-nil value seem also redundant, since if > 'inhibit-message' is non-nil, its effect is a superset of what > 'save-silently' does anyway. WDYT?