[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacsclient in elisp
From: |
Stefan Monnier |
Subject: |
Re: emacsclient in elisp |
Date: |
Sat, 22 May 2021 10:31:47 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> 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?
This is a question to ask the programmers who decided to use both at the
same time: it'll be their responsibility to arrange for the calls to
those functions to happen at the right time in the right order and for
the communication protocol to be designed accordingly. I don't think
there's much we can do on our side.
> The scenario is that we have the process for reading from stdin, but
> some function we called decides to ask the user.
BTW, a plain (while <read-from-minibuffer> <process-command>) setup we
can have the same problem: if one of the functions called by
<process-command> decides unexpectedly to call `read-from-minibuffer`,
it can wreak havoc in your communication protocol.
Again, there's nothing we can do about it on our side: it's the
responsibility of the programmers writing that code to make sure it
doesn't happen.
Stefan
PS: Admittedly, using a process object will make things a bit worse,
since, contrary to `read-from-minibuffer`, the programmer has no real
control over the amount of data read by `accept-process-output`
before it's passed to the process filter, which is why I said above
that it's also a question of protocol-design to make sure that if
there's data meant for `read-from-minibuffer` some mechanism in the
protocol should make sure it won't be sent while Emacs is inside
`accept-process-output`.
- Re: emacsclient in elisp, (continued)
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/21
- Re: emacsclient in elisp, Stefan Monnier, 2021/05/21
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/22
- Re: emacsclient in elisp, Daniel Mendler, 2021/05/22
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/22
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/22
- Re: emacsclient in elisp, Daniel Mendler, 2021/05/22
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/22
- Re: emacsclient in elisp, Stefan Monnier, 2021/05/22
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/22
- Re: emacsclient in elisp,
Stefan Monnier <=
- Re: emacsclient in elisp, Daniel Mendler, 2021/05/21
- Re: emacsclient in elisp, Jean Louis, 2021/05/21
- Re: emacsclient in elisp, Jean Louis, 2021/05/21
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/21
- Re: emacsclient in elisp, Jean Louis, 2021/05/21
- Re: emacsclient in elisp, Jean Louis, 2021/05/21
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/21
- Re: emacsclient in elisp, Jean Louis, 2021/05/21
- Re: emacsclient in elisp, Eli Zaretskii, 2021/05/21
- Re: emacsclient in elisp, Jean Louis, 2021/05/21