From 69dea2f9a02903fbca387496f2798ee8e0462d45 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 18 Feb 2015 01:43:09 -0500 Subject: Add command gnus-copy-gmane-link-as-kill --- lisp/init-gnus.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lisp') diff --git a/lisp/init-gnus.el b/lisp/init-gnus.el index ebe6eea..d8ed69a 100644 --- a/lisp/init-gnus.el +++ b/lisp/init-gnus.el @@ -173,6 +173,17 @@ to group buffer instead of moving to next group." (let ((gnus-auto-select-next (unless no-next 'quietly))) (gnus-summary-catchup-and-exit nil t))) +(defun km/gnus-copy-gmane-link-as-kill () + (interactive) + (km/gnus-summary-set-current-article) + (with-current-buffer gnus-original-article-buffer + (save-excursion + (goto-char (point-min)) + (if (re-search-forward "Archived-At: <\\(.*\\)>") + (let ((link (match-string-no-properties 1))) + (kill-new (message "%s" link))) + (user-error "No link found"))))) + (define-key gnus-summary-mode-map (kbd "C-c j") 'km/gnus-follow-last-message-link) (define-key gnus-summary-mode-map ";" 'gnus-summary-universal-argument) @@ -189,10 +200,12 @@ to group buffer instead of moving to next group." (define-prefix-command 'km/gnus-summary-prefix-map) (define-key gnus-summary-mode-map (kbd "C-c m") 'km/gnus-summary-prefix-map) (define-key km/gnus-summary-prefix-map "p" 'km/gnus-open-github-patch) +(define-key km/gnus-summary-prefix-map "l" 'km/gnus-copy-gmane-link-as-kill) (define-prefix-command 'km/gnus-article-prefix-map) (define-key gnus-article-mode-map (kbd "C-c m") 'km/gnus-article-prefix-map) (define-key km/gnus-article-prefix-map "p" 'km/gnus-open-github-patch) +(define-key km/gnus-article-prefix-map "l" 'km/gnus-copy-gmane-link-as-kill) ;;; Message mode -- cgit v1.2.3