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

Re: recentre anchor at top of window



>>>>> In [emacs-w3m : No.10836] Kevin Ryde wrote:
> Katsumi Yamaoka <yamaoka@xxxxxxx> writes:
>>
>> (To make the advice to `w3m-view-this-url-1' work, evaluating
>>  the `w3m-view-this-url' Lisp source is needed since
>>  `w3m-view-this-url-1' is an inline function.)

> Ah yes, I forget why that had seemed to work.  I think it was meant to
> pick up link following with Ret.

>> (defcustom w3m-view-this-url-and-recenter 1

> Maybe call it `w3m-view-recenter' or something like that, and make it
> apply to all forms of view and goto which have an anchor.  The main
> w3m-goto-url was the one I most wanted to work that way (rather than
> anything specific to w3m-view-this-url).

I've implemented it as follows:

--8<---------------cut here---------------start------------->8---
w3m-view-recenter is a variable defined in `w3m.el'.
Its value is (t . 1)

Documentation:
Argument passed to `recenter' that runs when visiting a link.
Valid values include an integer, t and nil, and cons of them.
T means run `recenter' with no argument.  Nil means don't perform it.
If it is cons, the car is used for an ordinary link, and the cdr is
used for a name link, i.e., the case where the url string ends up with
"#NAME".
--8<---------------cut here---------------end--------------->8---

Now w3m-search-name-anchor, w3m-view-this-url-1, w3m-next-anchor,
w3m-previous-anchor, w3m-next-form, w3m-previous-form,
w3m-next-image, and w3m-previous-image work with it.  Suggestions
to improve this feature are welcome.

Regards,