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

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Sat, 23 Apr 2016 13:52:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.0.93

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 23343 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 23343 <at> debbugs.gnu.org
Subject: Re: 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
Phil Sainty <psainty <at> orcon.net.nz> 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




This bug report was last modified 6 years and 19 days ago.

Previous Next


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