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 16DAE41ED70 for ; Fri, 13 Jan 2012 11:18:19 -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 9UsEvP2hNIBA for ; Fri, 13 Jan 2012 11:18:18 -0800 (PST) Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU [18.7.68.37]) by olra.theworths.org (Postfix) with ESMTP id 903E842119C for ; Fri, 13 Jan 2012 11:18:18 -0800 (PST) X-AuditID: 12074425-b7f4a6d0000008e0-e3-4f1083799380 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id DF.E6.02272.973801F4; Fri, 13 Jan 2012 14:18:18 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q0DJIHbD026913; Fri, 13 Jan 2012 14:18:17 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0DJIFFZ001349 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Fri, 13 Jan 2012 14:18:16 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1Rlmdj-0008OE-HU; Fri, 13 Jan 2012 14:18:15 -0500 Date: Fri, 13 Jan 2012 14:18:15 -0500 From: Austin Clements To: Tomi Ollila Subject: Re: [PATCH] test: make (kill-emacs) from emacsclient work with emacs 23.(1|2) Message-ID: <20120113191815.GJ18625@mit.edu> References: <20120112170244.GB18625@mit.edu> <1326442648-5060-1-git-send-email-tomi.ollila@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1326442648-5060-1-git-send-email-tomi.ollila@iki.fi> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IR4hRV1q1qFvA3uDmZ0eL6zZnMFm9WzmN1 YPI4/HUhi8ezVbeYA5iiuGxSUnMyy1KL9O0SuDLe3T7OXnCIq2Lfxw9MDYyHOboYOTkkBEwk NvRtZ4GwxSQu3FvP1sXIxSEksI9RYsLFJnYIZwOjxMszt5kgnJNMEpu7r0FlljBKLJvxC6yf RUBV4m3rQ3YQm01AQ2Lb/uWMILaIgIrEg7b1rCA2s4C0xLffzUwgtrBAhMS1W0/BbF4BHYn2 kxA1QgIpEstWzmWFiAtKnJz5hAWiV0vixr+XQPUcYHOW/wN7gVPASaKn8QFYiSjQqiknt7FN YBSahaR7FpLuWQjdCxiZVzHKpuRW6eYmZuYUpybrFicn5uWlFula6OVmluilppRuYgQFNruL 6g7GCYeUDjEKcDAq8fBKZgn4C7EmlhVX5h5ilORgUhLlfdEAFOJLyk+pzEgszogvKs1JLT7E KMHBrCTCK2UKlONNSaysSi3Kh0lJc7AoifNqar3zExJITyxJzU5NLUgtgsnKcHAoSfCebgJq FCxKTU+tSMvMKUFIM3FwggznARq+B6SGt7ggMbc4Mx0if4pRUUqcdxVIQgAkkVGaB9cLSzyv GMWBXhHm3QtSxQNMWnDdr4AGMwENLkvhAxlckoiQkmpgLNd/xLf/4OpDzz4d8E3+xhPQefgF p/lEx+ba9eE1YasfVJzO9jaf57v38Pb4qJ1X5pdofLhW8WmaWsSl3p3MdXVs77ODXVTsV809 svdBvFOxn8DmjMbVmWUiGwtCzXrtv0xXyzet1tn1ZKVf+hw+qwc7l4gd0Fjjtn9a7c+lC597 GYbLzd+TocRSnJFoqMVcVJwIADfrOYgXAwAA 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: Fri, 13 Jan 2012 19:18:19 -0000 LGTM. Quoth Tomi Ollila on Jan 13 at 10:17 am: > emacsclient --eval '(kill-emacs)' makes emacs versions 23.1 > and 23.2 ask user input from running emacs. Redefining > yes-or-no-p function when kill-emacs is executed for these > emacs versions in test-lib.el avoids this test problem. > --- > Thanks Austin for your comments. Including 'activate' into defadvice > made it possible to use if (well, without progn...) instead of when > which makes this also marginally faster (as we're not byte-compiling > this). > > test/test-lib.el | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/test/test-lib.el b/test/test-lib.el > index 3b817c3..59c5868 100644 > --- a/test/test-lib.el > +++ b/test/test-lib.el > @@ -26,6 +26,13 @@ > ;; `read' call. > (setq read-file-name-function (lambda (&rest _) (read))) > > +;; Work around a bug in emacs 23.1 and emacs 23.2 which prevents > +;; noninteractive (kill-emacs) from emacsclient. > +(if (and (= emacs-major-version 23) (< emacs-minor-version 3)) > + (defadvice kill-emacs (before disable-yes-or-no-p activate) > + "Disable yes-or-no-p before executing kill-emacs" > + (defun yes-or-no-p (prompt) t))) > + > (defun notmuch-test-wait () > "Wait for process completion." > (while (get-buffer-process (current-buffer))