From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Gnus: How to reference an article from a gmane mailing list
Date: Wed, 08 Dec 2021 08:22:09 +0100 [thread overview]
Message-ID: <874k7j7e8u.fsf@gmail.com> (raw)
In-Reply-To: <86mtlc6m3x.fsf@duenenhof-wilhelm.de> (H. Dieter Wilhelm's message of "Wed, 08 Dec 2021 00:17:38 +0100")
"H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de> writes:
> Thanks, it seems to work (though the cursor is skipping to the end of
> the message ;-)).
Right; I should probably wrap this in a save-excursion form?
>> https://lists.gnu.org/archive/html/help-gnu-emacs/2021-12/msg00103.html
>
> Thank you for the pointer to the archive! Is the GNU organisation
> itself maintaining such archives?
AFAIK, yes.
Note that some GNU projects host additional mirrors of their discussions
on other archiving systems. Notably, the Org Mode project uses
public-inbox:
https://list.orgmode.org/
FWIW I find public-inbox quite convenient for Message-ID users, since
the IDs are included in the URLs.
>> You'll see a comment in the HTML source with this same message ID:
>>
>>> <!--X-Message-Id: 86sfv76rqq.fsf@duenenhof-wilhelm.de -->
>
> I see, but how did you find this article? I tried to search (for parts)
> of the message ID and this seems not to work. If I want to use html
> links for such archives I need to search, for example, for the time of
> the post or the author to get to a particular message in the web
> archive, right?
See my reply to Emanuel <877dcihgag.fsf@gmail.com>; 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.
> Oh wait! What about Gmail or other mail readers of Emacs, do they have
> this functionality as well?
Can't tell you 😕 I'd be very (though pleasantly) surprised if GMail
could work with Message IDs; as for other mail readers, I just don't
know.
For this reason I wrote some (very dumb and hackish, and just plain not
working ATM, don't know why) helpers, which take in either a message ID
(resp. an archive URL), fetch the corresponding URL (resp. message ID),
and format them like so:
> <ID>
> https://<URL>
… to provide convenient links for everyone, regardless of their mail
client. As I said though, for some reason they don't work anymore; I'd
need to debug them 😒
#+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
next prev parent reply other threads:[~2021-12-08 7:22 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-05 13:26 Gnus: How to reference an article from a gmane mailing list H. Dieter Wilhelm
2021-12-05 14:21 ` Byung-Hee HWANG
2021-12-05 14:39 ` H. Dieter Wilhelm
2021-12-05 15:09 ` Byung-Hee HWANG
2021-12-08 11:19 ` Byung-Hee HWANG
2021-12-05 18:56 ` Kévin Le Gouguec
2021-12-05 21:24 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-05 21:51 ` Kévin Le Gouguec
2021-12-06 2:30 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-07 23:17 ` H. Dieter Wilhelm
2021-12-07 23:57 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-08 6:01 ` H. Dieter Wilhelm
2021-12-08 0:10 ` Michael Heerdegen
2021-12-08 0:37 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-08 6:14 ` H. Dieter Wilhelm
2021-12-08 6:39 ` Michael Heerdegen
2021-12-08 6:43 ` Michael Heerdegen
2021-12-08 6:50 ` Michael Heerdegen
2021-12-08 7:22 ` Kévin Le Gouguec [this message]
2021-12-08 8:06 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-10 18:30 ` H. Dieter Wilhelm
2021-12-11 1:27 ` Michael Heerdegen
2021-12-11 8:03 ` Yuri Khan
2021-12-12 22:14 ` H. Dieter Wilhelm
2021-12-12 23:17 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-13 17:38 ` H. Dieter Wilhelm
2021-12-13 19:46 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-05 18:21 ` Emanuel Berg via Users list for the GNU Emacs text editor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874k7j7e8u.fsf@gmail.com \
--to=kevin.legouguec@gmail.com \
--cc=dieter@duenenhof-wilhelm.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).