[RFC PATCH] emacs: make show view a/A/x/X key bindings more consistent
authorJani Nikula <jani@nikula.org>
Tue, 31 Jan 2012 15:03:55 +0000 (17:03 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:49 +0000 (09:43 -0800)
01/e12084111d898160963c87182aefa29bac94aa [new file with mode: 0644]

diff --git a/01/e12084111d898160963c87182aefa29bac94aa b/01/e12084111d898160963c87182aefa29bac94aa
new file mode 100644 (file)
index 0000000..7bd2070
--- /dev/null
@@ -0,0 +1,139 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D7333429E5B\r
+       for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 07:04:05 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.612\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.612 tagged_above=-999 required=5\r
+       tests=[GAPPY_SUBJECT=1.312, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Bk0FF8gkklVw for <notmuch@notmuchmail.org>;\r
+       Tue, 31 Jan 2012 07:04:04 -0800 (PST)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+       [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 65FAD429E25\r
+       for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 07:04:04 -0800 (PST)\r
+Received: by lahd3 with SMTP id d3so46149lah.26\r
+       for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 07:04:01 -0800 (PST)\r
+Received: by 10.152.148.106 with SMTP id tr10mr11481837lab.41.1328022241085;\r
+       Tue, 31 Jan 2012 07:04:01 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi.\r
+       [84.248.80.253])\r
+       by mx.google.com with ESMTPS id l19sm17298864lbv.12.2012.01.31.07.03.58\r
+       (version=SSLv3 cipher=OTHER); Tue, 31 Jan 2012 07:03:59 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC PATCH] emacs: make show view a/A/x/X key bindings more\r
+ consistent\r
+Date: Tue, 31 Jan 2012 17:03:55 +0200\r
+Message-Id: <1328022235-8400-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 31 Jan 2012 15:04:06 -0000\r
+\r
+Proposal for show view a/A/x/X key bindings, according to\r
+http://titanpad.com/SA39EbNezU and IRC discussion:\r
+\r
+'a' = Archive current message, then move to next message, or show next\r
+thread from search if at the last message in thread.\r
+\r
+'A' = Archive each message in thread, then show next thread from\r
+search.\r
+\r
+'x' = Archive current message, then move to next message, or exit back\r
+to search results if at the last message in thread.\r
+\r
+'X' = Archive each message in thread, then exit back to search\r
+results.\r
+\r
+IMHO these changes would make the current implementation more\r
+consistent in two ways: 1) 'a'/'A' would advance to next thread like\r
+'a' used to do, 2) 'x' would operate on messages and 'X' on threads\r
+like 'a'/'A' do now.\r
+\r
+The implementation here is hacky at best, and I agree with dme that\r
+notmuch-show.el could use some code cleanup and provide\r
+non-interactive primitives. However I won't have the time and energy\r
+for that right now.\r
+---\r
+ emacs/notmuch-show.el |   26 ++++++++++++++++++++------\r
+ 1 files changed, 20 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index de9421e..62f3664 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1075,9 +1075,10 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
+       (define-key map "h" 'notmuch-show-toggle-headers)\r
+       (define-key map "-" 'notmuch-show-remove-tag)\r
+       (define-key map "+" 'notmuch-show-add-tag)\r
+-      (define-key map "x" 'notmuch-show-archive-thread-then-exit)\r
+-      (define-key map "a" 'notmuch-show-archive-message-then-next)\r
++      (define-key map "X" 'notmuch-show-archive-thread-then-exit)\r
++      (define-key map "x" 'notmuch-show-archive-message-then-next-then-exit)\r
+       (define-key map "A" 'notmuch-show-archive-thread-then-next)\r
++      (define-key map "a" 'notmuch-show-archive-message-then-next-then-next)\r
+       (define-key map "N" 'notmuch-show-next-message)\r
+       (define-key map "P" 'notmuch-show-previous-message)\r
+       (define-key map "n" 'notmuch-show-next-open-message)\r
+@@ -1425,10 +1426,12 @@ buffer."\r
+     (if r\r
+       (progn\r
+         (notmuch-show-mark-read)\r
+-        (notmuch-show-message-adjust))\r
++        (notmuch-show-message-adjust)\r
++        t)\r
+       (if pop-at-end\r
+         (notmuch-show-next-thread)\r
+-      (goto-char (point-max))))))\r
++      (goto-char (point-max))\r
++      nil))))\r
+ \r
+ (defun notmuch-show-previous-open-message ()\r
+   "Show the previous open message."\r
+@@ -1645,12 +1648,23 @@ removed)."\r
+       (notmuch-show-add-tag "inbox")\r
+     (notmuch-show-remove-tag "inbox")))\r
+ \r
+-(defun notmuch-show-archive-message-then-next ()\r
+-  "Archive the current message, then show the next open message in the current thread."\r
++(defun notmuch-show-archive-message-then-next-then-exit ()\r
++  "Archive the current message, then show the next open message in the current thread.\r
++\r
++If at the last message in thread, then exit back to search results."\r
+   (interactive)\r
+   (notmuch-show-archive-message)\r
+   (notmuch-show-next-open-message t))\r
+ \r
++(defun notmuch-show-archive-message-then-next-then-next ()\r
++  "Archive the current message, then show the next open message in the current thread.\r
++\r
++If at the last message in thread, then show next thread from search."\r
++  (interactive)\r
++  (notmuch-show-archive-message)\r
++  (unless (notmuch-show-next-open-message)\r
++    (notmuch-show-next-thread t)))\r
++\r
+ (defun notmuch-show-stash-cc ()\r
+   "Copy CC field of current message to kill-ring."\r
+   (interactive)\r
+-- \r
+1.7.5.4\r
+\r