From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id CBCA4431FB6 for ; Fri, 17 Aug 2012 11:55:06 -0700 (PDT) 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 CqPg6kmHNjK4 for ; Fri, 17 Aug 2012 11:55:06 -0700 (PDT) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id 28F0F431FAF for ; Fri, 17 Aug 2012 11:55:06 -0700 (PDT) X-AuditID: 1209190d-b7fd56d000000933-64-502e9387e696 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id FA.BC.02355.7839E205; Fri, 17 Aug 2012 14:55:03 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q7HIt2se013183; Fri, 17 Aug 2012 14:55:03 -0400 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 q7HIt16J014141 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Fri, 17 Aug 2012 14:55:02 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1T2RhF-0007PJ-0x; Fri, 17 Aug 2012 14:55:01 -0400 Date: Fri, 17 Aug 2012 14:55:00 -0400 From: Austin Clements To: Tomi Ollila Subject: Re: [PATCH 2/2] test: emacs: run list-processes after accept-process-output in emacs 23.1 Message-ID: <20120817185500.GP11179@mit.edu> References: <1344165182-29246-1-git-send-email-tomi.ollila@iki.fi> <1344165182-29246-2-git-send-email-tomi.ollila@iki.fi> <20120813151613.GN11179@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42IRYrdT122frBdg8P+qtcX1mzOZLd6snMfq wORx+OtCFo9nq24xBzBFcdmkpOZklqUW6dslcGXcm3OSqaBPvGLvxo0sDYwzhboYOTkkBEwk 1u5+yQJhi0lcuLeerYuRi0NIYB+jROuen0wQzgZGiQ2Ni9khnJNMEvtWnWKFcJYwSmy78Ays n0VAVeLc0b9gNpuAhsS2/csZQWwRARWJB23rWUFsZgFpiW+/m5lAbGGBFIn+9hlgcV4BHYn9 fesYIYYeYZQ4cPsjI0RCUOLkzCcsEM1aEjf+vQRq5gAbtPwfB0iYU8BA4sChPWDlokC7ppzc xjaBUWgWku5ZSLpnIXQvYGRexSibklulm5uYmVOcmqxbnJyYl5dapGukl5tZopeaUrqJERTa nJK8OxjfHVQ6xCjAwajEwzvZRzdAiDWxrLgy9xCjJAeTkihvXodegBBfUn5KZUZicUZ8UWlO avEhRgkOZiURXieQHG9KYmVValE+TEqag0VJnPdKyk1/IYH0xJLU7NTUgtQimKwMB4eSBO/Z SUCNgkWp6akVaZk5JQhpJg5OkOE8QMNPgNTwFhck5hZnpkPkTzEqSonzrgdJCIAkMkrz4Hph qecVozjQK8K8S0GqeIBpC677FdBgJqDBK0V0QQaXJCKkpBoYzcW3dVxYnHTCU2xn8rKwhsCn /zdVhiUqNXYuUGAIyre/WZDeIXjI4vhC/e7GhZf/v025eUmluTxfiOfm/WPLVBui9LRqu8/G t4lN/ce0YuPBCRunRTXHT5/dVH87LmJu+1Ux//9l761zU48mWjBXdYfYGPRwFm6bxDKr+aPc sqXNrbql3MpKLMUZiYZazEXFiQBi0b0OGAMAAA== 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, 17 Aug 2012 18:55:06 -0000 Quoth Tomi Ollila on Aug 16 at 10:44 am: > On Mon, Aug 13 2012, Austin Clements wrote: > > > Quoth Tomi Ollila on Aug 05 at 2:13 pm: > >> When running emacs tests using emacs 23.1.1 the tests block (until timeout) > >> when emacs function (notmuch-test-wait) is called. > >> > >> There is an emacs bug #2930 titled: > >> 23.0.92; `accept-process-output' and `sleep-for' do not run sentinel > >> > >> It seems this is present in emacs 23.1. > >> > >> Calling list-processes after accept-process-output seems work around > >> this problem; in case Emacs version is 23.1 a defadvice is activated > >> to do just that. > > > > Should this workaround perhaps go in notmuch-test-wait directly, > > instead of being implemented as advice? > > This way the fact that this is workaround for bug that exists only in > 23.1(*) is emphasized; The notmuch-test-wait can exist in a (simpler) > format where it doesn't need to know about this bug. Okay. > (*) This bug probably exists in emacs 22 but the MUA has not worked > on emacs 22 at least for a year now. > > > If we do want to keep it as advice, should it go in notmuch-lib.el > > along with the few other compatibility functions? > > In tests we have fixed environment where we can write workarounds > as "global" advices. If we did this in notmuch-lib.el we'd be changing > users' environment, possibly causing surprises... Oh, right, of course. I'd forgotten that this was in test-lib.el and not in the general notmuch Emacs code. > ... but neither sleep-for or accept-process-output are used in > any of the notmuch elisp code so such "fixes" are not needed now... > > ... and this would ever be a problem, we might already support only > emacs 24 or newer >;) ... > > Tomi Series LGTM. > >> --- > >> > >> Thanks to Austin for the comments and IRC discussions on the matter. > >> > >> test/test-lib.el | 8 ++++++++ > >> 1 files changed, 8 insertions(+), 0 deletions(-) > >> > >> diff --git a/test/test-lib.el b/test/test-lib.el > >> index 52d9936..4330352 100644 > >> --- a/test/test-lib.el > >> +++ b/test/test-lib.el > >> @@ -35,6 +35,16 @@ > >> "Disable yes-or-no-p before executing kill-emacs" > >> (defun yes-or-no-p (prompt) t))) > >> > >> +;; Emacs bug #2930: > >> +;; 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels > >> +;; seems to be present in Emacs 23.1. > >> +;; Running `list-processes' after `accept-process-output' seems to work > >> +;; around this problem. > >> +(if (and (= emacs-major-version 23) (= emacs-minor-version 1)) > >> + (defadvice accept-process-output (after run-list-processes activate) > >> + "run list-processes after executing accept-process-output" > >> + (list-processes))) > >> + > >> (defun notmuch-test-wait () > >> "Wait for process completion." > >> (while (get-buffer-process (current-buffer))