all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, bugs@gnu.support, emacs-devel@gnu.org
Subject: Re: emacsclient in elisp
Date: Fri, 21 May 2021 12:33:12 +0200	[thread overview]
Message-ID: <dedf538b-7992-6274-9d26-603438740575@daniel-mendler.de> (raw)
In-Reply-To: <838s48obm4.fsf@gnu.org>

On 5/21/21 8:16 AM, Eli Zaretskii wrote:
>> Yes, that's right. I have two Emacs processes A and B. The process A
>> starts process B as subprocess and communicates with it via the pipe.
>> The process B reads from the stdin using `(read t)` or
>> `(read-from-minibuffer..)`. Now process B starts another subprocess C,
>> which has a filter and a sentinel. While B reads from stdin, B hangs and
>> the C-filter is not executed.
> 
> The same will happen if B runs some Lisp function that takes a long
> time.

Of course, but IO-bound waiting is fundamentally different from
CPU-bound computations.

>> Actually I am happy with using the emacsclient protocol now. It is a bit
>> of a hack, but it works for the simple use case I am currently exploring
> 
> I don't see why it would be considered a hack.  Using the emacsclient
> _protocol_ might be considered a kludge, but you can use your own
> protocol, and then I see no kludge at all in this design.

You are right about that. I think Stefan should elaborate. What I am
doing now - I am "upgrading" the emacsclient protocol on the server by
replacing the `server-process` filter with my own version. This works
well and is also clean. I am actually never using the emacsclient
protocol now, I am only reusing the Emacs infrastructure to set up the
server and to daemonize.

>> (https://github.com/minad/affe). There I have Emacs A (frontend)
>> starting an Emacs B (backend) which starts grep as a subprocess C,
>> generating output. Then A sends filter regular expressions to B, B
>> filters the output of C and answers with the matches.
> 
> Not sure why you need Grep in this equation at all: Emacs is perfectly
> capable of searching files entirely on its own, and since your design
> is asynchronous, speed should not matter too much anyway.

There is a point in doing what I am doing but it strongly depends on the
UI you are using. Do you know the command line fuzzy finder fzf. My
program basically emulates that working mode in Emacs. The grep
functionality offered by Emacs is not related to that, but is fine by
itself. There is no "need" for my package, it is just an experiment to
see if I can retrofit certain interaction models onto Emacs.

Daniel



  reply	other threads:[~2021-05-21 10:33 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 12:50 emacsclient in elisp Daniel Mendler
2021-05-19 13:41 ` Stefan Monnier
2021-05-19 14:13   ` Daniel Mendler
2021-05-19 14:55     ` T.V Raman
2021-05-20 14:31     ` Jean Louis
2021-05-20 15:10       ` Eli Zaretskii
2021-05-20 15:52         ` Daniel Mendler
2021-05-20 16:00           ` Eli Zaretskii
2021-05-20 16:40             ` Stefan Monnier
2021-05-20 17:49               ` Daniel Mendler
2021-05-20 18:59                 ` Eli Zaretskii
2021-05-20 19:10                   ` Daniel Mendler
2021-05-20 19:45                     ` Eli Zaretskii
2021-05-20 20:54                       ` Daniel Mendler
2021-05-21  6:16                         ` Eli Zaretskii
2021-05-21 10:33                           ` Daniel Mendler [this message]
2021-05-21 10:44                             ` Eli Zaretskii
2021-05-21 16:25                             ` Jean Louis
2021-05-21  6:38                         ` Jean Louis
2021-05-21  6:36                       ` Jean Louis
2021-05-21  7:10                         ` Eli Zaretskii
2021-05-20 21:21                   ` Stefan Monnier
2021-05-21  6:18                     ` Eli Zaretskii
2021-05-21 10:34                       ` Eli Zaretskii
2021-05-21 14:55                         ` Stefan Monnier
2021-05-21 15:08                           ` Eli Zaretskii
2021-05-21 15:33                             ` Stefan Monnier
2021-05-21 14:51                       ` Stefan Monnier
2021-05-21 15:06                         ` Eli Zaretskii
2021-05-21 15:29                           ` Stefan Monnier
2021-05-21 18:36                             ` Eli Zaretskii
2021-05-21 21:51                               ` Stefan Monnier
2021-05-22  6:11                                 ` Eli Zaretskii
2021-05-22 10:09                                   ` Daniel Mendler
2021-05-22 10:19                                     ` Eli Zaretskii
2021-05-22 10:29                                       ` Eli Zaretskii
2021-05-22 11:49                                         ` Daniel Mendler
2021-05-22 12:26                                           ` Eli Zaretskii
2021-05-22 13:55                                             ` Stefan Monnier
2021-05-22 14:08                                               ` Eli Zaretskii
2021-05-22 14:31                                                 ` Stefan Monnier
2021-05-21 16:10                         ` Daniel Mendler
2021-05-21 16:36                         ` Jean Louis
2021-05-21  6:27               ` Jean Louis
2021-05-21  7:07                 ` Eli Zaretskii
2021-05-21  7:25                   ` Jean Louis
2021-05-21  6:21         ` Jean Louis
2021-05-21  7:08           ` Eli Zaretskii
2021-05-21  7:26             ` Jean Louis
2021-05-21 10:31               ` Eli Zaretskii
2021-05-21 16:07                 ` Jean Louis
2021-05-21 17:41                   ` Eli Zaretskii
2021-05-21 17:43                   ` Eli Zaretskii
2021-05-21 22:05                     ` Jean Louis
2021-05-22  6:12                       ` Eli Zaretskii
2021-05-19 21:56 ` Daniel Mendler
2021-05-19 22:43   ` chad
2021-05-20  8:42     ` Daniel Mendler
2021-05-20 15:59   ` Arthur Miller
2021-05-20 17:45     ` Daniel Mendler
2021-05-21 19:52       ` Arthur Miller

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dedf538b-7992-6274-9d26-603438740575@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=bugs@gnu.support \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.