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

Re: [PATCH] w3m-lnum add highlight



Andrey Kotlarski wrote:
> Katsumi Yamaoka <yamaoka@xxxxxxx> writes:

>> Hideyuki SHIRAI wrote:
>>> "Lf" => w3m-linknum-follow
>>> "Ll" => w3m-go-to-linknum
>>> "Li" => w3m-linknum-toggle-image
>>> "Lg" => w3m-linknum-read-url
>>
>> Oh, good!  It solves the lack of keys.
>>
>> (free translation)
>>> Isn't there an intention with which emacs-w3m doesn't use such
>>> combined keystrokes?
>>
>> I believe there's nothing to hinder the use of such keys.

> Yup, seems good.  Though `w3m-linknum-read-url' is not intended for
> use as user command so no need for key and `w3m-linknum-toggle-image'...

Ok.

> I thought something better.  emacs-w3m provides some nice commands on (point)
> but when (point) is not onto something meaningful you get "No bla at
> point".  So I took some/most such commands and made enhanced versions
> which fall back to original when (point) is on proper element and in the
> other case turn numbering selection on for respectable type of elements,
> feeding result back to original.  I think these enhanced variants
> (w3m-linknum-bla-bla) can safely[1] supersede originals (w3m-bla-bla) on
> keybindings and maybe menus.  In such case the only command looking for
> keybinding is the killing feature :P `w3m-linknum-follow' (and maybe
> `w3m-go-to-linknum' as a sort of relative).  Here's a ChangeLog for
> w3m-lnum.

Oh, how helpful those commands are!  I like them very much!

> Then the diff itself and after this, for brave testers (enhancement is quite
> simple and not expecting oddities) temp diff with w3m.el replacing bindings of
> point-commands for their enhanced w3m-linknum-bla-bla variants (sorry
> for being longer than necessary, auto indented it).  So beware, 2 diffs.

Thanks.  But what I did temporarily in the CVS trunk was to bind
the L-prefixed keys to those commands.

,---- `L C-h' shows this ----
| Major Mode Bindings Starting With L:
| key             binding
| ---             -------
|
| L ESC		Prefix Command
| L F		w3m-go-to-linknum
| L I		w3m-linknum-view-image
| L d		w3m-linknum-download-this-url
| L e		w3m-linknum-edit-this-url
| L f		w3m-linknum-follow
| L t		w3m-linknum-toggle-inline-image
| L u		w3m-linknum-print-this-url
|
| L M-i		w3m-linknum-save-image
`----

Maybe we can rebind those keys into the ones, that aren't L-prefixed,
only in the condition where the `w3m-link-numbering-mode' minor mode
is turned on.  Hm, such a behavior may confuse users though.  Anyway,
I recommend users to try those commands without fail!  よろしく!

> [1] Joking :) For example I use w3m-wget alongside and it expects to
> substitute `w3m-download-this-url'.  Changed it accordingly
> and enhanced it in the above manner, but it comes to show that maybe
> originals should be "enhanced" in place for consistency with other
> packages.  Not that painful hopefully ;)