From: Jani Nikula Date: Tue, 31 Jan 2012 15:03:55 +0000 (+0200) Subject: [RFC PATCH] 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=fe4d6f8a6d5c4e819a54101f7de26ddbe70e4369;p=notmuch-archives.git [RFC PATCH] emacs: make show view a/A/x/X key bindings more consistent --- diff --git a/01/e12084111d898160963c87182aefa29bac94aa b/01/e12084111d898160963c87182aefa29bac94aa new file mode 100644 index 000000000..7bd207098 --- /dev/null +++ b/01/e12084111d898160963c87182aefa29bac94aa @@ -0,0 +1,139 @@ +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 D7333429E5B + for ; Tue, 31 Jan 2012 07:04:05 -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 Bk0FF8gkklVw for ; + Tue, 31 Jan 2012 07:04:04 -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 65FAD429E25 + for ; Tue, 31 Jan 2012 07:04:04 -0800 (PST) +Received: by lahd3 with SMTP id d3so46149lah.26 + for ; Tue, 31 Jan 2012 07:04:01 -0800 (PST) +Received: by 10.152.148.106 with SMTP id tr10mr11481837lab.41.1328022241085; + Tue, 31 Jan 2012 07:04:01 -0800 (PST) +Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi. + [84.248.80.253]) + by mx.google.com with ESMTPS id l19sm17298864lbv.12.2012.01.31.07.03.58 + (version=SSLv3 cipher=OTHER); Tue, 31 Jan 2012 07:03:59 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [RFC PATCH] emacs: make show view a/A/x/X key bindings more + consistent +Date: Tue, 31 Jan 2012 17:03:55 +0200 +Message-Id: <1328022235-8400-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 1.7.5.4 +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:04:06 -0000 + +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. + +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) + (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) +-- +1.7.5.4 +