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 7764E429E3C for ; Wed, 25 Jan 2012 07:45:34 -0800 (PST) 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 2VRMUSWJJWKD for ; Wed, 25 Jan 2012 07:45:34 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E93C8431FBC for ; Wed, 25 Jan 2012 07:45:33 -0800 (PST) Received: by wibhi8 with SMTP id hi8so2602173wib.26 for ; Wed, 25 Jan 2012 07:45:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.96.3 with SMTP id do3mr12157833wib.1.1327506332692; Wed, 25 Jan 2012 07:45:32 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id j16sm2701702wie.4.2012.01.25.07.45.31 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jan 2012 07:45:31 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id D9EA59FEEC; Wed, 25 Jan 2012 15:45:29 +0000 (GMT) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH 2/4 v2] test: `notmuch-test-run' should protect against buffer switching. Date: Wed, 25 Jan 2012 15:45:26 +0000 Message-Id: <1327506328-22126-3-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1327506328-22126-1-git-send-email-dme@dme.org> References: <1327503908-17226-1-git-send-email-dme@dme.org> <1327506328-22126-1-git-send-email-dme@dme.org> X-Gm-Message-State: ALoCoQlJjOcxbis7sJJgRFgLuwmJ44+T6fAGn0HzCp+JbHTDE69jgSIKPkTcN3e0FMmqKE535JQ4 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: Wed, 25 Jan 2012 15:45:34 -0000 The body of the test may cause the current buffer to change. Ensure that the output goes to the correct buffer by switching back before inserting it. --- test/test-lib.el | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/test/test-lib.el b/test/test-lib.el index 36e793a..0efb02a 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -89,7 +89,9 @@ nothing." (defmacro notmuch-test-run (&rest body) "Evaluate a BODY of test expressions and output the result." `(with-temp-buffer - (let ((result (progn ,@body))) + (let ((buffer (current-buffer)) + (result (progn ,@body))) + (switch-to-buffer buffer) (insert (if (stringp result) result (prin1-to-string result))) -- 1.7.8.3