unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>,
	Artur Malabarba <bruce.connor.am@gmail.com>
Cc: 38264@debbugs.gnu.org
Subject: bug#38264: 27.0.50; Emacs terminates unexpectedly when noninteractive is t
Date: Thu, 21 Nov 2019 00:35:50 +0800	[thread overview]
Message-ID: <87wobuv72x.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <834kyy1qu7.fsf@gnu.org>

> 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 <eliz@gnu.org> writes:

>> From: Ihor Radchenko <yantar92@gmail.com>
>> 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?






  reply	other threads:[~2019-11-20 16:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19  2:51 bug#38264: 27.0.50; Emacs terminates unexpectedly when noninteractive is t Ihor Radchenko
2019-11-19 16:02 ` Eli Zaretskii
2019-11-19 16:57   ` Ihor Radchenko
2019-11-20 15:59     ` Eli Zaretskii
2019-11-20 16:35       ` Ihor Radchenko [this message]
2019-11-20 17:37         ` Eli Zaretskii
2019-11-20 23:22           ` Artur Malabarba
2019-11-21  3:37             ` Eli Zaretskii
2019-11-21 11:15               ` Artur Malabarba
2019-11-21 14:22                 ` Eli Zaretskii
2019-11-22 14:38                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wobuv72x.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me \
    --to=yantar92@gmail.com \
    --cc=38264@debbugs.gnu.org \
    --cc=bruce.connor.am@gmail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).