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 1A430431FB6 for ; Thu, 12 Jan 2012 09:02:44 -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 EBpeoO-mrm9j for ; Thu, 12 Jan 2012 09:02:43 -0800 (PST) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id 8D90E429E25 for ; Thu, 12 Jan 2012 09:02:43 -0800 (PST) X-AuditID: 12074424-b7fae6d000000906-2c-4f0f12334462 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 2C.61.02310.3321F0F4; Thu, 12 Jan 2012 12:02:43 -0500 (EST) 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 q0CH2g6t006832; Thu, 12 Jan 2012 12:02:42 -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 q0CH2fOl003278 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Thu, 12 Jan 2012 12:02:41 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RlO32-0006CN-JG; Thu, 12 Jan 2012 12:02:44 -0500 Date: Thu, 12 Jan 2012 12:02:44 -0500 From: Austin Clements To: Tomi Ollila Subject: Re: [PATCH] make (kill-emacs) from emacsclient work with emacs 23.(1|2) Message-ID: <20120112170244.GB18625@mit.edu> References: <87d3b01qus.fsf@qmul.ac.uk> <1326293378-25248-1-git-send-email-tomi.ollila@iki.fi> <20120112041344.GZ20796@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+NgFupjleLIzCtJLcpLzFFi42IRYrdT1zUW4vc3mLSZ3eL6zZnMFm9WzmN1 YPI4/HUhi8ezVbeYA5iiuGxSUnMyy1KL9O0SuDIaFq9hLXjEVXH0xVXGBsZTHF2MnBwSAiYS nQtesEHYYhIX7q0Hsrk4hAT2MUq8eNUPlhAS2MAo0bS+BiJxkkmifdU8qMQSRonNz+VBbBYB VYmt3S9YQGw2AQ2JbfuXM4LYIgIqEg/a1rOC2MwC0hLffjczgdjCAkEST25fB6vnFdCROLnv CiPEzKWMEv0fNCDighInZz5hgejVkrjx7yVQLwfYnOX/wB7gBGr90L+WHcQWBVo15eQ2tgmM QrOQdM9C0j0LoXsBI/MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXXO93MwSvdSU0k2M4KB2UdnB 2HxI6RCjAAejEg/vjr28/kKsiWXFlbmHGCU5mJREea34+P2F+JLyUyozEosz4otKc1KLDzFK cDArifBOPs/nL8SbklhZlVqUD5OS5mBREufV0HrnJySQnliSmp2aWpBaBJOV4eBQkuBtFwQa KliUmp5akZaZU4KQZuLgBBnOAzT8qABQDW9xQWJucWY6RP4Uoy7HybVXzjEKseTl56VKifPG gQwSACnKKM2DmwNLRq8YxYHeEuZ1B6niASYyuEmvgJYwAS0pSwH5oLgkESEl1cCYuuvxm305 pubBJl79wgLv934+0NWiNOPi2W6mF3z3Sg97HlFbJ6rPK6siftJp35HPr6bW3/KSW7n5wrf+ K4ZnteJXtQhP7kpSu6Z8YgdH8kc/+SVnPMt83BMYTQy4GQIfFXyeHLH8WJ9rWatcsGgGf1aM kN28ov2Gx38yZuX9r5MweS92PkGJpTgj0VCLuag4EQBb4jycIQMAAA== 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 17:02:44 -0000 Quoth Tomi Ollila on Jan 12 at 10:51 am: > On Wed, 11 Jan 2012 23:13:44 -0500, Austin Clements wrote: > > 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. > > delq could work -- thanks for the idea -- but removing the hook was > wrong shot from my part (the hook removes the cleanup I mentioned in > one of my previous mails). Ah, interesting. > To minimise behaviour changes (to zero in emacs 23.3+) to minimal > in 23.(1|2) my next suggestion goes along lines: > > ;; 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)) > (defadvice kill-emacs (before disable-yes-or-no-p) > "Disable yes-or-no-p before executing kill-emacs" > (defun yes-or-no-p (prompt) t)) > (ad-activate 'kill-emacs)) This seems reasonable. You could shorten it a bit by changing (before disable-yes-or-no-p) to (before disable-yes-or-no-p activate) rather than calling ad-activate, but that's just a nit. > Now just (accidental) additions which use yes-or-no-p > into kill-emacs-hook are not noticed in emacs 23.1 & 23.2. > > > Tomi