Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / ca / 7b119723a55b58d3c63b372984c8a6f3eb96df
1 Return-Path: <too@guru-group.fi>\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 1DE00429E3C\r
6         for <notmuch@notmuchmail.org>; Wed,  4 Sep 2013 12:21:25 -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 ifBI5qN9ZnW1 for <notmuch@notmuchmail.org>;\r
16         Wed,  4 Sep 2013 12:21:17 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 082D8429E34\r
19         for <notmuch@notmuchmail.org>; Wed,  4 Sep 2013 12:21:17 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 1BE1C100063; Wed,  4 Sep 2013 22:21:12 +0300 (EEST)\r
22 From: "Tomi.Ollila" <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH 1/1] emacs: fix notmuch-mua-reply point placement when\r
25         signature involved\r
26 Date: Wed,  4 Sep 2013 22:20:58 +0300\r
27 Message-Id: <1378322458-30159-1-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.8.0\r
29 Cc: tomi.ollila@iki.fi\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Wed, 04 Sep 2013 19:21:25 -0000\r
43 \r
44 From: Tomi Ollila <tomi.ollila@iki.fi>\r
45 \r
46 When composing a reply, notmuch-mua-reply attempts to  cite the\r
47 the original message by inserting it before the user signature, if\r
48 one is present. The existing method used to search the signature\r
49 separator backward from the end of the buffer and then move one\r
50 line up. In case of variable `message-signature-insert-empty-line'\r
51 being nil (and `message-signature-setup-hook' not intervening) this\r
52 caused point to go to the beginning of '--text follows this line--'\r
53 separator line, and citation was inserted there.\r
54 This change checks the value of `message-signature-insert-empty-line'\r
55 and doesn't move point if that is nil. Additional narrowing to\r
56 the body region ensures that point never goes to the separator line\r
57 (or beyond).\r
58 \r
59 Original patch from "Geoffrey H. Ferrari", continued with iterations\r
60 from Jani and Mark.\r
61 ---\r
62  emacs/notmuch-mua.el | 12 ++++++++----\r
63  1 file changed, 8 insertions(+), 4 deletions(-)\r
64 \r
65 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
66 index 2baae5f..0280c9f 100644\r
67 --- a/emacs/notmuch-mua.el\r
68 +++ b/emacs/notmuch-mua.el\r
69 @@ -192,10 +192,14 @@ list."\r
70  \r
71        ;; Insert the message body - but put it in front of the signature\r
72        ;; if one is present\r
73 -      (goto-char (point-max))\r
74 -      (if (re-search-backward message-signature-separator nil t)\r
75 -         (forward-line -1)\r
76 -       (goto-char (point-max)))\r
77 +      (save-restriction\r
78 +       (message-goto-body)\r
79 +       (narrow-to-region (point) (point-max))\r
80 +       (goto-char (point-max))\r
81 +       (if (re-search-backward message-signature-separator nil t)\r
82 +           (if message-signature-insert-empty-line\r
83 +               (forward-line -1))\r
84 +         (goto-char (point-max))))\r
85  \r
86        (let ((from (plist-get original-headers :From))\r
87             (date (plist-get original-headers :Date))\r
88 -- \r
89 1.8.0\r
90 \r