From: David Edmondson Date: Tue, 20 May 2014 15:56:09 +0000 (+0100) Subject: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', bound to '>' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=949d3de101301e8d0b73e5b9d18e9e9dff837845;p=notmuch-archives.git [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', bound to '>' --- diff --git a/b9/3177b41392e759ad8e5274318fd909cd4272ab b/b9/3177b41392e759ad8e5274318fd909cd4272ab new file mode 100644 index 000000000..4e552a09e --- /dev/null +++ b/b9/3177b41392e759ad8e5274318fd909cd4272ab @@ -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 1FFF7431FBD + for ; Tue, 20 May 2014 08:56:18 -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 Vfhj6QBHpIJr for ; + Tue, 20 May 2014 08:56:14 -0700 (PDT) +Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com + [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 65D19431FBC + for ; Tue, 20 May 2014 08:56:14 -0700 (PDT) +Received: by mail-wi0-f178.google.com with SMTP id cc10so1216367wib.17 + for ; Tue, 20 May 2014 08:56:12 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:date:message-id; + bh=N6jyKFpruDPjNGD+XNGKJf+AQHB3BCREsKxbln7cLNU=; + b=cYQKVTK3R+kvCqVnd6gOIpeX0KvKRSY44lDH+bQOkarjGIjR4YCbRi01373ivVkT+P + jTqUd+IJec4BGoUjbBTnMX7KksQ4p5FT1IL2otzWTEWpN05v2fEDG7Kgg6fiSiAhjHWD + JXZE5CT0qaToCgh97VSfnd0e9CxVAq7sHV3Ybv6tuqRmSd+zx6EOCbqO5B4L0Ji7BgVB + LkZGIi4k/S4ZmMPHpZuQazlPe8D5QYxz/0p5YbCf2k3LDzaGqEVRkGwW1CT+jLogCHPy + +bdoaXA5Cr1L9zhTUF3o5hxp2tmGUT0NlbbsRj7rujrEXunbdlxV0reQ1OOI7AO0E98e + NOrQ== +X-Gm-Message-State: + ALoCoQn7rSyW+5AUH4g+SSdE8zYsyiM8YVJPKBY41e0xarD8iMdga9nP+emq3Gx5Mo8AGJgTfwou +X-Received: by 10.180.8.136 with SMTP id r8mr4937803wia.60.1400601371880; + Tue, 20 May 2014 08:56:11 -0700 (PDT) +Received: from hotblack-desiato.hh.sledj.net (disaster-area.hh.sledj.net. + [81.149.164.25]) by mx.google.com with ESMTPSA id + dz5sm21395949wib.22.2014.05.20.08.56.10 for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Tue, 20 May 2014 08:56:11 -0700 (PDT) +Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) + id 6E8631012EC; Tue, 20 May 2014 16:56:09 +0100 (BST) +From: David Edmondson +To: notmuch@notmuchmail.org +Subject: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', + bound to '>' +Date: Tue, 20 May 2014 16:56:09 +0100 +Message-Id: <1400601369-17005-1-git-send-email-dme@dme.org> +X-Mailer: git-send-email 2.0.0.rc0 +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, 20 May 2014 15:56:18 -0000 + +Add a function and key-binding to toggle the collapsing of citations +within the current message. +--- + emacs/notmuch-show.el | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index 10fc872..e4b56c7 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -1036,6 +1036,22 @@ useful for quoting in replies)." + "Content is not indented.")) + (notmuch-show-refresh-view)) + ++(defun notmuch-show-toggle-citation-visibility () ++ "Toggle the visibility of the citations in the current message." ++ (interactive) ++ (let ((beg (notmuch-show-message-top)) ++ (end (notmuch-show-message-bottom)) ++ button) ++ (save-excursion ++ (goto-char beg) ++ (while (and (setq button (next-button (point))) ++ (< (goto-char (button-start button)) ++ end)) ++ (let ((overlay (button-get button 'overlay))) ++ (when (and overlay ++ (string= (overlay-get overlay 'type) "citation")) ++ (push-button (point)))))))) ++ + (defun notmuch-show-insert-tree (tree depth) + "Insert the message tree TREE at depth DEPTH in the current thread." + (let ((msg (car tree)) +@@ -1311,6 +1327,7 @@ reset based on the original query." + (define-key map "!" 'notmuch-show-toggle-elide-non-matching) + (define-key map "$" 'notmuch-show-toggle-process-crypto) + (define-key map "<" 'notmuch-show-toggle-thread-indentation) ++ (define-key map ">" 'notmuch-show-toggle-citation-visibility) + (define-key map "t" 'toggle-truncate-lines) + (define-key map "." 'notmuch-show-part-map) + map) +-- +2.0.0.rc0 +