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 5B01D429E36 for ; Wed, 25 Jan 2012 09:37:12 -0800 (PST) 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 KplFYyHNKQLb for ; Wed, 25 Jan 2012 09:37:12 -0800 (PST) Received: from mail-bk0-f53.google.com (mail-bk0-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 B7A31431FBC for ; Wed, 25 Jan 2012 09:37:11 -0800 (PST) Received: by bkbzt19 with SMTP id zt19so3690656bkb.26 for ; Wed, 25 Jan 2012 09:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=UBpjjsSUi0ZEFdwGF3OAio6XFNX68n0dTVI6K/9/35M=; b=Mx+/re/SauGoTtr8neE7KU8wDBVjEqmWWz4XHRRR5MRxTLia37u5UCguorUkymTTYe PEb8G+k3NJja6zr6cyoel82TALW6hwXbeDUW0ydwHvSKSYT9RdFXhkG1SCWCGtDOKq2g lDaBc4CJUynbKOln7vzjQFlVx14C/y8fTFgfo= Received: by 10.204.152.26 with SMTP id e26mr7242393bkw.87.1327513030428; Wed, 25 Jan 2012 09:37:10 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id d2sm2481008bky.11.2012.01.25.09.37.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jan 2012 09:37:09 -0800 (PST) From: Dmitry Kurochkin To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH 2/4 v2] test: `notmuch-test-run' should protect against buffer switching. In-Reply-To: <1327506328-22126-3-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> <1327506328-22126-3-git-send-email-dme@dme.org> User-Agent: Notmuch/0.11+116~ge6e10b8 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Wed, 25 Jan 2012 21:36:04 +0400 Message-ID: <87obtrhegr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 17:37:12 -0000 On Wed, 25 Jan 2012 15:45:26 +0000, David Edmondson wrote: > 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. LGTM Regards, Dmitry > --- > 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 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch