[PATCH 4/4] emacs: Bind MIME part commands to "." submap
authorAustin Clements <amdragon@MIT.EDU>
Mon, 27 May 2013 20:46:34 +0000 (16:46 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:55:06 +0000 (09:55 -0800)
e4/9eeab716723f23f59bf923475be6696febdc6e [new file with mode: 0644]

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