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

Re: nnrss vs. copy link location



>>>>>> In [emacs-w3m : No.10493] 青田さん wrote:
>> Anyway, I wrote a patch to fix this problem. Could you check it?

>>>>> In [emacs-w3m : No.10499] 山岡 wrote:
> チェックしました。目から鱗です。そうかあ、こんなふうに使えるべき
> だったんだ。どうもありがとうございます。後で commit しようと思い
> ますが、Emacs と Gnus の両方の幹に行なっていですね?

付け忘れました。青田さんがポストしたパッチがなぜか壊れていました
が、直したものです。それから、make するときに Emacs 21 などでは
未定義変数の警告が出るので、commit 前に対処しておきます。
--- gnus-art.el~	2008-10-03 05:47:11 +0000
+++ gnus-art.el	2008-12-04 00:21:07 +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'.
 
--- mm-view.el~	2008-09-23 21:41:01 +0000
+++ mm-view.el	2008-12-04 00:21:07 +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 ()