unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Bruno BARBIER <brubar.cs@gmail.com>
To: notmuch@notmuchmail.org
Subject: emacs: address completion: 6 matches but no match
Date: Thu, 02 Jan 2025 18:17:41 +0100	[thread overview]
Message-ID: <6776ca37.7b0a0220.3a5cd0.e1f5@mx.google.com> (raw)

Hello,

Thank you so much for notmuch and its integration with Emacs!

I discovered a small glitch when completing email addresses.

I'm using the raw completion of Emacs (not company or an other
package). The variable 'notmuch-address-command' is the default one
(i.e. internal).  My completion style is partial-completion.

Now, here is the case where it doesn't work for me.  If I enter "AAA",
and I hit completion, I'm getting several choices: xxxAAAyyy, hhAAAhh,
etc. (that's what I want).  So, notmuch offers me to pick the one I
want using completing-read.  But, here is the problem: there is no
possible match!

Indeed, because I'm using partial-completion, the input "AAA" actually
doesn't match any of the possible completion (as they all have a
prefix, see the documentation of 'completion-styles-alist').

My workaround is to configure 'notmuch-address-selection-function',
prepending a "*" to the initial-input.

#+begin_src elisp
   (defun my-notmuch-address-selection (prompt collection initial-input)
      (notmuch-address-selection-function 
       prompt collection 
       (concat "*" initial-input)))
   (setq notmuch-address-selection-function #'my-notmuch-address-selection)
#+end_src

I'm fine with this solution.

Maybe that would great if notmuch could detect and warn that something
is wrong when the initial input doesn't match any of the addresses
that notmuch selected.

Best regards,

Bruno

                 reply	other threads:[~2025-01-05 21:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6776ca37.7b0a0220.3a5cd0.e1f5@mx.google.com \
    --to=brubar.cs@gmail.com \
    --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).