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 151584196F2 for ; Thu, 22 Apr 2010 01:24:13 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham 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 dgbHz-MJ+vrf for ; Thu, 22 Apr 2010 01:24:11 -0700 (PDT) Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com [74.125.82.53]) by olra.theworths.org (Postfix) with ESMTP id 5FC51431FC1 for ; Thu, 22 Apr 2010 01:24:11 -0700 (PDT) Received: by wwb28 with SMTP id 28so2049031wwb.26 for ; Thu, 22 Apr 2010 01:24:10 -0700 (PDT) Received: by 10.216.87.75 with SMTP id x53mr2416615wee.144.1271924650426; Thu, 22 Apr 2010 01:24:10 -0700 (PDT) Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com [83.217.165.81]) by mx.google.com with ESMTPS id n12sm3593014gve.0.2010.04.22.01.24.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 22 Apr 2010 01:24:09 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id B412F594163; Thu, 22 Apr 2010 09:24:07 +0100 (BST) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH] emacs/notmuch-show.el: Add `notmuch-show-toggle-all' bound to M-RET Date: Thu, 22 Apr 2010 09:24:03 +0100 Message-Id: <1271924643-7804-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.0 In-Reply-To: <87iq7kjz7c.fsf@yoom.home.cworth.org> References: <87iq7kjz7c.fsf@yoom.home.cworth.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: Thu, 22 Apr 2010 08:24:13 -0000 `notmuch-show-toggle-all' changes the visibility all of the messages in the current thread. By default it makes all of the messages visible. With a prefix argument, it makes them all not visible. --- emacs/notmuch-show.el | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 916b39e..9775fb4 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -526,6 +526,7 @@ function is used. " (define-key map "p" 'notmuch-show-previous-open-message) (define-key map (kbd "DEL") 'notmuch-show-rewind) (define-key map " " 'notmuch-show-advance-and-archive) + (define-key map (kbd "M-RET") 'notmuch-show-toggle-all) (define-key map (kbd "RET") 'notmuch-show-toggle-message) map) "Keymap for \"notmuch show\" buffers.") @@ -900,6 +901,18 @@ to stdout or stderr will appear in the *Messages* buffer." (not (plist-get props :message-visible)))) (force-window-update)) +(defun notmuch-show-toggle-all () + "Change the visibility all of the messages in the current +thread. By default make all of the messages visible. With a +prefix argument, make them all not visible." + (interactive) + (save-excursion + (goto-char (point-min)) + (loop do (notmuch-show-message-visible (notmuch-show-get-message-properties) + (not current-prefix-arg)) + until (not (notmuch-show-goto-message-next)))) + (force-window-update)) + (defun notmuch-show-next-button () "Advance point to the next button in the buffer." (interactive) -- 1.7.0