From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87033 Path: news.gmane.org!not-for-mail From: Sebastian Christ Newsgroups: gmane.emacs.gnus.general Subject: Re: insert a link to an article in gmane Date: Sat, 07 May 2016 22:40:47 +0200 Message-ID: References: <87mvo197r0.fsf@mat.ucm.es> <874ma9y7l7.fsf@mat.ucm.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1462653716 9509 80.91.229.3 (7 May 2016 20:41:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 May 2016 20:41:56 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M35254@lists.math.uh.edu Sat May 07 22:41:41 2016 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1az92j-00083g-2q for ding-account@gmane.org; Sat, 07 May 2016 22:41:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.86_2) (envelope-from ) id 1az925-0002AP-Lh; Sat, 07 May 2016 15:41:01 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1az922-00029z-NH for ding@lists.math.uh.edu; Sat, 07 May 2016 15:40:58 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_2) (envelope-from ) id 1az921-0007vc-3c for ding@lists.math.uh.edu; Sat, 07 May 2016 15:40:58 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1az91z-0007DG-Le for ding@gnus.org; Sat, 07 May 2016 22:40:55 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1az91y-0007RD-Ha for ding@gnus.org; Sat, 07 May 2016 22:40:54 +0200 Original-Received: from ip5f59bbba.dynamic.kabel-deutschland.de ([95.89.187.186]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 May 2016 22:40:54 +0200 Original-Received: from rudolfo.christ by ip5f59bbba.dynamic.kabel-deutschland.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 May 2016 22:40:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip5f59bbba.dynamic.kabel-deutschland.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:hwrGBisd//etGYoxrkXb2GCY6D8= X-Spam-Score: -3.8 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87033 Archived-At: On 2016-05-07 19:46, Uwe Brauer wrote: > Could you send me this function, please? thanks (defun fyi-article-get-header (header &optional skip-bounds) "Return HEADER of article in the current `gnus-article-buffer'. If SKIP-BOUNDS is non-nil, skip the first and the last character from the header value. This is useful if you want to omit some '<' and '>' that some headers have (e.g. Message-ID)." (gnus-summary-verbose-headers 1) (prog1 (with-current-buffer gnus-article-buffer (let ((nnmail-extra-headers (cons header nnmail-extra-headers))) (let ((header-value (cdr (assoc header (mail-header-extra (nnheader-parse-head t)))))) (when header-value (apply #'substring-no-properties header-value (when skip-bounds (list 1 -1))))))) (gnus-summary-verbose-headers -1))) (defun fyi-article-archived-at () "Return archived-at header of article in the current `gnus-article-buffer'." (fyi-article-get-header 'Archived-at t)) (defvar fyi-last-gmane-message-link nil) (defun fyi-copy-gmane-link () (interactive) (setq fyi-last-gmane-message-link (fyi-article-archived-at))) (defun fyi-insert-gmane-link () (interactive) (insert fyi-last-gmane-message-link)) But beware. This is very hacky and not really tested. It works, but can sure easily break I guess. So use with caution. Regards, Sebastian -- Sebastian (Rudolfo) Christ http://rudolfochrist.github.io GPG Fingerprint: 306D 8FD3 DFB6 4E44 5061 CE71 6407 D6F8 2AC5 55DD