summary refs log tree commit diff stats
path: root/lisp/acdw-erc.el
diff options
context:
space:
mode:
authorCase Duckworth2021-07-22 21:15:12 -0500
committerCase Duckworth2021-07-22 21:15:34 -0500
commit9534a7ed7f0caff60ccf994fbf9980a12387ebd3 (patch)
tree337f34589a68c65f06352d1db9e6fdf95918718a /lisp/acdw-erc.el
parentFix browse-url-browser-function setting (diff)
downloademacs-9534a7ed7f0caff60ccf994fbf9980a12387ebd3.tar.gz
emacs-9534a7ed7f0caff60ccf994fbf9980a12387ebd3.zip
Configure ERC further
Diffstat (limited to 'lisp/acdw-erc.el')
-rw-r--r--lisp/acdw-erc.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/acdw-erc.el b/lisp/acdw-erc.el index 423c4a5..09fa335 100644 --- a/lisp/acdw-erc.el +++ b/lisp/acdw-erc.el
@@ -111,6 +111,27 @@ If USE-TLS is non-nil, use TLS."
111 (setq num (1- num))) 111 (setq num (1- num)))
112 (apply #'concat ss)))))) 112 (apply #'concat ss))))))
113 113
114(defcustom erc-nick-truncate nil
115 "The width at which to truncate a nick with `erc-format-truncate-@nick'."
116 :group 'erc
117 :type 'integer)
118
119(defun erc-format-truncate-@nick (&optional user channel-data)
120 "Format the nickname of USER as in `erc-format-@nick', with truncation.
121Truncation is customized using the `erc-nick-truncate' variable.
122See also `erc-format-nick-function'."
123 (when user
124 (let* ((nick (erc-server-user-nickname user))
125 (ellipsis "~")
126 (max-len (- erc-nick-truncate 2 (length ellipsis))))
127 (concat (erc-propertize
128 (erc-get-user-mode-prefix nick)
129 'font-lock-face 'erc-nick-prefix-face)
130 (if (and max-len (> (length nick) max-len))
131 (format "%s%s" (substring nick 0 max-len)
132 ellipsis)
133 nick)))))
134
114 135
115;;; Uh 136;;; Uh
116 137