[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: 23.0.0; (thing-at-point 'url) returns invalid urls]
From: |
Leo |
Subject: |
Re: address@hidden: 23.0.0; (thing-at-point 'url) returns invalid urls] |
Date: |
Sat, 01 Sep 2007 21:57:02 +0100 |
User-agent: |
Gnus/5.110007 Emacs/23.0.0 (20070829) Fedora 7 (gnu/linux) |
On 2007-09-01 17:39 +0100, Drew Adams wrote:
>> Stefan gets my idea right. It is definitely not about aliveness.
>
> Fine. So what is the heuristic to use to recognize something that "is likely
> to be meant as a URL"? Presence of a URL scheme (e.g. http://, ftp://)?
> Presence of a URL scheme or "www." (e.g. www.whatever.anything)? There are
> already regexps defined to recognize URLs, with and without schemes. How
> should they be used or modified?
>
> And what to return when probably-intended-URL recognition fails? nil?
> Whatever is currently at point, without prepending http://? Should http://
> ever be prepended (e.g. if "www." satisfies the test for likely URL, as in
> www.google.com)?
To require that a url must contain a '.' in it is able to reduce the
risk of returning random urls by more than 90%. Can you image each time
I feed browse-url with (thing-at-point 'url), I am getting:
,----
| Cannot retrieve URL: http://something (exit status: 0)
|
| something could not be found. Please check the name, and try again.
`----
and it happen when the point is in any words.
> Let's stop being so vague and go beyond saying things like (1) just
> DTRT and (2) we'll have a heuristic that recognizes TRT. Which value
> do you want returned for which text at point? And what heuristic do
> you propose to use to recognize a likely URL intention?
Sometimes there might not be TRT thing, but there is a better thing to
do. i.e. make thing-at-point more useful.
I see erc, ffap uses there own url-regexp. Those kinds of duplication
can be avoided.
> The only difficult problem seen so far is knowing what is being
> requested. It's not an alligator. It's bigger than a breadbox. It
> doesn't contain chlorophyll. OK, so what is it?
--
Leo <sdl.web AT gmail.com> (GPG Key: 9283AA3F)
Gnus is one component of the Emacs operating system.