[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `g' and `G' do not provide current url as the initial minibuffer contents
- From: Katsumi Yamaoka <yamaoka@xxxxxxx>
- Date: Fri, 01 Aug 2014 10:45:27 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 12372
- References: <86a97xvd4v.fsf@xxxxxxxxxxxxxxxxxxxx> <878une21jz.fsf@xxxxxx> <b4mzjfu5pzg.fsf@xxxxxxx> <8638dlve9x.fsf@xxxxxxxxxxxxxxxxxxxx> <b4ma97thrbm.fsf@xxxxxxx> <86zjfs1ii9.fsf@xxxxxxxxxxxxxxxxxxxx> <b4mbns7sqew.fsf@xxxxxxx> <8761if3w8p.fsf@xxxxxx> <b4md2cmulqn.fsf@xxxxxxx> <87egx1fqxx.fsf@xxxxxx>
In [emacs-w3m : No.12370]
On Thu, 31 Jul 2014 18:12:10 +0200, Michael Heerdegen wrote:
> It actually is called, but I think it is just written in an illegitimate
> way and doesn't work correctly.
I realized the first `M-n' (with no prefix argument) doesn't call
`minibuffer-default-add-function'; binding of `minibuffer-default'
has no effect, it's a bad manner if anything (as you wrote).
> You must not shadow the variable `minibuffer-default', because it is
> already bound to the DEFAULT-VALUE argument of `read-from-minibuffer,
> e.g. "about:".
I thought "about:" is useless, but now I see it is necessary.
> Rebinding this variable obviously confuses Emacs. Here
> is a version that works for me:
> (defun w3m-input-url-default-add-completions ()
Thanks. I've installed it in CVS (with the removing of duplication).
The `M-n' key binding no longer exists.
> There is probably no sane solution that calls
> `minibuffer-default-add-completions' and avoids code duplication.
> Note that in the list returned by
> `w3m-input-url-default-add-completions' the current value of
> `minibuffer-default' must be the first element; else, the thing doesn't
> So, if you want the current url to be the first candidate when hitting
> M-n, you must make it the DEFAULT-VALUE of `read-from-minibuffer'.
> BTW, which Emacs versions do we need to support? Because, starting with
> Emacs 23, the DEFAULT-VALUE argument of `read-from-minibuffer' is
> allowed to be a list of several defaults. When we would use this
> feature, everything would become trivially simple.
Emacs-w3m still supports XEmacs(en), so we have to take care of
the old functions behaviors. Though I'm personally ok to drop
those old ones.