From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#23343: 25.0.93; [PATCH] URI schemes are not regexp-quoted for `goto-address-url-regexp' Date: Sun, 24 Apr 2016 13:36:47 +0200 Message-ID: References: <571B7DCC.5090506@orcon.net.nz> <571B8080.90009@orcon.net.nz> <571BFBA4.8070503@orcon.net.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1461497906 17776 80.91.229.3 (24 Apr 2016 11:38:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Apr 2016 11:38:26 +0000 (UTC) Cc: 23343@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 24 13:38:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1auIMg-0006hN-IG for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Apr 2016 13:38:14 +0200 Original-Received: from localhost ([::1]:55095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auIMf-0001nG-Pq for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Apr 2016 07:38:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auIMZ-0001hd-Ek for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2016 07:38:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auIMU-0005gd-EZ for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2016 07:38:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auIMU-0005gX-9a for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2016 07:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1auIMU-0003y7-2g for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2016 07:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Magne Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Apr 2016 11:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23343-submit@debbugs.gnu.org id=B23343.146149782215182 (code B ref 23343); Sun, 24 Apr 2016 11:38:02 +0000 Original-Received: (at 23343) by debbugs.gnu.org; 24 Apr 2016 11:37:02 +0000 Original-Received: from localhost ([127.0.0.1]:44510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1auILT-0003wV-Hm for submit@debbugs.gnu.org; Sun, 24 Apr 2016 07:37:02 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:37633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1auILO-0003wI-EQ for 23343@debbugs.gnu.org; Sun, 24 Apr 2016 07:36:58 -0400 Original-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 ) id 1auILI-0002ed-98; Sun, 24 Apr 2016 13:36:52 +0200 In-Reply-To: <571BFBA4.8070503@orcon.net.nz> (Phil Sainty's message of "Sun, 24 Apr 2016 10:48:04 +1200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:116738 Archived-At: Phil Sainty 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