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

Re: Default input URL for w3m-goto-url without link around point



In [emacs-w3m : No.12064] Katsumi Yamaoka wrote:
> In [emacs-w3m : No.12061] Michael Heerdegen wrote:
>> "Jose A. Ortega Ruiz" <jao@xxxxxxx> writes:

>>> Hi,
>>>
>>> In the CVS version of w3m-el, at least since a while ago, the prompt for
>>> w3m-goto-url when the cursor is not over a link defaults to the URL of
>>> the current page.
>>>
>>> In my case, this is often a problem.  When i hit 'g' in a w3m buffer to
>>> go elsewhere, i almost never want to go to the current URL or some in
>>> the same page.  Often, i've got in the kill ring the URL i want to go
>>> to, and if i C-k the default contents of the prompt it gets added to the
>>> kill ring, displacing my last kill.
>>>
>>> I see this behaviour is hard-coded, because w3m-goto-url is calling
>>> w3m-input-url which in turns calls (w3m-active-region-or-url-at-point
>>> t), with t forcing the return of the current URL.
>>>
>>> Is there any chance we could make this behaviour customizable?

>> As another w3m user I must say: glad to hear that I'm not the only one.
>> Most of the time, I don't want the initial minibuffer content.

>> It would IMHO be better to make the url at point available with M-n, so
>> there would be no need to insert it into the minibuffer by default.

> I guess the author considered the most case a user types `g' when
> the cursor doesn't point to a link is to want to go to another page
> within the site; it makes it unnecessary to enter a url fully.
> However, the plan went wrong, IMO, because a url thing is simply
> a row of random letters, not the human editable one.  So, I'd like
> to make it offer no initial minibuffer content even if the cursor
> points to a link.  Here's what I want to do:

> (defadvice w3m-active-region-or-url-at-point (around make-it-void activate)
>   "Always return nil.")

> Objection?

I made `w3m-input-url' offer no useless initial string.  Though
I didn't remove `w3m-active-region-or-url-at-point' after all
since others seem to rely on it.  Please try the new behavior.