[feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / a5 / c5e1926795a880211115db13e158cbd6f0877a
1 Return-Path: <amdragon@mit.edu>\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 15831431FB6\r
6         for <notmuch@notmuchmail.org>; Mon,  3 Dec 2012 07:20:20 -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 WLGvQGVnEqW4 for <notmuch@notmuchmail.org>;\r
16         Mon,  3 Dec 2012 07:20:19 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
18         [18.7.68.35])\r
19         by olra.theworths.org (Postfix) with ESMTP id 6C377431FAE\r
20         for <notmuch@notmuchmail.org>; Mon,  3 Dec 2012 07:20:19 -0800 (PST)\r
21 X-AuditID: 12074423-b7fcb6d000000927-69-50bcc3321074\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 0C.5C.02343.233CCB05; Mon,  3 Dec 2012 10:20:18 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id qB3FKINQ023577; \r
27         Mon, 3 Dec 2012 10:20:18 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qB3FKF1S011384\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Mon, 3 Dec 2012 10:20:16 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1TfXod-000251-HB; Mon, 03 Dec 2012 10:20:15 -0500\r
37 Date: Mon, 3 Dec 2012 10:20:15 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH] emacs: stash bugfix\r
41 Message-ID: <20121203152015.GD1020@mit.edu>\r
42 References: <1354443068-5030-1-git-send-email-markwalters1009@gmail.com>\r
43         <20121203013402.GC1020@mit.edu> <87ehj71o4i.fsf@qmul.ac.uk>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To: <87ehj71o4i.fsf@qmul.ac.uk>\r
48 User-Agent: Mutt/1.5.21 (2010-09-15)\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IRYrdT1zU6vCfAYOEaC4vVc3ksrt+cyezA\r
51         5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZcz8/pypYINAxa1jt9gaGD/wdDFyckgImEi8\r
52         XbKeDcIWk7hwD8Tm4hAS2McocfXZThYIZz2jRNPtaYwQzgUmiRULOtkhnCWMEo/+d7OD9LMI\r
53         qEjMOfoCbBabgIbEtv3LGUFsEQEdiduHFoDVMAtIS3z73cwEYgsD1Ry/dAOsnldAW2Ll8tXM\r
54         EEM7GCU2Pb7DCJEQlDg58wkLRLOWxI1/L4GaOcAGLf/HARLmBJqzZ9JZZhBbFOiGKSe3sU1g\r
55         FJqFpHsWku5ZCN0LGJlXMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Zrp5WaW6KWmlG5iBAe2i/IO\r
56         xj8HlQ4xCnAwKvHwPviyO0CINbGsuDL3EKMkB5OSKC/j5j0BQnxJ+SmVGYnFGfFFpTmpxYcY\r
57         JTiYlUR4d24EyvGmJFZWpRblw6SkOViUxHmvpdz0FxJITyxJzU5NLUgtgsnKcHAoSfCKHgJq\r
58         FCxKTU+tSMvMKUFIM3FwggznARquDVLDW1yQmFucmQ6RP8WoKCXOywSSEABJZJTmwfXCEs8r\r
59         RnGgV4R5uUGqeIBJC677FdBgJqDBL4R2gwwuSURISTUwTvlx7+YNYZE79jN39Wfuuegex7Wt\r
60         Jptlv/nc794hWiUJzJOnrOE841B06Mritc1znzwR9MnxNL1l82B6zcZzolcWRv/i7fz+8Jvb\r
61         YQn+hsu+p1imznqUHL2HaZdp4J5+QfMDH7fdWxaxflVi5a6I+ffss0QzeCYpTfq/+UEyp6tW\r
62         585PZn1KbkosxRmJhlrMRcWJAFVRvjQXAwAA\r
63 Cc: notmuch@notmuchmail.org\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Mon, 03 Dec 2012 15:20:20 -0000\r
77 \r
78 Quoth Mark Walters on Dec 03 at  9:27 am:\r
79\r
80 > On Mon, 03 Dec 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
81 > > Quoth Mark Walters on Dec 02 at 10:11 am:\r
82 > >> Currently an attempt to stash a non-existent field (eg cc when not\r
83 > >> present) throws an error. Catch this case and give the user a warning\r
84 > >> message.\r
85 > >> \r
86 > >> ---\r
87 > >> While messing around with notmuch-pick key bindings I found the\r
88 > >> following bug. The easiest way I have found to trigger it is cc\r
89 > >> (stash-cc) in show mode on a message with no cc header.\r
90 > >> \r
91 > >> Best wishes\r
92 > >> \r
93 > >> Mark\r
94 > >> \r
95 > >>  emacs/notmuch-lib.el |    7 +++++--\r
96 > >>  1 files changed, 5 insertions(+), 2 deletions(-)\r
97 > >> \r
98 > >> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
99 > >> index 1d0ec17..c7d8e02 100644\r
100 > >> --- a/emacs/notmuch-lib.el\r
101 > >> +++ b/emacs/notmuch-lib.el\r
102 > >> @@ -183,8 +183,11 @@ user-friendly queries."\r
103 > >>  \r
104 > >>  (defun notmuch-common-do-stash (text)\r
105 > >>    "Common function to stash text in kill ring, and display in minibuffer."\r
106 > >> -  (kill-new text)\r
107 > >> -  (message "Stashed: %s" text))\r
108 > >> +  (if text\r
109 > >> +      (progn\r
110 > >> +  (kill-new text)\r
111 > >> +  (message "Stashed: %s" text))\r
112 > >> +    (message "Warning: Nothing to stash!")))\r
113 > >\r
114 > > Without the unnecessary "Warning:" bit of the message, LGTM.\r
115\r
116 > I am obviously happy to remove the "warning": however do you think\r
117 > stashing a non-existent thing should empty the kill-ring? I am a little\r
118 > worried about someone stashing something, not noticing the "nothing to\r
119 > stash" and then pasting some random thing somewhere (eg something\r
120 > private into irc).\r
121 \r
122 Mm, interesting.  I don't think you want to empty the kill-ring\r
123 because there may be useful things earlier in it.  You could clear out\r
124 the window system selection directly, but that's probably flaky and\r
125 doesn't help if you're copying around within Emacs.  What about\r
126 (kill-new "")?  Then the function would always put something on the\r
127 kill-ring (and clipboard/selection/whatever) but it would be harmless\r
128 if there was nothing to stash.\r