[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`w3m-relationship-oddmuse-estimate' fix
- From: David Hansen <david.hansen@xxxxxxx>
- Date: Sat, 03 Nov 2007 03:34:51 +0100
- X-ml-name: emacs-w3m
- X-mail-count: 09751
Hello,
2007-11-03 David Hansen <david.hansen@xxxxxxx>
* w3m.el (w3m-relationship-oddmuse-estimate): Follow new page layout.
Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1322
diff -c -r1.1322 w3m.el
*** w3m.el 1 Nov 2007 12:05:29 -0000 1.1322
--- w3m.el 3 Nov 2007 02:32:11 -0000
***************
*** 5682,5698 ****
(concat "<A HREF=" w3m-html-string-regexp ">\\[index\\]</A>")))))
(defun w3m-relationship-oddmuse-estimate (url)
! (when (string-match "/wiki\\?search=[^\";]*\\(;page=\\([0-9]+\\)\\)?" url)
! (let ((re "<a href=\"\\(http://[^\"]+?/wiki\\?search=[^\";]*")
! (n (match-string 2 url)))
! (setq n (or (and n (string-to-number n)) 1))
! (let ((next (concat re ";page=" (number-to-string (1+ n)) "\\)\""))
! (prev (cond
! ((< 2 n)
! (concat re ";page=" (number-to-string (1- n)) "\\)\""))
! ((= 2 n)
! "<a href=\"\\(http://[^\"]+?/wiki\\?search=[^\"]*\\)\""))))
! (w3m-relationship-search-patterns url next prev)))))
(defun w3m-relationship-slashdot-estimate (url)
(goto-char (point-min))
--- 5682,5693 ----
(concat "<A HREF=" w3m-html-string-regexp ">\\[index\\]</A>")))))
(defun w3m-relationship-oddmuse-estimate (url)
! (when (string-match "/wiki\\?search=.*" url)
! (goto-char (point-min))
! (and (re-search-forward "href=\"\\([^\"]+\\)\">Previous</a>" nil t)
! (setq w3m-previous-url (match-string 1)))
! (and (re-search-forward "href=\"\\([^\"]+\\)\">Next</a>" nil t)
! (setq w3m-next-url (match-string 1)))))
(defun w3m-relationship-slashdot-estimate (url)
(goto-char (point-min))
Diffs between working revision and workfile end here.