From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: emacsclient in elisp Date: Sat, 22 May 2021 17:08:29 +0300 Message-ID: <83tumukgiq.fsf@gnu.org> References: <00ce8ae3-bb21-c58f-cd32-c196f146842b@daniel-mendler.de> <83pmxlo2z0.fsf@gnu.org> <922437d2-74ca-a7aa-cd1d-060f31d383e6@daniel-mendler.de> <83o8d5o0od.fsf@gnu.org> <186aa7ae-605d-3959-b923-ee5817c939f0@daniel-mendler.de> <83mtspnseg.fsf@gnu.org> <837djsobhw.fsf@gnu.org> <83cztkm8hu.fsf@gnu.org> <831ra0lyrb.fsf@gnu.org> <83y2c7l2l9.fsf@gnu.org> <7fba8daf-a3f0-88a0-dcd4-4b9bae033dbb@daniel-mendler.de> <83cztjkr4m.fsf@gnu.org> <83bl93kqnk.fsf@gnu.org> <53abac6a-88d6-e691-e8e5-eea602c0f295@daniel-mendler.de> <835yzbkl8c.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28582"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mail@daniel-mendler.de, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 22 16:09:19 2021 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 1lkSJb-0007Eh-AG for ged-emacs-devel@m.gmane-mx.org; Sat, 22 May 2021 16:09:19 +0200 Original-Received: from localhost ([::1]:34838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkSJa-00007n-Dc for ged-emacs-devel@m.gmane-mx.org; Sat, 22 May 2021 10:09:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkSIp-0007W0-95 for emacs-devel@gnu.org; Sat, 22 May 2021 10:08:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59904) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkSIo-0007XA-EE; Sat, 22 May 2021 10:08:30 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4734 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkSIn-0001Hd-Pr; Sat, 22 May 2021 10:08:30 -0400 In-Reply-To: (message from Stefan Monnier on Sat, 22 May 2021 09:55:20 -0400) 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:269611 Archived-At: > From: Stefan Monnier > Cc: Daniel Mendler , emacs-devel@gnu.org > Date: Sat, 22 May 2021 09:55:20 -0400 > > > What do you mean by "at the same time"? If I have a stdin-process > > active, we watch it via pselect and read from it using the machinery > > in wait_reading_process_output and accept-process-output. During all > > the time such a process is active, I see no way to also read from the > > same descriptor bypassing the above mechanisms, in a way that won't > > cause trouble on the Lisp level, due toe the basic inability to decide > > which input should go what way. > > AFAIK we watch this description only when we're inside > "wait_reading_process_output and accept-process-output". If we're > inside `read-from-minibuffer` then we're not inside > "wait_reading_process_output and accept-process-output" (and > vice-versa), so I don't think there should be much trouble (at least for > my understanding of POSIX file descriptors, which is admittedly somewhat > limited; for Windows, I have no idea). So we will enter read-from-minibuffer, and read the stuff from stdin till the first newline. How do we know what's there is for us, not for the stdin-process? The scenario is that we have the process for reading from stdin, but some function we called decides to ask the user.