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 62EEC431FD0 for ; Thu, 9 Jun 2011 22:42:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-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 TGGakJmGzNWL for ; Thu, 9 Jun 2011 22:42:09 -0700 (PDT) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E960E431FB6 for ; Thu, 9 Jun 2011 22:42:08 -0700 (PDT) Received: by qyg14 with SMTP id 14so1395721qyg.5 for ; Thu, 09 Jun 2011 22:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=C6l5c3ifQWMib5l5vdc1YnbB55dfUfyMeCVqwyeXF0M=; b=PNNDFMlSCnvy17nsKmuffjso6HxG4l1ub9RUz0qSZBpHjd8BPeXnxKrE8ne/BdsmrV A9Qx57kdR+FIBts5lGb738p/27hjFwtcp0YRLEPq/bT5jj/9DhQeK9GJv0GKPUmPGe0+ cnSQ0LTz/sVFD1Nb3gi3hH033ipQ+e+IoLVcs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=TQFTspxWCCoTH+TIW8JLg0hlHpHkvjR/iumKNZ0YmczHIoUIyX7juHAvCgsev3aswS HMCpcqwge+3DzJlInpn72zDvE0LvTXEd740LQT2reMyVRU64Vum2eC/cJT/8MV05uErB JVfyyMnk/ib3XckzlIKgCuDqs7nzYa71bkuWY= MIME-Version: 1.0 Received: by 10.229.176.170 with SMTP id be42mr1155393qcb.258.1307684528016; Thu, 09 Jun 2011 22:42:08 -0700 (PDT) Sender: amdragon@gmail.com Received: by 10.229.211.148 with HTTP; Thu, 9 Jun 2011 22:42:07 -0700 (PDT) In-Reply-To: <87tyc7hvtz.fsf@gilead.invalid> References: <874o4g563y.fsf@gilead.invalid> <87tyc7hvtz.fsf@gilead.invalid> Date: Fri, 10 Jun 2011 01:42:07 -0400 X-Google-Sender-Auth: vNGU91dAHs4tzu96GTxThlKblAg Message-ID: Subject: Re: [PATCH] emacs: User-defined sections in notmuch-hello From: Austin Clements To: Daniel Schoepe Content-Type: text/plain; charset=ISO-8859-1 Cc: notmuch@notmuchmail.org 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, 10 Jun 2011 05:42:12 -0000 This looks really interesting. I haven't examined the code very closely, but I have some high level comments. It seems that the code is simultaneously trying to do something very general, but also hard-coding a lot of behaviors, and I think the code's complexity suffers for it. What would this look like if the *entire* hello screen were replaced by a configurable list of sections? What I'm imagining could be as simple as a list of section-generating functions plus a collection of standard functions for generating standard sections (probably known to customize to make it easy for non-elispers to control). For more-configurable sections, there could be a mechanism for passing arguments, but this quickly enters the land of hair-raising defcustoms and confusing flexibility. I think it would be much simpler and more user-friendly to require the functions in this list to take no arguments (at least, none that are user-configurable). Flexible sections could be implemented then as a low-level function that takes arguments and one or more no-argument high-level functions that call the low-level section generator either with fixed arguments, or with the values of other customize variables. This would keep things simple and fairly flexible for non-elispers, without sacrificing complete flexibility if you're willing to write a few lines of elisp. Maybe you also want to configure the title of each section. But, IMO, this is also confusing flexibility. In fact, with the no-argument section generators, it would make a lot of sense to simply put the section name in the function's plist. This wouldn't fit well with the current logic to compute the cross-section widest tag, but personally I've always found that behavior extremely confusing (not to mention buggy) and wouldn't miss it at all. The use of the term "title" for pretty-printed tags is confusing. To me, "title" means the section title. For example, I couldn't figure out what "Return widest title string in SECTION." meant until I read the code (*flashback* "a section only has one title, what the heck is the widest one?") This patch should probably be split into a few patches, as it seems to also introduce new functionality for some of the sections (and does little things like moving notmuch-remove-if-not). On Fri, Jun 3, 2011 at 9:46 AM, Daniel Schoepe wrote: > On Fri, 27 May 2011 20:52:01 +0200, Daniel Schoepe wrote: >> I'll also work on some tests for this functionality, (if no one >> has big, structural complaints about the code). > > I rebased my patch against the current master and wrote some tests.