From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6803C429E5B for ; Tue, 31 Jan 2012 07:14:03 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.612 X-Spam-Level: X-Spam-Status: No, score=0.612 tagged_above=-999 required=5 tests=[GAPPY_SUBJECT=1.312, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dY1P03uOaeyu for ; Tue, 31 Jan 2012 07:14:02 -0800 (PST) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id 165FC429E25 for ; Tue, 31 Jan 2012 07:14:02 -0800 (PST) X-AuditID: 1209190c-b7fad6d000000920-ef-4f2805382222 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 19.B3.02336.835082F4; Tue, 31 Jan 2012 10:14:00 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0VFDxo3029330; Tue, 31 Jan 2012 10:14:00 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0VFDw0b008596 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Tue, 31 Jan 2012 10:13:59 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RsFOL-00047S-6h; Tue, 31 Jan 2012 10:13:05 -0500 Date: Tue, 31 Jan 2012 10:13:05 -0500 From: Austin Clements To: Jani Nikula Subject: Re: [RFC PATCH] emacs: make show view a/A/x/X key bindings more consistent Message-ID: <20120131151305.GB10898@mit.edu> References: <1328022235-8400-1-git-send-email-jani@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1328022235-8400-1-git-send-email-jani@nikula.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjleLIzCtJLcpLzFFi42IRYrdT0bVg1fA3OPDOwKJpurPF9ZszmR2Y PG7df83u8WzVLeYApigum5TUnMyy1CJ9uwSujG0fD7IVfJGraNzwjbmBcbJkFyMnh4SAicTR 9pfMELaYxIV769m6GLk4hAT2MUr8mnaHEcLZwCjRsr2DGcI5ySTxZ8t7VghnCaPEyT3X2ED6 WQRUJU63HwWbxSagIbFt/3JGEFtEQFFi88n9YDazgLTEt9/NTCC2sECoxMJHx4HiHBy8AjoS b48FgoSFBOwkWhu6wMbwCghKnJz5hAWiVUvixr+XTCDlIGOW/+MACXMK2Eu0HFoCViIqoCIx 5eQ2tgmMQrOQdM9C0j0LoXsBI/MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXUO93MwSvdSU0k2M oKDmlOTZwfjmoNIhRgEORiUe3p3v1fyFWBPLiitzDzFKcjApifLKsmj4C/El5adUZiQWZ8QX leakFh9ilOBgVhLhfbMaqJw3JbGyKrUoHyYlzcGiJM6rovXOT0ggPbEkNTs1tSC1CCYrw8Gh JMGbDTJUsCg1PbUiLTOnBCHNxMEJMpwHaPg1ZqAa3uKCxNzizHSI/ClGXY72t7vPMwqx5OXn pUqJ8xaCDBIAKcoozYObA0tGrxjFgd4S5g0AqeIBJjK4Sa+AljABLXnOoAqypCQRISXVwOiu PYG1794v4cZZbQtlGxfpVr95JrJBveveEhYuTdma3cuzy0K1fDrbHl/J/9H4lU/jyE13JtFg jSdH8tJVlzZ93JtdZXBvc4dlpZWP3gufs3xG05XP7v+bfn+HrZVUonAm3yfWoocqAV1fvh54 sXaLwjnNjstPFRPr7/pt3uSy1myWEYveZCWW4oxEQy3mouJEADJXbuwhAwAA Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 15:14:03 -0000 Quoth Jani Nikula on Jan 31 at 5:03 pm: > Proposal for show view a/A/x/X key bindings, according to > http://titanpad.com/SA39EbNezU and IRC discussion: > > '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. > > IMHO these changes would make the current implementation more > consistent in two ways: 1) 'a'/'A' would advance to next thread like > 'a' used to do, 2) 'x' would operate on messages and 'X' on threads > like 'a'/'A' do now. +1 to the proposal. I don't know the maze of twisty little passages that implement the show bindings well enough to say if the code is right. > The implementation here is hacky at best, and I agree with dme that > notmuch-show.el could use some code cleanup and provide > non-interactive primitives. However I won't have the time and energy > for that right now. > --- > emacs/notmuch-show.el | 26 ++++++++++++++++++++------ > 1 files changed, 20 insertions(+), 6 deletions(-) > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index de9421e..62f3664 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-then-exit) > (define-key map "A" 'notmuch-show-archive-thread-then-next) > + (define-key map "a" 'notmuch-show-archive-message-then-next-then-next) notmuch-show-archive-message-then-next-then-next-thread? I like the very explicit names, but "then-next-then-next" is rather opaque. > (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) > @@ -1425,10 +1426,12 @@ buffer." > (if r > (progn > (notmuch-show-mark-read) > - (notmuch-show-message-adjust)) > + (notmuch-show-message-adjust) > + t) > (if pop-at-end > (notmuch-show-next-thread) > - (goto-char (point-max)))))) > + (goto-char (point-max)) > + nil)))) > > (defun notmuch-show-previous-open-message () > "Show the previous open message." > @@ -1645,12 +1648,23 @@ 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-then-exit () > + "Archive the current message, then show the next open message in the current thread. > + > +If at the last message in 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-then-next () > + "Archive the current message, then show the next open message in the current thread. > + > +If at the last message in 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)