Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 46982431FB6 for ; Mon, 6 Aug 2012 07:20:28 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.8 X-Spam-Level: X-Spam-Status: No, score=-0.8 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NaL3OWC5aXbQ for ; Mon, 6 Aug 2012 07:20:24 -0700 (PDT) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DAC04431FAE for ; Mon, 6 Aug 2012 07:20:23 -0700 (PDT) Received: by eekc4 with SMTP id c4so1222538eek.26 for ; Mon, 06 Aug 2012 07:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=USYpGIiSNKLpp+KRusWbpAA/QAu+G/dsiBtrA2izd4w=; b=H4HxC9cuiTwGOF7bSyiAabFu5IspUWbPgYbWmirOgDJg94WKnHZLXVGR5SdHeD50Y1 uNvmq4mL7IhR1fzIn3tIRT0s+EwFMcnwSlevxqdYHvhIzWlrYFE4uWUIWYUFWIh7NEYB PlsSM5EmkqUgJEVC+oJiZp3pOqJP9RXrgpXoy28gWl7xBYZto8lrdOdzWfQwNStAiyx9 YNtQ0jSPk0aq9Zt1z02viuy4+9PItVp/kQuTeYHfPW7BitWXr2MqA9P/UBsvVRmEEjjF 8C8mKD+OigVh1gHIIV18vbMt7rI0dHMpR9BJQCfgnkih3/Rqi0QCs33h9onrSE4Zxjus OzJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:x-gm-message-state; bh=USYpGIiSNKLpp+KRusWbpAA/QAu+G/dsiBtrA2izd4w=; b=X74RwV7DUyDgFb7xkuyOHZil+TW2dO7HmqAuRU+eHilDxfT/QaZmYUVRHRi8NkY5bG I725VIUaz7NaqisILO/lLijjIWEmBemRjfpKD2Ovgx/6DUsnVEB0SEVJ5F+x+PJJy2z2 FPj19+t8gJgByFIAcuZfqCVPUkRxGt/QKkRy3k+yZYcofmX+h3asH/GNEIo97CRYtrMF j44/UWAci32Q2w1jsWGasDQo0IkfNdm980UNIteWQ5GMB4Vhvatsew52xLbHXtrl0fpZ bAUPd3ZrTKqZGYlSQt7INmTjvC6FZdwK8HrBdgtdSbIwOgyi6AH8IzdFWYdghn8WR4Ot H3SA== Received: by 10.14.181.137 with SMTP id l9mr13173133eem.28.1344262821318; Mon, 06 Aug 2012 07:20:21 -0700 (PDT) Received: by 10.14.181.137 with SMTP id l9mr13173119eem.28.1344262821187; Mon, 06 Aug 2012 07:20:21 -0700 (PDT) Received: from mpn-glaptop.corp.google.com (dhcp-172-16-75-225.zrh.corp.google.com [172.16.75.225]) by mx.google.com with ESMTPS id j4sm48042780eeo.11.2012.08.06.07.20.19 (version=SSLv3 cipher=OTHER); Mon, 06 Aug 2012 07:20:20 -0700 (PDT) From: Michal Nazarewicz To: notmuch@notmuchmail.org Subject: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option Date: Mon, 6 Aug 2012 16:20:11 +0200 Message-Id: <7c2931eb4d34ff78e4c73d721bc00dc60d185e6a.1344260116.git.mina86@mina86.com> X-Mailer: git-send-email 1.7.7.3 X-Gm-Message-State: ALoCoQljXK12dEABzPfFtj2/1Yt6X/H+TDMtckBkggNenJcr7EtRAQ2hlckvwF8yEJcTRxash4ppQE6XZi6cn6IrDCTTSSLwbLzFDnA2ZF3Dk9V4M3kjbfXeDYdkU41ypmqpWslTOG1cXnsFloyGvRTtGsyVGjHTyHdkJ7MyP49hxM9MTt5MK8LP9j1692SPXLxq8Tp5tVBhoRPip/+H8we0AJsMXIHVnw== X-Mailman-Approved-At: Mon, 06 Aug 2012 07:42:46 -0700 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 14:20:28 -0000 From: Michal Nazarewicz Setting `notmuch-show-auto-mark-read' to nil stops notmuch-show from marking the message as read (by removing the unread tag). Inteded for people who like to mark messages read explicitly. --- emacs/notmuch-show.el | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index d318430..85a17b1 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -183,6 +183,14 @@ provided with an MLA argument nor `completing-read' input." notmuch-show-stash-mlarchive-link-alist)) :group 'notmuch-show) +(defcustom notmuch-show-auto-mark-read t + "Whether to automatically mark message as read when it is shown. If +nil, message needs to be marked as read manually for instance by +removing the unread tag." + :type 'boolean + :group 'notmuch-show) + + (defmacro with-current-notmuch-show-message (&rest body) "Evaluate body with current buffer set to the text of current message" `(save-excursion @@ -1374,9 +1382,11 @@ current thread." "Are the headers of the current message visible?" (notmuch-show-get-prop :headers-visible)) -(defun notmuch-show-mark-read () - "Mark the current message as read." - (notmuch-show-tag-message "-unread")) +(defun notmuch-show-mark-read (&optional force) + "Mark the current message as read if FORCE or +`notmuch-show-auto-mark-read' is non-nil." + (when (or force notmuch-show-auto-mark-read) + (notmuch-show-tag-message "-unread"))) ;; Functions for getting attributes of several messages in the current ;; thread. -- 1.7.7.3