Leo Butler <[email protected]> writes:

On Tue, Oct 20 2026, Morgan Smith <[email protected]> wrote:

Leo Butler <[email protected]> writes:


Thanks, Morgan.

Forgive the question, but what did you grep to find this?

Leo

This was a question I was expecting and dreading :P

Thanks, Morgan, for taking the time to explain. I have put your notes in an org file that I will use for keeping track of maintainer-related stuff. I will give it a try in the next week or two.

Leo

I suppose it's time to actually put my setup up on worg. See attached patch. It's basically what I sent in my previous email but I found a minimal config file for public-inbox and I improved my script to grab all open threads (should be a little faster and now has a progress reporter).

I suppose I should get commit access to worg at some point...

I'm not particularly good at documentation or making the good English so let me know what you think!

If you get around to trying it Leo, please do so from these instructions and note any inconsistencies so we can improve this!

>From 106255ab35246b501dad0a8d69a44239fb97857c Mon Sep 17 00:00:00 2001
From: Morgan Smith <[email protected]>
Date: Tue, 20 Oct 2026 17:01:54 -0400
Subject: [PATCH] org-mailing-list.org: Document local public-inbox setup

---
 org-mailing-list.org | 151 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 151 insertions(+)

diff --git a/org-mailing-list.org b/org-mailing-list.org
index b8557c5b..b94c065a 100644
--- a/org-mailing-list.org
+++ b/org-mailing-list.org
@@ -168,6 +168,157 @@ * What to do if you don't receive an answer
 
 See [[file:org-contribute.org::#what-can-I-expect][As a contributor, what can I expect?]] for more.
 
+* Advanced local public-inbox setup
+It is possible to download and interact with mailing list locally on
+your computer using public-inbox.
+
+This uses the program "public-inbox" which when installed should
+provide all the executables mentioned (public-inbox-clone,
+public-inbox-index, lei).
+
+** Setup public-inbox
+First we want to use public-inbox to grab and index the mailing list:
+
+#+begin_src sh
+mkdir ~/.local/share/public-inbox
+public-inbox-clone https://list.orgmode.org/orgmode ~/.local/share/public-inbox/orgmode
+public-inbox-index ~/.local/share/public-inbox/orgmode
+#+end_src
+
+This is the one-time setup.  If you'd like to update an existing
+public-inbox do this:
+
+#+begin_src sh
+set -e # error on error
+public-inbox-fetch --exit-code -C ~/.local/share/public-inbox/orgmode
+public-inbox-index -C ~/.local/share/public-inbox/orgmode
+#+end_src
+
+** Setup lei
+Now we want to use the "lei" tool to view and query the mailing list.
+First we need to do a one-time setup:
+
+#+begin_src sh
+lei add-external ~/.local/share/public-inbox/orgmode
+#+end_src
+
+Now we can test lei by doing a simple query.  Too see the full query
+syntax run "man lei-q".
+
+#+begin_src sh :results output verbatim
+lei q --format=text t:"[email protected]" s:"Fix a docstring typo"
+#+end_src
+** Export open bug reports
+It could be handy to have a directory full of open bug report threads as
+listed on https://tracker.orgmode.org.  This would allows us to use
+grep and other standard tools to find open reports.
+
+To do this we will parse the json file located at
+https://tracker.orgmode.org/reports/all-open.json.  We will pull out
+all MESSAGE-IDS and then use "lei lcat" to print out the threads.
+
+Since we will sometimes end up printing out the same thread multiple
+times (one thread can contain multiple bug reports), we will do some
+minor de-duplication by making the file-name be a content hash.
+
+#+begin_src elisp
+(let ((output-directory (expand-file-name "~/output-dir"))
+      ;; wget https://tracker.orgmode.org/reports/all-open.json
+      (tracker-json (expand-file-name "~/downloads/all-open.json")))
+  (mkdir output-directory t)
+  (cl-flet*
+      ((get-message-id-list ()
+         (with-current-buffer (or (find-buffer-visiting tracker-json)
+                                  (find-file-noselect tracker-json t t))
+           (goto-char (point-min))
+           (seq-map
+            (lambda (report)
+              (alist-get 'message-id report))
+            (alist-get
+             'reports
+             (json-parse-buffer
+              :object-type 'alist)))))
+       (output-thread-to-file (message-id)
+         (unless (eq 0 (call-process "lei" nil '(:file "tmp.txt") nil
+                       "lcat" "--no-color" "--threads" message-id))
+           (error "lei did not return success"))
+         ;; File name is hash of content so we don't have duplicate files
+         (let ((file-hash
+                (car (string-split
+                      (shell-command-to-string "md5sum tmp.txt")))))
+           (rename-file "tmp.txt" (concat file-hash ".txt") t))))
+    (let ((default-directory output-directory))
+      (dolist-with-progress-reporter (message-id (get-message-id-list))
+          "Outputting threads to files: "
+        (output-thread-to-file message-id)))))
+#+end_src
+
+Now you should have a directory full of open bug reports that you can
+grep!  Then whenever you see something you want to interact with you can
+open using a message-id you find in the file.  You might want a helper
+function like this:
+
+#+BEGIN_SRC elisp
+(defun my-orglist-open (message-id)
+  "Open MESSAGE-ID orglist mail."
+  (interactive "smessage-id: \n")
+  (browse-url (concat "orgmode.org/list/"
+                      (string-trim message-id "<" ">"))))
+#+END_SRC
+
+** Hosting Mail for you mail reader
+We can serve the public-inbox mailbox locally for a mail reader to
+use.  HTTP, IMAP, NNTP, and POP3 are supported but I've only tried
+NNTP so that's what we'll setup here.
+
+We're going to need a config file for public-inbox now.  Here is a
+minimal one that needs to be placed at "~/.public-inbox/config".  Do
+note that you'll have to replace "USERNAME" with your own username.
+
+#+begin_src conf
+[publicinbox "orgmode"]
+	inboxdir = /home/USERNAME/.local/share/public-inbox/orgmode
+	address = [email protected]
+	infourl = https://www.orgmode.org/
+    listid = emacs-orgmode.gnu.org
+	newsgroup = emacs.orgmode
+#+end_src
+
+Now we can serve the mailing list locally over nntp like this:
+
+#+begin_src sh
+public-inbox-nntpd -l localhost:9012
+#+end_src
+
+*** gnus setup
+
+Now let's connect to it using gnus.
+
+#+begin_src elisp
+(setopt
+ gnus-secondary-select-methods
+ (list
+  ...
+  '(nntp "nntp"
+         (nntp-address "localhost")
+         (nntp-port-number 9012)
+         (nntp-open-connection-function nntp-open-plain-stream))))
+#+end_src
+
+And now let's tell browse-url to open links using gnus:
+
+#+begin_src elisp
+(setopt browse-url-handlers
+        `((,(rx (or "list.orgmode.org/" "orgmode.org/list/")) .
+           ,(lambda (host-or-url &rest _)
+              (org-gnus-follow-link "nntp+nntp:emacs.orgmode";
+                                    (string-trim
+                                     host-or-url
+                                     (rx (* anychar) (or (and "list.orgmode.org/" (? "orgmode/"))
+                                                         "orgmode.org/list/"))
+                                     "/.*"))))))
+#+end_src
+
 * COMMENT Statistics (as of sept. 19th 2010)
 
 ** Scope and method
-- 
2.55.0

Reply via email to