Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5c / 350f38d86ed4389b344cb984f33da04ad870b4
1 Return-Path: <dmitry.kurochkin@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 4E15E431FD0\r
6         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 09:27:43 -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 P5b0ynTnFIRg for <notmuch@notmuchmail.org>;\r
17         Thu, 26 May 2011 09:27:42 -0700 (PDT)\r
18 Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
19         [209.85.161.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 32FA5431FB6\r
22         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 09:27:42 -0700 (PDT)\r
23 Received: by fxm8 with SMTP id 8so873494fxm.26\r
24         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 09:27:40 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer\r
27         :mime-version:content-type:content-transfer-encoding;\r
28         bh=pNS4AUHOuGg3In8ISGyt/swa2qGUxBdwe12EgtzL8FE=;\r
29         b=hUo3owUK9NXZjP1RUd2I71mZcRM+h9QveQPV1+tppWlMEA/qMB6WZaaNQhPu4BtbVk\r
30         UQ5IUKVvYn+Lgo2O7V80EsG9V7QiiyFP5tiYNeH5FjDm1J9+DkeDEoZHO99rZnMXawQn\r
31         5C6uXvMSJjh4Ih1m+f5xHQeXMExf2JygMHjOk=\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
33         h=from:to:cc:subject:date:message-id:x-mailer:mime-version\r
34         :content-type:content-transfer-encoding;\r
35         b=sX66UQsI+RFG22LoJVo7cGiLW9veFUvCQwvNlVhuyc+4cbG23pD+6nateAScb+hF3F\r
36         sSCHboX6hXKnLaFSpwOnurEe3dS8mar4VFsSCLMmriP+D3zSt6XBhLeIS7bODvsOefo0\r
37         y0RNgfdoqNpfgDH1EnpeIdyxauhYM0wsj6YTE=\r
38 Received: by 10.223.33.6 with SMTP id f6mr1160425fad.85.1306427260766;\r
39         Thu, 26 May 2011 09:27:40 -0700 (PDT)\r
40 Received: from localhost ([91.144.186.21])\r
41         by mx.google.com with ESMTPS id z21sm365907fan.16.2011.05.26.09.27.39\r
42         (version=TLSv1/SSLv3 cipher=OTHER);\r
43         Thu, 26 May 2011 09:27:39 -0700 (PDT)\r
44 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
45 To: notmuch@notmuchmail.org\r
46 Subject:\r
47  [PATCH] test: add test-lib.el file with `visible-buffer-string' function\r
48 Date: Thu, 26 May 2011 20:27:58 +0400\r
49 Message-Id: <1306427278-14932-1-git-send-email-dmitry.kurochkin@gmail.com>\r
50 X-Mailer: git-send-email 1.7.5.1\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, 26 May 2011 16:27:43 -0000\r
67 \r
68 The patch adds test-lib.el file for Emacs tests auxiliary stuff.\r
69 Currently, it implements two functions: `visible-buffer-string'\r
70 and `visible-buffer-substring'.  These are similar to standard\r
71 counterparts without "visible-" prefix but exclude invisible\r
72 text.  The functions are not used anywhere at the moment but\r
73 should be useful for testing hiding/showing in the Emacs\r
74 interface.\r
75 ---\r
76  test/test-lib.el |   35 +++++++++++++++++++++++++++++++++++\r
77  test/test-lib.sh |    5 +++--\r
78  2 files changed, 38 insertions(+), 2 deletions(-)\r
79  create mode 100644 test/test-lib.el\r
80 \r
81 diff --git a/test/test-lib.el b/test/test-lib.el\r
82 new file mode 100644\r
83 index 0000000..9439996\r
84 --- /dev/null\r
85 +++ b/test/test-lib.el\r
86 @@ -0,0 +1,35 @@\r
87 +;; test-lib.el --- auxiliary stuff for Notmuch Emacs tests.\r
88 +;;\r
89 +;; Copyright © Carl Worth\r
90 +;; Copyright © David Edmondson\r
91 +;;\r
92 +;; This file is part of Notmuch test suit.\r
93 +;;\r
94 +;; Notmuch is free software: you can redistribute it and/or modify it\r
95 +;; under the terms of the GNU General Public License as published by\r
96 +;; the Free Software Foundation, either version 3 of the License, or\r
97 +;; (at your option) any later version.\r
98 +;;\r
99 +;; Notmuch is distributed in the hope that it will be useful, but\r
100 +;; WITHOUT ANY WARRANTY; without even the implied warranty of\r
101 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
102 +;; General Public License for more details.\r
103 +;;\r
104 +;; You should have received a copy of the GNU General Public License\r
105 +;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.\r
106 +;;\r
107 +;; Authors: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
108 +\r
109 +(defun visible-buffer-string ()\r
110 +  "Same as `buffer-string', but excludes invisible text."\r
111 +  (visible-buffer-substring (point-min) (point-max)))\r
112 +\r
113 +(defun visible-buffer-substring (start end)\r
114 +  "Same as `buffer-substring', but excludes invisible text."\r
115 +  (let (str)\r
116 +    (while (< start end)\r
117 +      (let ((next-pos (next-char-property-change start end)))\r
118 +       (when (not (invisible-p start))\r
119 +         (setq str (concat str (buffer-substring start next-pos))))\r
120 +       (setq start next-pos)))\r
121 +    str))\r
122 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
123 index 7cc43cd..9645567 100755\r
124 --- a/test/test-lib.sh\r
125 +++ b/test/test-lib.sh\r
126 @@ -843,9 +843,9 @@ fi\r
127  #\r
128  # --no-site-file       Don't load the site-wide startup stuff\r
129  #\r
130 -# --directory          Ensure that the local notmuch.el source is found\r
131 +# --directory          Ensure that the local elisp sources are found\r
132  #\r
133 -# --load               Force loading of notmuch.el\r
134 +# --load               Force loading of notmuch.el and test-lib.el\r
135  #\r
136  # notmuch-test-wait    Function for tests to use to wait for process completion\r
137  #\r
138 @@ -855,6 +855,7 @@ fi\r
139  \r
140  emacs \$BATCH --no-init-file --no-site-file \\r
141         --directory ../../emacs --load notmuch.el \\r
142 +       --directory .. --load test-lib.el \\r
143         --eval "(defun notmuch-test-wait ()\r
144                         (while (get-buffer-process (current-buffer))\r
145                                 (sleep-for 0.1)))" \\r
146 -- \r
147 1.7.5.1\r
148 \r