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 8A64B431FD0 for ; Fri, 8 Jul 2011 22:35:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 uCeLoyrQEfRf for ; Fri, 8 Jul 2011 22:35:49 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 10FD3431FB6 for ; Fri, 8 Jul 2011 22:35:49 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 3F96419F335A; Sat, 9 Jul 2011 07:35:48 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id nu7NKmjG9vRR; Sat, 9 Jul 2011 07:35:47 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 388F319F3355; Sat, 9 Jul 2011 07:35:47 +0200 (CEST) Received: from steelpick.2x.cz (cable-86-56-4-108.cust.telecolumbus.net [86.56.4.108]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 1C91DFA003; Sat, 9 Jul 2011 07:35:47 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.76) (envelope-from ) id 1QfQCg-0003Nr-Gy; Sat, 09 Jul 2011 07:35:46 +0200 From: Michal Sojka To: Daniel Schoepe , notmuch@notmuchmail.org Subject: Re: [PATCH v4 1/2] emacs: User-defined sections in notmuch-hello In-Reply-To: <87mxgo2wns.fsf@gilead.invalid> 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> <87mxgo2wns.fsf@gilead.invalid> User-Agent: Notmuch/0.5-332-gf8bc48d (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sat, 09 Jul 2011 07:35:46 +0200 Message-ID: <87sjqg6mod.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Sat, 09 Jul 2011 05:35:53 -0000 On Fri, 08 Jul 2011, Daniel Schoepe wrote: Non-text part: multipart/signed > On Sat, 09 Jul 2011 01:00:03 +0200, Michal Sojka wrote: > > 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. > > > > I think that the customization interface is much better arranged when it > > is modified like in the patch below (it is against v3). > > > > [..] > > - :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 messages")) > > - (: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"))) > > > > > -(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. Not necessarily. In fact, notmuch-hello-insert-tags-section is only a thin wrapper of notmuch-hello-insert-searches. In elisp you can always use directly those plist-based "low-level" functions. -Michal