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

w3m-uri-replace-alist: necessity of using colons in keys



This bug report will be sent to the emacs-w3m development team,
 not to your local site managers!!
Please write in simple English, because the emacs-w3m developers
aren't good at English reading. ;-)

Please describe as succinctly as possible:
	- What happened.
	- What you thought should have happened.
	- Precisely what you were doing at the time.

Please also include any Lisp back-traces that you may have.
================================================================
Dear Bug Team!

Currently, all keys in `w3m-uri-replace-alist' must include a colon.  If
you try something without colon like

--8<---------------cut here---------------start------------->8---
(put-alist 'w3m-uri-replace-alist "\\`ew"
	   '(w3m-search-uri-replace "emacswiki"))
--8<---------------cut here---------------end--------------->8---

and then enter a uri like "ew w3m" this won't work (try it!) because
before `w3m-uri-replace' is called, `w3m-canonicalize-url' "fixes" the
url to a Google feeling lucky thing.  The colon is hardcoded in
`w3m-url-components-regexp'.

For the short, something like this works for me:

--8<---------------cut here---------------start------------->8---
(advice-add 'w3m-canonicalize-url :before-until
	    (lambda (url &rest _)
	      (let ((replaced (ignore-errors (w3m-uri-replace url))))
		(and replaced (not (string= url replaced)) replaced)))
	    '((name . check-for-uri-replacement-first)))
--8<---------------cut here---------------end--------------->8---

Why is this important to me?  Because you now need an additional
redundant character and even the shift key to enter it.  But uri
replacement should be as convenient as possible.  Also, in other
browsers, search keys or webjumps or however they are named there don't
need to contain colons.

Any chance to change it?


Thanks,

Michael.


================================================================

System Info to help track down your bug:
---------------------------------------
emacs-w3m-version
 => "1.4.518"
emacs-version
 => "GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.2)\n of 2013-08-11 on dex, modified by Debian"
mule-version
 => "6.0 (HANACHIRUSATO)"
system-type
 => gnu/linux
(featurep 'gtk)
 => t
w3m-version
 => "w3m/0.5.3+debian-11"
w3m-type
 => w3m-m17n
w3m-compile-options
 => ("lang=en" "m17n" "image" "color" "ansi-color" "mouse" "gpm" "menu" "cookie" "ssl" "ssl-verify" "external-uri-loader" "w3mmailer" "nntp" "gopher" "ipv6" "alarm" "mark" "migemo")
w3m-language
 => nil
w3m-command-arguments
 => nil
w3m-command-arguments-alist
 => nil
w3m-command-environment
 => nil
w3m-input-coding-system
 => utf-8
w3m-output-coding-system
 => utf-8
w3m-use-mule-ucs
 => nil