[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnus: How to reference an article from a gmane mailing list

From: Kévin Le Gouguec
Subject: Re: Gnus: How to reference an article from a gmane mailing list
Date: Wed, 08 Dec 2021 08:22:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

"H. Dieter Wilhelm" <> 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?

> 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

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&#45; -->
> 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 <>; it used to be that
you could query the archive for a message ID, e.g. go here:

Then type in this search string:


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

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 ()
  (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)
                      (format "<%s>" id))

(defun my/describe-message-id (list id)
  "Format references from the Message-ID of a 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))))
        ;; For some reason, literal "+" chars cause the search to fail.
        ;; Escape them.
        (replace-regexp-in-string "\\+" "%2B" id)
        "&idxname=" list))
     (rx "<a href=\""
         (group "/archive/html/" (literal list) "/"
                (+ (any "0-9-")) "/msg" (+ (any "0-9")) ".html")
    (let ((url (concat ""; (match-string 1))))
      (my/describe-message id url))))

(defun my/describe-message-url (url)
  "Format references from an article archived on MHonArc."
    (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))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]