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 EF5B2431FAE for ; Mon, 30 Nov 2009 22:14:49 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 vC87C2GoroB0 for ; Mon, 30 Nov 2009 22:14:49 -0800 (PST) Received: from msr35.hinet.net (msr35.hinet.net [168.95.4.135]) by olra.theworths.org (Postfix) with ESMTP id 787B0431FBC for ; Mon, 30 Nov 2009 22:14:48 -0800 (PST) Received: from anar.kanru.info ([203.74.21.24]) by msr35.hinet.net (8.9.3/8.9.3) with ESMTP id OAA14282 for ; Tue, 1 Dec 2009 14:14:45 +0800 (CST) Received: from kanru (uid 1000) (envelope-from kanru@anar.kanru.info) id 1da0 by anar.kanru.info (DragonFly Mail Agent) Tue, 01 Dec 2009 14:14:35 +0800 From: Kan-Ru Chen To: notmuch@notmuchmail.org Date: Tue, 1 Dec 2009 14:13:51 +0800 Message-Id: <1259648033-30653-1-git-send-email-kanru@kanru.info> X-Mailer: git-send-email 1.6.5.3 Subject: [notmuch] [PATCH 1/3] notmuch.el: Add keybinding to toggle display of message body and headers. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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, 01 Dec 2009 06:14:50 -0000 I really missed this feature. Added notmuch-show-toggle-current-body and notmuch-show-toggle-current-header and bind them to 'b' and 'h'. Signed-off-by: Kan-Ru Chen --- notmuch.el | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/notmuch.el b/notmuch.el index 65473ba..2526020 100644 --- a/notmuch.el +++ b/notmuch.el @@ -62,7 +62,9 @@ ; overlays-at to query and manipulate the current overlay. (define-key map "a" 'notmuch-show-archive-thread) (define-key map "A" 'notmuch-show-mark-read-then-archive-thread) + (define-key map "b" 'notmuch-show-toggle-current-body) (define-key map "f" 'notmuch-show-forward-current) + (define-key map "h" 'notmuch-show-toggle-current-header) (define-key map "m" 'message-mail) (define-key map "n" 'notmuch-show-next-message) (define-key map "N" 'notmuch-show-mark-read-then-next-open-message) @@ -560,6 +562,26 @@ which this thread was originally shown." (force-window-update) (redisplay t)) +(defun notmuch-show-toggle-current-body () + "Toggle the current message body." + (interactive) + (save-excursion + (notmuch-show-move-to-current-message-summary-line) + (unless (button-at (point)) + (notmuch-show-next-button)) + (push-button)) + ) + +(defun notmuch-show-toggle-current-header () + (interactive) + (save-excursion + (notmuch-show-move-to-current-message-summary-line) + (next-line) + (unless (button-at (point)) + (notmuch-show-next-button)) + (push-button)) + ) + (define-button-type 'notmuch-button-invisibility-toggle-type 'action 'notmuch-toggle-invisible-action 'follow-link t) (define-button-type 'notmuch-button-citation-toggle-type 'help-echo "mouse-1, RET: Show citation" :supertype 'notmuch-button-invisibility-toggle-type) -- 1.6.5.3