1 Return-Path: <bremner@pivot.cs.unb.ca>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id EB985431FC2
\r
6 for <notmuch@notmuchmail.org>; Thu, 11 Feb 2010 19:04:39 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[AWL=0.598,
\r
12 BAYES_00=-2.599] autolearn=ham
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id sThZTwW7LDIF for <notmuch@notmuchmail.org>;
\r
16 Thu, 11 Feb 2010 19:04:39 -0800 (PST)
\r
17 Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 2F75A431FAE
\r
19 for <notmuch@notmuchmail.org>; Thu, 11 Feb 2010 19:04:39 -0800 (PST)
\r
21 fctnnbsc30w-142167166109.pppoe-dynamic.high-speed.nb.bellaliant.net
\r
22 ([142.167.166.109] helo=rocinante.cs.unb.ca)
\r
23 by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
\r
24 (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)
\r
25 id 1Nflpe-0002Ml-QY; Thu, 11 Feb 2010 23:04:38 -0400
\r
26 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.71)
\r
27 (envelope-from <bremner@rocinante.cs.unb.ca>)
\r
28 id 1Nflmy-0008Gd-0X; Thu, 11 Feb 2010 23:01:52 -0400
\r
29 From: david@tethera.net
\r
30 To: notmuch@notmuchmail.org
\r
31 Date: Thu, 11 Feb 2010 23:01:08 -0400
\r
32 Message-Id: <1265943668-31531-3-git-send-email-david@tethera.net>
\r
33 X-Mailer: git-send-email 1.6.5
\r
34 In-Reply-To: <1265943668-31531-2-git-send-email-david@tethera.net>
\r
35 References: <1261770829-23376-1-git-send-email-david@tethera.net>
\r
36 <1265943668-31531-1-git-send-email-david@tethera.net>
\r
37 <1265943668-31531-2-git-send-email-david@tethera.net>
\r
38 X-Sender-Verified: bremner@pivot.cs.unb.ca
\r
39 Cc: David Bremner <bremner@unb.ca>
\r
40 Subject: [notmuch] [PATCH 2/2] notmuch.el: add a submap (on "z" for "ztash")
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Fri, 12 Feb 2010 03:04:40 -0000
\r
56 From: David Bremner <bremner@unb.ca>
\r
58 Provide key bindings for stuffing various RFC822 header fields and other metadata
\r
59 into the emacs kill-ring as text. The bindings are as follows:
\r
61 z F notmuch-show-stash-filename
\r
62 z T notmuch-show-stash-tags
\r
63 z c notmuch-show-stash-cc
\r
64 z d notmuch-show-stash-date
\r
65 z f notmuch-show-stash-from
\r
66 z m notmuch-show-stash-message-id
\r
67 z s notmuch-show-stash-subject
\r
68 z t notmuch-show-stash-to
\r
70 notmuch.el | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
71 1 files changed, 61 insertions(+), 0 deletions(-)
\r
73 diff --git a/notmuch.el b/notmuch.el
\r
74 index 60ef592..faca26d 100644
\r
81 +(defvar notmuch-show-stash-map
\r
82 + (let ((map (make-sparse-keymap)))
\r
83 + (define-key map "c" 'notmuch-show-stash-cc)
\r
84 + (define-key map "d" 'notmuch-show-stash-date)
\r
85 + (define-key map "F" 'notmuch-show-stash-filename)
\r
86 + (define-key map "f" 'notmuch-show-stash-from)
\r
87 + (define-key map "m" 'notmuch-show-stash-message-id)
\r
88 + (define-key map "s" 'notmuch-show-stash-subject)
\r
89 + (define-key map "T" 'notmuch-show-stash-tags)
\r
90 + (define-key map "t" 'notmuch-show-stash-to)
\r
92 + "Submap for stash commands"
\r
95 +(fset 'notmuch-show-stash-map notmuch-show-stash-map)
\r
97 (defvar notmuch-show-mode-map
\r
98 (let ((map (make-sparse-keymap)))
\r
99 (define-key map "?" 'notmuch-help)
\r
101 (define-key map "n" 'notmuch-show-next-message)
\r
102 (define-key map (kbd "DEL") 'notmuch-show-rewind)
\r
103 (define-key map " " 'notmuch-show-advance-marking-read-and-archiving)
\r
104 + (define-key map "z" 'notmuch-show-stash-map)
\r
106 "Keymap for \"notmuch show\" buffers.")
\r
107 (fset 'notmuch-show-mode-map notmuch-show-mode-map)
\r
108 @@ -1074,6 +1091,50 @@ All currently available key bindings:
\r
109 :options '(hl-line-mode)
\r
112 +(defun notmuch-show-do-stash (text)
\r
114 + (message (concat "Saved: " text)))
\r
116 +(defun notmuch-show-stash-cc ()
\r
117 + "Copy CC field of current message to kill-ring."
\r
119 + (notmuch-show-do-stash (notmuch-show-get-cc)))
\r
121 +(defun notmuch-show-stash-date ()
\r
122 + "Copy date of current message to kill-ring."
\r
124 + (notmuch-show-do-stash (notmuch-show-get-date)))
\r
126 +(defun notmuch-show-stash-filename ()
\r
127 + "Copy filename of current message to kill-ring."
\r
129 + (notmuch-show-do-stash (notmuch-show-get-filename)))
\r
131 +(defun notmuch-show-stash-from ()
\r
132 + "Copy From address of current message to kill-ring."
\r
134 + (notmuch-show-do-stash (notmuch-show-get-from)))
\r
136 +(defun notmuch-show-stash-message-id ()
\r
137 + "Copy message-id of current message to kill-ring."
\r
139 + (notmuch-show-do-stash (notmuch-show-get-message-id)))
\r
141 +(defun notmuch-show-stash-subject ()
\r
142 + "Copy Subject field of current message to kill-ring."
\r
144 + (notmuch-show-do-stash (notmuch-show-get-subject)))
\r
146 +(defun notmuch-show-stash-tags ()
\r
147 + "Copy tags of current message to kill-ring as a comma separated list."
\r
149 + (notmuch-show-do-stash (mapconcat 'identity (notmuch-show-get-tags) ",")))
\r
151 +(defun notmuch-show-stash-to ()
\r
152 + "Copy To address of current message to kill-ring."
\r
154 + (notmuch-show-do-stash (notmuch-show-get-to)))
\r
156 ; Make show mode a bit prettier, highlighting URLs and using word wrap
\r
158 (defun notmuch-show-pretty-hook ()
\r