[PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', bound to '>'
authorDavid Edmondson <dme@dme.org>
Tue, 20 May 2014 15:56:09 +0000 (16:56 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:02:53 +0000 (10:02 -0800)
b9/3177b41392e759ad8e5274318fd909cd4272ab [new file with mode: 0644]

diff --git a/b9/3177b41392e759ad8e5274318fd909cd4272ab b/b9/3177b41392e759ad8e5274318fd909cd4272ab
new file mode 100644 (file)
index 0000000..4e552a0
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1FFF7431FBD\r
+       for <notmuch@notmuchmail.org>; Tue, 20 May 2014 08:56:18 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Vfhj6QBHpIJr for <notmuch@notmuchmail.org>;\r
+       Tue, 20 May 2014 08:56:14 -0700 (PDT)\r
+Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com\r
+       [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 65D19431FBC\r
+       for <notmuch@notmuchmail.org>; Tue, 20 May 2014 08:56:14 -0700 (PDT)\r
+Received: by mail-wi0-f178.google.com with SMTP id cc10so1216367wib.17\r
+       for <notmuch@notmuchmail.org>; Tue, 20 May 2014 08:56:12 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:subject:date:message-id;\r
+       bh=N6jyKFpruDPjNGD+XNGKJf+AQHB3BCREsKxbln7cLNU=;\r
+       b=cYQKVTK3R+kvCqVnd6gOIpeX0KvKRSY44lDH+bQOkarjGIjR4YCbRi01373ivVkT+P\r
+       jTqUd+IJec4BGoUjbBTnMX7KksQ4p5FT1IL2otzWTEWpN05v2fEDG7Kgg6fiSiAhjHWD\r
+       JXZE5CT0qaToCgh97VSfnd0e9CxVAq7sHV3Ybv6tuqRmSd+zx6EOCbqO5B4L0Ji7BgVB\r
+       LkZGIi4k/S4ZmMPHpZuQazlPe8D5QYxz/0p5YbCf2k3LDzaGqEVRkGwW1CT+jLogCHPy\r
+       +bdoaXA5Cr1L9zhTUF3o5hxp2tmGUT0NlbbsRj7rujrEXunbdlxV0reQ1OOI7AO0E98e\r
+       NOrQ==\r
+X-Gm-Message-State:\r
+ ALoCoQn7rSyW+5AUH4g+SSdE8zYsyiM8YVJPKBY41e0xarD8iMdga9nP+emq3Gx5Mo8AGJgTfwou\r
+X-Received: by 10.180.8.136 with SMTP id r8mr4937803wia.60.1400601371880;\r
+       Tue, 20 May 2014 08:56:11 -0700 (PDT)\r
+Received: from hotblack-desiato.hh.sledj.net (disaster-area.hh.sledj.net.\r
+       [81.149.164.25]) by mx.google.com with ESMTPSA id\r
+       dz5sm21395949wib.22.2014.05.20.08.56.10 for <notmuch@notmuchmail.org>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Tue, 20 May 2014 08:56:11 -0700 (PDT)\r
+Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
+       id 6E8631012EC; Tue, 20 May 2014 16:56:09 +0100 (BST)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility',\r
+       bound to '>'\r
+Date: Tue, 20 May 2014 16:56:09 +0100\r
+Message-Id: <1400601369-17005-1-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 2.0.0.rc0\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 20 May 2014 15:56:18 -0000\r
+\r
+Add a function and key-binding to toggle the collapsing of citations\r
+within the current message.\r
+---\r
+ emacs/notmuch-show.el | 17 +++++++++++++++++\r
+ 1 file changed, 17 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 10fc872..e4b56c7 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1036,6 +1036,22 @@ useful for quoting in replies)."\r
+            "Content is not indented."))\r
+   (notmuch-show-refresh-view))\r
\r
++(defun notmuch-show-toggle-citation-visibility ()\r
++  "Toggle the visibility of the citations in the current message."\r
++  (interactive)\r
++  (let ((beg (notmuch-show-message-top))\r
++      (end (notmuch-show-message-bottom))\r
++      button)\r
++    (save-excursion\r
++      (goto-char beg)\r
++      (while (and (setq button (next-button (point)))\r
++                (< (goto-char (button-start button))\r
++                   end))\r
++      (let ((overlay (button-get button 'overlay)))\r
++        (when (and overlay\r
++                   (string= (overlay-get overlay 'type) "citation"))\r
++          (push-button (point))))))))\r
++\r
+ (defun notmuch-show-insert-tree (tree depth)\r
+   "Insert the message tree TREE at depth DEPTH in the current thread."\r
+   (let ((msg (car tree))\r
+@@ -1311,6 +1327,7 @@ reset based on the original query."\r
+       (define-key map "!" 'notmuch-show-toggle-elide-non-matching)\r
+       (define-key map "$" 'notmuch-show-toggle-process-crypto)\r
+       (define-key map "<" 'notmuch-show-toggle-thread-indentation)\r
++      (define-key map ">" 'notmuch-show-toggle-citation-visibility)\r
+       (define-key map "t" 'toggle-truncate-lines)\r
+       (define-key map "." 'notmuch-show-part-map)\r
+       map)\r
+-- \r
+2.0.0.rc0\r
+\r