Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / a0 / a72537ad00d30fe716f250eedd65e524b32af7
1 Return-Path: <marmstrong@google.com>\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 arlo.cworth.org (Postfix) with ESMTP id CAA1C6DE00BD\r
6  for <notmuch@notmuchmail.org>; Tue,  2 Aug 2016 10:39:52 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.829\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.829 tagged_above=-999 required=5 tests=[AWL=0.002,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,\r
14  SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
15 Received: from arlo.cworth.org ([127.0.0.1])\r
16  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
17  with ESMTP id gT4XapKFBQNP for <notmuch@notmuchmail.org>;\r
18  Tue,  2 Aug 2016 10:39:45 -0700 (PDT)\r
19 Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com\r
20  [209.85.220.50])\r
21  by arlo.cworth.org (Postfix) with ESMTPS id D75296DE00B8\r
22  for <notmuch@notmuchmail.org>; Tue,  2 Aug 2016 10:39:44 -0700 (PDT)\r
23 Received: by mail-pa0-f50.google.com with SMTP id b2so12661470pat.0\r
24  for <notmuch@notmuchmail.org>; Tue, 02 Aug 2016 10:39:44 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\r
26  s=20120113; h=from:to:subject:user-agent:date:message-id:mime-version;\r
27  bh=J9kZjS2aXEXjfIE79leirpdXNRd6V0wEh7wWox7bvj4=;\r
28  b=mb7O5HJF3vMZq15K/H8PjVFWYLdt78GIAuSVHuzXKVnxP4bQk2crvaXt3oFWecmIwT\r
29  yU3MEu1bwVpBdIeoaFErF15m5Eu5QU/Z6yu4YGOfU/hT9KgWssqBlln+cuoYdKWPOGVg\r
30  7fFUO2Lt31GmIVSeQEptt5/D9w37V/j+Pggww3W1ibQl/qyVzgq8v5MVoBRl2JCScjnK\r
31  P+nFz4NYUWmYX7REkzOfxIQn0RzIrJV4DFx8HDEYJ2tSvulASFYI041fDd+MumZ4/Sbl\r
32  /JvK84wu/R/QZpqCl6uAw+TCQKW54UZUsXYowVud7HruGu3v2sF/7xBZiePmTggx1MME kHTA==\r
33 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
34  d=1e100.net; s=20130820;\r
35  h=x-gm-message-state:from:to:subject:user-agent:date:message-id\r
36  :mime-version;\r
37  bh=J9kZjS2aXEXjfIE79leirpdXNRd6V0wEh7wWox7bvj4=;\r
38  b=gdhW6uUkPAbkwl4PVoXvDe5eFwCnvbiULF1/S0qO5iICD6psvVgLIQFoVYCRJ/rXtR\r
39  qqg50OBUay5ZUulD+igZWpU+cPPrkvsR7rJMzmQCJRgHzDB5Kz5S8yzLuLCyc3JSrMG0\r
40  0VhZGMDWlCbLBhHpEL4IhuGS7jXczmJBXOXP6mJ7T5JO/SIHwbVNfQY2RnJHZ5ing2/M\r
41  bn+Lekx3LFXC4GkG07S4oO2hbchLVc4tECMfRKymdzgT3sAPAhYMDHcT82FuzxYEsKDD\r
42  IhjqIs4YN77Wu4wBRUDVDlktQ+NhDGxCopvQJ9TMHihlpfEBbpojpFZg+LK4UoAxsHPO\r
43  lBZA==\r
44 X-Gm-Message-State:\r
45  AEkooutxwiXOf5G91T+aFph3cxOhXgLOOUdMAt+m/1Fquwn4jmZPL/yVsE3vzUirP8AhckJC\r
46 X-Received: by 10.66.222.202 with SMTP id qo10mr107820580pac.76.1470159583894;\r
47   Tue, 02 Aug 2016 10:39:43 -0700 (PDT)\r
48 Received: from marmstrong-linux.kir.corp.google.com\r
49  ([2620:0:1008:1101:419b:e62d:4938:a6b6])\r
50  by smtp.gmail.com with ESMTPSA id f6sm6344116pfa.17.2016.08.02.10.39.42\r
51  for <notmuch@notmuchmail.org>\r
52  (version=TLS1_2 cipher=AES128-SHA bits=128/128);\r
53  Tue, 02 Aug 2016 10:39:42 -0700 (PDT)\r
54 From: Matt Armstrong <marmstrong@google.com>\r
55 To: notmuch@notmuchmail.org\r
56 Subject: notmuch and "mute" -- useful to anyone?\r
57 User-Agent: Notmuch/0.21 (https://notmuchmail.org) Emacs/24.3.1\r
58  (x86_64-pc-linux-gnu)\r
59 Date: Tue, 02 Aug 2016 10:39:41 -0700\r
60 Message-ID: <qf5vazjjciq.fsf@marmstrong-linux.kir.corp.google.com>\r
61 MIME-Version: 1.0\r
62 Content-Type: text/plain\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.20\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67  <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
69  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
74  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Tue, 02 Aug 2016 17:39:52 -0000\r
76 \r
77 Is anyone else interested in Gmail-like "mute" support in notmuch.el?\r
78 If so, I can think about polishing the below off and adding it to\r
79 notmuch.\r
80 \r
81 I've managed to implement Gmail's "mute" in notmuch as follows in my\r
82 notmuch-post-new:\r
83 \r
84 ----------------------------------------------------------------------\r
85 # Unmute all threads with new messages sent to me.\r
86 notmuch search --output=threads tag:new AND tag:me | \\r
87   xargs --no-run-if-empty notmuch tag -muted --\r
88 \r
89 # Remove all muted threads from the inbox and mark every message in them\r
90 # muted.  Ideally this would be atomic with the above.\r
91 notmuch search --output=threads tag:muted | \\r
92   xargs --no-run-if-empty notmuch tag -inbox +muted --\r
93 ----------------------------------------------------------------------\r
94 \r
95 Then in .emacs:\r
96 \r
97 ----------------------------------------------------------------------\r
98 (defcustom my-notmuch-mute-tags '("+muted" "-inbox")\r
99   "List of tag changes to apply to a message or a thread when it is muted.\r
100 \r
101 Tags starting with \"+\" (or not starting with either \"+\" or\r
102 \"-\") in the list will be added, and tags starting with \"-\"\r
103 will be removed from the message or thread being archived.\r
104 \r
105 For example, if you wanted to remove an \"inbox\" tag and add an\r
106 \"archived\" tag, you would set:\r
107     (\"-inbox\" \"+archived\")"\r
108   :type '(repeat string)\r
109   :group 'notmuch-search\r
110   :group 'notmuch-show)\r
111 \r
112 ;; TODO: consider defadvice?\r
113 (defun my-notmuch-search-mute-thread (&optional unarchive beg end)\r
114   "Mute the currently selected thread or region.\r
115 \r
116 Mute  each message in the currently selected thread by applying the\r
117 tag changes in `my-notmuch-mute-tags' to each (remove the \"inbox\"\r
118 tag by default). If a prefix argument is given, the messages will\r
119 be \"unarchived\" (i.e. the tag changes in `my-notmuch-mute-tags'\r
120 will be reversed).\r
121 \r
122 This function advances the next thread when finished."\r
123   (interactive (cons current-prefix-arg (notmuch-search-interactive-region)))\r
124   (let ((notmuch-archive-tags my-notmuch-mute-tags))\r
125     (notmuch-search-archive-thread unarchive beg end)))\r
126 \r
127 (defun my-notmuch-show-mute-thread-then-next ()\r
128   (interactive)\r
129   "Mute all messages in the current buffer, then show next thread from search."\r
130   (let ((notmuch-archive-tags my-notmuch-mute-tags))\r
131     (notmuch-show-archive-thread-then-next)))\r
132 \r
133 (define-key notmuch-search-mode-map "m" 'my-notmuch-search-mute-thread)\r
134 (define-key notmuch-show-mode-map "m" 'my-notmuch-show-mute-thread-then-next)\r
135 ----------------------------------------------------------------------\r