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 4D00F421192 for ; Wed, 29 Jun 2011 13:22:17 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 Es-dWjk74tBi for ; Wed, 29 Jun 2011 13:22:15 -0700 (PDT) X-Greylist: delayed 331 seconds by postgrey-1.32 at olra; Wed, 29 Jun 2011 13:22:15 PDT Received: from psychosis.jim.sh (jim.sh [75.150.123.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 046FF42118E for ; Wed, 29 Jun 2011 13:22:14 -0700 (PDT) Received: from psychosis.jim.sh (localhost [127.0.0.1]) by psychosis.jim.sh (8.14.4/8.14.4/Debian-2) with ESMTP id p5TKGfDY019811 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Jun 2011 16:16:41 -0400 Received: (from jim@localhost) by psychosis.jim.sh (8.14.4/8.14.4/Submit) id p5TKGeGQ019810; Wed, 29 Jun 2011 16:16:40 -0400 Date: Wed, 29 Jun 2011 16:16:40 -0400 From: Jim Paris To: Dmitry Kurochkin Subject: Re: [PATCH 1/6] test: run emacs inside screen Message-ID: <20110629201640.GA19216@psychosis.jim.sh> References: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com> Sender: jim@jim.sh User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.97 at psychosis X-Virus-Status: Clean 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 20:22:17 -0000 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 ... -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