unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>,
	David Bremner <david@tethera.net>,
	notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs/show: force notmuch-show-buttonise-links to act on lines
Date: Mon, 10 Oct 2016 21:30:21 +0300	[thread overview]
Message-ID: <m2y41wjbuq.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20161009223044.31442-1-david@tethera.net>

On Mon, Oct 10 2016, David Bremner <david@tethera.net> wrote:

> 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.
> ---

Applies cleanly and fixes the test in question on fedora 24

>  emacs/notmuch-show.el | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> This makes the test suite pass with emacs 25 for me. If people think
> this is sane, I'd like to do a bug fix release with this change.
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index f2487ab..643dee6 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.9.3
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

  reply	other threads:[~2016-10-10 18:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06  2:44 "id buttonization" test failure Marius Bakke
2016-10-06 13:08 ` David Bremner
2016-10-08  1:30 ` David Bremner
2016-10-08 12:33   ` David Bremner
2016-10-09 15:47     ` David Bremner
2016-10-09 22:30       ` [PATCH] emacs/show: force notmuch-show-buttonise-links to act on lines David Bremner
2016-10-10 18:30         ` Tomi Ollila [this message]
2016-10-11 11:25           ` David Bremner
2016-10-12  1:49         ` David Bremner
2016-10-12  2:05       ` "id buttonization" test failure David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2y41wjbuq.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).