[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: [PATCH] w3m-input-url



In [emacs-w3m : No.12656]
On Tue, 30 May 2017 03:00:09 -0400, Boruch Baum wrote:
> The attached patch corrects a nuisance I've had with the package since
> I started using it. I hope it or an equivalent can be accepted.

> The issue occurs when using command 'g', 'G', or 'U' to open a new url
> or perform a search. When one enters something of the form xxx.xxx
> without a protocol prefix xxxx://, the package interprets the input as
> a search request.

> My expectation was that inputing:

>   https://google.com    go there, and it does
>   google.com            go there, and it doesn't
>   google                peform a google search on the word

> The patch also interprets any input containing a space as a search
> request, so the following will perform searches:

>   what is google.com
>    what.is.google.com

I feel like a better place to modify would be `w3m-canonicalize-url'.
How about the following setting and the patch?

(setq w3m-enable-google-feeling-lucky nil)
--- w3m.el~	2017-05-29 02:40:19.000000000 +0000
+++ w3m.el	2017-05-30 08:21:42.041291600 +0000
@@ -4629,7 +4629,8 @@
 	replaced)
        ((match-beginning 1)
 	url)
-       (feeling-lucky
+       ((or feeling-lucky
+	    (string-match " " url))
 	(concat "\
 http://www.google.com/search?btnI=I%%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q="
 		(w3m-url-encode-string url nil t)))