Skip to content

Instantly share code, notes, and snippets.

@kubajecminek
Last active September 3, 2024 18:05
Show Gist options
  • Select an option

  • Save kubajecminek/83cb82969acd9ec3e0a773a54cad2d13 to your computer and use it in GitHub Desktop.

Select an option

Save kubajecminek/83cb82969acd9ec3e0a773a54cad2d13 to your computer and use it in GitHub Desktop.
Gnus RSS config
(setq my-feeds '(("Richard Stallman" "https://stallman.org/rss/rss.xml" "Chief GNUisance of the GNU Project")
;; Define other feeds right here (title url description)
))
;; This function mimics `gnus-group-make-rss-group' behaviour
(defun my-subscribe-rss-feeds (feeds)
(require 'nnrss)
(dolist (feed feeds)
(let* ((title (nth 0 feed))
(href (nth 1 feed))
(desc (nth 2 feed))
(coding (gnus-group-name-charset '(nnrss "") title)))
(when coding
;; Unify non-ASCII text.
(setq title (decode-coding-string
(encode-coding-string title coding)
coding)))
(unless (gnus-group-entry (gnus-group-prefixed-name title "nnrss"))
(gnus-group-make-group title '(nnrss ""))
(push (list title href desc) nnrss-group-alist)
(message "Group %s added" title)
(nnrss-save-server-data nil)))))
(add-hook 'gnus-setup-news-hook (lambda () (my-subscribe-rss-feeds my-feeds)))
@kubajecminek

Copy link
Copy Markdown
Author

Hi @grolongo, I don't think it does. But there is currently an initiative to include nnatom backend to the Emacs core. See this ticket.

@grolongo

Copy link
Copy Markdown

a patch for nnatom posted not before than yesterday. now that's some interesting timing. :)

@sergeyklay

Copy link
Copy Markdown

Doesn't work for me:

Debugger entered--Lisp error: (args-out-of-range 1064 1065)
  add-text-properties(1064 1065 (gnus-group "nnrss:Richard Stallman" gnus-unread t gnus-marked 32 gnus-indentation "" gnus-level 3))
  gnus-group-insert-group-line("nnrss:Richard Stallman" 3 nil t (nnrss ""))
  gnus-group-insert-group-line-info("nnrss:Richard Stallman")
  gnus-group-make-group("Richard Stallman" (nnrss ""))
  (if (gethash (gnus-group-prefixed-name title "nnrss") gnus-newsrc-hashtb) nil (gnus-group-make-group title '(nnrss "")) (setq nnrss-group-alist (cons (list title href desc) nnrss-group-alist)) (message "Group %s added" title) (nnrss-save-server-data nil))
  (let* ((title (nth 0 feed)) (href (nth 1 feed)) (desc (nth 2 feed)) (coding (gnus-group-name-charset '(nnrss "") title))) (if coding (progn (setq title (decode-coding-string (encode-coding-string title coding) coding)))) (if (gethash (gnus-group-prefixed-name title "nnrss") gnus-newsrc-hashtb) nil (gnus-group-make-group title '(nnrss "")) (setq nnrss-group-alist (cons (list title href desc) nnrss-group-alist)) (message "Group %s added" title) (nnrss-save-server-data nil)))
  (let ((feed (car tail))) (let* ((title (nth 0 feed)) (href (nth 1 feed)) (desc (nth 2 feed)) (coding (gnus-group-name-charset '(nnrss "") title))) (if coding (progn (setq title (decode-coding-string (encode-coding-string title coding) coding)))) (if (gethash (gnus-group-prefixed-name title "nnrss") gnus-newsrc-hashtb) nil (gnus-group-make-group title '(nnrss "")) (setq nnrss-group-alist (cons (list title href desc) nnrss-group-alist)) (message "Group %s added" title) (nnrss-save-server-data nil))) (setq tail (cdr tail)))
  (while tail (let ((feed (car tail))) (let* ((title (nth 0 feed)) (href (nth 1 feed)) (desc (nth 2 feed)) (coding (gnus-group-name-charset '(nnrss "") title))) (if coding (progn (setq title (decode-coding-string (encode-coding-string title coding) coding)))) (if (gethash (gnus-group-prefixed-name title "nnrss") gnus-newsrc-hashtb) nil (gnus-group-make-group title '(nnrss "")) (setq nnrss-group-alist (cons (list title href desc) nnrss-group-alist)) (message "Group %s added" title) (nnrss-save-server-data nil))) (setq tail (cdr tail))))
  (let ((tail feeds)) (while tail (let ((feed (car tail))) (let* ((title (nth 0 feed)) (href (nth 1 feed)) (desc (nth 2 feed)) (coding (gnus-group-name-charset '... title))) (if coding (progn (setq title (decode-coding-string ... coding)))) (if (gethash (gnus-group-prefixed-name title "nnrss") gnus-newsrc-hashtb) nil (gnus-group-make-group title '(nnrss "")) (setq nnrss-group-alist (cons (list title href desc) nnrss-group-alist)) (message "Group %s added" title) (nnrss-save-server-data nil))) (setq tail (cdr tail)))))
  my-subscribe-rss-feeds((("Richard Stallman" "https://stallman.org/rss/rss.xml" "Chief GNUisance of the GNU Project")))
  (lambda nil (my-subscribe-rss-feeds my-feeds))()
  run-hooks(gnus-setup-news-hook)
  apply(run-hooks gnus-setup-news-hook)
  gnus-run-hooks(gnus-setup-news-hook)
  #f(compiled-function () #<bytecode 0xff7750be0821785>)()
  gnus-1(nil nil nil)
  gnus(nil)
  funcall-interactively(gnus nil)
  call-interactively(gnus record nil)
  command-execute(gnus record)
  execute-extended-command(nil "gnus" "gnus")
  funcall-interactively(execute-extended-command nil "gnus" "gnus")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

@kubajecminek

kubajecminek commented Sep 3, 2024 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment