Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / f1 / e8f48d89e35b5ab01bb85f2d19b46b78302c11
1 Return-Path: <ethan.glasser.camp@gmail.com>\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 1B7E0431FB6\r
6         for <notmuch@notmuchmail.org>; Fri, 19 Oct 2012 15:52:36 -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.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 7AenKUxZHGnI for <notmuch@notmuchmail.org>;\r
17         Fri, 19 Oct 2012 15:52:35 -0700 (PDT)\r
18 Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com\r
19         [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 943D9431FAE\r
22         for <notmuch@notmuchmail.org>; Fri, 19 Oct 2012 15:52:35 -0700 (PDT)\r
23 Received: by mail-vb0-f53.google.com with SMTP id fc21so1116425vbb.26\r
24         for <notmuch@notmuchmail.org>; Fri, 19 Oct 2012 15:52:35 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type;\r
28         bh=slL/GRs+fqTXvkRcmrMM8m2y0WmGzdsiRnMddRYUf6I=;\r
29         b=wp0y09KDSxzEPBeZhvZ++oP8U/b2XiASueuTkSRNMY3eLBI+Gyl9LKeZs+yXqMe/bl\r
30         4LNNuvPoqcXfSbEF+kSbdr2yIck4/N+MHBuc1Iom5wUZlJaB2pdKyQE9auA6NKEBsrpR\r
31         Un3L2ezg3fNXJufeJkLOW/4UpzomNkqYCF23QvOszzsRnP1ELSt/zuVd/cnz9awUQi8L\r
32         orSw3Vvd0QK2duWGY8AYuHTG3KRW/nqP7emm1pC7OWCEOmkIgmhF3FllTiVrMX5brrgs\r
33         48cVDrGVdonMrd+VmSKq6h1j6f/5zCQkmTMS0mHBczch4MmZpZu960icVmkQzoHu94qD\r
34         ZDUw==\r
35 Received: by 10.220.226.7 with SMTP id iu7mr3563568vcb.64.1350687154986;\r
36         Fri, 19 Oct 2012 15:52:34 -0700 (PDT)\r
37 Received: from smtp.gmail.com (p70-80.acedsl.com. [66.114.70.80])\r
38         by mx.google.com with ESMTPS id o13sm2731358vde.21.2012.10.19.15.52.32\r
39         (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Fri, 19 Oct 2012 15:52:33 -0700 (PDT)\r
41 From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
42 To: Daniel Bergey <bergey@alum.mit.edu>,\r
43         Notmuch Mail List <notmuch@notmuchmail.org>\r
44 Subject: Re: [PATCH] emacs: functions to import sender or recipient into BBDB\r
45 In-Reply-To: <87lii62sk2.fsf@wonderlust.lan>\r
46 References: <87lii62sk2.fsf@wonderlust.lan>\r
47 User-Agent: Notmuch/0.14+45~g6ea9330 (http://notmuchmail.org) Emacs/23.3.1\r
48         (x86_64-pc-linux-gnu)\r
49 Date: Fri, 19 Oct 2012 18:52:21 -0400\r
50 Message-ID: <87ipa66pne.fsf@betacantrips.com>\r
51 MIME-Version: 1.0\r
52 Content-Type: text/plain; charset=us-ascii\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Fri, 19 Oct 2012 22:52:36 -0000\r
66 \r
67 Daniel Bergey <bergey@alum.mit.edu> writes:\r
68 \r
69 > From a show buffer, bbdb/notmuch-snarf-from imports the sender into\r
70 > bbdb.  bbdb/notmuch-snarf-to attempts to import all recipients.  BBDB\r
71 > displays a buffer with each contact; C-g displays the next contact, or\r
72 > returns to the notmuch-show buffer.\r
73 >\r
74 > This is my first notmuch patch.  Comments very welcome.\r
75 \r
76 Hi!\r
77 \r
78 >  emacs/notmuch-show.el |   28 ++++++++++++++++++++++++++++\r
79 \r
80 I don't think this belongs in notmuch-show. My first inclination is that\r
81 this should go into a new file contrib/notmuch-bbdb.el (assuming there's\r
82 no other notmuch-bbdb integration stuff floating around).\r
83 \r
84 >  1 file changed, 28 insertions(+)\r
85 >\r
86 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
87 > index 6335d45..3bc1da0 100644\r
88 > --- a/emacs/notmuch-show.el\r
89 > +++ b/emacs/notmuch-show.el\r
90 > @@ -1895,6 +1895,34 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')."\r
91 >                      (button-get button :notmuch-filename)\r
92 >                      (button-get button :notmuch-content-type)))))))\r
93 >\r
94 > +;; bbdb interaction functions, awaiting user keybindings\r
95 > +\r
96 > +(defun bbdb/snarf-between-commas ()\r
97 > +  ; What about names written "Surname, First M" <user@server.tld>?\r
98 \r
99 Most comments in emacslisp start with two semicolons.\r
100 \r
101 I do think more sophisticated parsing is necessary. If you're lucky,\r
102 somebody else already has a library to parse email addresses in this\r
103 form.\r
104 \r
105 > +  (goto-char (point-min))\r
106 \r
107 I'm not crazy about this. It's probably fine for something limited to\r
108 bbdb users (especially since bbdb-snarf uses a very similar technique),\r
109 but I think the better approach here is to just take a region and go\r
110 from region-beginning and region-end.\r
111 \r
112 > +  (let ((comma (point)))\r
113 > +    (while (search-forward "," nil "end")\r
114 \r
115 The third argument of search-forward is NOERROR. I don't understand what\r
116 the value "end" means. The help says "Optional third argument, if t..."\r
117 \r
118 > +      (bbdb-snarf-region comma (point))\r
119 > +      (setq comma (point)))\r
120 > +    (bbdb-snarf-region comma (point)) ; last entry\r
121 > +   ))\r
122 \r
123 Doesn't this cause snarf the comma into any of those entries? It seems\r
124 like point starts before the first entry but then goes before each\r
125 comma. Obviously this wouldn't be here if it didn't work. I thought\r
126 bbdb-snarf handled this kind of thing, but it doesn't. Could you explain\r
127 this?\r
128 \r
129 Ethan\r