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 DC66C431FBF for ; Fri, 18 Dec 2009 07:01:05 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 J+LC7duQcaV5 for ; Fri, 18 Dec 2009 07:01:05 -0800 (PST) Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by olra.theworths.org (Postfix) with ESMTP id B9A65431FAE for ; Fri, 18 Dec 2009 07:01:03 -0800 (PST) Received: from smtp6-g21.free.fr (localhost [127.0.0.1]) by smtp6-g21.free.fr (Postfix) with ESMTP id 9F407E0816C for ; Fri, 18 Dec 2009 16:00:57 +0100 (CET) Received: from UNKNOWN (imp8-g19.priv.proxad.net [172.20.243.138]) by smtp6-g21.free.fr (Postfix) with ESMTP id C99DCE0800E for ; Fri, 18 Dec 2009 16:00:50 +0100 (CET) Received: by UNKNOWN (Postfix, from userid 0) id 189972F8FCCE8; Fri, 18 Dec 2009 16:00:50 +0100 (CET) Received: from ([132.166.135.72]) by imp.free.fr (IMP) with HTTP for ; Fri, 18 Dec 2009 16:00:49 +0100 Message-ID: <1261148449.4b2b9921f3ab1@imp.free.fr> Date: Fri, 18 Dec 2009 16:00:49 +0100 From: racin@free.fr To: notmuch@notmuchmail.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.8 X-Originating-IP: 132.166.135.72 Subject: [notmuch] First attempt to add smart completion in notmuch-search X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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, 18 Dec 2009 15:01:06 -0000 Hi! Here is a first attempt to add "smart completion" to notmuch-search. What it does is that: - It tries to detects when you hit tab to complete a search term prefix (like to, from, subject...) , and if so completes your prefix; - If you try to complete a search term usign a specific prefix (like to), it helps you complete it using prefix founds in the messages matching the current search string. The patch has a Emacs-lisp part and a C part. I'm submitting the patch to know what people think of it, but there are some things still uncomplete: - I think headers should be parsed so that a better output is proposed, but I don't know which one yet; - There may be performance issues (because fetching headers require looking them in each message file), but I'm not sure if this is really a problem (since we already fetch headers to display it in the summary buffer). - I have a problem that notmuch-search-query-string is buffer-local and I can't access it from the minibuffer, which I don't know how to solve properly - There are still some glitches with the "". - There may be many other improvements that I haven't thought of. Anyway, I hope it's useful; I'll continue working on it when I come back from Holidays. Thanks for your input, Matthieu