Skip to content

Instantly share code, notes, and snippets.

@gnusosa
Created December 16, 2014 20:50
Show Gist options
  • Select an option

  • Save gnusosa/0164bbec9585bf64ae26 to your computer and use it in GitHub Desktop.

Select an option

Save gnusosa/0164bbec9585bf64ae26 to your computer and use it in GitHub Desktop.
(defun gnus-gmane-link ()
"Grabs the article name and generates a url found in Gmane.
If successful, sends it to the local web browser."
(interactive)
(let ((url
(with-current-buffer gnus-article-buffer
(let ((msgids (split-string (aref gnus-current-headers 8) "[ :]")))
(cond ((and (equal (substring (second msgids) 0 6)
"gwene.")
(goto-char (point-max))
(search-backward "Link" (point-min) 'noerror))
(shr-copy-url)
(current-kill 0))
((equal (substring (second msgids) 0 6)
"gmane.")
(concat "http://comments.gmane.org/" (second msgids) "/" (third msgids))))))))
(if url
(browse-url (message url))
(message "Couldn't find any likely url"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment