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 5EE90431FCB for ; Thu, 25 Oct 2012 01:09:45 -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 4ecANyDJptn5 for ; Thu, 25 Oct 2012 01:09:41 -0700 (PDT) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 915A7431FD0 for ; Thu, 25 Oct 2012 01:09:38 -0700 (PDT) Received: by mail-we0-f181.google.com with SMTP id u54so795382wey.26 for ; Thu, 25 Oct 2012 01:09:37 -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:in-reply-to:references; bh=6lcBIomlH/RgR54ShypwviV26OBCdI0GFJeqXtjgkFY=; b=N/T794yrxKIGa+aWQT+cC0g+GoXR5t+aQlQQyR0e0D1RQTXuuWP6PDlZWow4R0E6js iT8JTtv1vIxQTKenMAmARGXUvfbWekmt1jD5Ctchse0sGsJsjRnaglQUdyklHg19NZLh J99EvPXz9HOSuMy5jOPvFitlfBOKUTd+Nd1mnZulgoXC5nTiUoIEoxaiNRV0C1b/5jKT Pj0/oL91vHOSv1Ba9ElyazXNnKGnX9e0cQQd+T9xmpdp5kiO31e5cayGNLFkvKQUFh84 +gzPwJWkz9mgu8ZJefqctxBz4o+guB83f9NDdSWk1gpH/kqUNpjvgVMc2fu95cfrc7hS ZmsA== Received: by 10.180.96.164 with SMTP id dt4mr8471427wib.10.1351152576843; Thu, 25 Oct 2012 01:09:36 -0700 (PDT) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id gg4sm9893093wib.6.2012.10.25.01.09.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 01:09:35 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH (draft) 2/2] emacs: show: make "view part" show hidden parts Date: Thu, 25 Oct 2012 09:09:23 +0100 Message-Id: <1351152563-27277-3-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1351152563-27277-1-git-send-email-markwalters1009@gmail.com> References: <1351152563-27277-1-git-send-email-markwalters1009@gmail.com> 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:45 -0000 This change means that hidden parts in the show buffer are inserted into the buffer when the "view command" is called on that part (by default v on the button). --- emacs/notmuch-show.el | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 9157669..293456d 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -836,7 +836,8 @@ has overridden the default for this part" (when (memq nth user-parts) (setq not-shown (not not-shown))) (if not-shown - (notmuch-show-insert-part-header nth content-type content-type nil " (not shown)") + (button-put (notmuch-show-insert-part-header nth content-type content-type nil " (not shown)") + :part-not-shown 't) (notmuch-show-insert-bodypart-internal msg part content-type nth depth content-type))) ;; Some of the body part handlers leave point somewhere up in the ;; part, so we make sure that we're down at the end. @@ -1912,7 +1913,10 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')." (defun notmuch-show-part-button-view (&optional button) (interactive) - (notmuch-show-part-button-internal button #'notmuch-show-view-part)) + (let ((button (or button (button-at (point))))) + (if (and button (button-get button :part-not-shown)) + (notmuch-show-part-button-internal button #'notmuch-show-internally-show-part) + (notmuch-show-part-button-internal button #'notmuch-show-view-part)))) (defun notmuch-show-part-button-interactively-view (&optional button) (interactive) -- 1.7.9.1