Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b9 / 3177b41392e759ad8e5274318fd909cd4272ab
1 Return-Path: <dme@dme.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 1FFF7431FBD\r
6         for <notmuch@notmuchmail.org>; Tue, 20 May 2014 08:56:18 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id Vfhj6QBHpIJr for <notmuch@notmuchmail.org>;\r
16         Tue, 20 May 2014 08:56:14 -0700 (PDT)\r
17 Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com\r
18         [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 65D19431FBC\r
21         for <notmuch@notmuchmail.org>; Tue, 20 May 2014 08:56:14 -0700 (PDT)\r
22 Received: by mail-wi0-f178.google.com with SMTP id cc10so1216367wib.17\r
23         for <notmuch@notmuchmail.org>; Tue, 20 May 2014 08:56:12 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:subject:date:message-id;\r
27         bh=N6jyKFpruDPjNGD+XNGKJf+AQHB3BCREsKxbln7cLNU=;\r
28         b=cYQKVTK3R+kvCqVnd6gOIpeX0KvKRSY44lDH+bQOkarjGIjR4YCbRi01373ivVkT+P\r
29         jTqUd+IJec4BGoUjbBTnMX7KksQ4p5FT1IL2otzWTEWpN05v2fEDG7Kgg6fiSiAhjHWD\r
30         JXZE5CT0qaToCgh97VSfnd0e9CxVAq7sHV3Ybv6tuqRmSd+zx6EOCbqO5B4L0Ji7BgVB\r
31         LkZGIi4k/S4ZmMPHpZuQazlPe8D5QYxz/0p5YbCf2k3LDzaGqEVRkGwW1CT+jLogCHPy\r
32         +bdoaXA5Cr1L9zhTUF3o5hxp2tmGUT0NlbbsRj7rujrEXunbdlxV0reQ1OOI7AO0E98e\r
33         NOrQ==\r
34 X-Gm-Message-State:\r
35  ALoCoQn7rSyW+5AUH4g+SSdE8zYsyiM8YVJPKBY41e0xarD8iMdga9nP+emq3Gx5Mo8AGJgTfwou\r
36 X-Received: by 10.180.8.136 with SMTP id r8mr4937803wia.60.1400601371880;\r
37         Tue, 20 May 2014 08:56:11 -0700 (PDT)\r
38 Received: from hotblack-desiato.hh.sledj.net (disaster-area.hh.sledj.net.\r
39         [81.149.164.25]) by mx.google.com with ESMTPSA id\r
40         dz5sm21395949wib.22.2014.05.20.08.56.10 for <notmuch@notmuchmail.org>\r
41         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
42         Tue, 20 May 2014 08:56:11 -0700 (PDT)\r
43 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
44         id 6E8631012EC; Tue, 20 May 2014 16:56:09 +0100 (BST)\r
45 From: David Edmondson <dme@dme.org>\r
46 To: notmuch@notmuchmail.org\r
47 Subject: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility',\r
48         bound to '>'\r
49 Date: Tue, 20 May 2014 16:56:09 +0100\r
50 Message-Id: <1400601369-17005-1-git-send-email-dme@dme.org>\r
51 X-Mailer: git-send-email 2.0.0.rc0\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Tue, 20 May 2014 15:56:18 -0000\r
65 \r
66 Add a function and key-binding to toggle the collapsing of citations\r
67 within the current message.\r
68 ---\r
69  emacs/notmuch-show.el | 17 +++++++++++++++++\r
70  1 file changed, 17 insertions(+)\r
71 \r
72 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
73 index 10fc872..e4b56c7 100644\r
74 --- a/emacs/notmuch-show.el\r
75 +++ b/emacs/notmuch-show.el\r
76 @@ -1036,6 +1036,22 @@ useful for quoting in replies)."\r
77              "Content is not indented."))\r
78    (notmuch-show-refresh-view))\r
79  \r
80 +(defun notmuch-show-toggle-citation-visibility ()\r
81 +  "Toggle the visibility of the citations in the current message."\r
82 +  (interactive)\r
83 +  (let ((beg (notmuch-show-message-top))\r
84 +       (end (notmuch-show-message-bottom))\r
85 +       button)\r
86 +    (save-excursion\r
87 +      (goto-char beg)\r
88 +      (while (and (setq button (next-button (point)))\r
89 +                 (< (goto-char (button-start button))\r
90 +                    end))\r
91 +       (let ((overlay (button-get button 'overlay)))\r
92 +         (when (and overlay\r
93 +                    (string= (overlay-get overlay 'type) "citation"))\r
94 +           (push-button (point))))))))\r
95 +\r
96  (defun notmuch-show-insert-tree (tree depth)\r
97    "Insert the message tree TREE at depth DEPTH in the current thread."\r
98    (let ((msg (car tree))\r
99 @@ -1311,6 +1327,7 @@ reset based on the original query."\r
100         (define-key map "!" 'notmuch-show-toggle-elide-non-matching)\r
101         (define-key map "$" 'notmuch-show-toggle-process-crypto)\r
102         (define-key map "<" 'notmuch-show-toggle-thread-indentation)\r
103 +       (define-key map ">" 'notmuch-show-toggle-citation-visibility)\r
104         (define-key map "t" 'toggle-truncate-lines)\r
105         (define-key map "." 'notmuch-show-part-map)\r
106         map)\r
107 -- \r
108 2.0.0.rc0\r
109 \r