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

Re: w3m-canonicalize-url misbehaviour

In [emacs-w3m : No.12139] Michael Heerdegen wrote:
> Manuel Giraud <manuel@xxxxxxxxxxxxxx> writes:

>> Here is a patch for w3m-canonicalize-url. Without it, the following
>> code:
>> (let ((w3m-uri-replace-alist '(("\\`ddg:" w3m-search-uri-replace "duckduckgo")))
>>       (w3m-search-engine-alist '(("duckduckgo" "https://duckduckgo.com/html/?q=%s";))))
>>   (w3m-canonicalize-url "ddg:foo"))
>> evaluates to "ddg:foo". So URI replacement is broken.

> Indeed.  All URI like "foo:bar" are not working anymore.  We (I) should
> have been testing the last change there better.

Manuel, thanks for reporting this.  But your patch won't work
for emacs-w3m if `w3m-enable-google-feeling-lucky' is non-nil.

(let ((w3m-uri-replace-alist '(("\\`ddg:" w3m-search-uri-replace "duckduckgo")))
      (w3m-search-engine-alist '(("duckduckgo" "https://duckduckgo.com/html/?q=%s";))))
  (w3m-canonicalize-url "ddg:foo" t))

I slightly modified it and committed to the CVS repo.