From: Ihor Radchenko <yantar92@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Really noninteractive
Date: Thu, 20 Feb 2020 23:32:59 +0800 [thread overview]
Message-ID: <874kvlgtp0.fsf@localhost> (raw)
In-Reply-To: <878skx492v.fsf@gnus.org>
> 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.
Best,
Ihor
Lars Ingebrigtsen <larsi@gnus.org> 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,
PhD,
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: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg
next prev parent reply other threads:[~2020-02-20 15:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 14:39 Really noninteractive Lars Ingebrigtsen
2020-02-20 15:23 ` Andreas Schwab
2020-02-20 17:42 ` Lars Ingebrigtsen
2020-02-24 9:16 ` Andreas Schwab
2020-02-24 12:55 ` Noam Postavsky
2020-02-24 13:03 ` Lars Ingebrigtsen
2020-02-20 19:05 ` Clément Pit-Claudel
2020-02-20 15:32 ` Ihor Radchenko [this message]
2020-02-20 17:42 ` Lars Ingebrigtsen
2020-02-20 17:56 ` Noam Postavsky
2020-02-20 18:36 ` Lars Ingebrigtsen
2020-02-20 19:11 ` dick.r.chiang
2020-02-21 13:20 ` Noam Postavsky
2020-02-21 14:11 ` 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=874kvlgtp0.fsf@localhost \
--to=yantar92@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.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).