unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: Michal Nazarewicz <mpn@google.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
Date: Tue, 07 Aug 2012 16:13:40 +0100	[thread overview]
Message-ID: <874noepwez.fsf@qmul.ac.uk> (raw)
In-Reply-To: <7c2931eb4d34ff78e4c73d721bc00dc60d185e6a.1344260116.git.mina86@mina86.com>

On Mon, 06 Aug 2012, Michal Nazarewicz <mpn@google.com> wrote:
> From: Michal Nazarewicz <mina86@mina86.com>
>
> 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")))


As an alternative approach would allowing a list of tags (or even tag
changes) to apply when a message is "read" do what you want and be more
flexible? I am thinking of something roughly analogous to
notmuch-message-replied-tags. I can imagine some people would like to
remove the inbox tag automatically for example. (And since we sync with
maildir flags the exact tag name does matter).


I agree with Austin that the current unread marking is a little
weird/unpredictable (eg notmuch-show-next-message marks a message read
even if it is closed) but I don't think fixing that helps your use.

Best wishes 

Mark

  parent reply	other threads:[~2012-08-07 15:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-06 14:20 [PATCH] notmuch-show: add notmuch-show-auto-mark-read option Michal Nazarewicz
2012-08-06 16:28 ` Austin Clements
2012-08-06 17:17   ` Michal Nazarewicz
2012-08-07 15:13 ` Mark Walters [this message]
2012-08-07 15:32   ` Michal Nazarewicz
2012-08-07 15:49     ` Mark Walters
2012-08-07 15:56       ` Michal Nazarewicz
2012-08-07 16:38       ` Tomi Ollila
2012-08-07 15:51   ` Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874noepwez.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=mpn@google.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).