gnu: perl-www-curl: Fix build failure.
[jackhill/guix/guix.git] / gnu / packages / patches / notmuch-emacs-25-compatibility-fix.patch
1 This fixes a test failure with emacs-25. Picked from
2 https://git.notmuchmail.org/git?p=notmuch;a=commit;h=f575a346df09c82691bb9e7c462836d982fe31f7
3
4 From f575a346df09c82691bb9e7c462836d982fe31f7 Mon Sep 17 00:00:00 2001
5 From: David Bremner <david@tethera.net>
6 Date: Sun, 9 Oct 2016 19:30:44 -0300
7 Subject: [PATCH] emacs/show: force notmuch-show-buttonise-links to act on
8 lines
9
10 This seems to fix a problem with emacs 25 creating partial buttons by
11 calling n-s-b-l with a region that does not include the whole button.
12 I'm not 100% sure it's legit to act outside the region passed by
13 jit-lock, but goto-address-fontify-region (where I borrowed the code
14 from) already does this, so this patch to not make things worse.
15 ---
16 emacs/notmuch-show.el | 12 +++++++-----
17 1 file changed, 7 insertions(+), 5 deletions(-)
18
19 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
20 index 641398d..e7d16f8 100644
21 --- a/emacs/notmuch-show.el
22 +++ b/emacs/notmuch-show.el
23 @@ -1174,13 +1174,15 @@ This also turns id:\"<message id>\"-parts and mid: links into
24 buttons for a corresponding notmuch search."
25 (goto-address-fontify-region start end)
26 (save-excursion
27 - (let (links)
28 - (goto-char start)
29 - (while (re-search-forward notmuch-id-regexp end t)
30 + (let (links
31 + (beg-line (progn (goto-char start) (line-beginning-position)))
32 + (end-line (progn (goto-char end) (line-end-position))))
33 + (goto-char beg-line)
34 + (while (re-search-forward notmuch-id-regexp end-line t)
35 (push (list (match-beginning 0) (match-end 0)
36 (match-string-no-properties 0)) links))
37 - (goto-char start)
38 - (while (re-search-forward notmuch-mid-regexp end t)
39 + (goto-char beg-line)
40 + (while (re-search-forward notmuch-mid-regexp end-line t)
41 (let* ((mid-cid (match-string-no-properties 1))
42 (mid (save-match-data
43 (string-match "^[^/]*" mid-cid)
44 --
45 2.10.1
46