[PATCH v2 4/5] emacs: Bind MIME part commands to "." submap
authorAustin Clements <amdragon@MIT.EDU>
Thu, 30 May 2013 01:13:47 +0000 (21:13 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:55:09 +0000 (09:55 -0800)
7a/f2c8cdff4f8b799c99839d72330f7d694cdef1 [new file with mode: 0644]

diff --git a/7a/f2c8cdff4f8b799c99839d72330f7d694cdef1 b/7a/f2c8cdff4f8b799c99839d72330f7d694cdef1
new file mode 100644 (file)
index 0000000..6e1a8f7
--- /dev/null
@@ -0,0 +1,140 @@
+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 2F323431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 29 May 2013 18:14:20 -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 fdr8zm-u3z5E for <notmuch@notmuchmail.org>;\r
+       Wed, 29 May 2013 18:14:13 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu\r
+       [18.9.25.12])\r
+       by olra.theworths.org (Postfix) with ESMTP id 374F9431FC3\r
+       for <notmuch@notmuchmail.org>; Wed, 29 May 2013 18:14:04 -0700 (PDT)\r
+X-AuditID: 1209190c-b7f566d000004c69-21-51a6a7dad847\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 64.FB.19561.AD7A6A15; Wed, 29 May 2013 21:14:02 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r4U1DtQE015112; \r
+       Wed, 29 May 2013 21:13:56 -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 r4U1Dq0b003010\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Wed, 29 May 2013 21:13:54 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1UhrRA-0003Yw-9m; Wed, 29 May 2013 21:13:52 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 4/5] emacs: Bind MIME part commands to "." submap\r
+Date: Wed, 29 May 2013 21:13:47 -0400\r
+Message-Id: <1369876428-13537-5-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1369876428-13537-1-git-send-email-amdragon@mit.edu>\r
+References: <1369876428-13537-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsUixG6nrntr+bJAg44Jwhar5/JYXL85k9mB\r
+       yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyui71ste0C5WMWvKbeYGxuVCXYycHBICJhI7\r
+       H95nhLDFJC7cW8/WxcjFISSwj1Hi/O+fLBDORkaJpZ/aoDKnmSQe/tnDDuHMZZQ49/MQM0g/\r
+       m4CGxLb9y8FmiQhIS+y8O5sVxGYWcJT4vH8RUDcHh7CAi8THc5IgYRYBVYmOWXcZQcK8Ag4S\r
+       U2eIQVyhKNH9bAIbiM0J1Pm+7TrYRCGgkuZvfUwTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7M\r
+       y0st0jXUy80s0UtNKd3ECAojTkmeHYxvDiodYhTgYFTi4eXUXRYoxJpYVlyZe4hRkoNJSZR3\r
+       zVKgEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRHeNdpAOd6UxMqq1KJ8mJQ0B4uSOO/llJv+QgLp\r
+       iSWp2ampBalFMFkZDg4lCd63y4AaBYtS01Mr0jJzShDSTBycIMN5gIZfBanhLS5IzC3OTIfI\r
+       n2JUlBLn/QySEABJZJTmwfXC4vwVozjQK8K8r0GqeIApAq77FdBgJqDB4syLQQaXJCKkpBoY\r
+       Yw5fqtU6ynz6rcup22L2iydbv9lz6tCE1LM6Lc/VVmSGuFQVJJ3dvnlF0bX66zac3xa+3/+V\r
+       xzkiR3xB15ZrcWVlmmrTtylcPOCUpbbWz6470qfx2oKgM1m190Lfvfpjk6KaoyGpHeZ+RsLL\r
+       4ns3ewrLJSW2VXsbWmurP9ZM/VsbKmYQ8yxdiaU4I9FQi7moOBEAl6+q+c4CAAA=\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: Thu, 30 May 2013 01:14:20 -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.\r
+\r
+This removes the un-prefixed MIME part commands from the part button\r
+keymap, but that's okay because those clashed in annoying ways with\r
+show buffer bindings like "s" for search.  RET on part buttons is\r
+unaffected, which is the most important part button binding.\r
+---\r
+ emacs/notmuch-show.el |   23 +++++++++++------------\r
+ 1 file changed, 11 insertions(+), 12 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 0d9a34c..613e666 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -466,22 +466,10 @@ message at DEPTH in the current thread."\r
\r
+ (define-button-type 'notmuch-show-part-button-type\r
+   'action 'notmuch-show-part-button-default\r
+-  'keymap 'notmuch-show-part-button-map\r
+   'follow-link t\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
+@@ -1202,6 +1190,16 @@ 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-mode-map\r
+       (let ((map (make-sparse-keymap)))\r
+       (define-key map "?" 'notmuch-help)\r
+@@ -1244,6 +1242,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