[PATCH] test: fix die() in test-lib.sh and test-lib-common.sh
[notmuch-archives.git] / 2f / 68b2f535535a7b3108c9c81bf4c011c187747f
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 89879429E2A\r
6         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 14:38:19 -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 HCzpEyxpKJ+N for <notmuch@notmuchmail.org>;\r
17         Thu, 26 May 2011 14:38:18 -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 D493D429E25\r
22         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 14:38:17 -0700 (PDT)\r
23 Received: by mail-fx0-f53.google.com with SMTP id 8so1052886fxm.26\r
24         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 14:38:17 -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         :in-reply-to:references;\r
28         bh=8SnJWrkUxy03QbIlouFFns24JV2tu3uxZl1PB79vQX0=;\r
29         b=qWq09Qa1bBIGCCK2EQMsXm5bNJE072A3O7viOATSyEpt1c+uKG5CQviQ9bD+vKpuqW\r
30         s7tTeridA0/W7svAOr3uD/wm36b8U+vKUJTlc1bRdo21ty/4jTkgUWHspFk7shxE68fw\r
31         SUXZa47BNaLjWaH6N9Jzs9RsVpgXPXocp0XVU=\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:in-reply-to:references;\r
34         b=k7IIz8uHU4v4qkwLjQMjJGqf9Zb3wwOLF6J1PQcJPa77SU8FP5Tz939MsvmiDG4Bby\r
35         KWoDwfQXbT5ByIWwvlXP1qyveDXW13ZuaiLNA9/lCr+zn2DoTE9vojVrXffCSUbvCwUj\r
36         VebBN75SrnIY4tLgDgqYZXY5HEaTUxXMk8hWk=\r
37 Received: by 10.223.9.137 with SMTP id l9mr1479801fal.25.1306445897509;\r
38         Thu, 26 May 2011 14:38:17 -0700 (PDT)\r
39 Received: from localhost ([91.144.186.21])\r
40         by mx.google.com with ESMTPS id l26sm446553fam.21.2011.05.26.14.38.16\r
41         (version=TLSv1/SSLv3 cipher=OTHER);\r
42         Thu, 26 May 2011 14:38:16 -0700 (PDT)\r
43 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH 2/2] Workaround for Emacs bug #8721.\r
46 Date: Fri, 27 May 2011 01:38:35 +0400\r
47 Message-Id: <1306445915-9474-2-git-send-email-dmitry.kurochkin@gmail.com>\r
48 X-Mailer: git-send-email 1.7.5.1\r
49 In-Reply-To: <1306445915-9474-1-git-send-email-dmitry.kurochkin@gmail.com>\r
50 References: <1306361416-5019-1-git-send-email-dmitry.kurochkin@gmail.com>\r
51         <1306445915-9474-1-git-send-email-dmitry.kurochkin@gmail.com>\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Thu, 26 May 2011 21:38:19 -0000\r
65 \r
66 The patch adds `notmuch-isearch-range-invisible' function which\r
67 is the same as `isearch-range-invisible' but with fixed Emacs bug\r
68 `notmuch-isearch-range-invisible' instead of the original\r
69 `isearch-range-invisible' when in `notmuch-show-mode'.\r
70 ---\r
71  emacs/notmuch-wash.el |   67 +++++++++++++++++++++++++++++++++++++++++++++++++\r
72  1 files changed, 67 insertions(+), 0 deletions(-)\r
73 \r
74 diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
75 index 992fa8f..f37fd95 100644\r
76 --- a/emacs/notmuch-wash.el\r
77 +++ b/emacs/notmuch-wash.el\r
78 @@ -298,4 +298,71 @@ for error."\r
79  \r
80  ;;\r
81  \r
82 +;; Temporary workaround for Emacs bug #8721\r
83 +;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8721\r
84 +\r
85 +(defun notmuch-isearch-range-invisible (beg end)\r
86 +  "Same as `isearch-range-invisible' but with fixed Emacs bug #8721."\r
87 +  (when (/= beg end)\r
88 +    ;; Check that invisibility runs up to END.\r
89 +    (save-excursion\r
90 +      (goto-char beg)\r
91 +      (let (;; can-be-opened keeps track if we can open some overlays.\r
92 +           (can-be-opened (eq search-invisible 'open))\r
93 +           ;; the list of overlays that could be opened\r
94 +           (crt-overlays nil))\r
95 +       (when (and can-be-opened isearch-hide-immediately)\r
96 +         (isearch-close-unnecessary-overlays beg end))\r
97 +       ;; If the following character is currently invisible,\r
98 +       ;; skip all characters with that same `invisible' property value.\r
99 +       ;; Do that over and over.\r
100 +       (while (and (< (point) end) (invisible-p (point)))\r
101 +         (if (get-text-property (point) 'invisible)\r
102 +             (progn\r
103 +               (goto-char (next-single-property-change (point) 'invisible\r
104 +                                                       nil end))\r
105 +               ;; if text is hidden by an `invisible' text property\r
106 +               ;; we cannot open it at all.\r
107 +               (setq can-be-opened nil))\r
108 +           (when can-be-opened\r
109 +             (let ((overlays (overlays-at (point)))\r
110 +                   ov-list\r
111 +                   o\r
112 +                   invis-prop)\r
113 +               (while overlays\r
114 +                 (setq o (car overlays)\r
115 +                       invis-prop (overlay-get o 'invisible))\r
116 +                 (if (invisible-p invis-prop)\r
117 +                     (if (overlay-get o 'isearch-open-invisible)\r
118 +                         (setq ov-list (cons o ov-list))\r
119 +                       ;; We found one overlay that cannot be\r
120 +                       ;; opened, that means the whole chunk\r
121 +                       ;; cannot be opened.\r
122 +                       (setq can-be-opened nil)))\r
123 +                 (setq overlays (cdr overlays)))\r
124 +               (if can-be-opened\r
125 +                   ;; It makes sense to append to the open\r
126 +                   ;; overlays list only if we know that this is\r
127 +                   ;; t.\r
128 +                   (setq crt-overlays (append ov-list crt-overlays)))))\r
129 +           (goto-char (next-overlay-change (point)))))\r
130 +       ;; See if invisibility reaches up thru END.\r
131 +       (if (>= (point) end)\r
132 +           (if (and can-be-opened (consp crt-overlays))\r
133 +               (progn\r
134 +                 (setq isearch-opened-overlays\r
135 +                       (append isearch-opened-overlays crt-overlays))\r
136 +                 (mapc 'isearch-open-overlay-temporary crt-overlays)\r
137 +                 nil)\r
138 +             (setq isearch-hidden t)))))))\r
139 +\r
140 +(defadvice isearch-range-invisible (around notmuch-isearch-range-invisible-advice activate)\r
141 +  "Call `notmuch-isearch-range-invisible' instead of the original\r
142 +`isearch-range-invisible' when in `notmuch-show-mode' mode."\r
143 +  (if (eq major-mode 'notmuch-show-mode)\r
144 +      (setq ad-return-value (notmuch-isearch-range-invisible beg end))\r
145 +    ad-do-it))\r
146 +\r
147 +;;\r
148 +\r
149  (provide 'notmuch-wash)\r
150 -- \r
151 1.7.5.1\r
152 \r