From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 9E7256DE1204 for ; Mon, 10 Apr 2017 11:39:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.496 X-Spam-Level: X-Spam-Status: No, score=0.496 tagged_above=-999 required=5 tests=[AWL=-0.156, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MIJ2wcxlbYsm for ; Mon, 10 Apr 2017 11:39:04 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 6F6836DE11F0 for ; Mon, 10 Apr 2017 11:39:04 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id B0F66100086; Mon, 10 Apr 2017 21:38:13 +0300 (EEST) From: Tomi Ollila To: =?utf-8?Q?J=C3=B6rg?= Volbers , notmuch@notmuchmail.org Subject: Re: Address Completion In-Reply-To: <87pogl8c2i.fsf@joergvolbers.de> References: <87pogl8c2i.fsf@joergvolbers.de> User-Agent: Notmuch/0.24+52~g1f96813 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Mon, 10 Apr 2017 18:39:06 -0000 On Mon, Apr 10 2017, J=C3=B6rg Volbers wrote: > Hello, > > If I press looking for an address while writing mail,=20 > vanilla notmuch offers me one preselected candidate. Since I use=20 > ivy-mode, this canididate narrows down the list of all candidates,=20 > forcing me to delete the initial input (C-a C-k) before I can=20 > select among this list. Do you use 'internal completion or separate command to find completions ? If internal, the first choice would be to install `company' package from ELPA (I don't know how it works with separate command -- which I use, with selection-menu). Company-mode provides nice popup where to choose completions from. If that is not an option, someone(tm) could provide a patch which, based on (fboundp 'ivy-read) uses either ivy-read or completing-read, with their specific options for completion (what I saw about ivy-read that looks pretty good). OTOH, if someone(tm) can show (completing-read ...) which works good as is, or when wrapped with ivy, such patches might just be tolerated(tm). FWIW, I've used the following code in my notmuch setup like forever...: require 'selection-menu) (setq notmuch-address-selection-function (lambda (prompt collection initial-input) (selection-menu "Send To:" (cons initial-input collection) t))) Tomi > I currently override this behavior by setting=20 > notmuch-address-selection-function to my own function: > > (defun jv-notmuch--address-selection (prompt collection=20 > initial-input)=20 > (completing-read=20 > prompt collection nil nil orig 'notmuch-address-history))=20 > (setq notmuch-address-selection-function=20 > #'jv-notmuch--address-selection)=20 > > This works as intended. > > Now my question: Is this something specific to ivy-mode, and would=20 > it be possible to add an option which simulates the above behavior=20 > (basically, using the pre-set variable 'orig' instead of=20 > (car-options) in notmuch-address-expand-name), so that I do not=20 > need to insert my own function which adds no functionality? > > Thanks (also for CC me via PM) > > And by the way, notmuch really is great, thank you for this=20 > software! > > J=C3=B6rg > > > --=20 > http://www.joergvolbers.de > https://fu-berlin.academia.edu/jvolbers > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch