all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 456b34519a4d3e72f94f6580c9c7576c4ae47804 1744 bytes (raw)
name: gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
From f575a346df09c82691bb9e7c462836d982fe31f7 Mon Sep 17 00:00:00 2001
From: David Bremner <david@tethera.net>
Date: Sun, 9 Oct 2016 19:30:44 -0300
Subject: [PATCH] emacs/show: force notmuch-show-buttonise-links to act on
 lines

This seems to fix a problem with emacs 25 creating partial buttons by
calling n-s-b-l with a region that does not include the whole button.
I'm not 100% sure it's legit to act outside the region passed by
jit-lock, but goto-address-fontify-region (where I borrowed the code
from) already does this, so this patch to not make things worse.
---
 emacs/notmuch-show.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 641398d..e7d16f8 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1174,13 +1174,15 @@ This also turns id:\"<message id>\"-parts and mid: links into
 buttons for a corresponding notmuch search."
   (goto-address-fontify-region start end)
   (save-excursion
-    (let (links)
-      (goto-char start)
-      (while (re-search-forward notmuch-id-regexp end t)
+    (let (links
+	  (beg-line (progn (goto-char start) (line-beginning-position)))
+	  (end-line (progn (goto-char end) (line-end-position))))
+      (goto-char beg-line)
+      (while (re-search-forward notmuch-id-regexp end-line t)
 	(push (list (match-beginning 0) (match-end 0)
 		    (match-string-no-properties 0)) links))
-      (goto-char start)
-      (while (re-search-forward notmuch-mid-regexp end t)
+      (goto-char beg-line)
+      (while (re-search-forward notmuch-mid-regexp end-line t)
 	(let* ((mid-cid (match-string-no-properties 1))
 	       (mid (save-match-data
 		      (string-match "^[^/]*" mid-cid)
-- 
2.10.1


debug log:

solving 456b345 ...
found 456b345 in https://yhetil.org/guix/20161017165506.17750-3-mbakke@fastmail.com/

applying [1/1] https://yhetil.org/guix/20161017165506.17750-3-mbakke@fastmail.com/
diff --git a/gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch b/gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch
new file mode 100644
index 0000000..456b345

1:38: space before tab in indent.
 	(push (list (match-beginning 0) (match-end 0)
1:39: space before tab in indent.
 		    (match-string-no-properties 0)) links))
1:44: space before tab in indent.
 	(let* ((mid-cid (match-string-no-properties 1))
1:45: space before tab in indent.
 	       (mid (save-match-data
1:46: space before tab in indent.
 		      (string-match "^[^/]*" mid-cid)
Checking patch gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch...
Applied patch gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

index at:
100644 456b34519a4d3e72f94f6580c9c7576c4ae47804	gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.