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 AA1A2431FD6 for ; Mon, 27 May 2013 13:47:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 jAtF+RcS5bsy for ; Mon, 27 May 2013 13:46:55 -0700 (PDT) Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id 4A15D431FBF for ; Mon, 27 May 2013 13:46:50 -0700 (PDT) X-AuditID: 12074422-b7f5b6d00000095d-85-51a3c63828a2 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id D2.3B.02397.836C3A15; Mon, 27 May 2013 16:46:48 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH-1.MIT.EDU [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id r4RKkgsf002376; Mon, 27 May 2013 16:46:43 -0400 Received: from drake.dyndns.org (c-76-21-105-205.hsd1.ca.comcast.net [76.21.105.205]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r4RKkeMI026425 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 27 May 2013 16:46:42 -0400 Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1Uh4JU-0008NH-0v; Mon, 27 May 2013 16:46:40 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 4/4] emacs: Bind MIME part commands to "." submap Date: Mon, 27 May 2013 16:46:34 -0400 Message-Id: <1369687594-31774-5-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369687594-31774-1-git-send-email-amdragon@mit.edu> References: <1369687594-31774-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsUixG6nomtxbHGgwc/1ohar5/JYXL85k9mB yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyli79DdLQadoRUd/I0sD40nBLkZODgkBE4lF CxazQNhiEhfurWfrYuTiEBLYxyix5s9WVghnI6PEj92b2CGc00wSWx58ZAJpERKYyyjR3u0P YrMJaEhs27+cEcQWEZCW2Hl3NiuIzSzgKPF5/yI2EFsYyL65/hlYDYuAqsTZme3sIDavgIPE 2T9rGCHOUJTofjYBrJ4TqP7Krt+sELscJFa/7mCawMi/gJFhFaNsSm6Vbm5iZk5xarJucXJi Xl5qka6pXm5miV5qSukmRnAguSjtYPx5UOkQowAHoxIPr0Xm4kAh1sSy4srcQ4ySHExKorzs R4BCfEn5KZUZicUZ8UWlOanFhxglOJiVRHi3rwDK8aYkVlalFuXDpKQ5WJTEea+l3PQXEkhP LEnNTk0tSC2CycpwcChJ8DYdBWoULEpNT61Iy8wpQUgzcXCCDOcBGh4GUsNbXJCYW5yZDpE/ xagoJc6bApIQAElklObB9cIi/RWjONArwrz5IFU8wCQB1/0KaDAT0GBxZrDBJYkIKakGxojr UzLuP3pwR2jazgWH+zmTjss4Hb+e7mFeUlh898yHU7YMuoGmFeGf9NhbJDxs1a583z3b8vYp x4Cf6pJqZ38eW/DKouKtuYSB00rLY/eaKlU/FJzRrjgckGtwe/GRGP2/leda+dumsrxW+pD3 5nCilv4e0YVHrVZ5r5f9xXJb2tFl1yrvw0osxRmJhlrMRcWJABTrFSvPAgAA 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: Mon, 27 May 2013 20:47:03 -0000 Since the part commands are no longer tied to a button, but can be applied with point anywhere within a part, bind the part commands keymap to "." everywhere in the show buffer. This lets you save or view parts without having to navigate to the part button, and is particularly useful for parts that have no button. These key bindings are still available without the prefix when point is over a part button. --- emacs/notmuch-show.el | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index b33d92d..380b144 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -471,17 +471,6 @@ message at DEPTH in the current thread." 'face 'message-mml :supertype 'notmuch-button-type) -(defvar notmuch-show-part-button-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map button-map) - (define-key map "s" 'notmuch-show-save-part) - (define-key map "v" 'notmuch-show-view-part) - (define-key map "o" 'notmuch-show-interactively-view-part) - (define-key map "|" 'notmuch-show-pipe-part) - map) - "Submap for button commands") -(fset 'notmuch-show-part-button-map notmuch-show-part-button-map) - (defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment) (let ((button) (base-label (concat (when name (concat name ": ")) @@ -1195,6 +1184,21 @@ reset based on the original query." "Submap for stash commands") (fset 'notmuch-show-stash-map notmuch-show-stash-map) +(defvar notmuch-show-part-map + (let ((map (make-sparse-keymap))) + (define-key map "s" 'notmuch-show-save-part) + (define-key map "v" 'notmuch-show-view-part) + (define-key map "o" 'notmuch-show-interactively-view-part) + (define-key map "|" 'notmuch-show-pipe-part) + map) + "Submap for part commands") +(fset 'notmuch-show-part-map notmuch-show-part-map) + +(defvar notmuch-show-part-button-map + (make-composed-keymap notmuch-show-part-map button-map) + "Keymap for part button commands") +(fset 'notmuch-show-part-button-map notmuch-show-part-button-map) + (defvar notmuch-show-mode-map (let ((map (make-sparse-keymap))) (define-key map "?" 'notmuch-help) @@ -1237,6 +1241,7 @@ reset based on the original query." (define-key map "$" 'notmuch-show-toggle-process-crypto) (define-key map "<" 'notmuch-show-toggle-thread-indentation) (define-key map "t" 'toggle-truncate-lines) + (define-key map "." 'notmuch-show-part-map) map) "Keymap for \"notmuch show\" buffers.") (fset 'notmuch-show-mode-map notmuch-show-mode-map) -- 1.7.10.4