Gnus development mailing list
 help / color / mirror / Atom feed
* nnrss vs. copy link location
@ 2008-12-03  0:51 jidanni
  2008-12-03  2:18 ` Robert D. Crawford
  2008-12-03 17:17 ` [emacs-w3m:10493] " Naohiro Aota
  0 siblings, 2 replies; 8+ messages in thread
From: jidanni @ 2008-12-03  0:51 UTC (permalink / raw)
  To: ding

I'm reading http://feedproxy.google.com/TorrentFreak in NNRSS, but
when I come across links like
<a href="http://torrentfreak.com/pirate-party-endorses-obama-080103/">US Pirate Party</a>
there is no 'copy link location' etc. right click mouse keys etc. No
way to copy link location.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nnrss vs. copy link location
  2008-12-03  0:51 nnrss vs. copy link location jidanni
@ 2008-12-03  2:18 ` Robert D. Crawford
  2008-12-03  3:26   ` jidanni
  2008-12-03 17:17 ` [emacs-w3m:10493] " Naohiro Aota
  1 sibling, 1 reply; 8+ messages in thread
From: Robert D. Crawford @ 2008-12-03  2:18 UTC (permalink / raw)
  To: ding

jidanni@jidanni.org writes:

> I'm reading http://feedproxy.google.com/TorrentFreak in NNRSS, but
> when I come across links like
> <a href="http://torrentfreak.com/pirate-party-endorses-obama-080103/">US Pirate Party</a>
> there is no 'copy link location' etc. right click mouse keys etc. No
> way to copy link location.

If you want to copy the link into the kill ring for later yanking, here
is some code that will do this.  You did not mention whether you were
using w3 or w3m to view html buffers, but this code will work either
way:  


(defun rdc-gnus-save-url ()
  "Saves the url to the kill-ring."
  (interactive)
  (if (eq browse-url-browser-function 'w3m-browse-url)
      (w3m-print-this-url)
    (progn
      (w3-view-this-url)
      (w3-save-this-url))))

(define-key gnus-article-mode-map "v" 'rdc-gnus-save-url)

Helpful?

rdc
-- 
Robert D. Crawford                                      rdc1x@comcast.net





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nnrss vs. copy link location
  2008-12-03  2:18 ` Robert D. Crawford
@ 2008-12-03  3:26   ` jidanni
  0 siblings, 0 replies; 8+ messages in thread
From: jidanni @ 2008-12-03  3:26 UTC (permalink / raw)
  To: ding

OK, into .gnus.el I put

  (defun rdc-gnus-save-url ()
    "Saves the url to the kill-ring."
    (interactive)
    (w3m-print-this-url))
  (define-key gnus-article-mode-map "v" 'rdc-gnus-save-url)

and restarted emacs. But oddly v didn't put it on the kill ring.
However I discovered u already does w3m-print-this-url which indeed
puts it on the kill ring. So I'll use u. OK thanks. I chalk it up to the
w3m/gnus/nnrss special environment. E.g., no right mouse choices either.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [emacs-w3m:10493] Re: nnrss vs. copy link location
  2008-12-03  0:51 nnrss vs. copy link location jidanni
  2008-12-03  2:18 ` Robert D. Crawford
@ 2008-12-03 17:17 ` Naohiro Aota
  2008-12-03 19:21   ` jidanni
  2008-12-04  1:58   ` [emacs-w3m:10503] " Katsumi Yamaoka
  1 sibling, 2 replies; 8+ messages in thread
From: Naohiro Aota @ 2008-12-03 17:17 UTC (permalink / raw)
  To: jidanni; +Cc: emacs-w3m, ding

From: jidanni@jidanni.org
Subject: nnrss vs. copy link location
Date: Wed, 03 Dec 2008 08:51:14 +0800

> I'm reading http://feedproxy.google.com/TorrentFreak in NNRSS, but
> when I come across links like
> <a 
> href="http://torrentfreak.com/pirate-party-endorses-obama-080103/">US 
> Pirate Party</a>
> there is no 'copy link location' etc. right click mouse keys etc. No
> way to copy link location.

It seems that there is something wrong with Gnus.

mm-inline-text-html-render-with-w3m() in mm-view.el
.-------------------------------------------------------------------------------
|	(let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
|	      w3m-force-redisplay)
|	  (w3m-region (point-min) (point-max) nil charset))
`-------------------------------------------------------------------------------

Here, links' special keymap (w3m-link-map) is set.

