From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Really noninteractive Date: Thu, 20 Feb 2020 23:32:59 +0800 Message-ID: <874kvlgtp0.fsf@localhost> References: <878skx492v.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="23356"; mail-complaints-to="usenet@ciao.gmane.io" To: Lars Ingebrigtsen , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 20 16:36:45 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j4nsa-0005xS-2a for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Feb 2020 16:36:44 +0100 Original-Received: from localhost ([::1]:44430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4nsZ-0001Nj-5t for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Feb 2020 10:36:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49885) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4ns0-0000ef-MZ for emacs-devel@gnu.org; Thu, 20 Feb 2020 10:36:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4nrz-00084k-CU for emacs-devel@gnu.org; Thu, 20 Feb 2020 10:36:08 -0500 Original-Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:45417) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4nrz-00083p-5B for emacs-devel@gnu.org; Thu, 20 Feb 2020 10:36:07 -0500 Original-Received: by mail-pg1-x533.google.com with SMTP id b9so2100008pgk.12 for ; Thu, 20 Feb 2020 07:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=psIg8H1AKu+M87NxOcaMKL+G2XZIBYGAReyfz1FMtIs=; b=DgYmRecYcNZZIsbbXv8TftQXhzQVvQpuKy5/hdjIbOaFbsxuzmKIyFGegN7EAaGH0b +rUpP+q6qaTyXSODzbqcx0qyYu+FtEm75UFo+BFJXFaCvrjstN/QT+DYSz4CIXL+jMAC SLy7NgSIXdAcMXjvA3teCRFTVnwa+jIL11SvgCN6nhL7IREQ1F4rAwx+WE3JF4FOt1aN +9gFA3Zxk3zAx10iLNTQJPqsh0r6zKWi86SVsovdB88mi/cfsrSOvIpUTuByKhZvzxs4 EhkJdPKMahT3nNCF3x/9Pz7DW+PPzEMw9bwHEoU9UESRv5ZSaaD6PJ36ZcifESQR49lj 9Mhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=psIg8H1AKu+M87NxOcaMKL+G2XZIBYGAReyfz1FMtIs=; b=HdGl1j7rDWogP8cMW2S4OPQ07TGbjArjc0mOAVniIuZWKrpHZqdwgVCvJC/jduNmnY eGCxkHNXIHwkJ7UTresMg4cZW8xjGmres+6BwWjFh7jPyzIdeQ3lRNWfSpECyDMq5lwA eSiR3grGhSzTbiwDk8tU3kVQb4p8ds9o1mrxvEFwNRRyGM0COkLtPaIQ3y6vdPs8KWmU /akuEbpbGSBqQSFnxh0jOZrgns6BZayY9pOggWG+wHa0jbXBVdbVSciu3NdElSEy9AQ7 1hSGIfsV42qHSe9Ay3Qp9bEO/XN7RQ5GUeSaz/vYoFiKzt9aApsj8PVFHofG0ZZql4+a qnUQ== X-Gm-Message-State: APjAAAXSqR4qTMkBFXeOYciY8eTk2x904sghEvAxsSxEfYFBViVigiE+ J/5Kx5XhErl6T9iNeGhl2hb7vM1x X-Google-Smtp-Source: APXvYqzLGdbB1OUExrS0GMmhJWLDA2lrwlrb8SkfssExeFiKIvmH2uyki6CsFa+QnJTxBsJhifVFmQ== X-Received: by 2002:aa7:9f88:: with SMTP id z8mr32333838pfr.220.1582212964568; Thu, 20 Feb 2020 07:36:04 -0800 (PST) Original-Received: from localhost (97.151-89-23.rdns.scalabledns.com. [23.89.151.97]) by smtp.gmail.com with ESMTPSA id r62sm4106994pfc.89.2020.02.20.07.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 07:36:03 -0800 (PST) In-Reply-To: <878skx492v.fsf@gnus.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::533 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244993 Archived-At: > Is there a way to do this that I've missed? The Elisp manual says: -- Variable: noninteractive This variable is non-=E2=80=98nil=E2=80=99 when Emacs is running in ba= tch 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 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? > > --=20 > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > > --=20 Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong U= niversity, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg