Re: [PATCH v4 1/2] emacs: User-defined sections in notmuch-hello
authorDaniel Schoepe <daniel.schoepe@googlemail.com>
Fri, 8 Jul 2011 23:13:43 +0000 (01:13 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:01 +0000 (09:39 -0800)
d5/18732096982b94a73e6d6df3f5aff17e244371 [new file with mode: 0644]

diff --git a/d5/18732096982b94a73e6d6df3f5aff17e244371 b/d5/18732096982b94a73e6d6df3f5aff17e244371
new file mode 100644 (file)
index 0000000..df4cc3d
--- /dev/null
@@ -0,0 +1,156 @@
+Return-Path: <daniel.schoepe@googlemail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 57413431FD0\r
+       for <notmuch@notmuchmail.org>; Fri,  8 Jul 2011 16:13:57 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.789\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.789 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id g-0XVqGVY9VV for <notmuch@notmuchmail.org>;\r
+       Fri,  8 Jul 2011 16:13:56 -0700 (PDT)\r
+Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com\r
+       [209.85.161.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 07269431FB6\r
+       for <notmuch@notmuchmail.org>; Fri,  8 Jul 2011 16:13:55 -0700 (PDT)\r
+Received: by fxh19 with SMTP id 19so2517602fxh.19\r
+       for <notmuch@notmuchmail.org>; Fri, 08 Jul 2011 16:13:54 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=googlemail.com; s=gamma;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=H1KpKxwgHMUTTeXRGMBooL7vLrYLBuqWnB2tSQAbWkY=;\r
+       b=SGHNBr2jbjihSSG0QX9YkZDatJLSPZ1XS6W4skyFVQROdJ63cBc9Xtt/7zE+yi7i8a\r
+       PCAagv9Ot9pNWHbi05/uA2LpyzPohyrmZ37Eo5tE7qMgpW97nD1e8EI3YREFQj5AkzhB\r
+       0+mxR0+tk5Ej7tx7YfcvKWE7s0W+dGRnVNw4A=\r
+Received: by 10.223.10.143 with SMTP id p15mr3756386fap.12.1310166834708;\r
+       Fri, 08 Jul 2011 16:13:54 -0700 (PDT)\r
+Received: from localhost (dslb-178-004-020-175.pools.arcor-ip.net\r
+       [178.4.20.175])\r
+       by mx.google.com with ESMTPS id m5sm7659803fai.1.2011.07.08.16.13.52\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 08 Jul 2011 16:13:53 -0700 (PDT)\r
+From: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
+To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v4 1/2] emacs: User-defined sections in notmuch-hello\r
+In-Reply-To: <87box48jkc.fsf@steelpick.2x.cz>\r
+References:\r
+ <id:"1309379221-5617-1-git-send-email-daniel.schoepe@googlemail.com">\r
+       <1310079227-19120-1-git-send-email-daniel.schoepe@googlemail.com>\r
+       <1310079227-19120-2-git-send-email-daniel.schoepe@googlemail.com>\r
+       <87box48jkc.fsf@steelpick.2x.cz>\r
+User-Agent: Notmuch/0.5-329-g0b5d38d (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Sat, 09 Jul 2011 01:13:43 +0200\r
+Message-ID: <87mxgo2wns.fsf@gilead.invalid>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 08 Jul 2011 23:13:57 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Sat, 09 Jul 2011 01:00:03 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrot=\r
+e:\r
+> Yes, this is definitely a good idea. My last comment to the patch is\r
+> that I do not like the use of plists in customization interface. It is\r
+> especially weird in the case of boolean options like hide-if-empty,\r
+> because they actually have three states: disabled, off and on. And this\r
+> make not a lot of sense.\r
+>=20\r
+> I think that the customization interface is much better arranged when it\r
+> is modified like in the patch below (it is against v3).\r
+>=20\r
+> [..]\r
+> -  :type\r
+> -  (let ((opts\r
+> -        '((:title (string :tag "Title for this section"))\r
+> -          (:make-query (string :tag "Filter for each tag"))\r
+> -          (:make-count (string :tag "Different query to generate counts"=\r
+))\r
+> -          (:hide-tags (repeat :tag "Tags that will be hidden" string))\r
+> -          (:initially-hidden (boolean :tag "Hide this on startup?"))\r
+> -          (:hide-empty-tags (boolean :tag "Hide tags with no matching me=\r
+ssages"))\r
+> -          (:hide-if-empty (boolean :tag "Hide if empty")))))\r
+> -    `(list (const :tag "" notmuch-hello-insert-tags-section)\r
+> -          (plist :inline t :options ,opts))))\r
+> +  :type '(list (const :tag "" notmuch-hello-insert-tags-section)\r
+> +              (string :tag "Title for this section")\r
+> +              (string :tag "Filter for each tag")\r
+> +              (string :tag "Different filter to generate counts")\r
+> +              (repeat :tag "Tags that will be hidden" string)\r
+> +              (boolean :tag "Hide this on startup?")\r
+> +              (boolean :tag "Hide tags with no matching messages")\r
+> +              (boolean :tag "Hide if empty")))\r
+>=20=20\r
+\r
+> -(defun notmuch-hello-insert-tags-section (&rest options)\r
+> +(defun notmuch-hello-insert-tags-section (title &optional filter filter-=\r
+count hide-tags initially-hidden\r
+> +                                               hide-empty-searches hide-=\r
+if-empty)\r
+\r
+This would make customization via elisp somewhat more cumbersome though,\r
+because then one has to specify all preceding optional arguments to set\r
+an option near the end of the argument list. Also, it gets harder to\r
+decipher which value belongs to which option.\r
+\r
+An alternative would be to force specifying all possible options in the\r
+customization interface while still producing a plist as a\r
+result. Something along these lines should work:\r
+\r
+:type '(list (const :tag "" notmuch-hello-insert-tags-section)\r
+             (const :tag "" :make-query)\r
+             (string :tag "Filter for this tag")\r
+             ...)\r
+\r
+I guess the format instructions for the elements would have to be\r
+tweaked a bit more to avoid excessive spacing due to the many hidden\r
+elements.\r
+\r
+Cheers,\r
+Daniel\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+\r
+iQIcBAEBAgAGBQJOF48nAAoJEIaTAtce+Z+JW04P/isduyqNGGXYhCbRxp31iI4B\r
+mOaGzcijIWaX9VwTV3X5JGR36EG6mkdj0/N9RuaAcMG7eBMTAhVIKhltqv7qWcPA\r
+/Ybgo3OVEHPNPvEbb8W033ddOsCOPxZaFVdlY5xv50eI8byI8fKzryeYZGql32Gd\r
+NwvbcCA7aUEkonz+yEniHBN60G1tv8lt4Xl9ONPx4PGxuhIwQJddT1xp29u11Voq\r
+C29d+n5YgOiG2VueFj73q0G7l+992MWds6EIYIDV5tlua162CEYYEAAVbTEGSDMo\r
+a+93aq69RqCHBx9nIU4/pIpNd/CS9iL00zPbN5jycYWVIxyQzCgJf9/0Qc0B4cJ4\r
+ZRwXYnkTwjaeOAxPLQyqlq38yXQFEUXyyzsf32y82gw3ZcgS77rFyGeEfhwDRVPD\r
+oLkbXr9pvpLn8HMsN2lCCwvuY3FSmn0obtVVy8z6q0Wj6HGKyebAVxmzPzyLlsjx\r
+Pac/9QqqzSi86ZbHVuZpZybnzGyAD0R8LZdxYNdxj9lkY9Lbwaf9zw22hmh6YNyw\r
+8vSGiNhkhYACjC3WQuXHTSn27kclDKjFXnQpdFyyQyX/1rEgEN3X9HA1AKuJ6xOw\r
++SANR0BRhwX1MWQTovafi6CJAw6KocL95zQ6NiAvNaTKnp+zOa73tURwFW8uuZWy\r
+zsgPlVpP0wh0ZTWmgIZL\r
+=cCJj\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r