From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 67E78431FD0 for ; Thu, 19 May 2011 16:18:46 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.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 41HJRH-e6pKQ for ; Thu, 19 May 2011 16:18:45 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 70898431FB6 for ; Thu, 19 May 2011 16:18:45 -0700 (PDT) Received: by bwg12 with SMTP id 12so2715588bwg.26 for ; Thu, 19 May 2011 16:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:from:to:subject:user-agent:date:message-id :mime-version:content-type; bh=TbVISWAF7WOVctCHSdDAXfJnP8fJf1x7MaE4/wOHtJA=; b=mXqvlOuazaPyw7JoV6aRL3x2tP9cgEib7wiotYsTayyog5pX+reHhQFbE7FTEXaqKm 1FGN05XhZeqsia6QEZVVNrgkgKD6w64+Dz2YBt1NySPv8rm1m9dSboIOWnmDMgKxUrhC PipIbLYvig10YLBE34hC2lCPjvPNGNG39Pq5o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:subject:user-agent:date:message-id:mime-version :content-type; b=QlXVR4b8zNvAKXRaCDyE0jdwngDcmzzcm+AnmrjdQi7RWohdl6+cc1d60petaZ8Co3 XFO5/H411daqkJB11Uy8C1JEFQaq5Fnahzw78NWEpJB8sfeaRubVPP6YPUD+rOE1DENn oARNWcXxsoNPMVuqiCdz7d5VnJl9kNAgEQZUU= Received: by 10.204.73.157 with SMTP id q29mr3324919bkj.101.1305847123808; Thu, 19 May 2011 16:18:43 -0700 (PDT) Received: from localhost (dslb-088-069-130-239.pools.arcor-ip.net [88.69.130.239]) by mx.google.com with ESMTPS id c11sm1795495bkc.2.2011.05.19.16.18.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 May 2011 16:18:42 -0700 (PDT) From: Daniel Schoepe To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Make the queries used in the all-tags section User-Agent: Notmuch/0.5-210-g1acc997 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Fri, 20 May 2011 01:18:35 +0200 Message-ID: <87fwoath2s.fsf@gilead.home.box> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: Thu, 19 May 2011 23:18:46 -0000 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable From=20the commit message: emacs: Make queries used in the all-tags section configurable =20=20=20=20 This patch adds a customization variable that controls what queries are used to construct the all-tags section in notmuch-hello. It allows the user to specify a function to construct the query given a tag. It also allows hiding tags by returning nil. Possible uses would be things like displaying the unread count for tags instead of all messages with that tag and/or hiding uninteresting tags like "signed" or "encrypted". =2D- Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-emacs-Make-queries-used-in-the-all-tags-section-conf.patch Content-Transfer-Encoding: quoted-printable From=20bc4e046537518255ad02254c88e7b5bedd347c2b Mon Sep 17 00:00:00 2001 From: Daniel Schoepe Date: Fri, 20 May 2011 00:53:50 +0200 Subject: [PATCH] emacs: Make queries used in the all-tags section configurable This patch adds a customization variable that controls what queries are used to construct the all-tags section in notmuch-hello. It allows the user to specify a function to construct the query given a tag. It also allows hiding tags by returning nil. Signed-off-by: Daniel Schoepe =2D-- emacs/notmuch-hello.el | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index e58dd24..0b8c0b9 100644 =2D-- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -55,6 +55,17 @@ :type 'boolean :group 'notmuch) =20 +(defcustom notmuch-hello-tag-list-make-query nil + "Function to generate queries for the all tags list. + +This variable controls which query results are shown for each tag +in the \"all tags\" list. If this is nil, it uses the default of +\"tag:TAG\", otherwise it should be a function of one argument, +the tag, that should return the query to be used for that tag, or +nil, in which case the tag will be hidden." + :type '(choice function (const nil :tag "tag:TAG")) + :group 'notmuch) + (defface notmuch-hello-logo-background '((((class color) (background dark)) @@ -318,6 +329,16 @@ Complete list of currently available key bindings: ;;(setq buffer-read-only t) ) =20 +(defun notmuch-hello-generate-tag-alist () + "Return an alist from tags to queries to display in the all-tags section= ." + (filter 'cdr + (mapcar '(lambda (tag) + (cons tag + (if notmuch-hello-tag-list-make-query + (funcall notmuch-hello-tag-list-make-query tag) + (concat "tag:" tag)))) + (process-lines notmuch-command "search-tags")))) + ;;;###autoload (defun notmuch-hello (&optional no-display) "Run notmuch and display saved searches, known tags, etc." @@ -396,9 +417,7 @@ Complete list of currently available key bindings: if (> (string-to-number (notmuch-saved-search-count (cdr elem))) 0) collect elem))) (saved-widest (notmuch-hello-longest-label saved-alist)) =2D (alltags-alist (if notmuch-show-all-tags-list =2D (mapcar '(lambda (tag) (cons tag (concat "tag:" tag))) =2D (process-lines notmuch-command "search-tags")))) + (alltags-alist (if notmuch-show-all-tags-list (notmuch-hello-generat= e-tag-alist))) (alltags-widest (notmuch-hello-longest-label alltags-alist)) (widest (max saved-widest alltags-widest))) =20 =2D-=20 1.7.5.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJN1aVLAAoJEIaTAtce+Z+JbhIP/RGZjiBbgRfNViYOqZ9x2HCm jZ32miXAGNGNc9nbzVxsCxTkNkLC2oSPQbV7pi1BILWSeZI1YwE/VGTMKiLVjb7E UIjPRLkyZh9Hi+CBp1oLib5btl0rCGZju5KYOwR6BPQVfU/3H+TGnAWIY9RlxCbM n1gQFMnehntq31jJgxIQn0adgRs79QqI57C43f4vdRuqe+r4eYaNjDqulPSUNbSb JfDukhcYD3HSyRZPxRTSdjg9X9qj2kzIfaqVrhpPlWWG00gEsa1JbZQJ6CsFDcC9 nihn2tgsdANPEpWjijcRtaf9P+68ekKkT5X9YO5JNFFZ5nFbekHm4aLgPnD5L+pk n55hgd5GaV4DXaQkQnm5uqfEJ7FGPrI90fGl7WdjYjGe3bIdxwwYccHHWXLhmtZc sfK2w3x1FHqFz6r55QtujCLop7F8Unq47RH2ZfpjZbej9GpeX9ehIDc6EnZ4NXI2 lplG9QHSDn5QsuUIrgBgYOPTHMoUADnFQIZ/thSRXsZ1/KMsTZG/MfcnoXP4hIux dOld52wRGoxLERvJKk1QYfUclk5YSiaRClfJrEuG2yzxZYZJYz8/QEllrorp5ppc VuuOHwFg2wEIf1POZgA8nULllYZH7m1Gvq9sKj9EoZBbgDEovT3/ovKTnlatGg6y wExTxBGC8+y3+fwbgMdK =mxr8 -----END PGP SIGNATURE----- --==-=-=--