koldfront

Re: Tweaking get news in Gnus

🕢︎ - 2020-11-08

The solution I presented depend on the [ email ] topic being at the top and visible. That's not always the case, so I have changed my function to:

(defun asjo-group-get-new-news ()
  "Fetch news and move point"
  (interactive)
  (gnus-group-get-new-news)
  (goto-char (point-min))
  (when (search-forward " [" nil t)
    (let ((current-place (point)))
      (gnus-group-next-unread-group 1)
      (when (= current-place (point))
        (goto-char (point-min))))))

so it tries to find the first indented topic (which should be the first one after [ Gnus ]), and then goes to the first group with unread articles in it after that, which I think is a better solution.

Also using search-forward with NOERROR set allows the function to not show an error when there's nowhere to jump to.

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:

+=