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

Re: `g' and `G' do not provide current url as the initial minibuffer contents

In [emacs-w3m : No.12350]
	On Mon, 28 Jul 2014 16:50:02 +0400, Filipp Gunbin wrote:
>> (defadvice w3m-input-url (before provide-initial-contents activate)
>>   "Always provide initial minibuffer contents."
>>   (ad-set-arg 5 nil))

> Yes, it works, thank you.  It would be great if something like that was
> available to other users.

Ok, I've added this user option:

,---- (info "(emacs-w3m)Other variables")
| 'w3m-input-url-provide-initial-content'
|   If non-'nil', provide an initial minibuffer content (if any) when
|   entering a url.  The default is 'nil'.  A url string is not worth
|   editing in most cases since a url thing is generally a list of
|   arbitrary letters, not a human readable one.  So, we provide no
|   initial content when prompting you for a url by default.  But
|   sometimes there will be a case to be convenient if you can modify
|   the url string of the link under the cursor or of the current page.
|   In that case, you can use the 'M-n' key to fill the minibuffer with
|   an initial content if you use Emacs 23 and up.  Otherwise, set this
|   variable to a non-'nil' value to always provide an initial content.

In addition to this, I've improved the `M-n' command behavior.
When entering a url string, now it offers the url of the current
page as an initial content even if there is no link under the
cursor.  This is just what I sometimes wanted, so I'll probably
never set the new user option. ;-)