[PATCH 2/2] Emacs changes for reply to sender
[notmuch-archives.git] / 20 / 140a67089eb2085e7bcf47d5fa4791cada96c6
1 Return-Path: <BATV+416fd192af55372394e4+2437+infradead.org+hohndel@bombadil.srs.infradead.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 2BE29418C25\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 09:31:51 -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: -4.2\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham\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 CFAz9i1lM1J3 for <notmuch@notmuchmail.org>;\r
16         Mon, 26 Apr 2010 09:31:50 -0700 (PDT)\r
17 Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 5EAE0431FC1\r
19         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 09:31:50 -0700 (PDT)\r
20 Received: from localhost ([::1] helo=x200.gr8dns.org)\r
21         by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux))\r
22         id 1O6RDq-00058g-0T; Mon, 26 Apr 2010 16:31:50 +0000\r
23 Received: by x200.gr8dns.org (Postfix, from userid 500)\r
24         id 23B81CC83F; Mon, 26 Apr 2010 09:31:50 -0700 (PDT)\r
25 From: Dirk Hohndel <hohndel@infradead.org>\r
26 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
27 Subject: Re: [PATCH] emacs: More DWIM when editing messages\r
28 In-Reply-To: <1272290485-14217-1-git-send-email-dme@dme.org>\r
29 References: <1272290485-14217-1-git-send-email-dme@dme.org>\r
30 User-Agent: Notmuch/0.2-215-g399f248 (http://notmuchmail.org) Emacs/23.1.1\r
31         (i386-redhat-linux-gnu)\r
32 Date: Mon, 26 Apr 2010 09:31:49 -0700\r
33 Message-ID: <m3vdbejhu2.fsf@x200.gr8dns.org>\r
34 MIME-Version: 1.0\r
35 Content-Type: text/plain; charset=us-ascii\r
36 X-SRS-Rewrite: SMTP reverse-path rewritten from <hohndel@infradead.org> by\r
37         bombadil.infradead.org See http://www.infradead.org/rpr.html\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Mon, 26 Apr 2010 16:31:51 -0000\r
51 \r
52 On Mon, 26 Apr 2010 15:01:25 +0100, David Edmondson <dme@dme.org> wrote:\r
53 > For composing new messages and forwarding, leave the cursor on the\r
54 > 'To:' field. For replies, leave the cursor at the start of the\r
55 > body. In all cases, mark the buffer as not modified so that the user\r
56 > is not prompted if she decides to immediately kill the buffer.\r
57 \r
58 YES! Brilliant. I didn't realize how much I wanted it till you sent\r
59 this. Carl, please include in 0.3\r
60 \r
61 /D\r
62 \r
63 > ---\r
64 >  emacs/notmuch-mua.el |   32 +++++++++++++++++++-------------\r
65 >  1 files changed, 19 insertions(+), 13 deletions(-)\r
66\r
67 > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
68 > index bca20db..c7a9aee 100644\r
69 > --- a/emacs/notmuch-mua.el\r
70 > +++ b/emacs/notmuch-mua.el\r
71 > @@ -98,21 +98,24 @@ list."\r
72 >                             collect header)))\r
73 >      (message-sort-headers)\r
74 >      (message-hide-headers)\r
75 > -    (save-excursion\r
76 > -      (goto-char (point-max))\r
77 > -      (insert body))\r
78 > -    (set-buffer-modified-p nil)))\r
79 > +    (goto-char (point-max))\r
80 > +    (insert body))\r
81 > +    (set-buffer-modified-p nil)\r
82 > +\r
83 > +    (message-goto-body))\r
84 >  \r
85 >  (defun notmuch-mua-forward-message ()\r
86 >    (message-forward)\r
87 > -  (save-excursion\r
88 > -    (when notmuch-mua-user-agent-function\r
89 > -      (let ((user-agent (funcall notmuch-mua-user-agent-function)))\r
90 > -     (when (not (string= "" user-agent))\r
91 > -       (message-add-header (format "User-Agent: %s" user-agent)))))\r
92 > -    (message-sort-headers)\r
93 > -    (message-hide-headers))\r
94 > -  (set-buffer-modified-p nil))\r
95 > +\r
96 > +  (when notmuch-mua-user-agent-function\r
97 > +    (let ((user-agent (funcall notmuch-mua-user-agent-function)))\r
98 > +      (when (not (string= "" user-agent))\r
99 > +     (message-add-header (format "User-Agent: %s" user-agent)))))\r
100 > +  (message-sort-headers)\r
101 > +  (message-hide-headers)\r
102 > +  (set-buffer-modified-p nil)\r
103 > +\r
104 > +  (message-goto-to))\r
105 >  \r
106 >  (defun notmuch-mua-mail (&optional to subject other-headers continue\r
107 >                                  switch-function yank-action send-actions)\r
108 > @@ -126,7 +129,10 @@ list."\r
109 >    (message-mail to subject other-headers continue\r
110 >               switch-function yank-action send-actions)\r
111 >    (message-sort-headers)\r
112 > -  (message-hide-headers))\r
113 > +  (message-hide-headers)\r
114 > +  (set-buffer-modified-p nil)\r
115 > +\r
116 > +  (message-goto-to))\r
117 >  \r
118 >  (defun notmuch-mua-send-and-exit (&optional arg)\r
119 >    (interactive "P")\r
120 > -- \r
121 > 1.7.0\r
122\r
123 > _______________________________________________\r
124 > notmuch mailing list\r
125 > notmuch@notmuchmail.org\r
126 > http://notmuchmail.org/mailman/listinfo/notmuch\r
127 \r
128 -- \r
129 Dirk Hohndel\r
130 Intel Open Source Technology Center\r