[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / e3 / 573e2e52faf667fd881b946d787f019289e1d5
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 58820431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 25 Dec 2009 11:54:14 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id VT6cFA0bhsDl for <notmuch@notmuchmail.org>;\r
11         Fri, 25 Dec 2009 11:54:13 -0800 (PST)\r
12 Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])\r
13         by olra.theworths.org (Postfix) with ESMTP id 6BECF431FAE\r
14         for <notmuch@notmuchmail.org>; Fri, 25 Dec 2009 11:54:13 -0800 (PST)\r
15 Received: from\r
16         fctnnbsc30w-142167182194.pppoe-dynamic.high-speed.nb.bellaliant.net\r
17         ([142.167.182.194] helo=localhost)\r
18         by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
19         (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)\r
20         id 1NOGEl-0004mz-NH; Fri, 25 Dec 2009 15:54:12 -0400\r
21 Received: from bremner by localhost with local (Exim 4.71)\r
22         (envelope-from <bremner@pivot.cs.unb.ca>)\r
23         id 1NOGEg-00065z-AE; Fri, 25 Dec 2009 15:54:06 -0400\r
24 From: david@tethera.net\r
25 To: notmuch@notmuchmail.org\r
26 Date: Fri, 25 Dec 2009 15:53:49 -0400\r
27 Message-Id: <1261770829-23376-1-git-send-email-david@tethera.net>\r
28 X-Mailer: git-send-email 1.6.5.7\r
29 X-Sender-Verified: bremner@pivot.cs.unb.ca\r
30 Cc: David Bremner <bremner@unb.ca>\r
31 Subject: [notmuch] [PATCH] notmuch.el: add a submap (on "z" for "ztash") to\r
32         stash things.\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.12\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Fri, 25 Dec 2009 19:54:14 -0000\r
46 \r
47 From: David Bremner <bremner@unb.ca>\r
48 \r
49 Provide key bindings for stuffing everything with a notmuch-show-get-foo\r
50 function into the emacs kill-ring as text.\r
51 \r
52 Currently this is just message-id, filename, and tags.\r
53 ---\r
54 \r
55 One thing I find myself doing often is going into raw message mode in\r
56 order to grab a message-id. This patch automates that by letting you\r
57 stash the message id in the emacs kill-ring (and X clipboard, if\r
58 running under X).  It also allows the same for filename and tags.\r
59 It would be pretty trivial to add other similar commands for stashing \r
60 other headers and parts of a message given a corresponding \r
61 notmuch-show-get-foo function.\r
62 \r
63  notmuch.el |   28 ++++++++++++++++++++++++++++\r
64  1 files changed, 28 insertions(+), 0 deletions(-)\r
65 \r
66 diff --git a/notmuch.el b/notmuch.el\r
67 index 97914f2..53eb5a3 100644\r
68 --- a/notmuch.el\r
69 +++ b/notmuch.el\r
70 @@ -51,6 +51,17 @@\r
71  (require 'mm-view)\r
72  (require 'message)\r
73  \r
74 +(defvar notmuch-show-stash-map \r
75 +  (let ((map (make-sparse-keymap)))\r
76 +    (define-key map "m" 'notmuch-show-stash-message-id)\r
77 +    (define-key map "F" 'notmuch-show-stash-filename)\r
78 +    (define-key map "T" 'notmuch-show-stash-tags)\r
79 +    map)\r
80 +  "Submap for stash commands"\r
81 +  )\r
82 +\r
83 +(fset 'notmuch-show-stash-map notmuch-show-stash-map)\r
84 +\r
85  (defvar notmuch-show-mode-map\r
86    (let ((map (make-sparse-keymap)))\r
87      (define-key map "?" 'notmuch-help)\r
88 @@ -78,6 +89,7 @@\r
89      (define-key map "n" 'notmuch-show-next-message)\r
90      (define-key map (kbd "DEL") 'notmuch-show-rewind)\r
91      (define-key map " " 'notmuch-show-advance-marking-read-and-archiving)\r
92 +    (define-key map "z" 'notmuch-show-stash-map)\r
93      map)\r
94    "Keymap for \"notmuch show\" buffers.")\r
95  (fset 'notmuch-show-mode-map notmuch-show-mode-map)\r
96 @@ -920,6 +932,22 @@ All currently available key bindings:\r
97    :options '(hl-line-mode)\r
98    :group 'notmuch)\r
99  \r
100 +(defun notmuch-show-do-stash (text)\r
101 +    (kill-new text)\r
102 +    (message (concat "Saved " text)))\r
103 +   \r
104 +(defun notmuch-show-stash-message-id ()\r
105 +  (interactive)\r
106 +  (notmuch-show-do-stash (notmuch-show-get-message-id)))\r
107 +\r
108 +(defun notmuch-show-stash-filename ()\r
109 +  (interactive)\r
110 +  (notmuch-show-do-stash (notmuch-show-get-filename)))\r
111 +\r
112 +(defun notmuch-show-stash-tags ()\r
113 +  (interactive)\r
114 +  (notmuch-show-do-stash (mapconcat 'identity (notmuch-show-get-tags) ",")))\r
115 +\r
116  ; Make show mode a bit prettier, highlighting URLs and using word wrap\r
117  \r
118  (defun notmuch-show-pretty-hook ()\r
119 -- \r
120 1.6.5.7\r
121 \r