From 756c1ff7e39655b381906cf192ce72441703adb9 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sun, 11 May 2014 09:34:35 +0100 Subject: [PATCH] [PATCH 0/7] emacs: hello: custom display of saved searches --- d1/7ca3b80ff70e7115839f186844ea08ed7b579d | 115 ++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 d1/7ca3b80ff70e7115839f186844ea08ed7b579d diff --git a/d1/7ca3b80ff70e7115839f186844ea08ed7b579d b/d1/7ca3b80ff70e7115839f186844ea08ed7b579d new file mode 100644 index 000000000..e31b2b9ff --- /dev/null +++ b/d1/7ca3b80ff70e7115839f186844ea08ed7b579d @@ -0,0 +1,115 @@ +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 F274E431FC7 + for ; Sun, 11 May 2014 01:34:56 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] 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 n+J9OUTTmE05 for ; + Sun, 11 May 2014 01:34:51 -0700 (PDT) +Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com + [74.125.82.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 49364431FBF for ; Sun, 11 May 2014 01:34:51 -0700 + (PDT) +Received: by mail-wg0-f52.google.com with SMTP id l18so5523578wgh.11 + for ; Sun, 11 May 2014 01:34:48 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id; + bh=8lw7/M0IURF1esWQ67wsSOFULHon1d+1qmX6704AFz8=; + b=CXM8GUL58OTt8OyXlh3QVQh1yrWcc7uHcnbzPwrOe5g7ZaJSoG3PcCWr3VRRhya3NE + TPiL8GhChD1wV4sVLhf1J0iYKXXPzhtahzUrRne1ZP/qzOXAsWEIqK8yaid+7R5I8qR7 + tGIp09Ub8ulQ5TpFkze3brv5zgMiIISNYw0Ir3zrtzhKfL+dj8tNZNWhjR5H3NKfTi6l + 8ulajNza62QANIMUD4DzdprDlTPLyqsqnI5FeGVO8jQiwyCPWzy71nWhw00CAw4YODvW + /vhdHP1F3FjLcunaMAGM+MvYNQR/9SKgzdsrD/NzVvYwzU7J4lGegTDV8ptNHtmHgoAc + Qgnw== +X-Received: by 10.194.80.7 with SMTP id n7mr16288047wjx.8.1399797287730; + Sun, 11 May 2014 01:34:47 -0700 (PDT) +Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) + by mx.google.com with ESMTPSA id ln3sm12752930wjc.8.2014.05.11.01.34.46 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 11 May 2014 01:34:46 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 0/7] emacs: hello: custom display of saved searches +Date: Sun, 11 May 2014 09:34:35 +0100 +Message-Id: <1399797282-20389-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.10.4 +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, 11 May 2014 08:34:57 -0000 + +This series allows the user to customize the display of individual +saved searches, including showing thread counts, changed counts, +omitting counts (for speed), a read/unread count etc. + +The series is not as large as it looks. Patch 1 is just code movement, +and patches 4-7 implement some of the above possibilities. Patches 4-7 +could be applied but they are more intended to demonstrate and let +people test the infrastructure (ie showing what can be done). + +Comments on the series: + +the display function is given a keyword list of arguments (so use +&rest args, followed by (plist-get args :keyword)). This is to make +the interface easily extendible without breaking backwards +compatibility. + +custom display functions do not link into the batch count +functionality (but are omitted from it). Thus if the custom function +doesn't always do a query hello may be quicker, but in other cases, +particularly over a remote link, it may be slower. + +some custom display functions will be slow, but they may be fast +enough for small searches (eg inbox). + +Finally, a lisp query: I use a plist for saving the results of the +previous run (so display functions can highlight changes). This is +indexed by the saved searches themselves. I think this is OK (because +plist uses eq not equal) but would like a confirmation. + +Finally, some of this infrastructure could be used to do async counts +at a later stage. I have some preliminary patches, but that is all +rather more fragile. + +Best wishes + +Mark + + + +Mark Walters (7): + emacs: hello: separate out the saved-search display function + emacs: hello: allow saved search display functions + emacs: hello: store previous saved-search results + emacs: hello: add a threads-and-messages function + emacs: hello: require cl + emacs: hello: add highlight newly arrived messages option + emacs: hello: add option to omit count for a search + + emacs/notmuch-hello.el | 139 ++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 111 insertions(+), 28 deletions(-) + +-- +1.7.10.4 + -- 2.26.2