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