Function: doom-modeline-segment--gnus

doom-modeline-segment--gnus is a natively compiled function defined in doom-modeline-segments.el.

Signature

(doom-modeline-segment--gnus)

Documentation

Show notifications of any unread emails in gnus.

Source Code

;; Defined in /nix/store/1lcicrdd2r4b8rkc91nnn74ymk1jl6yd-emacs-packages-deps/share/emacs/site-lisp/elpa/doom-modeline-20260928.1632/doom-modeline-segments.el
(doom-modeline-def-segment gnus
  "Show notifications of any unread emails in `gnus'."
  (when (and (doom-modeline--segment-visible 'gnus)
             doom-modeline-gnus
             doom-modeline--gnus-started
             ;; Don't display if the unread mails count is zero
             (numberp doom-modeline--gnus-unread-mail)
             (> doom-modeline--gnus-unread-mail 0))
    (let ((sep (doom-modeline-spc))
          (vsep (doom-modeline-vspc)))
      (concat
       sep
       (propertize
        (concat
         (doom-modeline-icon 'mdicon "nf-md-email" "📧" "#"
                             :face 'doom-modeline-notification)
         vsep
         (propertize
          (if (> doom-modeline--gnus-unread-mail doom-modeline-number-limit)
              (format "%d+" doom-modeline-number-limit)
            (number-to-string doom-modeline--gnus-unread-mail))
          'face '(:inherit
                  (doom-modeline-unread-number doom-modeline-notification))))
        'mouse-face 'doom-modeline-highlight
        'help-echo (if (= doom-modeline--gnus-unread-mail 1)
                       "You have an unread email"
                     (format "You have %s unread emails" doom-modeline--gnus-unread-mail)))
       sep))))