Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 97 / 6894d34138aff49676ec6ae3e35aaf74b818b5
1 Return-Path: <david@belohrad.ch>\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 06AA9431FC2\r
6         for <notmuch@notmuchmail.org>; Wed, 29 Oct 2014 06:09:27 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 hn0l+g7BJXhd for <notmuch@notmuchmail.org>;\r
16         Wed, 29 Oct 2014 06:09:18 -0700 (PDT)\r
17 Received: from beesknees.cern.ch (beesknees.cern.ch [137.138.197.99])\r
18         (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id C8F30431FB6\r
21         for <notmuch@notmuchmail.org>; Wed, 29 Oct 2014 06:09:18 -0700 (PDT)\r
22 Received: from belohrad by beesknees.cern.ch with local (Exim 4.84)\r
23         (envelope-from <david@belohrad.ch>)\r
24         id 1XjSzx-0003Sd-1n; Wed, 29 Oct 2014 14:09:13 +0100\r
25 From: David Belohrad <david@belohrad.ch>\r
26 To: Eric Abrahamsen <eric@ericabrahamsen.net>, notmuch@notmuchmail.org\r
27 Subject: Re: [O] how to put into a journal info about the email sent\r
28 In-Reply-To: <87a94lh04t.fsf@ericabrahamsen.net>\r
29 References: <uaxh9yty1pm.fsf@beesknees.cern.ch>\r
30         <87ppdhh3rh.fsf@ericabrahamsen.net>\r
31         <m2k33p31yb.fsf@heart-of-gold.hh.sledj.net>\r
32         <87a94lh04t.fsf@ericabrahamsen.net>\r
33 User-Agent: Notmuch/0.18~rc0+2~gbc64cdc (http://notmuchmail.org) Emacs/24.3.1\r
34         (x86_64-pc-linux-gnu)\r
35 Date: Wed, 29 Oct 2014 14:09:12 +0100\r
36 Message-ID: <uaxd29bt43r.fsf@beesknees.cern.ch>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain\r
39 Cc: emacs-orgmode@gnu.org\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Wed, 29 Oct 2014 13:09:27 -0000\r
53 \r
54 dear all,\r
55 \r
56 thanks for fruitful hints. Based on what you've done I have setup it as\r
57 follows:\r
58 \r
59 1) the capture template, which uses clipboard buffer to setup the\r
60    data. So my org-capture-templates contains this entry:\r
61    \r
62    ("@" "Email outgoing sync. USED INTERNALLY" entry (file+datetree (concat my-org-files "emails_sent.org"))\r
63    "* EMAIL %c :EMAIL:\n%?\nEntered on %T\n")\r
64 \r
65 2) function which generates the notmuch link based on the message id:\r
66 \r
67   (defun org-notmuch-track-outgoing-emails()\r
68          (save-restriction\r
69          (message-narrow-to-headers)\r
70             (let ((link (mail-fetch-field "Message-ID"))\r
71                   (subject (mail-fetch-field "Subject"))\r
72                   (to (mail-fetch-field "To"))\r
73                   (date (mail-fetch-field "Date"))\r
74                   (msg-id (mail-fetch-field "Message-ID"))\r
75                   ;; `mail-fetch-field'. Construct date-ts and date-ts-ia with\r
76                   ;;(date-ts (format-time-string (org-time-stamp-format t [t]) (date-to-time (mail-fetch-field "Date"))))\r
77                   )\r
78                   (if link\r
79                       ;; messageid exists, we can link it\r
80                       (kill-new (concat "[[notmuch:id:" msg-id "][" subject "]]")))\r
81             ;; use special template to fill in\r
82                   (org-capture nil "@")\r
83                     )\r
84                   )\r
85             )\r
86 \r
87 3) hook to run the function when headers are created:\r
88 \r
89 (add-hook 'message-header-hook 'org-notmuch-track-outgoing-emails)\r
90 \r
91 \r
92 \r
93 The three what they do is that whenever I send an email, a new diary\r
94 style entry is setup in the editting buffer, where the timestamp, email\r
95 link and an EMAIL tag are already pre-filled. So unless I want to add\r
96 another tags, sending email is by default a -two times- C-c C-c combo. \r
97 \r
98 Bettern than nothing, but still far from being perfect due to two\r
99 things:\r
100 \r
101 - 'standard' behaviour is, that the email sent becomes read-only so with\r
102   'q' keystroke I can bury the buffer with the email. However when I\r
103   have implemented this, I have noticed that when I 'confirm' the\r
104   template, I go back into the buffer 'sent mail to...', but this the\r
105   *THE BUFFER IS NOT READ ONLY* and 'q' will just generate a character,\r
106   and then I have to kill this buffer using C-x k with additional 'yes'\r
107   because the buffer was modified. Quite annoying and I don't know how\r
108   to resolve this\r
109 \r
110 - second thing is, that I'd like to avoid at all opening the capture\r
111   template and just dump it into the file without any modifications\r
112   ongoing. The only 'modification' which comes into my mind is a setup\r
113   of an additional tag describing the email being attached to some\r
114   project...\r
115 \r
116 Any help on those two is highly appreciated :)\r
117 \r
118 .d.\r
119 \r
120 \r
121 \r
122 Eric Abrahamsen <eric@ericabrahamsen.net> writes:\r
123 \r
124 > David Edmondson <dme@dme.org> writes:\r
125 >\r
126 >> On Fri, Oct 24 2014, Eric Abrahamsen wrote:\r
127 >>> David Belohrad <david@belohrad.ch> writes:\r
128 >>>\r
129 >>>> Dear All,\r
130 >>>>\r
131 >>>> i'm using org. And I'm using notmuch (that's why I address both mailing\r
132 >>>> lists). Now, writing an email in everyday bussiness requires a\r
133 >>>> non-significant time of your workhours. So I'd like to have this event\r
134 >>>> in my org agenda. So any time I send some email with a given subject,\r
135 >>>> I'd like to 'automatically' entry the information about it into\r
136 >>>> e.g. sentmails.org in form of a diary entry, with appropriate tag.\r
137 >>>\r
138 >>> I do something like this in Gnorb, which I'd recommend you use except\r
139 >>> it's mostly Gnus specific.\r
140 >>>\r
141 >>> I do it in two parts, but you could do it in one. Basically I add a\r
142 >>> function to the `message-header-hook' (which ensures that all the\r
143 >>> message headers have been generated properly).\r
144 >>\r
145 >> Does `message-generate-headers-first' not do what you want for this\r
146 >> specific part?\r
147 >\r
148 > Yeah, I think I looked at that previously. But this thing is going in a\r
149 > hook anyway, might as well use the hook that *doesn't* require me to\r
150 > call that function explicitly.\r
151 >\r
152 >>> Obviously the downside is that, without a "Gcc:" header, org can't\r
153 >>> actually make a real link to the message. It doesn't know where it's\r
154 >>> going to be. However if you know that all your sent messages can be\r
155 >>> reached with a link that looks like "notmuch:id#Message-id", then you\r
156 >>> can make that yourself in your org capture template with something like\r
157 >>\r
158 >> As you suggest, know the message-id should be good enough to generate a\r
159 >> notmuch link, though you may have to wait for the notmuch index to be\r
160 >> updated for the link to be valid.\r
161 >\r
162 > Yup, I've got the same issue with nnimap -- you have to wait for the\r
163 > next sync to get access to the message. So far it hasn't been a problem,\r
164 > though.\r
165 >\r
166 > _______________________________________________\r
167 > notmuch mailing list\r
168 > notmuch@notmuchmail.org\r
169 > http://notmuchmail.org/mailman/listinfo/notmuch\r