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

display-hook



Hi,

I'm attempting to customize emacs-w3m (1.3.3) to display named anchors
near the top of the window, instead of in the middle when they are
linked.  Here's what I've used:

(add-hook 'w3m-display-hook 
	  (lambda (url)
	    (if (not (bobp)) (recenter 1))) 'append)

This seems to do the job when browse-url is used directly on a url with
a name (e.g. foo.html#12334), but navigating links within the page (e.g.
using arrows to navigate to a link, and pressing [RET]) then doesn't
work correctly.  I'm not sure why this is, given that another
display-hook function looks like:

(defun w3m-move-point-for-localcgi (url)
  (when (and (w3m-url-local-p url)
	     (file-directory-p (w3m-url-to-file-name url))
	     (not (eq w3m-local-directory-view-method 'w3m-dtree))
	     (= (point-min) (point))
	     (w3m-search-name-anchor "current" 'quiet))
    (recenter (/ (window-height) 5))))

Although this doesn't get called for my case, I presume it wouldn't
interfere with in-document link browsing.

Any help you could offer would be very much appreciated.

Thanks,

JD

-- 
 J.D. Smith            <=> 
 Steward Observatory   <=> 520-621-9532 <W>
 University of Arizona <=> 520-621-1532 <F>
 Tucson, Arizona 85721 <=>