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 D7C7F421186 for ; Wed, 29 Jun 2011 14:27:13 -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 IOZBMAE9euMz for ; Wed, 29 Jun 2011 14:27:13 -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 36A5F429E5F for ; Wed, 29 Jun 2011 14:27:13 -0700 (PDT) Received: by bwg12 with SMTP id 12so1534231bwg.26 for ; Wed, 29 Jun 2011 14:27:11 -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=WnBi/QqsClBHJyo3qbQaJfKrPsykuG7JV3PtNu8289w=; b=rqvugcYAJnPnJ8mWoFKIEpDe8Yt3QcZuKnWY3y/GCLTxHf/OJdtzA+mM4k+fqi6aRl dK+13ZjQ1a26X/Z5wyH3cpSfkenjXKvEkFmi5yw/CGDnRuIU7MfFszwItSdxGxgJxcDK 0s6zr628p72Sc1wtl8sX1C1hNZ0klA1ChFQSo= Received: by 10.204.8.89 with SMTP id g25mr1236389bkg.10.1309382831787; Wed, 29 Jun 2011 14:27:11 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id o3sm1493205bka.12.2011.06.29.14.27.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jun 2011 14:27:10 -0700 (PDT) From: Dmitry Kurochkin To: Jim Paris Subject: Re: [PATCH 1/6] test: run emacs inside screen In-Reply-To: <20110629201640.GA19216@psychosis.jim.sh> References: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com> <20110629201640.GA19216@psychosis.jim.sh> User-Agent: Notmuch/0.5-297-gfb148d8 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 30 Jun 2011 01:27:06 +0400 Message-ID: <87r56cuy51.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: Wed, 29 Jun 2011 21:27:14 -0000 On Wed, 29 Jun 2011 16:16:40 -0400, Jim Paris wrote: > Dmitry Kurochkin wrote: > > Before the change, emacs run in daemon mode without any visible > > buffers. Turns out that this affects emacs behavior in some > > cases. In particular, `window-end' function returns `point-max' > > instead of the last visible position. That makes it hard or > > impossible to implement some tests. The patch runs emacs in a > > detached screen(1) session. So that it works exactly as if it > > has a visible window. > > > > Note: screen terminates when emacs exits. So the patch does not > > introduce new "running processes left behind" issues. > > --- > > test/test-lib.sh | 10 ++++++++-- > > 1 files changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/test/test-lib.sh b/test/test-lib.sh > > index 079d7db..8d7c98d 100755 > > --- a/test/test-lib.sh > > +++ b/test/test-lib.sh > > @@ -873,10 +873,16 @@ EOF > > test_emacs () { > > if [ -z "$EMACS_SERVER" ]; then > > EMACS_SERVER="notmuch-test-suite-$$" > > - "$TMP_DIRECTORY/run_emacs" \ > > - --daemon \ > > + # start a detached screen session with an emacs server > > + screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \ > > To avoid problems with ~/.screenrc or /etc/screenrc, you might want e.g. > env SYSSCREENRC=/dev/null SCREENRC=/dev/null screen -S ... > Thanks for the suggestion, Jim. I sent a patch to fix that. Regards, Dmitry > -jim > > > + --no-window-system \ > > --eval "(setq server-name \"$EMACS_SERVER\")" \ > > + --eval '(server-start)' \ > > --eval "(orphan-watchdog $$)" || return > > + # wait until the emacs server is up > > + until test_emacs '()'; do > > + sleep 1 > > + done > > fi > > > > emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)" > > -- > > 1.7.5.4 > > > > _______________________________________________ > > notmuch mailing list > > notmuch@notmuchmail.org > > http://notmuchmail.org/mailman/listinfo/notmuch