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 CCB18429E25 for ; Tue, 28 Jun 2011 09:23:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 8Z7m0xg-LUoU for ; Tue, 28 Jun 2011 09:23:08 -0700 (PDT) Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU [18.9.25.14]) by olra.theworths.org (Postfix) with ESMTP id 58C03431FD0 for ; Tue, 28 Jun 2011 09:23:08 -0700 (PDT) X-AuditID: 1209190e-b7c39ae000000a8c-d8-4e09ffc910d8 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id 0C.0D.02700.9CFF90E4; Tue, 28 Jun 2011 12:22:33 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id p5SGN7SC012545; Tue, 28 Jun 2011 12:23:07 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p5SGN6lg003196 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Tue, 28 Jun 2011 12:23:07 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72) (envelope-from ) id 1Qbb3x-0002eQ-B6; Tue, 28 Jun 2011 12:22:57 -0400 Date: Tue, 28 Jun 2011 12:22:57 -0400 From: Austin Clements To: Dmitry Kurochkin Subject: Re: [PATCH 2/2] test: use emacsclient(1) for Emacs tests Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110628034937.GB4120@mit.edu> User-Agent: Mutt/1.5.20 (2009-06-14) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAKsWRmVeSWpSXmKPExsUixG6nonvyP6efwb6dehZXt/azW1y/OZPZ gclj56y77B7PVt1iDmCK4rJJSc3JLEst0rdL4MpYc/A4c0EDR8Xd72eZGhjXsnUxcnJICJhI LD+4mh3CFpO4cG89UJyLQ0hgH6PEin2LGCGcDYwS7bu3skA4J5kk3u3YDZVZwihxteEtK0g/ i4CqxL0D31lAbDYBDYlt+5czgtgiAoYSty6+YgaxmQWkJb79bmbqYuTgEBZwlLh+GqycV0Bb ouPKUaiZ95kkjn98xASREJQ4OfMJC0SvlsSNfy/BekHmLP/HARLmFNCR2LDtBdg7ogIqEtf2 t7NNYBSahaR7FpLuWQjdCxiZVzHKpuRW6eYmZuYUpybrFicn5uWlFuka6+VmluilppRuYgQF Nqck3w7GrweVDjEKcDAq8fAKPOb0E2JNLCuuzD3EKMnBpCTKu+wvUIgvKT+lMiOxOCO+qDQn tfgQowQHs5II71QjoBxvSmJlVWpRPkxKmoNFSZw3yvu/r5BAemJJanZqakFqEUxWhoNDSYK3 DxjBQoJFqempFWmZOSUIaSYOTpDhPEDD+UFqeIsLEnOLM9Mh8qcYdTnuPVp5mFGIJS8/L1VK nLfnO1CRAEhRRmke3BxYQnrFKA70ljBvAcgoHmAyg5v0CmgJE9CSslqwJSWJCCmpBsbME87n wyOZA8Nk+i6YN76zWXrhfPx2pw1vN55dxlGVf+rJwt7Zm3smqPa6BbV29JYteL9EUPuaodmM HMZlu/9vXrS6I8ZZ/2Ou3JYJVb1r/dL2dC2c8FuRz2iGF79EItOzorzPm95OfnH7l3BF86rv nSv3hNSy5Kif9vg+9WHMzuV9/x5y3AhXYinOSDTUYi4qTgQAC7ueEyMDAAA= 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:23:08 -0000 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.)