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

recentre anchor at top of window



Recently there was a question about recentring the window start when
going to an anchor,

    http://osdir.com/ml/emacs.w3m/2003-04/msg00025.html

Did a way to control or customize that ever come to pass?

I wanted much the same for going to functions in the gtk docs.  When
going to a particular anchor there it's good to have the anchor point at
the top of the window so as to see as much as possible of the target
function, not the preceding one, if you know what I mean.

I got the effect I wanted with the following hack, but perhaps there's a
better way.  (If so it could be indexed under "recenter" in the manual.)

    (defadvice w3m-search-name-anchor (around my-recentre activate)
      "Recentre to top of window."
      (let ((found ad-do-it))
        (if found
            (recenter 1))
        found))
    (defadvice w3m-view-this-url-1 (after my-recentre activate)
      "Recentre to top of window."
      (recenter 1))