From 7bcc912c3ec9a24d783a6dca6d6015aa1f783e8d Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sun, 12 Feb 2012 10:32:48 +0000 Subject: [PATCH] RFC notmuch-pick: an emacs threaded message view with split-pane --- b5/6e4c35473bc1553f609d9c1bae979a036f85bf | 138 ++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 b5/6e4c35473bc1553f609d9c1bae979a036f85bf diff --git a/b5/6e4c35473bc1553f609d9c1bae979a036f85bf b/b5/6e4c35473bc1553f609d9c1bae979a036f85bf new file mode 100644 index 000000000..1bc20ae2a --- /dev/null +++ b/b5/6e4c35473bc1553f609d9c1bae979a036f85bf @@ -0,0 +1,138 @@ +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 525EA431FB6 + for ; Sun, 12 Feb 2012 02:31:32 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, 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 iMyIAz+ZhHHR for ; + Sun, 12 Feb 2012 02:31:31 -0800 (PST) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 74252431FAE + for ; Sun, 12 Feb 2012 02:31:31 -0800 (PST) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1RwWiP-0004go-PQ; Sun, 12 Feb 2012 10:31:30 +0000 +Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] + helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1RwWiP-00079q-Eq; Sun, 12 Feb 2012 10:31:29 +0000 +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: RFC notmuch-pick: an emacs threaded message view with split-pane +User-Agent: Notmuch/0.11.1+172~g6a5d2c5 (http://notmuchmail.org) Emacs/23.2.1 + (i486-pc-linux-gnu) +Date: Sun, 12 Feb 2012 10:32:48 +0000 +Message-ID: <87d39k1gvi.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 94.192.233.223 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: c6761476b99f56156da099f193d7d0dd (of first 20000 bytes) +X-SpamAssassin-Score: -1.8 +X-SpamAssassin-SpamBar: - +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -1.8 points. + Summary of the scoring: + * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, + * medium trust + * [138.37.6.40 listed in list.dnswl.org] + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + * domain + * 0.5 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Sun, 12 Feb 2012 10:31:32 -0000 + + +Hello + +On irc recently dme posted a patch notmuch-pick.el which provided a +threaded message view in the emacs interface. I have added substantially +to it and made some cli changes to support it better. See +http://kanelephant.com/screen.png for a screenshot. + +It seems to be working well (although doubtless has bugs and lots of +room for improvement). + +One important caveat is that it does call notmuch-show rather than +notmuch-search so it can be slow. Viewing 10000 notmuch messages takes +me 20 seconds with a warm cache and about a minute with a cold +cache. Viewing million message searches in this fashion is not +recommended! + +Note since I modify the notmuch-show.c backend this applies on top of +Jani's show parsing patches id:"cover.1328558175.git.jani@nikula.org" + +The most important key bindings are as follows: + +'z' enter a search to display in pick view (analogous to s; works in +hello, search, show and pick mode). + +'Z' displays the current search in pick mode (works in search and show +mode) + +In pick mode: RET displays a message (splitting the current window), +SPACE scrolls the message window and goes to next message when it +reaches the end, 'b' scrolls the message window back, 'p', 'n' move to +the next matching message, 'q' closes the message window (if open) or +quits the pick view. + +'t' toggles whether to show the messages as a thread-tree structure or +just as single messages, 'o' toggles the sort order. + +Most of the other commands I could think of work as I would expect (eg +tagging, piping, help etc) + +Questions/thoughts and known bugs: + +Do people like the rough idea? + +At the moment there is some shared code with notmuch-show.el. This could +be factored out: however, while this pick mode is WIP I don't think it +is worth it. I have tried to keep the impact on the current parts of the +emacs code and the command line interface fairly small. + +I will send the patches as 3 bits: one is the command-line support +needed (i.e. changes to notmuch-show.c) one is the changes to the other +emacs files and the final one is the notmuch-pick.el file itself. + +There are some things that need fixing: some of which are marked in the +code. For example the highlighting (lowlighting?) of non-matching +messages is hard-wired gray and should be a defcustom. The tags are not +in a nice tag face and do not update automatically. There should be an +option not to use the split-screen mode. + +Anyway I am already finding it useful: show a long thread, press 'Z' to +see the thread structure nicely and then ... + +Best wishes + +Mark -- 2.26.2