Bug: emacs 23.2 doesn't like ido-completing-read

classic Classic list List threaded Threaded
7 messages Options
Mark Walters Mark Walters
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Bug: emacs 23.2 doesn't like ido-completing-read


Hello

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).

Many thanks

Mark


_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
David Edmondson David Edmondson
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Bug: emacs 23.2 doesn't like ido-completing-read

On Sun, 29 Jan 2012 23:17:55 +0000, Mark Walters <[hidden email]> 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?

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch

attachment0 (203 bytes) Download Attachment
Mark Walters Mark Walters
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Bug: emacs 23.2 doesn't like ido-completing-read

On Mon, 30 Jan 2012 09:39:32 +0000, David Edmondson <[hidden email]> wrote:

> On Sun, 29 Jan 2012 23:17:55 +0000, Mark Walters <[hidden email]> 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.

Many thanks

Mark
_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
Mark Walters Mark Walters
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Bug: emacs 23.2 doesn't like ido-completing-read

On Mon, 30 Jan 2012 10:21:38 +0000, Mark Walters <[hidden email]> wrote:

> On Mon, 30 Jan 2012 09:39:32 +0000, David Edmondson <[hidden email]> wrote:
> > On Sun, 29 Jan 2012 23:17:55 +0000, Mark Walters <[hidden email]> 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

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Bug: emacs 23.2 doesn't like ido-completing-read

On Sat, 04 Feb 2012 12:31:57 +0000, Mark Walters <[hidden email]> wrote:

>
> 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

Should that other ido-completing-read be kept there -- it is the only
one left after this patch...

Tomi


> --
> 1.7.2.3

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
Mark Walters Mark Walters
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Bug: emacs 23.2 doesn't like ido-completing-read

On Sat, 04 Feb 2012 22:14:25 +0200, Tomi Ollila <[hidden email]> wrote:

> On Sat, 04 Feb 2012 12:31:57 +0000, Mark Walters <[hidden email]> wrote:
> >
> > 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
>
> Should that other ido-completing-read be kept there -- it is the only
> one left after this patch...

Whoops: I hadn't even noticed that one. Is there any way of fixing it
so ido-completing-read works (see the link in my first message
id:"[hidden email]")? Not because I want the extra
functionality but perhaps someone else likes it as it is.

Many thanks

Mark

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
Mark Walters Mark Walters
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[PATCH] emacs: initialize ido mode in notmuch-mua.el

ido-completing-read is used in notmuch-mua.el without any
initialization.  This should work but a bug (emacs bug #3247) in some
emacs 23 versions (including 23.2.1 from Debian stable) causes emacs
to get stuck in the mini-buffer. This tests to see if ido-mode has
been initialized and if not calls it. This avoids the bug for these
older versions of emacs.

This is the only place that ido-completing-read is used so an alternative
would be to replace ido-completing-read by completing-read but cworth
expressed a preference for the ido version in
id:"[hidden email]"


---
 emacs/notmuch-mua.el |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 4be7c13..9fe75db 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -194,6 +194,8 @@ the From: header is already filled in by notmuch."
     addresses     (cons (notmuch-user-primary-email) (notmuch-user-other-email))
     one-name-only t))
     ;; Now prompt the user, either for an email address only or for a full identity.
+    (unless ido-mode
+      (ido-mode t))
     (if one-name-only
  (let ((address
        (ido-completing-read (concat "Sender address for " name ": ") addresses
--
1.7.2.3

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
Loading...