Re: [PATCH 1/6] test: run emacs inside screen
authorJim Paris <jim@jtan.com>
Wed, 29 Jun 2011 20:16:40 +0000 (16:16 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:50 +0000 (09:38 -0800)
40/7d62d9b90d92c7ba10b5717d5e5baad6145d7e [new file with mode: 0644]

diff --git a/40/7d62d9b90d92c7ba10b5717d5e5baad6145d7e b/40/7d62d9b90d92c7ba10b5717d5e5baad6145d7e
new file mode 100644 (file)
index 0000000..96f6f08
--- /dev/null
@@ -0,0 +1,111 @@
+Return-Path: <jim@jim.sh>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 4D00F421192\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 13:22:17 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Es-dWjk74tBi for <notmuch@notmuchmail.org>;\r
+       Wed, 29 Jun 2011 13:22:15 -0700 (PDT)\r
+X-Greylist: delayed 331 seconds by postgrey-1.32 at olra;\r
+       Wed, 29 Jun 2011 13:22:15 PDT\r
+Received: from psychosis.jim.sh (jim.sh [75.150.123.25])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 046FF42118E\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 13:22:14 -0700 (PDT)\r
+Received: from psychosis.jim.sh (localhost [127.0.0.1])\r
+       by psychosis.jim.sh (8.14.4/8.14.4/Debian-2) with ESMTP id\r
+       p5TKGfDY019811\r
+       (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);\r
+       Wed, 29 Jun 2011 16:16:41 -0400\r
+Received: (from jim@localhost)\r
+       by psychosis.jim.sh (8.14.4/8.14.4/Submit) id p5TKGeGQ019810;\r
+       Wed, 29 Jun 2011 16:16:40 -0400\r
+Date: Wed, 29 Jun 2011 16:16:40 -0400\r
+From: Jim Paris <jim@jtan.com>\r
+To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+Subject: Re: [PATCH 1/6] test: run emacs inside screen\r
+Message-ID: <20110629201640.GA19216@psychosis.jim.sh>\r
+References: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+Sender: jim@jim.sh\r
+User-Agent: Mutt/1.5.20 (2009-06-14)\r
+X-Virus-Scanned: clamav-milter 0.97 at psychosis\r
+X-Virus-Status: Clean\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 29 Jun 2011 20:22:17 -0000\r
+\r
+Dmitry Kurochkin wrote:\r
+> Before the change, emacs run in daemon mode without any visible\r
+> buffers.  Turns out that this affects emacs behavior in some\r
+> cases.  In particular, `window-end' function returns `point-max'\r
+> instead of the last visible position.  That makes it hard or\r
+> impossible to implement some tests.  The patch runs emacs in a\r
+> detached screen(1) session.  So that it works exactly as if it\r
+> has a visible window.\r
+> \r
+> Note: screen terminates when emacs exits.  So the patch does not\r
+> introduce new "running processes left behind" issues.\r
+> ---\r
+>  test/test-lib.sh |   10 ++++++++--\r
+>  1 files changed, 8 insertions(+), 2 deletions(-)\r
+> \r
+> diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+> index 079d7db..8d7c98d 100755\r
+> --- a/test/test-lib.sh\r
+> +++ b/test/test-lib.sh\r
+> @@ -873,10 +873,16 @@ EOF\r
+>  test_emacs () {\r
+>      if [ -z "$EMACS_SERVER" ]; then\r
+>              EMACS_SERVER="notmuch-test-suite-$$"\r
+> -            "$TMP_DIRECTORY/run_emacs" \\r
+> -                    --daemon \\r
+> +            # start a detached screen session with an emacs server\r
+> +            screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \\r
+\r
+To avoid problems with ~/.screenrc or /etc/screenrc, you might want e.g.\r
+  env SYSSCREENRC=/dev/null SCREENRC=/dev/null screen -S ...\r
+\r
+-jim\r
+\r
+> +                    --no-window-system \\r
+>                      --eval "(setq server-name \"$EMACS_SERVER\")" \\r
+> +                    --eval '(server-start)' \\r
+>                      --eval "(orphan-watchdog $$)" || return\r
+> +            # wait until the emacs server is up\r
+> +            until test_emacs '()'; do\r
+> +                    sleep 1\r
+> +            done\r
+>      fi\r
+>  \r
+>      emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)"\r
+> -- \r
+> 1.7.5.4\r
+> \r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r