unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] contrib: pick: archive message updated
@ 2012-12-08 12:41 Mark Walters
  2012-12-15 14:34 ` Tomi Ollila
  2012-12-15 18:35 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Walters @ 2012-12-08 12:41 UTC (permalink / raw)
  To: notmuch

Update pick's archive message to respect notmuch-archive-tags. Also
split archive message into an archiving part and a separate
"then-next" part, to move more inline with show. Update the keybinding
so default behaviour is unchanged.
---

Notmuch pick had fallen behind show so update.

Best wishes 

Mark


 contrib/notmuch-pick/notmuch-pick.el |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index 755cbbc..36587a6 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -173,7 +173,7 @@
     (define-key map "q" 'notmuch-pick-quit)
     (define-key map "x" 'notmuch-pick-quit)
     (define-key map "?" 'notmuch-help)
-    (define-key map "a" 'notmuch-pick-archive-message)
+    (define-key map "a" 'notmuch-pick-archive-message-then-next)
     (define-key map "=" 'notmuch-pick-refresh-view)
     (define-key map "s" 'notmuch-search)
     (define-key map "z" 'notmuch-pick)
@@ -393,10 +393,23 @@ Does NOT change the database."
       (kill-buffer notmuch-pick-message-buffer))
     t))
 
-(defun notmuch-pick-archive-message ()
+(defun notmuch-pick-archive-message (&optional unarchive)
+  "Archive the current message.
+
+Archive the current message by applying the tag changes in
+`notmuch-archive-tags' to it (remove the \"inbox\" tag by
+default). If a prefix argument is given, the message will be
+\"unarchived\", i.e. the tag changes in `notmuch-archive-tags'
+will be reversed."
+  (interactive "P")
+  (when notmuch-archive-tags
+    (apply 'notmuch-pick-tag
+	   (notmuch-tag-change-list notmuch-archive-tags unarchive))))
+
+(defun notmuch-pick-archive-message-then-next (&optional unarchive)
   "Archive the current message and move to next matching message."
-  (interactive)
-  (notmuch-pick-tag "-inbox")
+  (interactive "P")
+  (notmuch-pick-archive-message unarchive)
   (notmuch-pick-next-matching-message))
 
 (defun notmuch-pick-next-message ()
-- 
1.7.9.1

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

* Re: [PATCH] contrib: pick: archive message updated
  2012-12-08 12:41 [PATCH] contrib: pick: archive message updated Mark Walters
@ 2012-12-15 14:34 ` Tomi Ollila
  2012-12-15 18:35 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2012-12-15 14:34 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Sat, Dec 08 2012, Mark Walters <markwalters1009@gmail.com> wrote:

> Update pick's archive message to respect notmuch-archive-tags. Also
> split archive message into an archiving part and a separate
> "then-next" part, to move more inline with show. Update the keybinding
> so default behaviour is unchanged.
> ---

LGTM.

Tomi


>
> Notmuch pick had fallen behind show so update.
>
> Best wishes 
>
> Mark
>
>
>  contrib/notmuch-pick/notmuch-pick.el |   21 +++++++++++++++++----
>  1 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
> index 755cbbc..36587a6 100644
> --- a/contrib/notmuch-pick/notmuch-pick.el
> +++ b/contrib/notmuch-pick/notmuch-pick.el
> @@ -173,7 +173,7 @@
>      (define-key map "q" 'notmuch-pick-quit)
>      (define-key map "x" 'notmuch-pick-quit)
>      (define-key map "?" 'notmuch-help)
> -    (define-key map "a" 'notmuch-pick-archive-message)
> +    (define-key map "a" 'notmuch-pick-archive-message-then-next)
>      (define-key map "=" 'notmuch-pick-refresh-view)
>      (define-key map "s" 'notmuch-search)
>      (define-key map "z" 'notmuch-pick)
> @@ -393,10 +393,23 @@ Does NOT change the database."
>        (kill-buffer notmuch-pick-message-buffer))
>      t))
>  
> -(defun notmuch-pick-archive-message ()
> +(defun notmuch-pick-archive-message (&optional unarchive)
> +  "Archive the current message.
> +
> +Archive the current message by applying the tag changes in
> +`notmuch-archive-tags' to it (remove the \"inbox\" tag by
> +default). If a prefix argument is given, the message will be
> +\"unarchived\", i.e. the tag changes in `notmuch-archive-tags'
> +will be reversed."
> +  (interactive "P")
> +  (when notmuch-archive-tags
> +    (apply 'notmuch-pick-tag
> +	   (notmuch-tag-change-list notmuch-archive-tags unarchive))))
> +
> +(defun notmuch-pick-archive-message-then-next (&optional unarchive)
>    "Archive the current message and move to next matching message."
> -  (interactive)
> -  (notmuch-pick-tag "-inbox")
> +  (interactive "P")
> +  (notmuch-pick-archive-message unarchive)
>    (notmuch-pick-next-matching-message))
>  
>  (defun notmuch-pick-next-message ()
> -- 
> 1.7.9.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] contrib: pick: archive message updated
  2012-12-08 12:41 [PATCH] contrib: pick: archive message updated Mark Walters
  2012-12-15 14:34 ` Tomi Ollila
@ 2012-12-15 18:35 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2012-12-15 18:35 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> Update pick's archive message to respect notmuch-archive-tags. Also
> split archive message into an archiving part and a separate
> "then-next" part, to move more inline with show. Update the keybinding
> so default behaviour is unchanged.
> ---

pushed, 

d

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

end of thread, other threads:[~2012-12-15 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-08 12:41 [PATCH] contrib: pick: archive message updated Mark Walters
2012-12-15 14:34 ` Tomi Ollila
2012-12-15 18:35 ` David Bremner

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