I switched from mutt to gnus and would like to extract urls from emails and be able to launch a new buffer that contains all urls in a given email. Urlview does this for mutt as a frame of reference for what I am looking for.
Is there a urlview (a la mutt) for gnus? Or just elisp for extracting urls?
632 views Asked by AudioBubble At
2
There are 2 answers
0
On
I don't think that function is built-in. The following code will do what you want. From the summary buffer, call M-x urlview, or bind it to a convenient key. The save-excursion wrapper should drop you back in the summary buffer, but for some reason it leaves you in the article buffer. Just hitting the h key will put you back, but you shouldn't need to do that. Maybe someone else can clarify that part?
(defun urlview ()
(interactive)
(save-excursion
(gnus-summary-select-article-buffer)
(beginning-of-buffer)
(while
(re-search-forward "https?://" nil t)
(browse-url-at-point))))
Edit: Joseph's answer works for both http and https, which I had overlooked. So I swiped that part of his code.
I wrote the following and tested it to work on a couple of articles. Maybe it will be a good starting point for you.
I should clarify that this is intended to be run from within the article buffer. Also, I may have missed the point by taking what you said literally about launching a new buffer containing the urls, in which case you can change the last form to:
Or, Tyler's approach is simpler if you don't need to parse widget urls.