From: Jani Nikula Date: Tue, 31 Jan 2012 17:29:06 +0000 (+0200) Subject: [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ca008ac3c6256e299f97f71382033bf3ccdb673e;p=notmuch-archives.git [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more consistent --- diff --git a/73/ee82f22ca52c9e153504991804700febdecc0b b/73/ee82f22ca52c9e153504991804700febdecc0b new file mode 100644 index 000000000..18081a9e0 --- /dev/null +++ b/73/ee82f22ca52c9e153504991804700febdecc0b @@ -0,0 +1,150 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id DFDD7429E5B + for ; Tue, 31 Jan 2012 09:29:22 -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 nYdwTu3KBJIk for ; + Tue, 31 Jan 2012 09:29:12 -0800 (PST) +Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com + [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id AFA4E429E25 + for ; Tue, 31 Jan 2012 09:29:11 -0800 (PST) +Received: by lahd3 with SMTP id d3so155817lah.26 + for ; Tue, 31 Jan 2012 09:29:10 -0800 (PST) +Received: by 10.112.100.200 with SMTP id fa8mr5664250lbb.99.1328030950130; + Tue, 31 Jan 2012 09:29:10 -0800 (PST) +Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi. + [84.248.80.253]) + by mx.google.com with ESMTPS id w8sm17644479lbm.8.2012.01.31.09.29.07 + (version=SSLv3 cipher=OTHER); Tue, 31 Jan 2012 09:29:08 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more + consistent +Date: Tue, 31 Jan 2012 19:29:06 +0200 +Message-Id: <1328030946-9793-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 1.7.5.4 +In-Reply-To: +References: +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 17:29:23 -0000 + +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 +