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