From 5f9d93238c623cbfb7e04feb5730f944cc028530 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 4 Feb 2012 12:31:57 +0000 Subject: [PATCH] Re: Bug: emacs 23.2 doesn't like ido-completing-read --- 6a/e6f6002f89c8e168725f00e1274a3510c65d55 | 131 ++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 6a/e6f6002f89c8e168725f00e1274a3510c65d55 diff --git a/6a/e6f6002f89c8e168725f00e1274a3510c65d55 b/6a/e6f6002f89c8e168725f00e1274a3510c65d55 new file mode 100644 index 000000000..606edd0b3 --- /dev/null +++ b/6a/e6f6002f89c8e168725f00e1274a3510c65d55 @@ -0,0 +1,131 @@ +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 ECFA6431FB6 + for ; Sat, 4 Feb 2012 04:30:53 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 c9nL3sDf5dai for ; + Sat, 4 Feb 2012 04:30:53 -0800 (PST) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id E778E431FAF + for ; Sat, 4 Feb 2012 04:30:52 -0800 (PST) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1RtelU-00071n-MG; Sat, 04 Feb 2012 12:30:49 +0000 +Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] + helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1RtelU-0001Un-9w; Sat, 04 Feb 2012 12:30:48 +0000 +From: Mark Walters +To: David Edmondson , notmuch@notmuchmail.org +Subject: Re: Bug: emacs 23.2 doesn't like ido-completing-read +In-Reply-To: <87pqe14hjh.fsf@qmul.ac.uk> +References: <871uqijdy4.fsf@qmul.ac.uk> + + <87pqe14hjh.fsf@qmul.ac.uk> +User-Agent: Notmuch/0.11+129~gdd41085 (http://notmuchmail.org) Emacs/23.2.1 + (i486-pc-linux-gnu) +Date: Sat, 04 Feb 2012 12:31:57 +0000 +Message-ID: <8762fmeq4i.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 94.192.233.223 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: dffef0b803f22573b705bf879e47040a (of first 20000 bytes) +X-SpamAssassin-Score: -1.8 +X-SpamAssassin-SpamBar: - +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -1.8 points. + Summary of the scoring: + * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, + * medium trust + * [138.37.6.40 listed in list.dnswl.org] + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + * domain + * 0.5 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Sat, 04 Feb 2012 12:30:54 -0000 + +On Mon, 30 Jan 2012 10:21:38 +0000, Mark Walters wrote: +> On Mon, 30 Jan 2012 09:39:32 +0000, David Edmondson wrote: +> > On Sun, 29 Jan 2012 23:17:55 +0000, Mark Walters wrote: +> > > I have been experimenting with notmuch-always-prompt-for-sender on my +> > > debian stable setup (emacs 23.2.1) and it doesn't like +> > > ido-completing-read. It goes to the minibuffer and then it seems to be +> > > impossible to exit the minibuffer. +> > > +> > > I can find an emacs bug report #3274 and some discussion +> > > http://comments.gmane.org/gmane.emacs.bugs/27856 which indicates that it +> > > is a problem with ido initialisation. Unfortunately I can't get from there to a +> > > solution (except upgrade emacs). +> > +> > I'm not sure that notmuch-mua.el should be using `ido-completing-read', +> > and certainly not without `require'ing it. +> > +> > Is there a particular thing required that `completing-read' doesn't do? +> +> Thanks for the suggestion: I can confirm that with ido-completing-read +> replaced by completing-read it works nicely. The "ido" version shows the +> possibilities for you which is nice, but this works fine. + +I hadn't realised before but this also goes wrong if you use the prefix +argument to mail (eg ctrl-u m). The current code seems to mess up the +mini-buffer and even closing the buffer does not get out of it. + +Changing ido-completing-read read to completing-read seems to fix the +problem entirely. Since this will affect most debian stable users (*) I +think we should fix it. The trivial patch below works for me but other solutions +may be better as they could maintain the benefits of ido-completing-read +(eg that it shows the possibilities). + +Best wishes + +Mark + +(*) Perhaps only those who have more than one email address. + +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index 023645e..41f82c2 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -191,7 +191,7 @@ the From: header is already filled in by notmuch." + ;; Now prompt the user, either for an email address only or for a full identity. + (if one-name-only + (let ((address +- (ido-completing-read (concat "Sender address for " name ": ") addresses ++ (completing-read (concat "Sender address for " name ": ") addresses + nil nil nil 'notmuch-mua-sender-history (car addresses)))) + (concat name " <" address ">")) + (ido-completing-read "Send mail From: " notmuch-identities +-- +1.7.2.3 + -- 2.26.2