From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C59EE429E25 for ; Tue, 28 Jun 2011 09:42:51 -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 faab+JQqv73p for ; Tue, 28 Jun 2011 09:42:51 -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 1E5B4431FD0 for ; Tue, 28 Jun 2011 09:42:50 -0700 (PDT) Received: by bwg12 with SMTP id 12so368393bwg.26 for ; Tue, 28 Jun 2011 09:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=AmlAa1NXpiTTQDWVXOlYTBwFvNg7MDDUF9ijCjO+f/o=; b=KjgCXW0Fp9crTm50W+hcXalkM9Z8WsY6zUXV3QStYLERlTl7neOLtUg4W8tk0zeXAO juZMcKuQOt5ow6sTQzzR5Nv/KLOl7twhORsd7bIBkx53Xef1OmNhYlX6poFNNHX6clBA Ixx0qZrbn/IxmMTSdX81N2HozrbXR+01l5ebk= Received: by 10.204.137.68 with SMTP id v4mr5807127bkt.115.1309279369419; Tue, 28 Jun 2011 09:42:49 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id o3sm355915bka.12.2011.06.28.09.42.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 28 Jun 2011 09:42:47 -0700 (PDT) From: Dmitry Kurochkin To: Austin Clements Subject: Re: [PATCH 2/2] test: use emacsclient(1) for Emacs tests In-Reply-To: <20110628162257.GD4120@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> <20110628162257.GD4120@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 20:42:42 +0400 Message-ID: <871uydzz3x.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 16:42:51 -0000 On Tue, 28 Jun 2011 12:22:57 -0400, Austin Clements wrote: > Quoth myself on Jun 27 at 11:49 pm: > > Quoth Dmitry Kurochkin on Jun 28 at 5:03 am: > > EMACSDONE=$TEST_DIRECTORY/emacsdone > > mkfifo $EMACSDONE > > coproc emacs --batch --eval '(while t (eval (read)) (write-region "\n" nil "'$EMACSDONE'" t 0))' > > EMACSFD=${COPROC[1]} > > > > test_emacs() { > > echo "$1" >&$EMACSFD > > read <$EMACSDONE > > } > > > > test_emacs '(sleep-for 2)' > > test_emacs '(message "Hi")' > > > > echo '(kill-emacs)' >&$EMACSFD > > Oops, got a little overzealous with TEST_DIRECTORY. For reference, > the pipe should, of course, have gone in the current directory (or > TMP_DIRECTORY). > > mkfifo emacsdone > coproc emacs --batch --eval '(while t (eval (read)) (write-region "\n" nil "emacsdone" t 0))' > EMACSFD=${COPROC[1]} > > test_emacs() { > echo "$1" >&$EMACSFD > read < emacsdone > } > > > (I don't really see how that could be either more shell code or more > elisp code than using emacsclient plus cleanup code [nor why it > matters for five lines of code], but I'm probably missing something.) Well, it may not be less code if you count lines. It is just IMHO, but it shell code in case of emacsclient is simpler (no fifo, no coproc), cleanup is the same (one line with kill-emacs). More lisp code in emacsclient variant, but that is just because you put it all on one line :) Code size does not matter indeed. Your approach just feels more of a hack to me and unnecessary complex. Again, this is just my IMHO. I would like to hear what other (Carl in particular) think about this. If the consensus is for your approach, I would be happy to implement it. Regards, Dmitry