unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
@ 2012-08-06 14:20 Michal Nazarewicz
  2012-08-06 16:28 ` Austin Clements
  2012-08-07 15:13 ` Mark Walters
  0 siblings, 2 replies; 9+ messages in thread
From: Michal Nazarewicz @ 2012-08-06 14:20 UTC (permalink / raw)
  To: notmuch

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")))
 
 ;; Functions for getting attributes of several messages in the current
 ;; thread.
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Austin Clements @ 2012-08-06 16:28 UTC (permalink / raw)
  To: Michal Nazarewicz; +Cc: notmuch

LGTM, though I wonder: Is this actually what you want, or would you be
happy with automatic read marking if it followed a different pattern
(perhaps a more predictable pattern)?

Quoth Michal Nazarewicz on Aug 06 at  4:20 pm:
> 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")))
>  
>  ;; Functions for getting attributes of several messages in the current
>  ;; thread.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
  2012-08-06 16:28 ` Austin Clements
@ 2012-08-06 17:17   ` Michal Nazarewicz
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Nazarewicz @ 2012-08-06 17:17 UTC (permalink / raw)
  To: Austin Clements; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]

Austin Clements <amdragon@MIT.EDU> writes:
> LGTM, though I wonder: Is this actually what you want, or would you be
> happy with automatic read marking if it followed a different pattern
> (perhaps a more predictable pattern)?

At the moment, I feel that's what I want.  I have a few keys set up for
addings tags like mute or delete, ie.:

     (set-key notmuch-show-mode-map key
              (notmuch-show-tag tag) (notmuch-show-next-thread t))

This adds the tag and opens the next thread, which is great, except
I sometimes don't want to mark the next thread unread.

I have two more shortcut which go to the next thread but one of them
removes unread tag.  This way, this setup does not mean I have to type
more -- I just need to conciously choose whether I want to tag current
message read or not.

> Quoth Michal Nazarewicz on Aug 06 at  4:20 pm:
>> 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.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
  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-07 15:13 ` Mark Walters
  2012-08-07 15:32   ` Michal Nazarewicz
  2012-08-07 15:51   ` Tomi Ollila
  1 sibling, 2 replies; 9+ messages in thread
From: Mark Walters @ 2012-08-07 15:13 UTC (permalink / raw)
  To: Michal Nazarewicz, notmuch

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
  2012-08-07 15:13 ` Mark Walters
@ 2012-08-07 15:32   ` Michal Nazarewicz
  2012-08-07 15:49     ` Mark Walters
  2012-08-07 15:51   ` Tomi Ollila
  1 sibling, 1 reply; 9+ messages in thread
From: Michal Nazarewicz @ 2012-08-07 15:32 UTC (permalink / raw)
  To: Mark Walters, notmuch

[-- Attachment #1: Type: text/plain, Size: 2836 bytes --]

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

Mark Walters <markwalters1009@gmail.com> writes:
> 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?

Something like the following (not tested)?

From: Michal Nazarewicz <mina86@mina86.com>
Date: Mon, 6 Aug 2012 15:31:20 +0200
Subject: [PATCH] notmuch-show: add notmuch-show-mark-read-tags option

The `notmuch-show-mark-read-tags' lists tags that are to be applied when
message is read.  By default, the only value is "-unread" which will remove
the unread tag.  Among other uses, this variable can be used to stop
notmuch-show from modifying tags when message is shown (by setting the
variable to an empty list).
---
 emacs/notmuch-show.el |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index dcfc190..92a4beb 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -183,6 +183,13 @@ provided with an MLA argument nor `completing-read' input."
 	     notmuch-show-stash-mlarchive-link-alist))
   :group 'notmuch-show)
 
+(defcustom notmuch-show-mark-read-tags '("-unread")
+  "List of tags to apply when message is read, ie. shown in notmuch-show
+buffer."
+  :type '(repeat string)
+  :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
@@ -1383,8 +1390,9 @@ current thread."
   (notmuch-show-get-prop :headers-visible))
 
 (defun notmuch-show-mark-read ()
-  "Mark the current message as read."
-  (notmuch-show-tag-message "-unread"))
+  "Apply `notmuch-show-mark-read-tags' to the message."
+  (when notmuch-show-mark-read-tags
+    (apply notmuch-show-tag-message notmuch-show-mark-read-tags)))
 
 ;; Functions for getting attributes of several messages in the current
 ;; thread.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
  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
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Walters @ 2012-08-07 15:49 UTC (permalink / raw)
  To: Michal Nazarewicz, notmuch

