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 18A5A431FD0 for ; Fri, 8 Jul 2011 16:00:09 -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 y4aD6WZzGN2S for ; Fri, 8 Jul 2011 16:00:07 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id C2BC5431FB6 for ; Fri, 8 Jul 2011 16:00:06 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id E50C519F3348; Sat, 9 Jul 2011 01:00:05 +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 W0l+-Feoi3-d; Sat, 9 Jul 2011 01:00:04 +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 45F2F19F32F2; Sat, 9 Jul 2011 01:00:04 +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 3750CFA003; Sat, 9 Jul 2011 01:00:04 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.76) (envelope-from ) id 1QfK1j-0002oC-Gw; Sat, 09 Jul 2011 01:00:03 +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: <1310079227-19120-2-git-send-email-daniel.schoepe@googlemail.com> References: <1310079227-19120-1-git-send-email-daniel.schoepe@googlemail.com> <1310079227-19120-2-git-send-email-daniel.schoepe@googlemail.com> User-Agent: Notmuch/0.5-332-gf8bc48d (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sat, 09 Jul 2011 01:00:03 +0200 Message-ID: <87box48jkc.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: Fri, 08 Jul 2011 23:00:09 -0000 On Fri, 08 Jul 2011, Daniel Schoepe wrote: > This has been done in v4 of the patch, for which I screwed up the > In-Reply-To header and hence is listed as a separate thread: > > id:"1310079227-19120-1-git-send-email-daniel.schoepe@googlemail.com" Oh, you always send new versions faster than I can investigate the older ones :-) > > - The title of custom tags section was not passed correctly to the > > functions. This is also fixed in the patch below. > > I changed title to a mandatory argument for consistency with > notmuch-insert-searches and because a title-less section wouldn't make > much sense anyway. 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). -Michal diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index d3b146e..3e883ff 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -106,17 +106,14 @@ Typically \",\" in the US and UK and \".\" in Europe." (define-widget 'notmuch-hello-tags-section 'lazy "Customize-type for notmuch-hello tag-list sections." :tag "Customized tag-list" - :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"))) (define-widget 'notmuch-hello-query-section 'lazy "Customize-type for custom saved-search-like sections" @@ -629,7 +626,8 @@ Supports the following entries in OPTIONS as a plist: (indent-rigidly start (point) notmuch-hello-indent) target-pos)))) -(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) "Insert a section displaying all tags and message counts for each. TITLE defaults to \"All tags: \". @@ -637,13 +635,13 @@ Allowed options are those accepted by `notmuch-hello-insert-searches' and the following: :hide-tags - List of tags that should be excluded." - (apply 'notmuch-hello-insert-searches - (plist-get options :title) - (notmuch-hello-generate-tag-alist - (plist-get options :hide-tags) - (plist-get options :make-query) - (plist-get options :make-count)) - options)) + (notmuch-hello-insert-searches title + (notmuch-hello-generate-tag-alist hide-tags filter + (if (string= "" filter-count) + nil filter-count)) + :initially-hidden initially-hidden + :hide-empty-searches hide-empty-searches + :hide-if-empty hide-if-empty)) (defun notmuch-hello-insert-inbox () "Show an entry for each saved search and inboxed messages for each tag"