From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 9E1C56DE137D for ; Sun, 9 Oct 2016 15:30:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.006 X-Spam-Level: X-Spam-Status: No, score=-0.006 tagged_above=-999 required=5 tests=[AWL=0.005, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mFP_dpMCOwn7 for ; Sun, 9 Oct 2016 15:30:55 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 0F4826DE137A for ; Sun, 9 Oct 2016 15:30:54 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1btMcA-0002md-Ry; Sun, 09 Oct 2016 18:30:38 -0400 Received: (nullmailer pid 31489 invoked by uid 1000); Sun, 09 Oct 2016 22:30:50 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH] emacs/show: force notmuch-show-buttonise-links to act on lines Date: Sun, 9 Oct 2016 19:30:44 -0300 Message-Id: <20161009223044.31442-1-david@tethera.net> X-Mailer: git-send-email 2.9.3 In-Reply-To: <87fuo5wmlk.fsf@zancas.localnet> References: <87fuo5wmlk.fsf@zancas.localnet> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 22:30:55 -0000 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(-) 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:\"\"-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