summaryrefslogtreecommitdiff
path: root/itches
diff options
context:
space:
mode:
Diffstat (limited to 'itches')
-rw-r--r--itches/emacs/development.org17
1 files changed, 17 insertions, 0 deletions
diff --git a/itches/emacs/development.org b/itches/emacs/development.org
index a1fe3f2..a3e05da 100644
--- a/itches/emacs/development.org
+++ b/itches/emacs/development.org
@@ -46,6 +46,23 @@ trick, e.g.
&submit=Search!
&idxname=$LIST
#+end_example
+ ⇒
+ #+begin_src elisp
+ (defun mhonarc-to-messageid (url)
+ "Retrieve the Message-ID from an article archived on MHonArc."
+ (interactive
+ (list
+ (let* ((default (or (thing-at-point-url-at-point)
+ (and (derived-mode-p 'eww-mode)
+ (shr-url-at-point nil))))
+ (prompt (if default
+ (format "URL? (%s) " default)
+ "URL? ")))
+ (read-string prompt nil nil default))))
+ (with-current-buffer (url-retrieve-synchronously url)
+ (search-forward-regexp "^<!--X-Message-Id: \\(.+\\) -->$")
+ (message (xml-substitute-numeric-entities (match-string 1)))))
+ #+end_src
- public-inbox: trivial
*** TODO HTTP archive → Message-ID
- <https://lists.gnu.org>: cf. =X-Message-Id= comment in HTML