database error
[notmuch-archives.git] / 6c / 3d1e897d1104a94c90c476d3bd831f5bd7476b
1 Return-Path: <jani@nikula.org>\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 3C2A9431FAF\r
6         for <notmuch@notmuchmail.org>; Fri,  2 Jan 2015 09:49:35 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 P6mADcrMTzp6 for <notmuch@notmuchmail.org>;\r
16         Fri,  2 Jan 2015 09:49:32 -0800 (PST)\r
17 Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com\r
18  [74.125.82.52])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  D225A431FAE    for <notmuch@notmuchmail.org>; Fri,  2 Jan 2015 09:49:31 -0800\r
21  (PST)\r
22 Received: by mail-wg0-f52.google.com with SMTP id x12so24356381wgg.11\r
23         for <notmuch@notmuchmail.org>; Fri, 02 Jan 2015 09:49:30 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:subject:in-reply-to:references\r
27         :user-agent:date:message-id:mime-version:content-type;\r
28         bh=Jqq8nmu+Hlrz70oBoAkWMfbv+GgF9oLQEksY0vnTtKA=;\r
29         b=lJRy2JOrdZ/gjOhWG8Cd0KUVdE/PfHkVanI6FPwtVNZ1EZc+I9vTpWFD2lsiaHG+78\r
30         Ja/uEhVHrf6vbCXmLiuHCwxnC2E7rfh9K9GFGP06JCaAEpdzkV+MYwpSXiLF0x+IJgrd\r
31         HXn4I0OHZeHtBKGudyYqu10wZz987bFaAy12WJjNyzWOVJPUDX9TlzT8Q3kZdvmMnj5L\r
32         /IOed8GOgj/uKtvBPM3kcaib1iab+jrbeEqas7njGtOIuhi+eGQ6lqv4biz8WZF3RIpR\r
33         cPcw+fJ1ZGSnHZas+5SzdUH/jjGHC5CUsgMAb/Zf7Dz6BHAL5yk87sJfYd1aZ/9xFEQ8\r
34         791A==\r
35 X-Gm-Message-State:\r
36  ALoCoQmtoPHMCly6gNsg9v9MK3WEH58/FOmI6Nl81FGNNJBPr+/ajoOpAny3ibCuHr8uA4Tc5hVE\r
37 X-Received: by 10.194.75.195 with SMTP id e3mr96730972wjw.44.1420220970662;\r
38         Fri, 02 Jan 2015 09:49:30 -0800 (PST)\r
39 Received: from localhost (mobile-internet-bceeb5-193.dhcp.inet.fi.\r
40         [188.238.181.193])\r
41         by mx.google.com with ESMTPSA id cg8sm63246636wjc.1.2015.01.02.09.49.29\r
42         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
43         Fri, 02 Jan 2015 09:49:30 -0800 (PST)\r
44 From: Jani Nikula <jani@nikula.org>\r
45 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
46 Subject: Re: [PATCH v2] emacs: add stash support for git send-email command\r
47         line\r
48 In-Reply-To: <cuna921smnf.fsf@gargravarr.hh.sledj.net>\r
49 References: <1414525138-838-1-git-send-email-jani@nikula.org>\r
50         <1420134332-25698-1-git-send-email-jani@nikula.org>\r
51         <cuna921smnf.fsf@gargravarr.hh.sledj.net>\r
52 User-Agent: Notmuch/0.19+6~gf2e3d2c (http://notmuchmail.org) Emacs/24.4.1\r
53         (x86_64-pc-linux-gnu)\r
54 Date: Fri, 02 Jan 2015 19:49:37 +0200\r
55 Message-ID: <874ms9139q.fsf@nikula.org>\r
56 MIME-Version: 1.0\r
57 Content-Type: text/plain\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Fri, 02 Jan 2015 17:49:35 -0000\r
71 \r
72 On Fri, 02 Jan 2015, David Edmondson <dme@dme.org> wrote:\r
73 > On Thu, Jan 01 2015, Jani Nikula wrote:\r
74 >> Stash From/To/Cc as --to/--to/--cc, respectively, and Message-Id as\r
75 >> --in-reply-to, suitable for pasting to git send-email command line.\r
76 >> ---\r
77 >>  emacs/notmuch-show.el | 38 ++++++++++++++++++++++++++++++++++++++\r
78 >>  1 file changed, 38 insertions(+)\r
79 >>\r
80 >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
81 >> index b8cfbb8a3286..887d877672fc 100644\r
82 >> --- a/emacs/notmuch-show.el\r
83 >> +++ b/emacs/notmuch-show.el\r
84 >> @@ -1280,6 +1280,7 @@ reset based on the original query."\r
85 >>      (define-key map "t" 'notmuch-show-stash-to)\r
86 >>      (define-key map "l" 'notmuch-show-stash-mlarchive-link)\r
87 >>      (define-key map "L" 'notmuch-show-stash-mlarchive-link-and-go)\r
88 >> +    (define-key map "G" 'notmuch-show-stash-git-send-email)\r
89 >>      (define-key map "?" 'notmuch-subkeymap-help)\r
90 >>      map)\r
91 >>    "Submap for stash commands")\r
92 >> @@ -2131,6 +2132,43 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')."\r
93 >>    (notmuch-show-stash-mlarchive-link mla)\r
94 >>    (browse-url (current-kill 0 t)))\r
95 >>  \r
96 >> +(defun notmuch-show-stash-git-helper (addresses prefix)\r
97 >> +  "Escape, trim, quote, and add PREFIX to each address in list of\r
98 >> ADDRESSES."\r
99 >\r
100 > "...and return the result as a single string."\r
101 >\r
102 >> +  (mapconcat (lambda (x)\r
103 >> +           (concat prefix "\""\r
104 >> +                   ;; escape double-quotes\r
105 >> +                   (replace-regexp-in-string\r
106 >> +                    "\"" "\\\\\""\r
107 >> +                    ;; trim leading and trailing spaces\r
108 >> +                    (replace-regexp-in-string\r
109 >> +                     "\\(^ *\\| *$\\)" ""\r
110 >> +                     x)) "\""))\r
111 >> +         addresses " "))\r
112 >> +\r
113 >> +(put 'notmuch-show-stash-git-send-email 'notmuch-prefix-doc\r
114 >> +     "Copy From/To/Cc of current message to kill-ring in a form suitable for pasting to git send-email command line.")\r
115 >> +\r
116 >> +(defun notmuch-show-stash-git-send-email (&optional no-in-reply-to)\r
117 >> +  "Copy From/To/Cc/Message-Id of current message to kill-ring in a form suitable for pasting to git send-email command line.\r
118 >> +\r
119 >> +If invoked with a prefix argument (or NO-IN-REPLY-TO is non-nil,\r
120 >> +omit --in-reply-to=<Message-Id>."\r
121 >\r
122 > Missing ")" after "non-nil".\r
123 >\r
124 >> +  (interactive "P")\r
125 >> +  (notmuch-common-do-stash\r
126 >> +   (mapconcat 'identity\r
127 >> +          (remove ""\r
128 >> +                  (list\r
129 >> +                   (notmuch-show-stash-git-helper\r
130 >> +                    (message-tokenize-header (notmuch-show-get-from)) "--to=")\r
131 >> +                   (notmuch-show-stash-git-helper\r
132 >> +                    (message-tokenize-header (notmuch-show-get-to)) "--to=")\r
133 >> +                   (notmuch-show-stash-git-helper\r
134 >> +                    (message-tokenize-header (notmuch-show-get-cc)) "--cc=")\r
135 >> +                   (unless no-in-reply-to\r
136 >> +                     (notmuch-show-stash-git-helper\r
137 >> +                      (list (notmuch-show-get-message-id t))\r
138 >> "--in-reply-to="))))\r
139 >\r
140 > This will still generate a trailing space if `no-in-reply-to' is set,\r
141 > but I think that we can live with it.\r
142 \r
143 I know I can! ;)\r
144 \r
145 Thanks for the review, v3 in reply.\r
146 \r
147 BR,\r
148 Jani.\r
149 \r
150 \r
151 >\r
152 >> +          " ")))\r
153 >> +\r
154 >>  ;; Interactive part functions and their helpers\r
155 >>  \r
156 >>  (defun notmuch-show-generate-part-buffer (message-id nth)\r
157 >> -- \r
158 >> 2.1.4\r