.-------------------------------------------------------------------------------
|	(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)))
`-------------------------------------------------------------------------------

But here, the previous keymap is overridden. :(

Anyway, I wrote a patch to fix this problem. Could you check it?

Regards,
Naohiro Aota

2008-12-03  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.

Index: lisp/gnus-art.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v
retrieving revision 7.283
diff -u -r7.283 gnus-art.el
--- lisp/gnus-art.el	3 Oct 2008 04:21:54 -0000	7.283
+++ lisp/gnus-art.el	3 Dec 2008 17:05:33 -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'.

Index: lisp/mm-view.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mm-view.el,v
retrieving revision 7.59
diff -u -r7.59 mm-view.el
--- lisp/mm-view.el	22 Sep 2008 10:34:03 -0000	7.59
+++ lisp/mm-view.el	3 Dec 2008 17:05:33 -0000
@@ -261,11 +261,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))))
 	(mm-handle-set-undisplayer
 	 handle
 	 `(lambda ()



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nnrss vs. copy link location
  2008-12-03 17:17 ` [emacs-w3m:10493] " Naohiro Aota
@ 2008-12-03 19:21   ` jidanni
  2008-12-04  1:58   ` [emacs-w3m:10503] " Katsumi Yamaoka
  1 sibling, 0 replies; 8+ messages in thread
From: jidanni @ 2008-12-03 19:21 UTC (permalink / raw)
  To: nao.aota; +Cc: emacs-w3m, ding

NA> Anyway, I wrote a patch to fix this problem. Could you check it?
Thanks. I trust that it will work, however I prefer to stick to my
Debian sid set-up.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [emacs-w3m:10503] Re: nnrss vs. copy link location
  2008-12-03 17:17 ` [emacs-w3m:10493] " Naohiro Aota
  2008-12-03 19:21   ` jidanni
@ 2008-12-04  1:58   ` Katsumi Yamaoka
  2008-12-04 20:14     ` Reiner Steib
  1 sibling, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2008-12-04  1:58 UTC (permalink / raw)
  To: ding; +Cc: jidanni, emacs-w3m

>>>>> Naohiro Aota wrote:
> It seems that there is something wrong with Gnus.

> mm-inline-text-html-render-with-w3m() in mm-view.el
> .-------------------------------------------------------------------------------
>|	(let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
>|	      w3m-force-redisplay)
>|	  (w3m-region (point-min) (point-max) nil charset))
> `-------------------------------------------------------------------------------

> Here, links' special keymap (w3m-link-map) is set.

> .-------------------------------------------------------------------------------
>|	(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)))
> `-------------------------------------------------------------------------------

> But here, the previous keymap is overridden. :(

> Anyway, I wrote a patch to fix this problem. Could you check it?

Thank you for fixing the bug.  I verified that the patch does
the trick and realized that the mouse handling on links got to be
very convenient.  I've committed your patch (that was broken but
I repaired manually) in both the Gnus trunk and the Emacs trunk.

Regards,



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [emacs-w3m:10503] Re: nnrss vs. copy link location
  2008-12-04  1:58   ` [emacs-w3m:10503] " Katsumi Yamaoka
@ 2008-12-04 20:14     ` Reiner Steib
  2008-12-04 22:14       ` [emacs-w3m:10509] " Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Reiner Steib @ 2008-12-04 20:14 UTC (permalink / raw)
  To: Naohiro Aota; +Cc: emacs-w3m, ding

On Thu, Dec 04 2008, Katsumi Yamaoka wrote:

> I've committed your patch [...]  in both the Gnus trunk and the
> Emacs trunk.

+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.

We don't have papers on file from Naohiro Aota.  AFAICS the patch is
to long to be installed without a copyright assignment for Emacs or
Gnus.  Are you willing to assign the copyright to the FSF?  If so,
I'll send you the form off-list.

+	* lpath.el: Bind w3m-link-map for Emacs 21, 22, and XEmacs.

Shouldn't this be a separate entry for Katsumi Yamaoka?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [emacs-w3m:10509] Re: nnrss vs. copy link location
  2008-12-04 20:14     ` Reiner Steib
@ 2008-12-04 22:14       ` Katsumi Yamaoka
  0 siblings, 0 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2008-12-04 22:14 UTC (permalink / raw)
  To: Naohiro Aota; +Cc: emacs-w3m, ding

>>>>> Reiner Steib wrote:
> +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.

> We don't have papers on file from Naohiro Aota.  AFAICS the patch is
> to long to be installed without a copyright assignment for Emacs or
> Gnus.  Are you willing to assign the copyright to the FSF?  If so,
> I'll send you the form off-list.

Aota-san replied to me that he has already started the paper work
yesterday (I noticed he has not been in the AUTHORS file yet too,
and sent the form to him).

> +       * lpath.el: Bind w3m-link-map for Emacs 21, 22, and XEmacs.

> Shouldn't this be a separate entry for Katsumi Yamaoka?

Yes, I've fixed it already.

Regards,



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-12-04 22:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-03  0:51 nnrss vs. copy link location jidanni
2008-12-03  2:18 ` Robert D. Crawford
2008-12-03  3:26   ` jidanni
2008-12-03 17:17 ` [emacs-w3m:10493] " Naohiro Aota
2008-12-03 19:21   ` jidanni
2008-12-04  1:58   ` [emacs-w3m:10503] " Katsumi Yamaoka
2008-12-04 20:14     ` Reiner Steib
2008-12-04 22:14       ` [emacs-w3m:10509] " Katsumi Yamaoka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).