Created
June 3, 2016 09:07
-
-
Save jmn/8ed0b4e726928b094087248bf66f394a to your computer and use it in GitHub Desktop.
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
;; Align messages in Emacs erc IRC-client by setting nick names | |
;; to use a fixed number of chars. | |
(defun jmn-erc-format-nick (&optional user channel-data) | |
"Like `erc-format-nick' but trim/pad nick to a fixed length. | |
- Based on xwl-erc-format-nick" | |
(let ((nick (erc-format-nick user channel-data))) | |
(when (> (length nick) 9) | |
(setq nick (concat (substring nick 0 6) | |
".." | |
(substring nick -1)))) | |
(when (< (length nick) 9) | |
(setq nick (format "%-9s" nick))) | |
nick)) | |
;; Use with below (or customize): | |
(setq erc-format-nick-function 'jmn-erc-format-nick) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment