[PATCH 2/2] test: use emacsclient(1) for Emacs tests
Dmitry Kurochkin
dmitry.kurochkin at gmail.com
Mon Jun 27 21:44:51 PDT 2011
On Tue, 28 Jun 2011 00:17:42 -0400, Austin Clements <amdragon at MIT.EDU> wrote:
> Quoth Dmitry Kurochkin on Jun 28 at 7:59 am:
> > I am sure that would work, but I do not like the complexity. How about
> > getting back to standard emacsclient and running a watchdog in the
> > emacs? Like:
> >
> > (defun orphan-watchdog (pid)
> > "Periodically check that the process with id PID is still
> > running, quit if it terminated."
> > (if (not (process-attributes pid))
> > (kill-emacs)
> > (run-at-time "1 min" nil orphan-watchdog pid)))
> >
> > This function (or my other changes) do not work (by yet unknown reason
> > :)), but you get the idea.
>
> I would consider this more complex than a few file descriptors. ]:--8)
More shell code and more elisp code. I do not think can be considered
simpler :)
> Though, I'm automatically distrustful of anything that relies on
> polling (why poll when you can be notified instantly?).
>
I agree that polling is not as elegant as an instant notification. But
IMO reinventing emacsclient just kills all the beauty of this solution.
I liked it when it was a simple read loop, but now it is too complex to
my taste. Besides, I am a bit worried that we will face new problems in
the future that would force us to add more "features" to our
not-so-poor-man's Emacs server implementation.
> It also has some problems. For example, PID's are easily reused, so
> if another process happens to take up that PID, the emacs could still
> hang around for a long time.
Indeed. We may add a more complex process detection, but IMO it is an
overkill.
Anyway, I am done with reworking the patch series and will post it now.
Perhaps others would voice their opinion on this one.
Regards,
Dmitry
More information about the notmuch
mailing list