# HG changeset patch # User Katsumi Yamaoka # Date 1228355881 0 # Node ID c20a057aefda9b58facebe563f65a8dda8c66a25 # Parent 3076f8588570b3c659fe1b75dddd1176248b7668 * mm-view.el (mm-inline-text-html-render-with-w3m): Put special keymap on links. * gnus-art.el (gnus-article-wash-html-with-w3m): Ditto. diff -r 3076f8588570 -r c20a057aefda lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Wed Dec 03 23:49:00 2008 +0000 +++ b/lisp/gnus/ChangeLog Thu Dec 04 01:58:01 2008 +0000 @@ -1,3 +1,10 @@ +2008-12-04 Naohiro Aota + + * mm-view.el (mm-inline-text-html-render-with-w3m): Put special keymap + on links. + + * gnus-art.el (gnus-article-wash-html-with-w3m): Ditto. + 2008-12-03 Katsumi Yamaoka * message.el (message-idna-to-ascii-rhs-1): Protect against local diff -r 3076f8588570 -r c20a057aefda lisp/gnus/gnus-art.el --- a/lisp/gnus/gnus-art.el Wed Dec 03 23:49:00 2008 +0000 +++ b/lisp/gnus/gnus-art.el Thu Dec 04 01:58:01 2008 +0000 @@ -2731,11 +2731,34 @@ (when (and mm-inline-text-html-with-w3m-keymap (boundp 'w3m-minor-mode-map) w3m-minor-mode-map) - (add-text-properties - (point-min) (point-max) - (list 'keymap w3m-minor-mode-map - ;; Put the mark meaning this part was rendered by emacs-w3m. - 'mm-inline-text-html-with-w3m t)))) + (if (and (boundp 'w3m-link-map) + w3m-link-map) + (let ((begin (point-min)) + (map (copy-keymap w3m-link-map)) + end) + (set-keymap-parent map w3m-minor-mode-map) + (while (setq end (next-single-property-change begin + 'w3m-href-anchor)) + (add-text-properties + begin end + (list 'keymap (if (get-text-property begin 'w3m-href-anchor) + map + w3m-minor-mode-map) + ;; Put the mark meaning this part was rendered by emacs-w3m. + 'mm-inline-text-html-with-w3m t)) + (setq begin end)) + (add-text-properties + begin (point-max) + (list 'keymap (if (get-text-property begin 'w3m-href-anchor) + map + w3m-minor-mode-map) + ;; Put the mark meaning this part was rendered by emacs-w3m. + 'mm-inline-text-html-with-w3m t))) + (add-text-properties + (point-min) (point-max) + (list 'keymap w3m-minor-mode-map + ;; Put the mark meaning this part was rendered by emacs-w3m. + 'mm-inline-text-html-with-w3m t))))) (defvar charset) ;; Bound by `article-wash-html'. diff -r 3076f8588570 -r c20a057aefda lisp/gnus/mm-view.el --- a/lisp/gnus/mm-view.el Wed Dec 03 23:49:00 2008 +0000 +++ b/lisp/gnus/mm-view.el Thu Dec 04 01:58:01 2008 +0000 @@ -261,11 +261,37 @@ (when (and mm-inline-text-html-with-w3m-keymap (boundp 'w3m-minor-mode-map) w3m-minor-mode-map) - (add-text-properties - (point-min) (point-max) - (list 'keymap w3m-minor-mode-map - ;; Put the mark meaning this part was rendered by emacs-w3m. - 'mm-inline-text-html-with-w3m t))) + (if (and (boundp 'w3m-link-map) + w3m-link-map) + (let ((begin (point-min)) + (map (copy-keymap w3m-link-map)) + end) + (set-keymap-parent map w3m-minor-mode-map) + (while (setq end (next-single-property-change + begin 'w3m-href-anchor)) + (add-text-properties + begin end + (list 'keymap (if (get-text-property begin 'w3m-href-anchor) + map + w3m-minor-mode-map) + ;; Put the mark meaning this part was rendered + ;; by emacs-w3m. + 'mm-inline-text-html-with-w3m t)) + (setq begin end)) + (add-text-properties + begin (point-max) + (list 'keymap (if (get-text-property begin 'w3m-href-anchor) + map + w3m-minor-mode-map) + ;; Put the mark meaning this part was rendered + ;; by emacs-w3m. + 'mm-inline-text-html-with-w3m t))) + (add-text-properties + (point-min) (point-max) + (list 'keymap w3m-minor-mode-map + ;; Put the mark meaning this part was rendered + ;; by emacs-w3m. + 'mm-inline-text-html-with-w3m t)))) (mm-handle-set-undisplayer handle `(lambda ()