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

Re: [PATCH] w3m-lnum add highlight

In [emacs-w3m : No.11256] Andrey wrote:
> Katsumi Yamaoka <yamaoka@xxxxxxx> writes:
>> Agreed.  I also agree to make the `C-c C-l' key be bound to
>> `w3m-linknum-follow' by default.  I.e., abolish `w3m-go-to-linknum'
>> and make indexing of forms the default.

> I find `w3m-go-to-linknum' handy when I want to navigate within
> uncomfortable to reach with search areas or just peek url
> behind link.  I think it must stay (and maybe at a single
> letter).

I see.

> We are spoiled with so many ways of navigating within Emacs.  I have
> `w3m-linknum-follow' bound to "f", it's free within both lynx and info
> keymaps and guess what, it's same in Conkeror.  Which makes me think of
> "F" for `w3m-go-to-linknum'.

Hm, at least I have no reason to object to the use of `f' and `F'.
However, I hesitate to use such precious single keystrokes.  Has
anyone reserved those keys for the future use?  Alternatively,
how about `C-c l' and `C-c C-l'?   In short in Japanese:

`f' キーを `w3m-linknum-follow' に、`F' キーを `w3m-go-to-linknum'
代わりに `C-c l' と `C-c C-l' では?

>> [1] I've slightly changed your code.  Let me know if there's any
>> oddity.

> No problems detected.  Meanwhile, I've made some refinement/mess and
> added things.  Having O(1) access over links, form fields and buttons is
> great, just one thing left (?), images.  So added support for enumerating
> images as well and an obvious example action over them - toggling.

I just tried the new w3m-lnum.el.  Very good!!  Maybe the usage
comment at the beginning of w3m-lnum.el is needless.  Instead,
we will have to mention the features in the Info document.

>> Furthermore, I think it's convenient if `w3m-read-int-interactive'
>> turns off the `w3m-link-numbering-mode' mode by the `C-c C-l' key
>> input.  IOW, making the `C-c C-l' key the toggle switch.  WDYT?

> I think `w3m-read-int-interactive' is ok as is (didn't prepend w3m- in
> the first try as it seems nicely decoupled general way to input an
> integer).  Unless very slow.
> I'd like to promote `w3m-with-linknum' which takes care of switching
> between different types of enumeration and cleaning after.  To be fair,
> I see no point in interactively using `w3m-link-numbering-mode'
> (actually now things seem to work ok without it as well).  Why would you
> need the clutter of numbered elements for more than 5 seconds without
> useful immediate action (maybe something could be thought).  So here
> comes `w3m-linknum-get-action' using `w3m-with-linknum' which activates
> given type of numbering, reads interactively (showing matches) some
> element number, deactivates numbering and keeping position collects a
> list of properties of selection (url/action, position, image url if
> such) so do what you wish with them.  The only user command which does
> not use it is `w3m-go-to-linknum' because I wanted to keep good ol'
> non-interactive element number selection on prefix argument (for just in
> case).
> Here's the new set of changes against current cvs w3m-lnum.el.

Thanks.  Er, shouldn't `w3m-linknum-read-url' be as follows?

(defun w3m-linknum-read-url (&optional prompt)
  (let ((link (w3m-linknum-get-action (or prompt "Link number: ") 1)))
And more, could you provide the ChangeLog entries by yourself?
Here's unfinished one. ;-)

2010-07-07  Andrey Kotlarski  <m00naticus@xxxxxxxxx>

	* w3m-lnum.el: Update usage comment.
	(w3m-linknum-remove-overlays): Quit immediately when it finds and
	deletes temporary match overlay.
	(w3m-link-numbering-mode): Pass prefix arg, which makes this function
	index only images if it is 2, to w3m-link-numbering.
	(w3m-link-numbering, w3m-with-linknum): Vary function according to arg;
	index only images if it is 2.
	(w3m-highlight-numbered-anchor): xxx.
	(w3m-get-anchor-info): New function.
	(w3m-go-to-linknum): xxx.
	(w3m-linknum-get-action): xxx.
	(w3m-linknum-follow): xxx.
	(w3m-linknum-read-url): xxx.
	(w3m-linknum-toggle-image): New function.

BTW, currently the w3m-lnum features don't work with XEmacs, so
I'm going to fix some time.  In addition, the `minibuffer-prompt'
face is not available in not only XEmacs but also Emacs 21.  Maybe
we need to provide something like `w3m-linknum-minibuffer-prompt',
that is a copy of `minibuffer-prompt' if it is available.