[Top][All Lists]

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

Re: Really noninteractive

From: Ihor Radchenko
Subject: Re: Really noninteractive
Date: Thu, 20 Feb 2020 23:32:59 +0800

> Is there a way to do this that I've missed?

The Elisp manual says:

 -- Variable: noninteractive
     This variable is non-‘nil’ when Emacs is running in batch mode.

So, in your case, emacs does not really hang, but awaits input from
terminal. You can test it by running emacs in batch mode (as suggested
by Andreas):

emacs -Q --batch --eval "(let ((noninteractive t)) (read-string \"foo: \"))"

Probably, docstring needs to be clarified to conform with the manual.


Lars Ingebrigtsen <address@hidden> writes:

> I somehow expected
> (let ((noninteractive t)) (read-string "foo: "))
> to error out, since the documentation of the variable is:
> ---
> Non-nil means Emacs is running without interactive terminal.
> ---
> I'm trying to use Emacs from a server context, and would prefer that
> Emacs signal an error whenever you tell it to do something interactive
> rather than hang forever.
> Is there a way to do this that I've missed?
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

Ihor Radchenko,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong 
University, Xi'an, China
Email: address@hidden, address@hidden

reply via email to

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