From: Mark Walters Date: Thu, 25 Oct 2012 08:09:21 +0000 (+0100) Subject: [PATCH (draft) 0/2] Allow emacs to toggle display of all parts including multipart X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=19b24b950bc8f2fdaab9e6f1c43f5bd94a8e409a;p=notmuch-archives.git [PATCH (draft) 0/2] Allow emacs to toggle display of all parts including multipart --- diff --git a/63/cc9f5d4a82378a3ce9e0698b23931912cd2484 b/63/cc9f5d4a82378a3ce9e0698b23931912cd2484 new file mode 100644 index 000000000..c3fce1419 --- /dev/null +++ b/63/cc9f5d4a82378a3ce9e0698b23931912cd2484 @@ -0,0 +1,109 @@ +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 73101431FAF + for ; Thu, 25 Oct 2012 01:09:34 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=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 0PA+ElRUCxIA for ; + Thu, 25 Oct 2012 01:09:33 -0700 (PDT) +Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com + [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + BCCDA431FAE for ; Thu, 25 Oct 2012 01:09:32 -0700 + (PDT) +Received: by mail-wg0-f45.google.com with SMTP id dq12so897880wgb.2 + for ; Thu, 25 Oct 2012 01:09:31 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer; + bh=ZYixgR4W10jC8IHyAlCbOfaK9RgaiEqDMIo2iKUNvwU=; + b=BqjaROysBurT13wrNtOLLBbhD7t/ApWfqCIOuWRhS90zQ8hZpeG24VW41ekVJuzhQc + 5Uf0cUWyYcoKkqv9H7Q5OUWYPHt0azTJiVjM4Xay6EtRLsOURXps5BajjVo4i1M7Hrc2 + quP9hH0gOY5WaDQwuKQn5oFDWKPn7MINIqVSgSq41YJ36dh5fAJTaByFxzuw0Ddmz487 + zHP/dOo//BBDvI7enwjHQ0+/na3FNG1A3auGUNB3gfdOKPQZpEfBrERSSOjyx7TEAgGx + QdeN1oZ84UqSVhU+aOXX8hFBv0LMe85rHaxhoA7jW5BPKS09J68HjXma75GfM/EXgZlF + f9GQ== +Received: by 10.180.79.7 with SMTP id f7mr11827216wix.22.1351152571511; + Thu, 25 Oct 2012 01:09:31 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPS id fp6sm8766801wib.0.2012.10.25.01.09.29 + (version=TLSv1/SSLv3 cipher=OTHER); + Thu, 25 Oct 2012 01:09:30 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH (draft) 0/2] Allow emacs to toggle display of all parts + including multipart +Date: Thu, 25 Oct 2012 09:09:21 +0100 +Message-Id: <1351152563-27277-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +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: Thu, 25 Oct 2012 08:09:34 -0000 + +This patch series adds a function to toggle the display of any emacs +part in the show buffer. This is particularly useful for +multipart/alternative where the parts have different information. + +The first patch binds this toggle to 't' on the part button. This +patch works by itself. + +The second patch makes it that "viewing" (ie v on the part-button) a +"not shown" part displays the part in the buffer. Note this is not a +toggle since having displayed the part in the buffer the user may wish +to view the part externally (eg if it is a text/html part). + +Caveats: + the patches work by reloading the whole buffer: this may mean + extra messages appear in the thread. This is not ideal but is + the same as toggling indentation etc. + + the reload saves state as normal but this means the view + returns to the top of the current message. Since we know + exactly where the user was (ie on the button) this should be + restored. + + for technical reasons the "view" part functionality in the + second patch only works for view called explicitly: not if + the user has customised the default action to be view and + calls that. This is easy to fix but the most natural way + would break existing customisation of this action. + + reloading the buffer without keeping state does not currently + reset the toggled parts. Again this is easy to fix but lets + see if people like the general approach first. + +Best wishes + +Mark + + +Mark Walters (2): + emacs: allow the user to toggle the visibility of + multipart/alternative parts + emacs: show: make "view part" show hidden parts + + emacs/notmuch-show.el | 53 ++++++++++++++++++++++++++++++++++++++++-------- + 1 files changed, 44 insertions(+), 9 deletions(-) + +-- +1.7.9.1 +