From: Jonas Bernoulli <jonas@bernoul.li>
Date: Sun, 10 Jan 2021 14:00:56 +0000 (+0100)
Subject: emacs: notmuch-mua-prompt-for-sender: don't force Ido on users
X-Git-Tag: 0.32_rc0~143
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=37bb41a7929b0abdaaafd8bf1f67e32a9c75a0ec;p=notmuch-old

emacs: notmuch-mua-prompt-for-sender: don't force Ido on users

We shouldn't force `ido-completion-read' on users who do not otherwise
use Ido.  Unfortunately simply turning on `ido-mode' does not change
every `completing-read' into a `ido-completing-read', instead it only
changes file and buffer completion.

I do realize that existing Ido users will initially dislike this
change, but I would like to encourage them to see this as an
opportunity to learn about Fido.

Unlike `ido-mode', build-in `fido-mode' confirms to the standard
completion API, so turning it on causes every `completing-read' to
use the Fido completion mechanism and which is similar to the Ido
mechanism:

> An enhanced `icomplete-mode' that emulates `ido-mode'.  This global
> minor mode makes minibuffer completion behave more like `ido-mode'
> than regular `icomplete-mode'."
---

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 95d1965b..2d0b7169 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -431,16 +431,16 @@ the From: header is already filled in by notmuch."
 (defun notmuch-mua-prompt-for-sender ()
   "Prompt for a sender from the user's configured identities."
   (if notmuch-identities
-      (ido-completing-read "Send mail from: " notmuch-identities
-			   nil nil nil 'notmuch-mua-sender-history
-			   (car notmuch-identities))
+      (completing-read "Send mail from: " notmuch-identities
+		       nil nil nil 'notmuch-mua-sender-history
+		       (car notmuch-identities))
     (let* ((name (notmuch-user-name))
 	   (addrs (cons (notmuch-user-primary-email)
 			(notmuch-user-other-email)))
 	   (address
-	    (ido-completing-read (concat "Sender address for " name ": ") addrs
-				 nil nil nil 'notmuch-mua-sender-history
-				 (car addrs))))
+	    (completing-read (concat "Sender address for " name ": ") addrs
+			     nil nil nil 'notmuch-mua-sender-history
+			     (car addrs))))
       (message-make-from name address))))
 
 (put 'notmuch-mua-new-mail 'notmuch-prefix-doc "... and prompt for sender")