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 123D1431FBC for ; Mon, 18 Jun 2012 23:57:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 rjTsEoPguXfA for ; Mon, 18 Jun 2012 23:57:20 -0700 (PDT) Received: from mail-gh0-f181.google.com (mail-gh0-f181.google.com [209.85.160.181]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 72A7F431FAF for ; Mon, 18 Jun 2012 23:57:20 -0700 (PDT) Received: by ghbz13 with SMTP id z13so5720770ghb.26 for ; Mon, 18 Jun 2012 23:57:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type:x-gm-message-state; bh=VOKSaaw517yLSz6MMLvf8IrWemPzMg4Xkfv92QCMvRQ=; b=oIBGGtM+SPmLFnHE8YkIZndrZpQu8AQPuAsHNpVwFEy9a7RttdLZlfrEtiUXrAj/ut kloX5JJRUNfZBQ3Zlv+vLe6u0WDkJmFv99iRM9Dk7M7MYoClZsxnqWkVMRebxyOz5cDd 4gpFmEuCUYPkkUuUWfjjdCG2Ejs9oDPosDUtxompwI1Otn/UevZ/4XRYw9tehuB3FcM2 flXHVGbC3dtW/2VTOV9aMAw+9YyIOVeb9Zj8OrK9HsupnSacCX+B3Ic3Aiyhq9RgkEzl HgZlxDfQl4TJrbyoQPnXALax6qHQhi/xdJhYulfF0NT6pfQ2FF+oCHmpHI92Hp//O+tZ 4a8w== Received: by 10.236.73.4 with SMTP id u4mr21277675yhd.78.1340089039973; Mon, 18 Jun 2012 23:57:19 -0700 (PDT) Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) by mx.google.com with ESMTPS id j34sm33728870ani.14.2012.06.18.23.57.19 (version=SSLv3 cipher=OTHER); Mon, 18 Jun 2012 23:57:19 -0700 (PDT) From: Jani Nikula To: Jameson Graef Rollins , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: add function to toggle display of all multipart/alternative parts In-Reply-To: <87zk80gvmb.fsf@servo.finestructure.net> References: <1339775751-18002-1-git-send-email-jani@nikula.org> <87zk80gvmb.fsf@servo.finestructure.net> User-Agent: Notmuch/0.13.2+60~g0f46448 (http://notmuchmail.org) Emacs/23.1.1 (i686-pc-linux-gnu) Date: Tue, 19 Jun 2012 06:57:17 +0000 Message-ID: <87ehpbyek2.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQl+1NhA6AEEp+RbUIIj+DQfu7YdC5o7jbwp4Jsor+4KlWAnyYR6w/QnxJb3rz7a8BbY3LBj 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: Tue, 19 Jun 2012 06:57:21 -0000 On Mon, 18 Jun 2012, Jameson Graef Rollins wrote: > On Fri, Jun 15 2012, Jani Nikula wrote: >> Add function notmuch-show-toggle-multipart-alternative to make >> notmuch-show-all-multipart/alternative-parts buffer local, toggle its >> value in the buffer, and redisplay the thread with either all or >> preferred alternative parts expanded. > > This is a very cool feature. I haven't looked closely at this but can't > this mechanism work the same as the other show-mode toggles, like crypto > or indenting? I wouldn't think it would require any more extra variable > stuff than what is used for those other toggles. I don't know how I missed those - thanks for pointing them out to me. They seem to do the extra variable stuff at the top level, alongside the defvar, rather than in the toggle function like I do. I should rearrange this toggle to be in line with the others. > Also, the *really* sweet thing would be if the toggle actually cycled > through display of the alternatives, only displaying one at a time. > That would be very swank. It is easy to agree with that. At a glance, it looks like it needs a bunch more work than the simple toggle in this patch, though. One difficulty is choosing the parts to cycle, as we may have multiple messages with different sets of multipart/alternative in the same show buffer. And the cycle would be buffer local, not "message local". I think it would be possible to have show/hide buttons for the parts, and the buttons could add/remove the part type from a buffer local list of alternative parts to show, and then refresh view. But that too would affect all messages in the buffer, not just one part of one message. In short, with my limited elisp skills and even more limited time, I don't see a nice solution this. That doesn't say anything about the possible existence of a nice solution, though. ;) BR, Jani.