On Tue, 07 Aug 2012, Michal Nazarewicz <mpn@google.com> wrote:
>> On Mon, 06 Aug 2012, Michal Nazarewicz <mpn@google.com> wrote:
>>> @@ -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")))
>
> Mark Walters <markwalters1009@gmail.com> writes:
>> 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?
>
> Something like the following (not tested)?

Yes this was what I had in mind. I like this (both the symmetry with
reply tags and the added flexibility) but I will let others
comment. (There is one small bug in your draft: see below)

Best wishes

Mark

> From: Michal Nazarewicz <mina86@mina86.com>
> Date: Mon, 6 Aug 2012 15:31:20 +0200
> Subject: [PATCH] notmuch-show: add notmuch-show-mark-read-tags option
>
> The `notmuch-show-mark-read-tags' lists tags that are to be applied when
> message is read.  By default, the only value is "-unread" which will remove
> the unread tag.  Among other uses, this variable can be used to stop
> notmuch-show from modifying tags when message is shown (by setting the
> variable to an empty list).
> ---
>  emacs/notmuch-show.el |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index dcfc190..92a4beb 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -183,6 +183,13 @@ provided with an MLA argument nor `completing-read' input."
>  	     notmuch-show-stash-mlarchive-link-alist))
>    :group 'notmuch-show)
>  
> +(defcustom notmuch-show-mark-read-tags '("-unread")
> +  "List of tags to apply when message is read, ie. shown in notmuch-show
> +buffer."
> +  :type '(repeat string)
> +  :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
> @@ -1383,8 +1390,9 @@ current thread."
>    (notmuch-show-get-prop :headers-visible))
>  
>  (defun notmuch-show-mark-read ()
> -  "Mark the current message as read."
> -  (notmuch-show-tag-message "-unread"))
> +  "Apply `notmuch-show-mark-read-tags' to the message."
> +  (when notmuch-show-mark-read-tags
> +    (apply notmuch-show-tag-message notmuch-show-mark-read-tags)))

 This needs to be (apply 'notmuch-show-tag-message ...)
>  
>  ;; Functions for getting attributes of several messages in the current
>  ;; thread.
>
> -- 
> Best regards,                                         _     _
> .o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
> ..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
> ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
  2012-08-07 15:13 ` Mark Walters
  2012-08-07 15:32   ` Michal Nazarewicz
@ 2012-08-07 15:51   ` Tomi Ollila
  1 sibling, 0 replies; 9+ messages in thread
From: Tomi Ollila @ 2012-08-07 15:51 UTC (permalink / raw)
  To: Mark Walters, Michal Nazarewicz, notmuch

On Tue, Aug 07 2012, Mark Walters <markwalters1009@gmail.com> wrote:

> 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?

That's a great idea -- better than mine (just a variable which informs
which tag is to be removed) .. something like:

(defcustom notmuch-message-read-tag-changes '("-unread") "docstring" ...)

Then one can have e.g.

'() -- for no tag changes
'("-inbox" "-unread" "+read") 
'("-postilaatikko" "-lukematon" "+luettu") -- the above in finnish.


Tomi


> 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
>
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
  2012-08-07 15:49     ` Mark Walters
@ 2012-08-07 15:56       ` Michal Nazarewicz
  2012-08-07 16:38       ` Tomi Ollila
  1 sibling, 0 replies; 9+ messages in thread
From: Michal Nazarewicz @ 2012-08-07 15:56 UTC (permalink / raw)
  To: Mark Walters, notmuch

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

>> From: Michal Nazarewicz <mina86@mina86.com>
>> @@ -1383,8 +1390,9 @@ current thread."
>>    (notmuch-show-get-prop :headers-visible))
>>  
>>  (defun notmuch-show-mark-read ()
>> -  "Mark the current message as read."
>> -  (notmuch-show-tag-message "-unread"))
>> +  "Apply `notmuch-show-mark-read-tags' to the message."
>> +  (when notmuch-show-mark-read-tags
>> +    (apply notmuch-show-tag-message notmuch-show-mark-read-tags)))

