Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B83B2429E41 for ; Mon, 27 Jun 2011 21:44:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gzkRqktszTlv for ; Mon, 27 Jun 2011 21:44:58 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B9B33429E32 for ; Mon, 27 Jun 2011 21:44:57 -0700 (PDT) Received: by bwg12 with SMTP id 12so4889410bwg.26 for ; Mon, 27 Jun 2011 21:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=5dzt1K6xFewaNwgKecUVdMCADHen/A9PhxqP3oZXJrE=; b=FNw+JreqkorzWqDNP2DZYeOoDL1IpaKmuHlvJWMhWox+NRDl1H2WCU4LY0Ofxt8r72 zlpge2v366BiB6p+xVfDS/Y+fJ2y3UMhQeZu6bEM/rzbS7K7UFBDiQs18FKo3vud/E75 5pWc7qfyOuxMG2+soIODUHSeyRIIw4ILW75lU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; b=Yqjv18Ki0sxUsawYuJGvYjsj4p+/MQ2URT1kICemrV9RcaDqKEkOvaf7PeCuvDOs1I PaAd8sGNZxmL8nDS8DX5OuCDJekUydAb+iuqlcKQ4hgXPomkzCFBAhlyZVYfqp6HoywU Q/cktAqyVH+abHpdH8wvboKpSFHjxP1pdXLdQ= Received: by 10.204.83.33 with SMTP id d33mr4893503bkl.55.1309236296160; Mon, 27 Jun 2011 21:44:56 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id n3sm4741982bka.16.2011.06.27.21.44.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Jun 2011 21:44:55 -0700 (PDT) From: Dmitry Kurochkin To: Austin Clements Subject: Re: [PATCH 2/2] test: use emacsclient(1) for Emacs tests In-Reply-To: <20110628041742.GC4120@mit.edu> References: <1309132379-24089-1-git-send-email-dmitry.kurochkin@gmail.com> <1309146846-30991-1-git-send-email-dmitry.kurochkin@gmail.com> <1309146846-30991-2-git-send-email-dmitry.kurochkin@gmail.com> <87hb7byqge.fsf@gmail.com> <87d3hyzs1c.fsf@gmail.com> <20110628034937.GB4120@mit.edu> <87aad2zjuz.fsf@gmail.com> <20110628041742.GC4120@mit.edu> User-Agent: Notmuch/0.5-275-g75c95e5 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Tue, 28 Jun 2011 08:44:51 +0400 Message-ID: <877h86zhrw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 04:44:58 -0000 On Tue, 28 Jun 2011 00:17:42 -0400, Austin Clements 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