 
 ;;; Custom commands
 
+;; Visit group under point and immediately close it; this updates gnus’ registry
+;; as a side-effect
 (bind-key "v u"
           '(lambda ()
-            (interactive)
-            (save-mark-and-excursion
-              (when (gnus-topic-select-group)
-                (gnus-summary-exit))))
-           gnus-group-mode-map)
-
-(bind-key "v j"
-          '(lambda ()
-            (interactive)
-            (gnus-agent-toggle-plugged nil)
-            (gnus-agent-toggle-plugged t)
-            (gnus-group-get-new-news 3))
-           gnus-group-mode-map)
-
-(add-hook 'gnus-get-new-news-hook
-          (lambda ()
-            (when gnus-plugged
-              (gnus-agent-toggle-plugged nil)
-              (gnus-agent-toggle-plugged t))))
-
-;; (bind-key "v g" #'db/get-mail gnus-group-mode-map)
-
+             (interactive)
+             (save-mark-and-excursion
+               (when (gnus-topic-select-group)
+                 (gnus-summary-exit))))
+          gnus-group-mode-map)
+
+;; Toggle visibility of News group
 (bind-key "v c"
           (lambda ()
             (interactive)


;;; MIME

(use-package dash
  :demand t
  :ensure t)

(add-to-list 'gnus-boring-article-headers 'long-to)

(setq gnus-ignored-mime-types '("text/x-vcard")
      mm-discouraged-alternatives '("text/richtext" "text/html")
      mm-automatic-display (-difference mm-automatic-display

(add-hook 'gnus-message-setup-hook
          #'db/signencrypt-message-when-possible)

;; Fix: mm-view does not seem to support verifying S/MIME messages using gpgsm,
;; so we add a simple fix here

(defun mm-view-pkcs7-verify (handle)
  (let ((verified nil))
