GNU bug report logs - #23343
25.0.93; URI schemes are not regexp-quoted for `goto-address-url-regexp'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Phil Sainty <psainty@HIDDEN>; Keywords: patch; dated Sat, 23 Apr 2016 13:52:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Lars Magne Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 23343 <at> debbugs.gnu.org:


Received: (at 23343) by debbugs.gnu.org; 24 Apr 2016 13:48:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 24 09:48:19 2016
Received: from localhost ([127.0.0.1]:44636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1auKOY-0001ux-RN
	for submit <at> debbugs.gnu.org; Sun, 24 Apr 2016 09:48:18 -0400
Received: from [219.88.242.62] (port=52276 helo=mail.orcon.net.nz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1auKOX-0001un-DH
 for 23343 <at> debbugs.gnu.org; Sun, 24 Apr 2016 09:48:18 -0400
Received: from [192.168.20.100] (host-203-94-60-222.xdsl.kinect.net.nz
 [203.94.60.222] (may be forged)) (authenticated bits=0)
 by mail.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id u3ODmAPT033676; 
 Mon, 25 Apr 2016 01:48:11 +1200
Subject: Re: bug#23343: 25.0.93; [PATCH] URI schemes are not regexp-quoted for
 `goto-address-url-regexp'
To: Lars Magne Ingebrigtsen <larsi@HIDDEN>
References: <571B7DCC.5090506@HIDDEN> <571B8080.90009@HIDDEN>
 <571BFBA4.8070503@HIDDEN> <m3inz7ck6o.fsf@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <571CCE9A.1020103@HIDDEN>
Date: Mon, 25 Apr 2016 01:48:10 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <m3inz7ck6o.fsf@HIDDEN>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-Bayes-Prob: 0.0001 (Score 0: No Bayes scoring rules defined,
 tokens from: outbound)
X-Spam-Score: -1.73 () [Hold at 3.00] FREEMAIL_FROM:0.001, RDNS_NONE:1.274,
 CC(NZ:-3)
X-CanIt-Geo: ip=203.94.60.222; country=NZ; region=Waikato; city=Hamilton;
 latitude=-37.7610; longitude=175.2474;
 http://maps.google.com/maps?q=-37.7610,175.2474&z=6
X-CanItPRO-Stream: base:outbound
X-Canit-Stats-ID: 02QKdMbId - 3dcc044ea958 - 20160425 (trained as not-spam)
X-Scanned-By: CanIt (www . roaringpenguin . com)
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On 24/04/16 23:36, Lars Magne Ingebrigtsen wrote: > Having
 variable defaults depend on each other can be awkward, especially > when
 it's the "first" variable that users will realistically be > tweaking. [...]
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (psainty[at]orcon.net.nz)
 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Debbugs-Envelope-To: 23343
Cc: 23343 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  On 24/04/16 23:36, Lars Magne Ingebrigtsen wrote: > Having
    variable defaults depend on each other can be awkward, especially > when
   it's the "first" variable that users will realistically be > tweaking. [...]
    
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail provider
                             (psainty[at]orcon.net.nz)
  1.3 RDNS_NONE              Delivered to internal network by a host with no rDNS

On 24/04/16 23:36, Lars Magne Ingebrigtsen wrote:
 > Having variable defaults depend on each other can be awkward, especially
 > when it's the "first" variable that users will realistically be
 > tweaking.

