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

Emacs-W3m bug about highlight .



Hi, all.

I'm use emacs 23.0.60.2. and Emacs-W3m CVS Version (2008-06-02)
And I'm a Chinese.

Before i found a bug of Emacs-W3m about www.google.cn keyword highlight,
example i search "中国" at www.google.cn, in search result pages, the Chinese keyword "中国" can't
highlight.

So Katsumi Yamaoka give me a little code do this:

---------------------> code start <---------------------------
(setq w3m-use-filter t)
(defun my-w3m-filter-for-google-cn (&rest args)
  "Replace <font color=CC0033> tags with <b>'s."
  (goto-char (point-min))
  (while (re-search-forward "<font color=CC0033>\\([^<]+\\)</font>" nil t)
    (replace-match "<b>\\1</b>")))
(eval-after-load "w3m-filter"
  '(add-to-list 'w3m-filter-rules
                '("\\`http://www\\.google\\.cn/";
                  my-w3m-filter-for-google-cn)))
--------------------> code end <-------------------------------

But today, i update Emacs-W3m CVS version (2008-06-02), the Chinese keyword (example "中国") can't
highlight in the google search pages.

Above is Chinese keyword highlight bug in www.google.cn.

And i found a English keyword highlight bug in www.google.cn:

We know in the format of google search result item is like below:

first line:	title
second line:	context
third line:	page url

So when i use current Emacs-W3m version (2008-06-02) with Katsumi Yamaoka give me code to search
"Emacs" in www.google.com and www.google.cn.

1> In result pages of www.google.com, keyword "Emacs" can bold in "title", highlight with "context"
and "page url".

2> But in result pages of www.google.cn, keyword "Emacs" can only highlight in "page url", it can't
bold in "title" and highlight in "context".

Below i give you two linked to recur this bug:

www.google.com search url: http://www.google.com/search?q=emacs+

www.google.cn search url: http://www.google.cn/search?q=emacs

And i think in google first result have a item "Emacs - Wikipedia, the free encyclopedia".
And you compare two page, you will found in result of www.google.cn, keyword "Emacs" only highlight
in "page url".

So can you give me a patch to repair above two bugs?
And patch can add in source code of Emacs-W3m? 
So uesers won't get bug whatever others modify source code.

All developers, you're working hard, Thank you very much!
Wish you happy everyday :)