Quickly marking a thread read #gnus #activitypub #elisp #nntp

🕖︎ - 2023-06-24

I have been implementing an ActivityPub server with an nntp-, rather than an https- or client-api-, interface.

As my blog engine with an nntp interface is called Lantern, the ActivityPub server is called Illuminant.

It is starting to work nicely, and as it automatically fetches parents of notes, I often see entire threads I don't care to read, so I want to efficiently mark them as read and move on.

Searching the Gnus interface and manual I found T⃣k⃣ - gnus-summary-kill-thread - which almost does what I want. Actually it does too much, it also collapses the thread, which confuses my eyes "huh, suddenly some lines disappeared, is something awry?"

So I made a copy of gnus-summary-kill-thread and simplified it to this:

    ; My own version of gnus-summary-kill-thread:
    (defun asjo-gnus-summary-mark-thread-read ()
      "Mark articles under current thread as read."
      (interactive "" gnus-summary-mode)
      (let ((articles (gnus-summary-articles-in-thread)))
          ;; Expand the thread.
          ;; Mark all the articles.
          (while articles
            (gnus-summary-goto-subject (car articles))
            (gnus-summary-mark-article-as-read gnus-read-mark)
            (setq articles (cdr articles)))))
        ;; Go to next unread subject.
      (gnus-summary-next-subject 1 t)
      (gnus-set-mode-line 'summary))

and bound it to the unused shortcut T⃣r⃣:

    (define-key gnus-summary-mode-map [(T) (r)] 'asjo-gnus-summary-mark-thread-read)

and won't you know it, when my timeline suddenly had a 400+ note long thread, I pressed T⃣r⃣, and Bob's became my uncle, as the thread was marked read and the first article after the thread was opened.

Add comment

To avoid spam many websites make you fill out a CAPTCHA, or log in via an account at a corporation such as Twitter, Facebook, Google or even Microsoft GitHub.

I have chosen to use a more old school method of spam prevention.

To post a comment here, you need to:

¹ Such as Thunderbird, Pan, slrn, tin or Gnus (part of Emacs).

Or, you can fill in this form: