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 64E47429E29 for ; Wed, 11 Jan 2012 20:13:42 -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 xGQBv+46UKtU for ; Wed, 11 Jan 2012 20:13:42 -0800 (PST) Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id E45BB429E25 for ; Wed, 11 Jan 2012 20:13:41 -0800 (PST) X-AuditID: 12074422-b7fd66d0000008f9-03-4f0e5df544b9 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id A5.BE.02297.5FD5E0F4; Wed, 11 Jan 2012 23:13:41 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q0C4DeW3017077; Wed, 11 Jan 2012 23:13:41 -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 q0C4DdNo017385 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Wed, 11 Jan 2012 23:13:40 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RlC2q-0004me-Up; Wed, 11 Jan 2012 23:13:45 -0500 Date: Wed, 11 Jan 2012 23:13:44 -0500 From: Austin Clements To: Tomi Ollila Subject: Re: [PATCH] make (kill-emacs) from emacsclient work with emacs 23.(1|2) Message-ID: <20120112041344.GZ20796@mit.edu> References: <87d3b01qus.fsf@qmul.ac.uk> <1326293378-25248-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: <1326293378-25248-1-git-send-email-tomi.ollila@iki.fi> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hTV1v0ay+dv8GaCuMX1mzOZLd6snMfq wORx+OtCFo9nq24xBzBFcdmkpOZklqUW6dslcGWs+ryYsWAvd8XsdxtZGhgXcnYxcnJICJhI rNy6ixXCFpO4cG89WxcjF4eQwD5Gie9nFjFDOBsYJa4ef8kEUiUkcJJJon2BKkRiCaPElE+X wRIsAqoSN5esZQSx2QQ0JLbtXw5miwioSDxoWw+2gllAWuLb72awemGBIIknt6+zgNi8AjoS 1ydcZYFYkCBx5cxXdoi4oMTJmU9YIHq1JG78AzmCA2zO8n8cIGFOAWeJ9R9OsoHYokCrppzc xjaBUWgWku5ZSLpnIXQvYGRexSibklulm5uYmVOcmqxbnJyYl5dapGuql5tZopeaUrqJERTW 7C5KOxh/HlQ6xCjAwajEw7tjL6+/EGtiWXFl7iFGSQ4mJVFeI2BUCPEl5adUZiQWZ8QXleak Fh9ilOBgVhLhdaoBKudNSaysSi3Kh0lJc7AoifOqa73zExJITyxJzU5NLUgtgsnKcHAoSfD+ iQEaKliUmp5akZaZU4KQZuLgBBnOAzRcG2Qxb3FBYm5xZjpE/hSjopQ4LxtIQgAkkVGaB9cL SzuvGMWBXhHm/QGyggeYsuC6XwENZgIavGUdD8jgkkSElFQDY+HKh4n568SO3gn8uNFqRYdu 2usd+zOLphs7ie0yY1FkkjDZdnbJxS0ak1urjrMIiykq9Adq75yvyP9OvG7b5ctHdq/8MXOi gfUegwnzuR15jpU8eV5UZ7fk5qRiTZcE4ZIqkYsS6nUPY588mPE6MztK48H9Y7KvMw4pPAvk +rEr1UTq14uHKUosxRmJhlrMRcWJAOkIATYWAwAA 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: Thu, 12 Jan 2012 04:13:42 -0000 This is important to fix, but this solution seems needlessly roundabout. What about using an after-advice and simply delq'ing whatever the offending hook is? That wouldn't even need a version check. Quoth Tomi Ollila on Jan 11 at 4:49 pm: > emacsclient --eval '(kill-emacs)' doesn't work without interactive > user input. By removing the hook which asks user input makes things > work well enough in our test cases. > --- > test/test-lib.el | 13 +++++++++++++ > 1 files changed, 13 insertions(+), 0 deletions(-) > > diff --git a/test/test-lib.el b/test/test-lib.el > index 3b817c3..c52854e 100644 > --- a/test/test-lib.el > +++ b/test/test-lib.el > @@ -26,6 +26,19 @@ > ;; `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. > +(when (and (= emacs-major-version 23) (< emacs-minor-version 3)) > + (require 'server) > + (fset 'server-start-real (symbol-function 'server-start)) > + (defun server-start (&optional leave-dead) > + (interactive "P") > + (let ((hc (length kill-emacs-hook))) > + (unwind-protect > + (server-start-real leave-dead) > + (if (> (length kill-emacs-hook) hc) > + (setq kill-emacs-hook (cdr kill-emacs-hook))))))) > + > (defun notmuch-test-wait () > "Wait for process completion." > (while (get-buffer-process (current-buffer))