Skip to content

Instantly share code, notes, and snippets.

@tsuchm
Last active October 23, 2023 11:33
Show Gist options
  • Save tsuchm/409360e92434a20e0e1aa6b128dbebdf to your computer and use it in GitHub Desktop.
Save tsuchm/409360e92434a20e0e1aa6b128dbebdf to your computer and use it in GitHub Desktop.
Ridiculous training gear for users to prevent too frequent activation of Gnus
(defun gnus-resume (&optional force)
"Resume the last Gnus session or start a Gnus session."
(interactive "P")
(when (or force
(memq major-mode '(gnus-group-mode gnus-summary-mode gnus-article-mode message-mode lsdb-mode))
(let* ((key (+ ?a (random 26)))
(inp (read-char (format "Really start or resume Gnus session? Type \"%s\": " (string key)))))
(or (char-equal key inp)
(progn
(message "No reading news is good news")
(sit-for 3)
(message "")
nil))))
(if (and (boundp 'gnus-group-buffer)
(get-buffer (symbol-value 'gnus-group-buffer))
(fboundp 'gnus-alive-p)
(gnus-alive-p))
(switch-to-buffer (symbol-value 'gnus-group-buffer))
(gnus))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment