Created
October 21, 2014 00:20
-
-
Save gnusosa/b4800ca313e862def12f to your computer and use it in GitHub Desktop.
gnus-gmane-gwene-link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Gmane article link | |
| ;; Using shr. This will only work in Emacs 24.4 | |
| (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