Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 16C3F431FD5 for ; Fri, 12 Dec 2014 02:39:32 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M0j1sONixoH7 for ; Fri, 12 Dec 2014 02:39:28 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id D3511431FBF for ; Fri, 12 Dec 2014 02:39:27 -0800 (PST) Received: from localhost (unknown [192.168.200.7]) by max.feld.cvut.cz (Postfix) with ESMTP id 0A50D5CCE6A; Fri, 12 Dec 2014 11:39:22 +0100 (CET) X-Virus-Scanned: IMAP STYX AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10044) with ESMTP id kP_XeF-R0uVp; Fri, 12 Dec 2014 11:39:17 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 5C3533CFEF4; Fri, 12 Dec 2014 11:39:17 +0100 (CET) Received: from wsh by steelpick.2x.cz with local (Exim 4.84) (envelope-from ) id 1XzNcz-0005MV-1x; Fri, 12 Dec 2014 11:39:17 +0100 From: Michal Sojka To: Lele Gaifax , notmuch@notmuchmail.org Subject: Re: New "notmuch address" command In-Reply-To: <878uid9qjl.fsf@nautilus.nautilus> References: <878uid9qjl.fsf@nautilus.nautilus> User-Agent: Notmuch/0.18.2+178~g6e9e8bb (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Fri, 12 Dec 2014 11:39:17 +0100 Message-ID: <87ppbpf8yy.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Fri, 12 Dec 2014 10:39:32 -0000 Hi Lele, On Fri, Dec 12 2014, Lele Gaifax wrote: > Hi all again, > > I'm happily using "notmuch-addrlookup"[1] as "notmuch-address-command", in > my Emacs configuration. > > As explained in my other message, yesterday I spent some time tweaking > that configuration and tried to replace it with the new "notmuch > address" introduced in version 0.19. > > An (almost) equivalent of "notmuch-addrlookup foo" could be "notmuch > address to:foo* OR from:foo*", but it has at least one indesiderable > difference: it seems considering the "CC" field, but always emits the > "TO" content (i.e., assuming I have a message I sent to "john@doe.com" > and CCed to "foo@bar.com", "notmuch address to:foo" emits > "john@doe.com", not "foo@bar.com") so the candidates it generates are > way too much. > > I don't know it that's done on purpose (I clearly miss the use case if > so). Yes, this is expected behavior. Notmuch address is basically a wrapper around search command. The command does not interpret the query at all, because there might be no from:/to: term. The use case was to SIMPLIFY address completers. > I wonder if it would be reasonable adding a "--complete" flag to the > "address" command that selects a more specific behaviour, so that > "notmuch address --complete foo": This would definitely be useful. > a) automatically performs a partial match (i.e. it adds the '*' suffix > on its own) OK > b) searches the given text only in the related headers (hiding the > difference between "incoming" and "outgoing" messages, This should be configurable, because --output=sender is much faster than --output=recipients. I think that ideal address completion should offer you the addresses you have already written to, i.e. notmuch address --output=recipient from:my@address to:"prefix*" But this may be too slow on non-SSD disks. Some users may therefore prefer notmuch address --output=sender to:my@address from:"prefix*" which would be faster, but also includes every spammer/robot/... who sends anything to you. > and not > considering the body at all) What considers body now? > > c) avoids the "bug"/"feature" explained above Yes, if you know the substring you are looking for, implementing a filter would be trivial. > What do you think? Another question is that uses may want to select which my@address to use. So maybe you can add --my-address option that allow specifying one or more addresses. If this option would not be given, all configured addresses in .notmuch-config would be used. So I think that --complete should just construct the query containing from:/to: terms and this should be concatenated with what user specified as a query. For example: notmuch address --complete prefix tag:attachment -Michal