unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent
       [not found] <id:1328022235-8400-1-git-send-email-jani@nikula.org>
@ 2012-01-31 17:29 ` Jani Nikula
  2012-01-31 23:17   ` Dmitry Kurochkin
                     ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jani Nikula @ 2012-01-31 17:29 UTC (permalink / raw)
  To: notmuch

Modify the show view key bindings as follows to make them more
consistent:

'a' = Archive current message, then move to next message, or show next
thread from search if at the last message in thread.

'A' = Archive each message in thread, then show next thread from
search.

'x' = Archive current message, then move to next message, or exit back
to search results if at the last message in thread.

'X' = Archive each message in thread, then exit back to search
results.

The changes make the key bindings more consistent in two ways:
1) 'a'/'A' both advance to the next thread like 'a' used to.
2) 'x' operates on messages and 'X' on threads like 'a'/'A'.

---

The original proposal with some discussion is at
http://titanpad.com/SA39EbNezU.

This v2 is merely a slightly polished version of the original. There
will be no further contributions on the subject from me.
---
 emacs/notmuch-show.el |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index de9421e..57830b6 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1075,9 +1075,10 @@ thread id.  If a prefix is given, crypto processing is toggled."
 	(define-key map "h" 'notmuch-show-toggle-headers)
 	(define-key map "-" 'notmuch-show-remove-tag)
 	(define-key map "+" 'notmuch-show-add-tag)
-	(define-key map "x" 'notmuch-show-archive-thread-then-exit)
-	(define-key map "a" 'notmuch-show-archive-message-then-next)
+	(define-key map "X" 'notmuch-show-archive-thread-then-exit)
+	(define-key map "x" 'notmuch-show-archive-message-then-next-or-exit)
 	(define-key map "A" 'notmuch-show-archive-thread-then-next)
+	(define-key map "a" 'notmuch-show-archive-message-then-next-or-next-thread)
 	(define-key map "N" 'notmuch-show-next-message)
 	(define-key map "P" 'notmuch-show-previous-message)
 	(define-key map "n" 'notmuch-show-next-open-message)
@@ -1417,7 +1418,8 @@ thread, navigate to the next thread in the parent search buffer."
 
 If a prefix argument is given and this is the last open message
 in the thread, navigate to the next thread in the parent search
-buffer."
+buffer. Return t if there was a next open message in the thread
+to show, nil otherwise."
   (interactive "P")
   (let (r)
     (while (and (setq r (notmuch-show-goto-message-next))
@@ -1428,7 +1430,8 @@ buffer."
 	  (notmuch-show-message-adjust))
       (if pop-at-end
 	  (notmuch-show-next-thread)
-	(goto-char (point-max))))))
+	(goto-char (point-max))))
+    r))
 
 (defun notmuch-show-previous-open-message ()
   "Show the previous open message."
@@ -1645,12 +1648,25 @@ removed)."
       (notmuch-show-add-tag "inbox")
     (notmuch-show-remove-tag "inbox")))
 
-(defun notmuch-show-archive-message-then-next ()
-  "Archive the current message, then show the next open message in the current thread."
+(defun notmuch-show-archive-message-then-next-or-exit ()
+  "Archive the current message, then show the next open message in the current thread.
+
+If at the last open message in the current thread, then exit back
+to search results."
   (interactive)
   (notmuch-show-archive-message)
   (notmuch-show-next-open-message t))
 
+(defun notmuch-show-archive-message-then-next-or-next-thread ()
+  "Archive the current message, then show the next open message in the current thread.
+
+If at the last open message in the current thread, then show next
+thread from search."
+  (interactive)
+  (notmuch-show-archive-message)
+  (unless (notmuch-show-next-open-message)
+    (notmuch-show-next-thread t)))
+
 (defun notmuch-show-stash-cc ()
   "Copy CC field of current message to kill-ring."
   (interactive)
-- 
1.7.5.4

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

* Re: [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent
  2012-01-31 17:29 ` [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent Jani Nikula
@ 2012-01-31 23:17   ` Dmitry Kurochkin
  2012-02-03 12:45   ` Tomi Ollila
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Dmitry Kurochkin @ 2012-01-31 23:17 UTC (permalink / raw)
  To: Jani Nikula, notmuch

On Tue, 31 Jan 2012 19:29:06 +0200, Jani Nikula <jani@nikula.org> wrote:
> Modify the show view key bindings as follows to make them more
> consistent:
> 
> 'a' = Archive current message, then move to next message, or show next
> thread from search if at the last message in thread.
> 
> 'A' = Archive each message in thread, then show next thread from
> search.
> 
> 'x' = Archive current message, then move to next message, or exit back
> to search results if at the last message in thread.
> 
> 'X' = Archive each message in thread, then exit back to search
> results.
> 
> The changes make the key bindings more consistent in two ways:
> 1) 'a'/'A' both advance to the next thread like 'a' used to.
> 2) 'x' operates on messages and 'X' on threads like 'a'/'A'.
> 
> ---
> 
> The original proposal with some discussion is at
> http://titanpad.com/SA39EbNezU.
> 
> This v2 is merely a slightly polished version of the original. There
> will be no further contributions on the subject from me.
> ---

Looks good to me.

Regards,
  Dmitry

>  emacs/notmuch-show.el |   28 ++++++++++++++++++++++------
>  1 files changed, 22 insertions(+), 6 deletions(-)
> 
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index de9421e..57830b6 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1075,9 +1075,10 @@ thread id.  If a prefix is given, crypto processing is toggled."
>  	(define-key map "h" 'notmuch-show-toggle-headers)
>  	(define-key map "-" 'notmuch-show-remove-tag)
>  	(define-key map "+" 'notmuch-show-add-tag)
> -	(define-key map "x" 'notmuch-show-archive-thread-then-exit)
> -	(define-key map "a" 'notmuch-show-archive-message-then-next)
> +	(define-key map "X" 'notmuch-show-archive-thread-then-exit)
> +	(define-key map "x" 'notmuch-show-archive-message-then-next-or-exit)
>  	(define-key map "A" 'notmuch-show-archive-thread-then-next)
> +	(define-key map "a" 'notmuch-show-archive-message-then-next-or-next-thread)
>  	(define-key map "N" 'notmuch-show-next-message)
>  	(define-key map "P" 'notmuch-show-previous-message)
>  	(define-key map "n" 'notmuch-show-next-open-message)
> @@ -1417,7 +1418,8 @@ thread, navigate to the next thread in the parent search buffer."
>  
>  If a prefix argument is given and this is the last open message
>  in the thread, navigate to the next thread in the parent search
> -buffer."
> +buffer. Return t if there was a next open message in the thread
> +to show, nil otherwise."
>    (interactive "P")
>    (let (r)
>      (while (and (setq r (notmuch-show-goto-message-next))
> @@ -1428,7 +1430,8 @@ buffer."
>  	  (notmuch-show-message-adjust))
>        (if pop-at-end
>  	  (notmuch-show-next-thread)
> -	(goto-char (point-max))))))
> +	(goto-char (point-max))))
> +    r))
>  
>  (defun notmuch-show-previous-open-message ()
>    "Show the previous open message."
> @@ -1645,12 +1648,25 @@ removed)."
>        (notmuch-show-add-tag "inbox")
>      (notmuch-show-remove-tag "inbox")))
>  
> -(defun notmuch-show-archive-message-then-next ()
> -  "Archive the current message, then show the next open message in the current thread."
> +(defun notmuch-show-archive-message-then-next-or-exit ()
> +  "Archive the current message, then show the next open message in the current thread.
> +
> +If at the last open message in the current thread, then exit back
> +to search results."
>    (interactive)
>    (notmuch-show-archive-message)
>    (notmuch-show-next-open-message t))
>  
> +(defun notmuch-show-archive-message-then-next-or-next-thread ()
> +  "Archive the current message, then show the next open message in the current thread.
> +
> +If at the last open message in the current thread, then show next
> +thread from search."
> +  (interactive)
> +  (notmuch-show-archive-message)
> +  (unless (notmuch-show-next-open-message)
> +    (notmuch-show-next-thread t)))
> +
>  (defun notmuch-show-stash-cc ()
>    "Copy CC field of current message to kill-ring."
>    (interactive)
> -- 
> 1.7.5.4
> 
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent
  2012-01-31 17:29 ` [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent Jani Nikula
  2012-01-31 23:17   ` Dmitry Kurochkin
@ 2012-02-03 12:45   ` Tomi Ollila
  2012-02-04 19:52   ` David Bremner
  2012-02-08 17:37   ` David Bremner
  3 siblings, 0 replies; 5+ messages in thread
From: Tomi Ollila @ 2012-02-03 12:45 UTC (permalink / raw)
  To: Jani Nikula, notmuch

On Tue, 31 Jan 2012 19:29:06 +0200, Jani Nikula <jani@nikula.org> wrote:
> Modify the show view key bindings as follows to make them more
> consistent:
> 
> 'a' = Archive current message, then move to next message, or show next
> thread from search if at the last message in thread.
> 
> 'A' = Archive each message in thread, then show next thread from
> search.
> 
> 'x' = Archive current message, then move to next message, or exit back
> to search results if at the last message in thread.
> 
> 'X' = Archive each message in thread, then exit back to search
> results.
> 
> The changes make the key bindings more consistent in two ways:
> 1) 'a'/'A' both advance to the next thread like 'a' used to.
> 2) 'x' operates on messages and 'X' on threads like 'a'/'A'.
> 
> ---

+1 for the time being -- quickly after this patch has been pushed
way to avoid 'next-thread' MAGIC in 'a' and 'A' needs to be implemented...
but that should not hinder pushing this patch.

Tomi

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

* Re: [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent
  2012-01-31 17:29 ` [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent Jani Nikula
  2012-01-31 23:17   ` Dmitry Kurochkin
  2012-02-03 12:45   ` Tomi Ollila
@ 2012-02-04 19:52   ` David Bremner
  2012-02-08 17:37   ` David Bremner
  3 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2012-02-04 19:52 UTC (permalink / raw)
  To: Jani Nikula, notmuch

On Tue, 31 Jan 2012 19:29:06 +0200, Jani Nikula <jani@nikula.org> wrote:
> Modify the show view key bindings as follows to make them more
> consistent:

Last chance for objections...

d

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

* Re: [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent
  2012-01-31 17:29 ` [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent Jani Nikula
                     ` (2 preceding siblings ...)
  2012-02-04 19:52   ` David Bremner
@ 2012-02-08 17:37   ` David Bremner
  3 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2012-02-08 17:37 UTC (permalink / raw)
  To: Jani Nikula, notmuch

On Tue, 31 Jan 2012 19:29:06 +0200, Jani Nikula <jani@nikula.org> wrote:
> Modify the show view key bindings as follows to make them more
> consistent:

Cry havoc, and let loose the dogs of bikeshedding. Err, I mean, pushed.

d

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

end of thread, other threads:[~2012-02-08 17:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <id:1328022235-8400-1-git-send-email-jani@nikula.org>
2012-01-31 17:29 ` [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent Jani Nikula
2012-01-31 23:17   ` Dmitry Kurochkin
2012-02-03 12:45   ` Tomi Ollila
2012-02-04 19:52   ` David Bremner
2012-02-08 17:37   ` 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).