From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> Newsgroups: gmane.emacs.help Subject: Re: Gnus: How to reference an article from a gmane mailing list Date: Wed, 08 Dec 2021 09:06:30 +0100 Message-ID: <8735n3zfjt.fsf@zoho.eu> References: <86wnkj6v41.fsf@duenenhof-wilhelm.de> <87r1arceup.fsf@penguin> <86sfv76rqq.fsf@duenenhof-wilhelm.de> <87lf0yq3s5.fsf@gmail.com> <86mtlc6m3x.fsf@duenenhof-wilhelm.de> <874k7j7e8u.fsf@gmail.com> Reply-To: Emanuel Berg <moasenwood@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35291"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:PG7oXyWJglTdZ52X/SiR5Xk6dXE= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 08 09:08:03 2021 Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org> Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>) id 1murze-0008zl-45 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 08 Dec 2021 09:08:02 +0100 Original-Received: from localhost ([::1]:57736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>) id 1murzc-0006m3-Lk for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 08 Dec 2021 03:08:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <geh-help-gnu-emacs@m.gmane-mx.org>) id 1muryO-0006lg-7t for help-gnu-emacs@gnu.org; Wed, 08 Dec 2021 03:06:47 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:47000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <geh-help-gnu-emacs@m.gmane-mx.org>) id 1muryJ-0000Oe-CM for help-gnu-emacs@gnu.org; Wed, 08 Dec 2021 03:06:43 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from <geh-help-gnu-emacs@m.gmane-mx.org>) id 1muryH-0007KQ-1q for help-gnu-emacs@gnu.org; Wed, 08 Dec 2021 09:06:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/help-gnu-emacs> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org> Xref: news.gmane.io gmane.emacs.help:134887 Archived-At: <http://permalink.gmane.org/gmane.emacs.help/134887> Kévin Le Gouguec wrote: > See my reply to Emanuel <877dcihgag.fsf@gmail.com> Haha ... stop it :) > it used to be that you could query the archive for a message > ID, e.g. go here: > > https://lists.gnu.org/archive/html/help-gnu-emacs/ > > Then type in this search string: > > +message-id:<6214117000e144ffaeceded74c239fb8@frb.gov> > > That shold yield a single result (from a message I picked at > random in Gnus's summray buffer). > > For some reason though, the search engine does not seem to > work for more recent messages. Maybe indexing is broken? > Someone would need to ping the list admins. Better ask them for a header to the future archive post ... they should have it. re: your Elisp ... it's very good! Just add this ... (require 'gnus-sum) (require 'nnheader) (require 'shr) (require 'xml) and LIST, ID, and URL to the docstrings and you're all set :) > #+begin_src elisp > ;; Utilities for mailing lists. > (defun my/kill-message-id () > (interactive) > (kill-new (mail-header-message-id (gnus-summary-article-header)))) > > (defun my/describe-message (id url) > (kill-new (format "%s\n%s\n" > (if (string-prefix-p "<" id) > id > (format "<%s>" id)) > url))) > > (defun my/describe-message-id (list id) > "Format references from the Message-ID of a gnu.org list." > (interactive > (list > (read-string "List: ") ; TODO: default to current list. > (let ((default-id > (mail-header-message-id (gnus-summary-article-header)))) > (read-string (format-prompt "Message-ID" default-id) > nil nil default-id)))) > (with-current-buffer > (url-retrieve-synchronously > (concat > ;; For some reason, literal "+" chars cause the search to fail. > ;; Escape them. > "https://lists.gnu.org/archive/cgi-bin/namazu.cgi" > "?query=%2Bmessage-id:" > (replace-regexp-in-string "\\+" "%2B" id) > "&submit=Search!" > "&idxname=" list)) > (search-forward-regexp > (rx "<a href=\"" > (group "/archive/html/" (literal list) "/" > (+ (any "0-9-")) "/msg" (+ (any "0-9")) ".html") > "\">")) > (let ((url (concat "https://lists.gnu.org" (match-string 1)))) > (my/describe-message id url)))) > > (defun my/describe-message-url (url) > "Format references from an article archived on MHonArc." > (interactive > (list > (let ((default (or (thing-at-point 'url) > (and (derived-mode-p 'eww-mode) > (shr-url-at-point nil))))) > (read-string (format-prompt "URL" default) nil nil default)))) > (with-current-buffer (url-retrieve-synchronously url) > (search-forward-regexp "^<!--X-Message-Id: \\(.+\\) -->$") > (let ((id (xml-substitute-numeric-entities (match-string 1)))) > (my/describe-message id url)))) > #+end_src > -- underground experts united https://dataswamp.org/~incal