Yes indeed. I don't especially like the way I've done it -- but it
seemed like an improvement, nevertheless.

 >> +(defvar goto-address-uri-schemes
 >
 > I don't much value to this "intermediate" variable.  It just makes
 > things even more complicated to work with, I think.

It's true that this one is an intermediate by default; but it's one
which users might potentially want to set in order to say "I don't
care about the default schemes at all; I only want the specific
schemes I've specified here to be matched."

So of the two new variables I'm adding, a user might set one or the
other depending on their needs. That was my line of thought, anyhow.

-Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23343; Package emacs. Full text available.

Message received at 23343 <at> debbugs.gnu.org:


Received: (at 23343) by debbugs.gnu.org; 24 Apr 2016 11:37:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 24 07:37:02 2016
Received: from localhost ([127.0.0.1]:44510 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1auILT-0003wV-Hm
	for submit <at> debbugs.gnu.org; Sun, 24 Apr 2016 07:37:02 -0400
Received: from hermes.netfonds.no ([80.91.224.195]:37633)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1auILO-0003wI-EQ
 for 23343 <at> debbugs.gnu.org; Sun, 24 Apr 2016 07:36:58 -0400
Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories)
 by hermes.netfonds.no with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
 (Exim 4.84_2) (envelope-from <larsi@HIDDEN>)
 id 1auILI-0002ed-98; Sun, 24 Apr 2016 13:36:52 +0200
From: Lars Magne Ingebrigtsen <larsi@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: Re: bug#23343: 25.0.93; [PATCH] URI schemes are not regexp-quoted for
 `goto-address-url-regexp'
References: <571B7DCC.5090506@HIDDEN> <571B8080.90009@HIDDEN>
 <571BFBA4.8070503@HIDDEN>
Date: Sun, 24 Apr 2016 13:36:47 +0200
In-Reply-To: <571BFBA4.8070503@HIDDEN> (Phil Sainty's message of "Sun,
 24 Apr 2016 10:48:04 +1200")
Message-ID: <m3inz7ck6o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 23343
Cc: 23343 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Phil Sainty <psainty@HIDDEN> writes:

> I've made docstring changes to point out that it's only useful to
> set goto-address-uri-schemes-ignored and goto-address-uri-schemes
> prior to loading the library.
>
> I'm not sure if there's any policy about such things, but it seemed
> like it would be quite a lot more work to get around that. I imagine
> the :set ability of defcustom would make it possible to have changes
> to those variables dynamically update goto-address-url-regexp as well;
> but in doing that you'd need to take care not to clobber values which
> had themselves been customized also, and it all seemed like a lot of
> added complexity for little benefit.

Having variable defaults depend on each other can be awkward, especially
when it's the "first" variable that users will realistically be
tweaking.

[...]

> +(defvar goto-address-uri-schemes-ignored
> +  ;; By default we exclude `mailto:' (email addresses are matched
> +  ;; by `goto-address-mail-regexp') and also `data:', as it is not
> +  ;; terribly useful to follow those URIs, and leaving them causes
> +  ;; `use Data::Dumper;' to be fontified oddly in Perl files.
> +  '("mailto:" "data:")

Which is this one.  But I don't really see how to fix that without
having a different interface here (i.e., getting rid of
goto-address-url-regexp), so perhaps it's OK...

But:

> +(defvar goto-address-uri-schemes
> +  ;; We use `thing-at-point-uri-schemes', with a few exclusions,
> +  ;; as listed in `goto-address-uri-schemes-ignored'.
> +  (seq-reduce (lambda (accum elt) (delete elt accum))
> +              goto-address-uri-schemes-ignored
> +              (copy-sequence thing-at-point-uri-schemes))

I don't much value to this "intermediate" variable.  It just makes
things even more complicated to work with, I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23343; Package emacs. Full text available.

Message received at 23343 <at> debbugs.gnu.org:


Received: (at 23343) by debbugs.gnu.org; 23 Apr 2016 22:48:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 23 18:48:12 2016
Received: from localhost ([127.0.0.1]:44376 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1au6LU-0000jj-6r
	for submit <at> debbugs.gnu.org; Sat, 23 Apr 2016 18:48:12 -0400
Received: from [219.88.242.56] (port=38073 helo=mail.orcon.net.nz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1au6LS-0000jZ-Bq
 for 23343 <at> debbugs.gnu.org; Sat, 23 Apr 2016 18:48:11 -0400
Received: from [192.168.20.100] (host-203-94-60-222.xdsl.kinect.net.nz
 [203.94.60.222] (may be forged)) (authenticated bits=0)
 by mail.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id u3NMm4mQ029592
 for <23343 <at> debbugs.gnu.org>; Sun, 24 Apr 2016 10:48:05 +1200
Subject: Re: bug#23343: 25.0.93; [PATCH] URI schemes are not regexp-quoted for
 `goto-address-url-regexp'
To: 23343 <at> debbugs.gnu.org
References: <571B7DCC.5090506@HIDDEN> <571B8080.90009@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <571BFBA4.8070503@HIDDEN>
Date: Sun, 24 Apr 2016 10:48:04 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <571B8080.90009@HIDDEN>
Content-Type: multipart/mixed; boundary="------------090006060502080504060907"
X-Bayes-Prob: 0.0001 (Score 0: No Bayes scoring rules defined,
 tokens from: outbound)
X-Spam-Score: -1.71 () [Hold at 3.00] FREEMAIL_FROM:0.001, RDNS_NONE:1.274,
 TO_NO_BRKTS_NORDNS:0.001, T_TO_NO_BRKTS_FREEMAIL:0.01, CC(NZ:-3)
X-CanIt-Geo: ip=203.94.60.222; country=NZ; region=Waikato; city=Hamilton;
 latitude=-37.7610; longitude=175.2474;
 http://maps.google.com/maps?q=-37.7610,175.2474&z=6
X-CanItPRO-Stream: base:outbound
X-Canit-Stats-ID: 01QJWM5jj - f0a0bf12ec30 - 20160424 (trained as not-spam)
X-Scanned-By: CanIt (www . roaringpenguin . com)
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: I've made docstring changes to point out that it's only
 useful
 to set goto-address-uri-schemes-ignored and goto-address-uri-schemes prior
 to loading the library. I'm not sure if there's any policy about such things, 
 but it seemed like it would be quite a lot more work to get around that.
 I imagine the :set ability of defcustom would make it possible to have changes
 to those variables dynamically update goto-address-url-regexp as well; but
 in doing that you'd need to take care not to clobber values which had
 themselves
 been customized also, and it all seemed like a lot of added complexity for
 little benefit. [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [219.88.242.56 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [219.88.242.56 listed in wl.mailspike.net]
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (psainty[at]orcon.net.nz)
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Debbugs-Envelope-To: 23343
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  I've made docstring changes to point out that it's only useful
    to set goto-address-uri-schemes-ignored and goto-address-uri-schemes prior
    to loading the library. I'm not sure if there's any policy about such things,
    but it seemed like it would be quite a lot more work to get around that.
   I imagine the :set ability of defcustom would make it possible to have changes
    to those variables dynamically update goto-address-url-regexp as well; but
    in doing that you'd need to take care not to clobber values which had themselves
    been customized also, and it all seemed like a lot of added complexity for
    little benefit. [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
                             trust
                             [219.88.242.56 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [219.88.242.56 listed in wl.mailspike.net]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail provider
                             (psainty[at]orcon.net.nz)
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
  1.3 RDNS_NONE              Delivered to internal network by a host with no rDNS

This is a multi-part message in MIME format.
--------------090006060502080504060907
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

I've made docstring changes to point out that it's only useful to
set goto-address-uri-schemes-ignored and goto-address-uri-schemes
prior to loading the library.

I'm not sure if there's any policy about such things, but it seemed
like it would be quite a lot more work to get around that. I imagine
the :set ability of defcustom would make it possible to have changes
to those variables dynamically update goto-address-url-regexp as well;
but in doing that you'd need to take care not to clobber values which
had themselves been customized also, and it all seemed like a lot of
added complexity for little benefit.


-Phil

--------------090006060502080504060907
Content-Type: text/x-patch;
 name="0001-Fix-goto-address-url-regexp.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0001-Fix-goto-address-url-regexp.patch"

From 9cbe7647f7f1558274afaabb26c84d85f3e6c6a4 Mon Sep 17 00:00:00 2001
From: Phil Sainty <psainty@HIDDEN>
Date: Sun, 24 Apr 2016 01:40:47 +1200
Subject: [PATCH] Fix `goto-address-url-regexp'

* lisp/net/goto-addr.el: The URI schemes to be recognised by
`goto-address-mode' were not regexp-quoted. (Bug#23343)
---
 lisp/net/goto-addr.el | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index bc3c403..e8d1b62 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -59,6 +59,7 @@
 
 ;;; Code:
 
+(require 'seq)
 (require 'thingatpt)
 (autoload 'browse-url-url-at-point "browse-url")
 
@@ -101,23 +102,30 @@ goto-address-mail-regexp
   "[-a-zA-Z0-9=._+]+@\\([-a-zA-z0-9_]+\\.\\)+[a-zA-Z0-9]+"
   "A regular expression probably matching an e-mail address.")
 
+(defvar goto-address-uri-schemes-ignored
+  ;; By default we exclude `mailto:' (email addresses are matched
+  ;; by `goto-address-mail-regexp') and also `data:', as it is not
+  ;; terribly useful to follow those URIs, and leaving them causes
+  ;; `use Data::Dumper;' to be fontified oddly in Perl files.
+  '("mailto:" "data:")
+  "List of URI schemes to exclude from `goto-address-uri-schemes'.
+
+Customisations made after goto-addr is loaded will have no effect.")
+
+(defvar goto-address-uri-schemes
+  ;; We use `thing-at-point-uri-schemes', with a few exclusions,
+  ;; as listed in `goto-address-uri-schemes-ignored'.
+  (seq-reduce (lambda (accum elt) (delete elt accum))
+              goto-address-uri-schemes-ignored
+              (copy-sequence thing-at-point-uri-schemes))
+  "List of URI schemes matched by `goto-address-url-regexp'.
+
+Customisations made after goto-addr is loaded will have no effect.")
+
 (defvar goto-address-url-regexp
-  (concat
-   "\\<\\("
-   (mapconcat 'identity
-              (delete "mailto:"
-		      ;; Remove `data:', as it's not terribly useful to follow
-		      ;; those.  Leaving them causes `use Data::Dumper;' to be
-		      ;; fontified oddly in Perl files.
-                      (delete "data:"
-                              (copy-sequence thing-at-point-uri-schemes)))
-              "\\|")
-   "\\)"
-   thing-at-point-url-path-regexp)
-  ;; (concat "\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|"
-  ;; 	  "telnet\\|wais\\):\\(//[-a-zA-Z0-9_.]+:"
-  ;; 	  "[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*"
-  ;; 	  "[-a-zA-Z0-9_=#$@~`%&*+|\\/]")
+  (concat "\\<"
+          (regexp-opt goto-address-uri-schemes t)
+          thing-at-point-url-path-regexp)
   "A regular expression probably matching a URL.")
 
 (defvar goto-address-highlight-keymap
-- 
2.8.0


--------------090006060502080504060907--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23343; Package emacs. Full text available.

Message received at 23343 <at> debbugs.gnu.org:


Received: (at 23343) by debbugs.gnu.org; 23 Apr 2016 14:02:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 23 10:02:50 2016
Received: from localhost ([127.0.0.1]:44148 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aty94-0004OU-A7
	for submit <at> debbugs.gnu.org; Sat, 23 Apr 2016 10:02:50 -0400
Received: from [219.88.242.52] (port=52071 helo=mail.orcon.net.nz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1aty91-0004OJ-Nt
 for 23343 <at> debbugs.gnu.org; Sat, 23 Apr 2016 10:02:48 -0400
Received: from [192.168.20.100] (host-203-94-60-222.xdsl.kinect.net.nz
 [203.94.60.222] (may be forged)) (authenticated bits=0)
 by mail.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id u3NE2eiZ028285
 for <23343 <at> debbugs.gnu.org>; Sun, 24 Apr 2016 02:02:41 +1200
Subject: bug#23343: 25.0.93; [PATCH] URI schemes are not regexp-quoted for
 `goto-address-url-regexp'
To: 23343 <at> debbugs.gnu.org
References: <571B7DCC.5090506@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <571B8080.90009@HIDDEN>
Date: Sun, 24 Apr 2016 02:02:40 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <571B7DCC.5090506@HIDDEN>
Content-Type: multipart/mixed; boundary="------------040109020806040006060005"
X-Bayes-Prob: 0.0001 (Score 0: No Bayes scoring rules defined,
 tokens from: outbound)
X-Spam-Score: -1.71 () [Hold at 3.00] FREEMAIL_FROM:0.001, RDNS_NONE:1.274,
 TO_NO_BRKTS_NORDNS:0.001, T_TO_NO_BRKTS_FREEMAIL:0.01, CC(NZ:-3)
X-CanIt-Geo: ip=203.94.60.222; country=NZ; region=Waikato; city=Hamilton;
 latitude=-37.7610; longitude=175.2474;
 http://maps.google.com/maps?q=-37.7610,175.2474&z=6
X-CanItPRO-Stream: base:outbound
X-Canit-Stats-ID: 01QJO2ELB - 95c3bcd73d43 - 20160424 (trained as not-spam)
X-Scanned-By: CanIt (www . roaringpenguin . com)
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: This could be resolved with - (mapconcat 'identity +
 (mapconcat 'regexp-quote But on account of
 http://stackoverflow.com/questions/36787889/how-to-remove-some-link-type-in-emacs
 I thought that making it easier to customise this feature was a useful
 improvement to make. [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (psainty[at]orcon.net.nz)
 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Debbugs-Envelope-To: 23343
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  This could be resolved with - (mapconcat 'identity + (mapconcat
    'regexp-quote But on account of http://stackoverflow.com/questions/36787889/how-to-remove-some-link-type-in-emacs
    I thought that making it easier to customise this feature was a useful improvement
    to make. [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail provider
                             (psainty[at]orcon.net.nz)
  1.3 RDNS_NONE              Delivered to internal network by a host with no rDNS

This is a multi-part message in MIME format.
--------------040109020806040006060005
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

This could be resolved with

-   (mapconcat 'identity
+   (mapconcat 'regexp-quote

But on account of 
http://stackoverflow.com/questions/36787889/how-to-remove-some-link-type-in-emacs
I thought that making it easier to customise this feature was a useful
improvement to make.


-Phil

--------------040109020806040006060005
Content-Type: text/x-patch;
 name="0001-Fix-goto-address-url-regexp.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0001-Fix-goto-address-url-regexp.patch"

From 0d7a39a1c56700020127c01a622d13c27aec498d Mon Sep 17 00:00:00 2001
From: Phil Sainty <psainty@HIDDEN>
Date: Sun, 24 Apr 2016 01:40:47 +1200
Subject: [PATCH] Fix `goto-address-url-regexp'

* lisp/net/goto-addr.el: The URI schemes to be recognised by
`goto-address-mode' were not regexp-quoted. (Bug#23343)
---
 lisp/net/goto-addr.el | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index bc3c403..e4bbf76 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -59,6 +59,7 @@
 
 ;;; Code:
 
+(require 'seq)
 (require 'thingatpt)
 (autoload 'browse-url-url-at-point "browse-url")
 
@@ -101,23 +102,26 @@ goto-address-mail-regexp
   "[-a-zA-Z0-9=._+]+@\\([-a-zA-z0-9_]+\\.\\)+[a-zA-Z0-9]+"
   "A regular expression probably matching an e-mail address.")
 
+(defvar goto-address-uri-schemes-ignored
+  ;; By default we exclude `mailto:' (email addresses are matched
+  ;; by `goto-address-mail-regexp') and also `data:', as it is not
+  ;; terribly useful to follow those URIs, and leaving them causes
+  ;; `use Data::Dumper;' to be fontified oddly in Perl files.
+  '("mailto:" "data:")
+  "List of URI schemes to exclude from `goto-address-uri-schemes'.")
+
+(defvar goto-address-uri-schemes
+  ;; We use `thing-at-point-uri-schemes', with a few exclusions,
+  ;; as listed in `goto-address-uri-schemes-ignored'.
+  (seq-reduce (lambda (accum elt) (delete elt accum))
+              goto-address-uri-schemes-ignored
+              (copy-sequence thing-at-point-uri-schemes))
+  "List of URI schemes matched by `goto-address-url-regexp'.")
+
 (defvar goto-address-url-regexp
-  (concat
-   "\\<\\("
-   (mapconcat 'identity
-              (delete "mailto:"
-		      ;; Remove `data:', as it's not terribly useful to follow
-		      ;; those.  Leaving them causes `use Data::Dumper;' to be
-		      ;; fontified oddly in Perl files.
-                      (delete "data:"
-                              (copy-sequence thing-at-point-uri-schemes)))
-              "\\|")
-   "\\)"
-   thing-at-point-url-path-regexp)
-  ;; (concat "\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|"
-  ;; 	  "telnet\\|wais\\):\\(//[-a-zA-Z0-9_.]+:"
-  ;; 	  "[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*"
-  ;; 	  "[-a-zA-Z0-9_=#$@~`%&*+|\\/]")
+  (concat "\\<"
+          (regexp-opt goto-address-uri-schemes t)
+          thing-at-point-url-path-regexp)
   "A regular expression probably matching a URL.")
 
 (defvar goto-address-highlight-keymap
-- 
2.8.0


--------------040109020806040006060005--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23343; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Apr 2016 13:51:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 23 09:51:44 2016
Received: from localhost ([127.0.0.1]:43705 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1atxyK-00041X-7a
	for submit <at> debbugs.gnu.org; Sat, 23 Apr 2016 09:51:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39953)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1atxyI-00041L-NV
 for submit <at> debbugs.gnu.org; Sat, 23 Apr 2016 09:51:43 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1atxyC-0007dY-SV
 for submit <at> debbugs.gnu.org; Sat, 23 Apr 2016 09:51:37 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:37994)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1atxyC-0007dU-Oh
 for submit <at> debbugs.gnu.org; Sat, 23 Apr 2016 09:51:36 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59139)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1atxyC-00074z-1Z
 for bug-gnu-emacs@HIDDEN; Sat, 23 Apr 2016 09:51:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1atxy8-0007av-SG
 for bug-gnu-emacs@HIDDEN; Sat, 23 Apr 2016 09:51:35 -0400
Received: from [219.88.242.59] (port=56882 helo=mail.orcon.net.nz)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1atxy8-0007VQ-BZ
 for bug-gnu-emacs@HIDDEN; Sat, 23 Apr 2016 09:51:32 -0400
Received: from [192.168.20.100] (host-203-94-60-222.xdsl.kinect.net.nz
 [203.94.60.222] (may be forged)) (authenticated bits=0)
 by mail.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id u3NDp9Pv011450
 for <bug-gnu-emacs@HIDDEN>; Sun, 24 Apr 2016 01:51:10 +1200
To: bug-gnu-emacs@HIDDEN
From: Phil Sainty <psainty@HIDDEN>
Subject: 25.0.93; URI schemes are not regexp-quoted for
 `goto-address-url-regexp'
Message-ID: <571B7DCC.5090506@HIDDEN>
Date: Sun, 24 Apr 2016 01:51:08 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.5.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Bayes-Prob: 0.5 (Score 0: No Bayes scoring rules defined,
 tokens from: outbound)
X-CanIt-Geo: ip=203.94.60.222; country=NZ; region=Waikato; city=Hamilton;
 latitude=-37.7610; longitude=175.2474;
 http://maps.google.com/maps?q=-37.7610,175.2474&z=6
X-CanItPRO-Stream: base:outbound
X-Canit-Stats-ID: 02QJNP9FI - dbc579757f76 - 20160424
X-Scanned-By: CanIt (www . roaringpenguin . com)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.4 (---)

The URI schemes from `thing-at-point-uri-schemes' are concatenated
into a regexp group without being suitably escaped, meaning there
are bugs whenever regexp meta-characters appear. e.g.:

bzr+ssh://
iris.beep:





Acknowledgement sent to Phil Sainty <psainty@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#23343; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Apr 2016 23:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.