[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#23343: 25.0.93; [PATCH] URI schemes are not regexp-quoted for `goto-
From: |
Lars Magne Ingebrigtsen |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Phil Sainty <psainty@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