[PATCH v5] devel/emacs: add devel/try-emacs-mua
[notmuch-archives.git] / 15 / 7a72fd8b9454e81b48e59bb88dbecac79cb8b8
1 Return-Path: <markwalters1009@gmail.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 olra.theworths.org (Postfix) with ESMTP id 9B553431E62\r
6         for <notmuch@notmuchmail.org>; Sun,  1 Dec 2013 02:02:44 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id G00pTmjJPYES for <notmuch@notmuchmail.org>;\r
18         Sun,  1 Dec 2013 02:02:38 -0800 (PST)\r
19 Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com\r
20  [74.125.82.48])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  E2F7A431FAF    for <notmuch@notmuchmail.org>; Sun,  1 Dec 2013 02:02:37 -0800\r
23  (PST)\r
24 Received: by mail-wg0-f48.google.com with SMTP id z12so10804144wgg.27\r
25         for <notmuch@notmuchmail.org>; Sun, 01 Dec 2013 02:02:36 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
28         bh=3Vf/imofLOIgUyrlDJFL9j2d6ZxpoFu8Uaygb2bfDf0=;\r
29         b=sqj4QuTd6sIKPC5gy7tZMFdh9ChDM1G+Ip4I0R9J1JtYOxGwHRbAr21CK5H0LHF3Xi\r
30         GUJ3GOqU35ciYp5yJedktFCfmWiUl2lj+BandGQUQ0V5RJ3l808t8le/P6oDi1OseC7s\r
31         k0cMZf8lAxWj0didX5sOc5BjFRVrcSr2qCKdQ90NbpGYmptAgjTAVJGLa9YEndVf1A40\r
32         jTPpzp49wu8q7KbRbXV96VVFl75QCPbnMkxtizlUvaFqXaPN3MSa+g1oeYwf5m+ux2kC\r
33         XnEbFtUT7G5ZnffJ20D/m0viv7YFRLpOU4/79X0KInTGaVsQBLiNcvf0vhqw9uzMq9ul\r
34         yiFQ==\r
35 X-Received: by 10.180.210.232 with SMTP id mx8mr13811800wic.34.1385892156568; \r
36         Sun, 01 Dec 2013 02:02:36 -0800 (PST)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPSA id f11sm93688599wic.4.2013.12.01.02.02.35\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Sun, 01 Dec 2013 02:02:36 -0800 (PST)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH WIP v2 3/6] emacs: show: sync seen to read on quit and refresh\r
45 Date: Sun,  1 Dec 2013 10:02:24 +0000\r
46 Message-Id: <1385892147-16994-4-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1385892147-16994-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1385892147-16994-1-git-send-email-markwalters1009@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Sun, 01 Dec 2013 10:02:44 -0000\r
63 \r
64 This makes notmuch show buffers mark all seen messages as read when\r
65 quitting or refreshing the show buffer, accept in the case these are\r
66 called with a prefix argument.\r
67 \r
68 This slightly overloads the prefix-argument to refresh: as it tells\r
69 refresh not to save state either. This is probably OK as it says "make\r
70 the buffer look like the database".\r
71 \r
72 Note, at this point the seen functionality is not yet used: that is\r
73 nothing yet marks a message seen.\r
74 ---\r
75  emacs/notmuch-show.el |   15 +++++++++++++++\r
76  1 files changed, 15 insertions(+), 0 deletions(-)\r
77 \r
78 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
79 index c63d295..05f649b 100644\r
80 --- a/emacs/notmuch-show.el\r
81 +++ b/emacs/notmuch-show.el\r
82 @@ -1213,6 +1213,11 @@ preferences. If invoked with a prefix argument (or RESET-STATE is\r
83  non-nil) then the state of the buffer (open/closed messages) is\r
84  reset based on the original query."\r
85    (interactive "P")\r
86 +  ;; Do not mark seen messages read if we are resetting state. The\r
87 +  ;; idea is that resetting state is asking for the view to be reset\r
88 +  ;; to the current state of the database.\r
89 +  (notmuch-show-mark-all-seen-read reset-state)\r
90 +\r
91    (let ((inhibit-read-only t)\r
92         (state (unless reset-state\r
93                  (notmuch-show-capture-state))))\r
94 @@ -1258,6 +1263,8 @@ reset based on the original query."\r
95  (defvar notmuch-show-mode-map\r
96        (let ((map (make-sparse-keymap)))\r
97         (set-keymap-parent map notmuch-common-keymap)\r
98 +       ;; the following overrides the common-keymap quit\r
99 +       (define-key map [remap notmuch-kill-this-buffer] 'notmuch-show-quit-and-mark-read)\r
100         (define-key map "Z" 'notmuch-tree-from-show-current-query)\r
101         (define-key map (kbd "<C-tab>") 'widget-backward)\r
102         (define-key map (kbd "M-TAB") 'notmuch-show-previous-button)\r
103 @@ -1570,6 +1577,14 @@ we are not marking them."\r
104               ((= count 0)\r
105                (message "No messages marked read")))))))\r
106  \r
107 +(put 'notmuch-show-quit-and-mark-read 'notmuch-prefix-doc\r
108 +     "... without marking seen messages read.")\r
109 +(defun notmuch-show-quit-and-mark-read (&optional not-mark)\r
110 +  "Kill the current buffer marking seen messages read."\r
111 +  (interactive "P")\r
112 +  (notmuch-show-mark-all-seen-read not-mark)\r
113 +  (notmuch-kill-this-buffer))\r
114 +\r
115  ;; Functions for getting attributes of several messages in the current\r
116  ;; thread.\r
117  \r
118 -- \r
119 1.7.9.1\r
120 \r