Created
January 20, 2020 23:55
-
-
Save mplscorwin/0fd23717d41e317825cd13b10c503a7c to your computer and use it in GitHub Desktop.
Can't ever remember where I stole this code. Sketchy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; erc-countusers-mode.el --- display a count of channel users in the mode-string | |
;;; Commentary: | |
;; TODO: return empty string if parted/disconnected | |
;; TODO: add to emacswiki files | |
;;; Code: | |
(define-minor-mode ncm-mode "https://www.emacswiki.org/emacs/ErcModeline | |
Add this to your .emacs to see the number of opped/voiced/normal members of the | |
current channel in the modeline:" nil | |
(:eval | |
(let ((ops 0) | |
(voices 0) | |
(members 0)) | |
(maphash (lambda (key value) | |
(when (erc-channel-user-op-p key) | |
(setq ops (1+ ops))) | |
(when (erc-channel-user-voice-p key) | |
(setq voices (1+ voices))) | |
(setq members (1+ members))) | |
erc-channel-users) | |
(format " %S/%S/%S" ops voices members)))) | |
(provide ncm-mode) | |
;;; erc-countusers-mode.el ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh good. I did leave a URL in the source somewhere just took me a minute to find it:
See: https://www.emacswiki.org/emacs/ErcModeline