--- Begin Message ---
- From: Christoph Conrad <christoph.conrad@xxxxxx>
- Date: 05 Jun 2001 09:02:59 +0200
Hello Tsuchiya,
to illustrate what i mean i have implemented a version of following
the anchor without re-rendering, see below. The implementation might
not be perfect, it would better use defadvice. Feel free to use the
code for any purpose. BTW: is TSUCHIYA your surname or your given
name?
(defun w3m-view-this-url (&optional arg)
"*View the URL of the link under point."
(interactive "P")
(let ((url (w3m-anchor)) (act (w3m-action)) anchor-found anchor-pos)
;; target link is an anchor in the current url?
(when (string-match (concat "^" w3m-current-url "#\\(.*$\\)") url)
;; extract anchor
(let ( (anchor-string (match-string 1 url)) )
(save-excursion
;; search anchor
(goto-char (point-min))
(while (and (not anchor-found)
(setq anchor-pos (next-single-property-change
(point) 'w3m-name-anchor)))
(when (equal anchor-string
(plist-get (text-properties-at anchor-pos)
'w3m-name-anchor))
(setq anchor-found t))
(goto-char anchor-pos)))))
(if anchor-found
(progn
(w3m-history-store-position)
(goto-char anchor-pos))
(cond
(url (w3m-goto-url url arg))
(act (eval act))))))
Best regards,
cu, -cc-
--
=> GNU Emacs Webring @ <http://www.gnusoftware.com/WebRing/> <=
Look Ma, this man can twist his fingers as if they were made of rubber,
isn't that amazing? -- Not really, he's been using emacs for years...!
--- End Message ---