Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 46 / 364c5038e65dd9c247d4333c820460027cf046
1 Return-Path: <markwalters1009@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 84E73431FAF\r
6         for <notmuch@notmuchmail.org>; Thu, 10 Jan 2013 02:41:23 -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.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id ApjG66bP5LOf for <notmuch@notmuchmail.org>;\r
18         Thu, 10 Jan 2013 02:41:23 -0800 (PST)\r
19 Received: from mail-we0-f171.google.com (mail-we0-f171.google.com\r
20         [74.125.82.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id BFAC2431FB6\r
23         for <notmuch@notmuchmail.org>; Thu, 10 Jan 2013 02:41:22 -0800 (PST)\r
24 Received: by mail-we0-f171.google.com with SMTP id u3so169568wey.2\r
25         for <notmuch@notmuchmail.org>; Thu, 10 Jan 2013 02:41:21 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
28         :references:mime-version:content-type:content-transfer-encoding;\r
29         bh=NHFI9jXTJCTEokIKdN8V4Blwa/OObvBTro/5tvWD3VI=;\r
30         b=P1Dqy4LmvJLc4XnBmiEEldvZAHsTabJn+GBVz02ymfm+xS4sXT1MhIxhMYUsDFgft3\r
31         5RqDXXOogHowa5rMv8YxT0OkpBd06yTi30YUMzt4b73rR7leArrR8R4JLNLmbRDqojKk\r
32         R3lXQiYQXHUu3GokqLKlH5VtGeM4NMlqly0lJRRLNP4YQ5reQDfrJUkcrJhJ3kobNmrD\r
33         lcseZIGtdlGtyU2jrPuYWiHnP1ZdYX++At3o+VxCrYXXXT2lNeQvVwLnPpoHXO4DpNaz\r
34         z6u7TPq5H8/71zbYwswSGGu7GuaMD04kqOemrZK6r1X+CJZSPbK2oF+EL0UmdSpvRHTp\r
35         4wMA==\r
36 X-Received: by 10.180.72.146 with SMTP id d18mr8200752wiv.33.1357814481617;\r
37         Thu, 10 Jan 2013 02:41:21 -0800 (PST)\r
38 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
39         by mx.google.com with ESMTPS id bw9sm7779330wib.5.2013.01.10.02.41.20\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Thu, 10 Jan 2013 02:41:21 -0800 (PST)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject:\r
45  [PATCH 1/2] contrib: pick: move save-excursion closer to message insertion\r
46 Date: Thu, 10 Jan 2013 10:41:16 +0000\r
47 Message-Id: <1357814477-1348-2-git-send-email-markwalters1009@gmail.com>\r
48 X-Mailer: git-send-email 1.7.9.1\r
49 In-Reply-To: <1357814477-1348-1-git-send-email-markwalters1009@gmail.com>\r
50 References: <1357814477-1348-1-git-send-email-markwalters1009@gmail.com>\r
51 MIME-Version: 1.0\r
52 Content-Type: text/plain; charset=UTF-8\r
53 Content-Transfer-Encoding: 8bit\r
54 X-BeenThere: notmuch@notmuchmail.org\r
55 X-Mailman-Version: 2.1.13\r
56 Precedence: list\r
57 List-Id: "Use and development of the notmuch mail system."\r
58         <notmuch.notmuchmail.org>\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
62 List-Post: <mailto:notmuch@notmuchmail.org>\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
66 X-List-Received-Date: Thu, 10 Jan 2013 10:41:23 -0000\r
67 \r
68 Pick keeps point roughly at the top of the buffer while inserting\r
69 messages at the end as they come in (from the async\r
70 parser). Previously the save-excursion to do this was done once for\r
71 each thread inserted: now it is done for each individual message.\r
72 \r
73 The advantage is that the message insertion code can decide where to\r
74 leave point. In the next patch point will be left on the target message.\r
75 \r
76 Note notmuch-pick-insert-msg is unchanged as that is used by the tag\r
77 display update code.\r
78 ---\r
79  contrib/notmuch-pick/notmuch-pick.el |   17 ++++++++++-------\r
80  1 files changed, 10 insertions(+), 7 deletions(-)\r
81 \r
82 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
83 index d75a66a..d597126 100644\r
84 --- a/contrib/notmuch-pick/notmuch-pick.el\r
85 +++ b/contrib/notmuch-pick/notmuch-pick.el\r
86 @@ -638,6 +638,11 @@ unchanged ADDRESS if parsing fails."\r
87    (notmuch-pick-set-message-properties msg)\r
88    (insert "\n"))\r
89  \r
90 +(defun notmuch-pick-goto-and-insert-msg (msg)\r
91 +  "Insert msg at the end of the buffer."\r
92 +  (save-excursion\r
93 +    (goto-char (point-max))\r
94 +    (notmuch-pick-insert-msg msg)))\r
95  (defun notmuch-pick-insert-tree (tree depth tree-status first last)\r
96    "Insert the message tree TREE at depth DEPTH in the current thread."\r
97    (let ((msg (car tree))\r
98 @@ -659,7 +664,7 @@ unchanged ADDRESS if parsing fails."\r
99         (push "├" tree-status)))\r
100  \r
101        (push (concat (if replies "┬" "─") "►") tree-status)\r
102 -      (notmuch-pick-insert-msg (plist-put msg :tree-status tree-status))\r
103 +      (notmuch-pick-goto-and-insert-msg (plist-put msg :tree-status tree-status))\r
104        (pop tree-status)\r
105        (pop tree-status)\r
106  \r
107 @@ -678,12 +683,10 @@ unchanged ADDRESS if parsing fails."\r
108           do (notmuch-pick-insert-tree tree depth tree-status (eq count 1) (eq count n)))))\r
109  \r
110  (defun notmuch-pick-insert-forest-thread (forest-thread)\r
111 -  (save-excursion\r
112 -    (goto-char (point-max))\r
113 -    (let (tree-status)\r
114 -      ;; Reset at the start of each main thread.\r
115 -      (setq notmuch-pick-previous-subject nil)\r
116 -      (notmuch-pick-insert-thread forest-thread 0 tree-status))))\r
117 +  (let (tree-status)\r
118 +    ;; Reset at the start of each main thread.\r
119 +    (setq notmuch-pick-previous-subject nil)\r
120 +    (notmuch-pick-insert-thread forest-thread 0 tree-status)))\r
121  \r
122  (defun notmuch-pick-insert-forest (forest)\r
123    (mapc 'notmuch-pick-insert-forest-thread forest))\r
124 -- \r
125 1.7.9.1\r
126 \r