Re: [RFC PATCH] emacs: make show view a/A/x/X key bindings more consistent
authorAustin Clements <amdragon@MIT.EDU>
Tue, 31 Jan 2012 15:13:05 +0000 (10:13 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:50 +0000 (09:43 -0800)
63/128e960405eb9a7834fd43c62f36463226e732 [new file with mode: 0644]

diff --git a/63/128e960405eb9a7834fd43c62f36463226e732 b/63/128e960405eb9a7834fd43c62f36463226e732
new file mode 100644 (file)
index 0000000..c4ccc05
--- /dev/null
@@ -0,0 +1,172 @@
+Return-Path: <amdragon@mit.edu>\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 6803C429E5B\r
+       for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 07:14:03 -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 dY1P03uOaeyu for <notmuch@notmuchmail.org>;\r
+       Tue, 31 Jan 2012 07:14:02 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
+       [18.9.25.12])\r
+       by olra.theworths.org (Postfix) with ESMTP id 165FC429E25\r
+       for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 07:14:02 -0800 (PST)\r
+X-AuditID: 1209190c-b7fad6d000000920-ef-4f2805382222\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+       by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 19.B3.02336.835082F4; Tue, 31 Jan 2012 10:14:00 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0VFDxo3029330; \r
+       Tue, 31 Jan 2012 10:14:00 -0500\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0VFDw0b008596\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Tue, 31 Jan 2012 10:13:59 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1RsFOL-00047S-6h; Tue, 31 Jan 2012 10:13:05 -0500\r
+Date: Tue, 31 Jan 2012 10:13:05 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Jani Nikula <jani@nikula.org>\r
+Subject: Re: [RFC PATCH] emacs: make show view a/A/x/X key bindings more\r
+       consistent\r
+Message-ID: <20120131151305.GB10898@mit.edu>\r
+References: <1328022235-8400-1-git-send-email-jani@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1328022235-8400-1-git-send-email-jani@nikula.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFupjleLIzCtJLcpLzFFi42IRYrdT0bVg1fA3OPDOwKJpurPF9ZszmR2Y\r
+       PG7df83u8WzVLeYApigum5TUnMyy1CJ9uwSujG0fD7IVfJGraNzwjbmBcbJkFyMnh4SAicTR\r
+       9pfMELaYxIV769m6GLk4hAT2MUr8mnaHEcLZwCjRsr2DGcI5ySTxZ8t7VghnCaPEyT3X2ED6\r
+       WQRUJU63HwWbxSagIbFt/3JGEFtEQFFi88n9YDazgLTEt9/NTCC2sECoxMJHx4HiHBy8AjoS\r
+       b48FgoSFBOwkWhu6wMbwCghKnJz5hAWiVUvixr+XTCDlIGOW/+MACXMK2Eu0HFoCViIqoCIx\r
+       5eQ2tgmMQrOQdM9C0j0LoXsBI/MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXUO93MwSvdSU0k2M\r
+       oKDmlOTZwfjmoNIhRgEORiUe3p3v1fyFWBPLiitzDzFKcjApifLKsmj4C/El5adUZiQWZ8QX\r
+       leakFh9ilOBgVhLhfbMaqJw3JbGyKrUoHyYlzcGiJM6rovXOT0ggPbEkNTs1tSC1CCYrw8Gh\r
+       JMGbDTJUsCg1PbUiLTOnBCHNxMEJMpwHaPg1ZqAa3uKCxNzizHSI/ClGXY72t7vPMwqx5OXn\r
+       pUqJ8xaCDBIAKcoozYObA0tGrxjFgd4S5g0AqeIBJjK4Sa+AljABLXnOoAqypCQRISXVwOiu\r
+       PYG1794v4cZZbQtlGxfpVr95JrJBveveEhYuTdma3cuzy0K1fDrbHl/J/9H4lU/jyE13JtFg\r
+       jSdH8tJVlzZ93JtdZXBvc4dlpZWP3gufs3xG05XP7v+bfn+HrZVUonAm3yfWoocqAV1fvh54\r
+       sXaLwjnNjstPFRPr7/pt3uSy1myWEYveZCWW4oxEQy3mouJEADJXbuwhAwAA\r
+Cc: notmuch@notmuchmail.org\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:14:03 -0000\r
+\r
+Quoth Jani Nikula on Jan 31 at  5:03 pm:\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
++1 to the proposal.  I don't know the maze of twisty little passages\r
+that implement the show bindings well enough to say if the code is\r
+right.\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
+\r
+notmuch-show-archive-message-then-next-then-next-thread?  I like the\r
+very explicit names, but "then-next-then-next" is rather opaque.\r
+\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