unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: notmuch@notmuchmail.org
Subject: [PATCH 3/3] emacs: notmuch-address-expand-name: use the actual initial-input
Date: Mon,  9 Nov 2020 00:11:50 +0100	[thread overview]
Message-ID: <20201108231150.5419-4-jonas@bernoul.li> (raw)
In-Reply-To: <20201108231150.5419-1-jonas@bernoul.li>

Users may type some text into the buffer on an address line, before
actually invoking address completion.  We now use that text as the
initial input when we begin address completion.

Previously we did knowingly replace the actual initial input with some
completion candidate that happens to match. Which candidate is used is
essentially random, at least when the actual initial input is short.
As a result users very often had to begin completion by deleting the
less than helpful "initial input".
---
 emacs/notmuch-address.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 6e29b99a..591ad7ae 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -238,14 +238,8 @@ (defun notmuch-address-expand-name ()
 		    (t
 		     (funcall notmuch-address-selection-function
 			      (format "Address (%s matches): " num-options)
-			      ;; We put the first match as the initial
-			      ;; input; we put all the matches as
-			      ;; possible completions, moving the
-			      ;; first match to the end of the list
-			      ;; makes cursor up/down in the list work
-			      ;; better.
-			      (append (cdr options) (list (car options)))
-			      (car options))))))
+			      options
+			      orig)))))
       (if chosen
 	  (progn
 	    (push chosen notmuch-address-history)
-- 
2.29.1

      parent reply	other threads:[~2020-11-08 23:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-08 23:11 [PATCH 0/3] emacs: allow opting out of notmuch's address completion Jonas Bernoulli
2020-11-08 23:11 ` [PATCH 1/3] emacs: notmuch-address-setup: cosmetics Jonas Bernoulli
2020-11-08 23:11 ` [PATCH 2/3] emacs: allow opting out of notmuch's address completion Jonas Bernoulli
2020-11-08 23:11 ` Jonas Bernoulli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201108231150.5419-4-jonas@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).