]> git.eshelyaron.com Git - emacs.git/commitdiff
* mm-view.el (mm-inline-text-html-render-with-w3m): Put special keymap on links.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 4 Dec 2008 01:58:01 +0000 (01:58 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 4 Dec 2008 01:58:01 +0000 (01:58 +0000)
* gnus-art.el (gnus-article-wash-html-with-w3m): Ditto.

lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el
lisp/gnus/mm-view.el

index 7e8ca0c44f8e6305559caf32cba2d983a187c850..37a6355ce31d0f83d1c7cd7df8b309714b145bf8 100644 (file)
@@ -1,3 +1,10 @@
+2008-12-04  Naohiro Aota  <nao.aota@gmail.com>
+
+       * 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  <yamaoka@jpl.org>
 
        * message.el (message-idna-to-ascii-rhs-1): Protect against local
index 025d5b5e0d8f72d99e95afbb57e8cedf99b5b2eb..7d96a347b0b173770357349e40ac0bdca1eb6413 100644 (file)
@@ -2731,11 +2731,34 @@ charset defined in `gnus-summary-show-article-charset-alist' is used."
   (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'.
 
index 473948e19c5f1be51de1ea157839f8143b6d6bea..fd01a0132f6d77ca440224083e879a5be440778f 100644 (file)
        (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 ()