Mark Walters <markwalters1009@gmail.com> writes:
>  This needs to be (apply 'notmuch-show-tag-message ...)

Yes, it would appear you are right. :)

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option
  2012-08-07 15:49     ` Mark Walters
  2012-08-07 15:56       ` Michal Nazarewicz
@ 2012-08-07 16:38       ` Tomi Ollila
  1 sibling, 0 replies; 9+ messages in thread
From: Tomi Ollila @ 2012-08-07 16:38 UTC (permalink / raw)
  To: Mark Walters, Michal Nazarewicz, notmuch

On Tue, Aug 07 2012, Mark Walters <markwalters1009@gmail.com> wrote:

> On Tue, 07 Aug 2012, Michal Nazarewicz <mpn@google.com> wrote:

[ ... ]

>> Mark Walters <markwalters1009@gmail.com> writes:
>>> 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?
>>
>> Something like the following (not tested)?
>
> Yes this was what I had in mind. I like this (both the symmetry with
> reply tags and the added flexibility) but I will let others
> comment. (There is one small bug in your draft: see below)

I like the idea -- and the draft!

>
> Best wishes
>
> Mark

Tomi

>
>> From: Michal Nazarewicz <mina86@mina86.com>
>> Date: Mon, 6 Aug 2012 15:31:20 +0200
>> Subject: [PATCH] notmuch-show: add notmuch-show-mark-read-tags option
>>
>> The `notmuch-show-mark-read-tags' lists tags that are to be applied when
>> message is read.  By default, the only value is "-unread" which will remove
>> the unread tag.  Among other uses, this variable can be used to stop
>> notmuch-show from modifying tags when message is shown (by setting the
>> variable to an empty list).
>> ---
>>  emacs/notmuch-show.el |   12 ++++++++++--
>>  1 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
>> index dcfc190..92a4beb 100644
>> --- a/emacs/notmuch-show.el
>> +++ b/emacs/notmuch-show.el
>> @@ -183,6 +183,13 @@ provided with an MLA argument nor `completing-read' input."
>>  	     notmuch-show-stash-mlarchive-link-alist))
>>    :group 'notmuch-show)
>>  
>> +(defcustom notmuch-show-mark-read-tags '("-unread")
>> +  "List of tags to apply when message is read, ie. shown in notmuch-show
>> +buffer."
>> +  :type '(repeat string)
>> +  :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
>> @@ -1383,8 +1390,9 @@ current thread."
>>    (notmuch-show-get-prop :headers-visible))
>>  
>>  (defun notmuch-show-mark-read ()
>> -  "Mark the current message as read."
>> -  (notmuch-show-tag-message "-unread"))
>> +  "Apply `notmuch-show-mark-read-tags' to the message."
>> +  (when notmuch-show-mark-read-tags
>> +    (apply notmuch-show-tag-message notmuch-show-mark-read-tags)))
>
>  This needs to be (apply 'notmuch-show-tag-message ...)
>>  
>>  ;; Functions for getting attributes of several messages in the current
>>  ;; thread.
>>
>> -- 
>> Best regards,                                         _     _
>> .o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
>> ..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
>> ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-08-07 16:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).