Re: Hi all
[notmuch-archives.git] / 5b / 6b8f60278b467f06aa147d3a91bb9ccfe8afa6
1 Return-Path: <mpn@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 olra.theworths.org (Postfix) with ESMTP id 46982431FB6\r
6         for <notmuch@notmuchmail.org>; Mon,  6 Aug 2012 07:20:28 -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.8\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.8 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id NaL3OWC5aXbQ for <notmuch@notmuchmail.org>;\r
17         Mon,  6 Aug 2012 07:20:24 -0700 (PDT)\r
18 Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
19  [74.125.83.53])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
20  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
21  DAC04431FAE    for <notmuch@notmuchmail.org>; Mon,  6 Aug 2012 07:20:23 -0700\r
22  (PDT)\r
23 Received: by eekc4 with SMTP id c4so1222538eek.26\r
24         for <notmuch@notmuchmail.org>; Mon, 06 Aug 2012 07:20:21 -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:date:message-id:x-mailer;\r
27         bh=USYpGIiSNKLpp+KRusWbpAA/QAu+G/dsiBtrA2izd4w=;\r
28         b=H4HxC9cuiTwGOF7bSyiAabFu5IspUWbPgYbWmirOgDJg94WKnHZLXVGR5SdHeD50Y1\r
29         uNvmq4mL7IhR1fzIn3tIRT0s+EwFMcnwSlevxqdYHvhIzWlrYFE4uWUIWYUFWIh7NEYB\r
30         PlsSM5EmkqUgJEVC+oJiZp3pOqJP9RXrgpXoy28gWl7xBYZto8lrdOdzWfQwNStAiyx9\r
31         YNtQ0jSPk0aq9Zt1z02viuy4+9PItVp/kQuTeYHfPW7BitWXr2MqA9P/UBsvVRmEEjjF\r
32         8C8mKD+OigVh1gHIIV18vbMt7rI0dHMpR9BJQCfgnkih3/Rqi0QCs33h9onrSE4Zxjus    OzJw==\r
33 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
34         d=google.com; s=20120113;\r
35         h=from:to:subject:date:message-id:x-mailer:x-gm-message-state;\r
36         bh=USYpGIiSNKLpp+KRusWbpAA/QAu+G/dsiBtrA2izd4w=;\r
37         b=X74RwV7DUyDgFb7xkuyOHZil+TW2dO7HmqAuRU+eHilDxfT/QaZmYUVRHRi8NkY5bG\r
38         I725VIUaz7NaqisILO/lLijjIWEmBemRjfpKD2Ovgx/6DUsnVEB0SEVJ5F+x+PJJy2z2\r
39         FPj19+t8gJgByFIAcuZfqCVPUkRxGt/QKkRy3k+yZYcofmX+h3asH/GNEIo97CRYtrMF\r
40         j44/UWAci32Q2w1jsWGasDQo0IkfNdm980UNIteWQ5GMB4Vhvatsew52xLbHXtrl0fpZ\r
41         bAUPd3ZrTKqZGYlSQt7INmTjvC6FZdwK8HrBdgtdSbIwOgyi6AH8IzdFWYdghn8WR4Ot\r
42         H3SA==\r
43 Received: by 10.14.181.137 with SMTP id l9mr13173133eem.28.1344262821318;\r
44         Mon, 06 Aug 2012 07:20:21 -0700 (PDT)\r
45 Received: by 10.14.181.137 with SMTP id l9mr13173119eem.28.1344262821187;\r
46         Mon, 06 Aug 2012 07:20:21 -0700 (PDT)\r
47 Received: from mpn-glaptop.corp.google.com\r
48         (dhcp-172-16-75-225.zrh.corp.google.com [172.16.75.225])\r
49         by mx.google.com with ESMTPS id j4sm48042780eeo.11.2012.08.06.07.20.19\r
50         (version=SSLv3 cipher=OTHER); Mon, 06 Aug 2012 07:20:20 -0700 (PDT)\r
51 From: Michal Nazarewicz <mpn@google.com>\r
52 To: notmuch@notmuchmail.org\r
53 Subject: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option\r
54 Date: Mon,  6 Aug 2012 16:20:11 +0200\r
55 Message-Id:\r
56  <7c2931eb4d34ff78e4c73d721bc00dc60d185e6a.1344260116.git.mina86@mina86.com>\r
57 X-Mailer: git-send-email 1.7.7.3\r
58 X-Gm-Message-State: ALoCoQljXK12dEABzPfFtj2/1Yt6X/H+TDMtckBkggNenJcr7EtRAQ2hlckvwF8yEJcTRxash4ppQE6XZi6cn6IrDCTTSSLwbLzFDnA2ZF3Dk9V4M3kjbfXeDYdkU41ypmqpWslTOG1cXnsFloyGvRTtGsyVGjHTyHdkJ7MyP49hxM9MTt5MK8LP9j1692SPXLxq8Tp5tVBhoRPip/+H8we0AJsMXIHVnw==\r
59 X-Mailman-Approved-At: Mon, 06 Aug 2012 07:42:46 -0700\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Mon, 06 Aug 2012 14:20:28 -0000\r
73 \r
74 From: Michal Nazarewicz <mina86@mina86.com>\r
75 \r
76 Setting `notmuch-show-auto-mark-read' to nil stops notmuch-show from marking\r
77 the message as read (by removing the unread tag).  Inteded for people who\r
78 like to mark messages read explicitly.\r
79 ---\r
80  emacs/notmuch-show.el |   16 +++++++++++++---\r
81  1 files changed, 13 insertions(+), 3 deletions(-)\r
82 \r
83 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
84 index d318430..85a17b1 100644\r
85 --- a/emacs/notmuch-show.el\r
86 +++ b/emacs/notmuch-show.el\r
87 @@ -183,6 +183,14 @@ provided with an MLA argument nor `completing-read' input."\r
88              notmuch-show-stash-mlarchive-link-alist))\r
89    :group 'notmuch-show)\r
90  \r
91 +(defcustom notmuch-show-auto-mark-read t\r
92 +  "Whether to automatically mark message as read when it is shown.  If\r
93 +nil, message needs to be marked as read manually for instance by\r
94 +removing the unread tag."\r
95 +  :type 'boolean\r
96 +  :group 'notmuch-show)\r
97 +\r
98 +\r
99  (defmacro with-current-notmuch-show-message (&rest body)\r
100    "Evaluate body with current buffer set to the text of current message"\r
101    `(save-excursion\r
102 @@ -1374,9 +1382,11 @@ current thread."\r
103    "Are the headers of the current message visible?"\r
104    (notmuch-show-get-prop :headers-visible))\r
105  \r
106 -(defun notmuch-show-mark-read ()\r
107 -  "Mark the current message as read."\r
108 -  (notmuch-show-tag-message "-unread"))\r
109 +(defun notmuch-show-mark-read (&optional force)\r
110 +  "Mark the current message as read if FORCE or\r
111 +`notmuch-show-auto-mark-read' is non-nil."\r
112 +  (when (or force notmuch-show-auto-mark-read)\r
113 +    (notmuch-show-tag-message "-unread")))\r
114  \r
115  ;; Functions for getting attributes of several messages in the current\r
116  ;; thread.\r
117 -- \r
118 1.7.7.3\r
119 \r